Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 1 | ################################################################################ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 2 | # Autotools package infrastructure |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 3 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 4 | # This file implements an infrastructure that eases development of |
| 5 | # package .mk files for autotools packages. It should be used for all |
Thomas Petazzoni | c0e6b52 | 2012-04-17 16:45:20 +0200 | [diff] [blame] | 6 | # packages that use the autotools as their build system. |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 7 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 8 | # See the Buildroot documentation for details on the usage of this |
| 9 | # infrastructure |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 10 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 11 | # In terms of implementation, this autotools infrastructure requires |
Thomas De Schampheleire | 60714bb | 2014-07-24 20:07:02 +0200 | [diff] [blame] | 12 | # the .mk file to only specify metadata information about the |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 13 | # package: name, version, download URL, etc. |
Bernhard Reutner-Fischer | 00b8456 | 2007-09-30 12:46:02 +0000 | [diff] [blame] | 14 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 15 | # We still allow the package .mk file to override what the different |
| 16 | # steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is |
| 17 | # already defined, it is used as the list of commands to perform to |
| 18 | # build the package, instead of the default autotools behaviour. The |
| 19 | # package can also define some post operation hooks. |
Bernhard Reutner-Fischer | 00b8456 | 2007-09-30 12:46:02 +0000 | [diff] [blame] | 20 | # |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 21 | ################################################################################ |
| 22 | |
Thomas Petazzoni | 102a93b | 2011-08-31 23:35:06 +0200 | [diff] [blame] | 23 | |
| 24 | # |
| 25 | # Utility function to upgrade config.sub and config.guess files |
| 26 | # |
| 27 | # argument 1 : directory into which config.guess and config.sub need |
| 28 | # to be updated. Note that config.sub and config.guess are searched |
| 29 | # recursively in this directory. |
| 30 | # |
| 31 | define CONFIG_UPDATE |
| 32 | for file in config.guess config.sub; do \ |
| 33 | for i in $$(find $(1) -name $$file); do \ |
| 34 | cp support/gnuconfig/$$file $$i; \ |
| 35 | done; \ |
| 36 | done |
| 37 | endef |
| 38 | |
Thomas Petazzoni | f4642ee | 2014-03-21 05:34:03 +0100 | [diff] [blame] | 39 | # This function generates the ac_cv_file_<foo> value for a given |
| 40 | # filename. This is needed to convince configure script doing |
| 41 | # AC_CHECK_FILE() tests that the file actually exists, since such |
| 42 | # tests cannot be done in a cross-compilation context. This function |
| 43 | # takes as argument the path of the file. An example usage is: |
| 44 | # |
| 45 | # FOOBAR_CONF_ENV = \ |
| 46 | # $(call AUTOCONF_AC_CHECK_FILE_VAL,/dev/random)=yes |
| 47 | AUTOCONF_AC_CHECK_FILE_VAL = ac_cv_file_$(subst -,_,$(subst /,_,$(subst .,_,$(1)))) |
| 48 | |
Johan Oudinet | 3a82b1e | 2014-11-12 01:25:47 +0100 | [diff] [blame] | 49 | # |
| 50 | # Hook to update config.sub and config.guess if needed |
| 51 | # |
| 52 | define UPDATE_CONFIG_HOOK |
| 53 | @$(call MESSAGE,"Updating config.sub and config.guess") |
| 54 | $(call CONFIG_UPDATE,$(@D)) |
| 55 | endef |
| 56 | |
| 57 | # |
| 58 | # Hook to patch libtool to make it work properly for cross-compilation |
| 59 | # |
| 60 | define LIBTOOL_PATCH_HOOK |
Yann E. MORIN | b3b2222 | 2014-11-12 01:25:52 +0100 | [diff] [blame] | 61 | @$(call MESSAGE,"Patching libtool") |
Waldemar Brodkorb | 7485ff4 | 2016-12-07 19:41:20 +0100 | [diff] [blame] | 62 | $(Q)for i in `find $($(PKG)_DIR) -name ltmain.sh`; do \ |
Danomi Manchego | 5eb23c9 | 2015-07-07 00:34:00 -0400 | [diff] [blame] | 63 | ltmain_version=`sed -n '/^[ \t]*VERSION=/{s/^[ \t]*VERSION=//;p;q;}' $$i | \ |
Danomi Manchego | 9917e48 | 2015-07-05 16:53:48 -0400 | [diff] [blame] | 64 | sed -e 's/\([0-9]*\.[0-9]*\).*/\1/' -e 's/\"//'`; \ |
Danomi Manchego | 5eb23c9 | 2015-07-07 00:34:00 -0400 | [diff] [blame] | 65 | ltmain_patchlevel=`sed -n '/^[ \t]*VERSION=/{s/^[ \t]*VERSION=//;p;q;}' $$i | \ |
Danomi Manchego | 9917e48 | 2015-07-05 16:53:48 -0400 | [diff] [blame] | 66 | sed -e 's/\([0-9]*\.[0-9]*\.*\)\([0-9]*\).*/\2/' -e 's/\"//'`; \ |
Yann E. MORIN | b3b2222 | 2014-11-12 01:25:52 +0100 | [diff] [blame] | 67 | if test $${ltmain_version} = '1.5'; then \ |
Romain Naour | ba4af1a | 2016-08-17 18:01:08 +0200 | [diff] [blame] | 68 | patch -i support/libtool/buildroot-libtool-v1.5.patch $${i}; \ |
Yann E. MORIN | b3b2222 | 2014-11-12 01:25:52 +0100 | [diff] [blame] | 69 | elif test $${ltmain_version} = "2.2"; then\ |
Romain Naour | ba4af1a | 2016-08-17 18:01:08 +0200 | [diff] [blame] | 70 | patch -i support/libtool/buildroot-libtool-v2.2.patch $${i}; \ |
Yann E. MORIN | b3b2222 | 2014-11-12 01:25:52 +0100 | [diff] [blame] | 71 | elif test $${ltmain_version} = "2.4"; then\ |
Yann E. MORIN | 383287c | 2015-01-27 00:30:24 +0100 | [diff] [blame] | 72 | if test $${ltmain_patchlevel:-0} -gt 2; then\ |
Romain Naour | ba4af1a | 2016-08-17 18:01:08 +0200 | [diff] [blame] | 73 | patch -i support/libtool/buildroot-libtool-v2.4.4.patch $${i}; \ |
Gustavo Zacarias | 4a28e35 | 2014-12-16 11:08:15 -0300 | [diff] [blame] | 74 | else \ |
Romain Naour | ba4af1a | 2016-08-17 18:01:08 +0200 | [diff] [blame] | 75 | patch -i support/libtool/buildroot-libtool-v2.4.patch $${i}; \ |
Gustavo Zacarias | 4a28e35 | 2014-12-16 11:08:15 -0300 | [diff] [blame] | 76 | fi \ |
Yann E. MORIN | b3b2222 | 2014-11-12 01:25:52 +0100 | [diff] [blame] | 77 | fi \ |
| 78 | done |
Johan Oudinet | 3a82b1e | 2014-11-12 01:25:47 +0100 | [diff] [blame] | 79 | endef |
| 80 | |
| 81 | # |
Sam bobroff | 41444d7 | 2016-11-28 16:11:39 +1100 | [diff] [blame] | 82 | # Hook to patch common issue with configure on powerpc64{,le} failing |
| 83 | # to detect shared library support: |
| 84 | # |
| 85 | define CONFIGURE_FIX_POWERPC64_HOOK |
| 86 | @$(call MESSAGE,"Checking configure (powerpc64/powerpc64le)") |
| 87 | support/scripts/fix-configure-powerpc64.sh $($(PKG)_DIR) |
| 88 | endef |
| 89 | |
| 90 | # |
Johan Oudinet | 3a82b1e | 2014-11-12 01:25:47 +0100 | [diff] [blame] | 91 | # Hook to gettextize the package if needed |
| 92 | # |
| 93 | define GETTEXTIZE_HOOK |
| 94 | @$(call MESSAGE,"Gettextizing") |
| 95 | $(Q)cd $($(PKG)_SRCDIR) && $(GETTEXTIZE) $($(PKG)_GETTEXTIZE_OPTS) |
| 96 | endef |
| 97 | |
| 98 | # |
| 99 | # Hook to autoreconf the package if needed |
| 100 | # |
| 101 | define AUTORECONF_HOOK |
| 102 | @$(call MESSAGE,"Autoreconfiguring") |
| 103 | $(Q)cd $($(PKG)_SRCDIR) && $($(PKG)_AUTORECONF_ENV) $(AUTORECONF) $($(PKG)_AUTORECONF_OPTS) |
Johan Oudinet | 3a82b1e | 2014-11-12 01:25:47 +0100 | [diff] [blame] | 104 | endef |
| 105 | |
Peter Korsgaard | d58636d | 2009-01-16 10:27:48 +0000 | [diff] [blame] | 106 | ################################################################################ |
Arnout Vandecappelle (Essensium/Mind) | 46fa5cb | 2012-07-03 00:07:08 +0200 | [diff] [blame] | 107 | # inner-autotools-package -- defines how the configuration, compilation and |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 108 | # installation of an autotools package should be done, implements a |
| 109 | # few hooks to tune the build process for autotools specifities and |
| 110 | # calls the generic package infrastructure to generate the necessary |
| 111 | # make targets |
Peter Korsgaard | d58636d | 2009-01-16 10:27:48 +0000 | [diff] [blame] | 112 | # |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 113 | # argument 1 is the lowercase package name |
Thomas De Schampheleire | 5bd9ed6 | 2014-07-24 20:57:41 +0200 | [diff] [blame] | 114 | # argument 2 is the uppercase package name, including a HOST_ prefix |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 115 | # for host packages |
| 116 | # argument 3 is the uppercase package name, without the HOST_ prefix |
| 117 | # for host packages |
Thomas De Schampheleire | 26aef88 | 2014-02-05 10:44:03 +0100 | [diff] [blame] | 118 | # argument 4 is the type (target or host) |
Peter Korsgaard | d58636d | 2009-01-16 10:27:48 +0000 | [diff] [blame] | 119 | ################################################################################ |
| 120 | |
Arnout Vandecappelle (Essensium/Mind) | 46fa5cb | 2012-07-03 00:07:08 +0200 | [diff] [blame] | 121 | define inner-autotools-package |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 122 | |
Thomas Petazzoni | d2c73f5 | 2010-04-28 23:40:45 +0200 | [diff] [blame] | 123 | ifndef $(2)_LIBTOOL_PATCH |
| 124 | ifdef $(3)_LIBTOOL_PATCH |
Thomas De Schampheleire | 54456cc | 2014-06-11 21:12:24 +0200 | [diff] [blame] | 125 | $(2)_LIBTOOL_PATCH = $$($(3)_LIBTOOL_PATCH) |
Thomas Petazzoni | d2c73f5 | 2010-04-28 23:40:45 +0200 | [diff] [blame] | 126 | else |
| 127 | $(2)_LIBTOOL_PATCH ?= YES |
| 128 | endif |
| 129 | endif |
| 130 | |
Peter Korsgaard | ce1ae87 | 2011-05-17 10:00:01 +0200 | [diff] [blame] | 131 | ifndef $(2)_MAKE |
| 132 | ifdef $(3)_MAKE |
Thomas De Schampheleire | 54456cc | 2014-06-11 21:12:24 +0200 | [diff] [blame] | 133 | $(2)_MAKE = $$($(3)_MAKE) |
Peter Korsgaard | ce1ae87 | 2011-05-17 10:00:01 +0200 | [diff] [blame] | 134 | else |
Thomas De Schampheleire | 54456cc | 2014-06-11 21:12:24 +0200 | [diff] [blame] | 135 | $(2)_MAKE ?= $$(MAKE) |
Peter Korsgaard | ce1ae87 | 2011-05-17 10:00:01 +0200 | [diff] [blame] | 136 | endif |
| 137 | endif |
| 138 | |
Peter Korsgaard | 97c6870 | 2013-10-02 23:37:58 +0200 | [diff] [blame] | 139 | ifndef $(2)_AUTORECONF |
| 140 | ifdef $(3)_AUTORECONF |
Thomas De Schampheleire | 54456cc | 2014-06-11 21:12:24 +0200 | [diff] [blame] | 141 | $(2)_AUTORECONF = $$($(3)_AUTORECONF) |
Peter Korsgaard | 97c6870 | 2013-10-02 23:37:58 +0200 | [diff] [blame] | 142 | else |
| 143 | $(2)_AUTORECONF ?= NO |
| 144 | endif |
| 145 | endif |
| 146 | |
Yann E. MORIN | 8992583 | 2014-07-17 00:00:35 +0200 | [diff] [blame] | 147 | ifndef $(2)_GETTEXTIZE |
| 148 | ifdef $(3)_GETTEXTIZE |
| 149 | $(2)_GETTEXTIZE = $$($(3)_GETTEXTIZE) |
| 150 | else |
| 151 | $(2)_GETTEXTIZE ?= NO |
| 152 | endif |
| 153 | endif |
| 154 | |
Yann E. MORIN | bea8f26 | 2014-07-18 23:02:31 +0200 | [diff] [blame] | 155 | ifeq ($(4),host) |
Thomas De Schampheleire | 35886e5 | 2014-09-27 21:32:46 +0200 | [diff] [blame] | 156 | $(2)_GETTEXTIZE_OPTS ?= $$($(3)_GETTEXTIZE_OPTS) |
Yann E. MORIN | 8992583 | 2014-07-17 00:00:35 +0200 | [diff] [blame] | 157 | endif |
| 158 | |
Thomas De Schampheleire | 54456cc | 2014-06-11 21:12:24 +0200 | [diff] [blame] | 159 | ifeq ($(4),host) |
Thomas De Schampheleire | 1d2574a | 2014-09-27 21:32:43 +0200 | [diff] [blame] | 160 | $(2)_AUTORECONF_OPTS ?= $$($(3)_AUTORECONF_OPTS) |
Thomas De Schampheleire | 54456cc | 2014-06-11 21:12:24 +0200 | [diff] [blame] | 161 | endif |
| 162 | |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 163 | $(2)_CONF_ENV ?= |
Thomas De Schampheleire | aaffd20 | 2014-09-27 21:32:44 +0200 | [diff] [blame] | 164 | $(2)_CONF_OPTS ?= |
Bernhard Reutner-Fischer | 00b8456 | 2007-09-30 12:46:02 +0000 | [diff] [blame] | 165 | $(2)_MAKE_ENV ?= |
Thomas De Schampheleire | 0518a98 | 2014-09-27 21:32:38 +0200 | [diff] [blame] | 166 | $(2)_MAKE_OPTS ?= |
Thomas De Schampheleire | b199343 | 2014-09-27 21:32:39 +0200 | [diff] [blame] | 167 | $(2)_INSTALL_OPTS ?= install |
Thomas De Schampheleire | d6c32da | 2014-09-27 21:32:41 +0200 | [diff] [blame] | 168 | $(2)_INSTALL_STAGING_OPTS ?= DESTDIR=$$(STAGING_DIR) install |
Maxime Hadjinlian | 44c48b1 | 2015-07-12 17:06:50 +0200 | [diff] [blame] | 169 | $(2)_INSTALL_TARGET_OPTS ?= DESTDIR=$$(TARGET_DIR) install |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 170 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 171 | # |
| 172 | # Configure step. Only define it if not already defined by the package |
| 173 | # .mk file. And take care of the differences between host and target |
| 174 | # packages. |
| 175 | # |
| 176 | ifndef $(2)_CONFIGURE_CMDS |
Thomas De Schampheleire | 26aef88 | 2014-02-05 10:44:03 +0100 | [diff] [blame] | 177 | ifeq ($(4),target) |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 178 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 179 | # Configure package for target |
| 180 | define $(2)_CONFIGURE_CMDS |
| 181 | (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache && \ |
| 182 | $$(TARGET_CONFIGURE_OPTS) \ |
| 183 | $$(TARGET_CONFIGURE_ARGS) \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 184 | $$($$(PKG)_CONF_ENV) \ |
Romain Naour | f8d4fe3 | 2014-08-22 11:12:53 +0200 | [diff] [blame] | 185 | CONFIG_SITE=/dev/null \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 186 | ./configure \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 187 | --target=$$(GNU_TARGET_NAME) \ |
| 188 | --host=$$(GNU_TARGET_NAME) \ |
| 189 | --build=$$(GNU_HOST_NAME) \ |
| 190 | --prefix=/usr \ |
| 191 | --exec-prefix=/usr \ |
| 192 | --sysconfdir=/etc \ |
Jörg Krause | b3ed7c2 | 2014-10-18 00:36:32 +0200 | [diff] [blame] | 193 | --localstatedir=/var \ |
Yann E. MORIN | a8d6e2c | 2011-08-10 00:12:34 +0200 | [diff] [blame] | 194 | --program-prefix="" \ |
Thomas De Schampheleire | e20df63 | 2014-02-05 14:51:00 +0100 | [diff] [blame] | 195 | --disable-gtk-doc \ |
Bernd Kuhls | 356584c | 2014-10-19 11:59:03 +0200 | [diff] [blame] | 196 | --disable-gtk-doc-html \ |
Thomas De Schampheleire | e20df63 | 2014-02-05 14:51:00 +0100 | [diff] [blame] | 197 | --disable-doc \ |
| 198 | --disable-docs \ |
| 199 | --disable-documentation \ |
| 200 | --with-xmlto=no \ |
Peter Korsgaard | 4e0cd2e | 2014-02-09 01:00:22 +0100 | [diff] [blame] | 201 | --with-fop=no \ |
Ignacy Gawędzki | 630c335 | 2017-02-01 14:53:10 +0100 | [diff] [blame] | 202 | $$(if $$($$(PKG)_OVERRIDE_SRCDIR),,--disable-dependency-tracking) \ |
Gustavo Zacarias | cd4e483 | 2015-04-19 09:40:01 -0300 | [diff] [blame] | 203 | --enable-ipv6 \ |
Thomas Petazzoni | 8d60362 | 2017-07-04 16:47:48 +0200 | [diff] [blame] | 204 | $$(NLS_OPTS) \ |
Thomas Petazzoni | 009d8fc | 2011-05-30 23:57:02 +0200 | [diff] [blame] | 205 | $$(SHARED_STATIC_LIBS_OPTS) \ |
Thomas De Schampheleire | aaffd20 | 2014-09-27 21:32:44 +0200 | [diff] [blame] | 206 | $$(QUIET) $$($$(PKG)_CONF_OPTS) \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 207 | ) |
| 208 | endef |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 209 | else |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 210 | |
| 211 | # Configure package for host |
Arnout Vandecappelle | 489970e | 2012-12-12 04:07:22 +0000 | [diff] [blame] | 212 | # disable all kind of documentation generation in the process, |
| 213 | # because it often relies on host tools which may or may not be |
| 214 | # installed. |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 215 | define $(2)_CONFIGURE_CMDS |
| 216 | (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache; \ |
Yann E. MORIN | 7d6858d | 2015-11-22 15:39:41 +0100 | [diff] [blame] | 217 | $$(HOST_CONFIGURE_OPTS) \ |
| 218 | CFLAGS="$$(HOST_CFLAGS)" \ |
| 219 | LDFLAGS="$$(HOST_LDFLAGS)" \ |
| 220 | $$($$(PKG)_CONF_ENV) \ |
| 221 | CONFIG_SITE=/dev/null \ |
| 222 | ./configure \ |
Arnout Vandecappelle | 8529a7d | 2017-07-04 16:03:59 +0200 | [diff] [blame] | 223 | --prefix="$$(HOST_DIR)" \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 224 | --sysconfdir="$$(HOST_DIR)/etc" \ |
Jörg Krause | b3ed7c2 | 2014-10-18 00:36:32 +0200 | [diff] [blame] | 225 | --localstatedir="$$(HOST_DIR)/var" \ |
Thomas Petazzoni | 009d8fc | 2011-05-30 23:57:02 +0200 | [diff] [blame] | 226 | --enable-shared --disable-static \ |
Arnout Vandecappelle | 489970e | 2012-12-12 04:07:22 +0000 | [diff] [blame] | 227 | --disable-gtk-doc \ |
Bernd Kuhls | 356584c | 2014-10-19 11:59:03 +0200 | [diff] [blame] | 228 | --disable-gtk-doc-html \ |
Arnout Vandecappelle | 489970e | 2012-12-12 04:07:22 +0000 | [diff] [blame] | 229 | --disable-doc \ |
| 230 | --disable-docs \ |
| 231 | --disable-documentation \ |
Bernd Kuhls | 822a757 | 2014-10-19 11:59:01 +0200 | [diff] [blame] | 232 | --disable-debug \ |
Arnout Vandecappelle | 489970e | 2012-12-12 04:07:22 +0000 | [diff] [blame] | 233 | --with-xmlto=no \ |
| 234 | --with-fop=no \ |
Ignacy Gawędzki | 630c335 | 2017-02-01 14:53:10 +0100 | [diff] [blame] | 235 | $$(if $$($$(PKG)_OVERRIDE_SRCDIR),,--disable-dependency-tracking) \ |
Thomas De Schampheleire | aaffd20 | 2014-09-27 21:32:44 +0200 | [diff] [blame] | 236 | $$(QUIET) $$($$(PKG)_CONF_OPTS) \ |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 237 | ) |
| 238 | endef |
| 239 | endif |
Eric Andersen | a7e49eb | 2007-08-10 19:07:51 +0000 | [diff] [blame] | 240 | endif |
| 241 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 242 | $(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 243 | |
Thomas Petazzoni | 7dfa3b3 | 2010-04-28 23:40:42 +0200 | [diff] [blame] | 244 | ifeq ($$($(2)_AUTORECONF),YES) |
Yann E. MORIN | 452c8da | 2014-11-12 01:25:53 +0100 | [diff] [blame] | 245 | |
Yann E. MORIN | 8992583 | 2014-07-17 00:00:35 +0200 | [diff] [blame] | 246 | # This has to come before autoreconf |
| 247 | ifeq ($$($(2)_GETTEXTIZE),YES) |
| 248 | $(2)_PRE_CONFIGURE_HOOKS += GETTEXTIZE_HOOK |
| 249 | $(2)_DEPENDENCIES += host-gettext |
| 250 | endif |
Lionel Landwerlin | 89d1ad9 | 2010-11-04 03:50:24 +0100 | [diff] [blame] | 251 | $(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK |
Johan Oudinet | d2ae901 | 2014-11-12 01:25:50 +0100 | [diff] [blame] | 252 | # default values are not evaluated yet, so don't rely on this defaulting to YES |
| 253 | ifneq ($$($(2)_LIBTOOL_PATCH),NO) |
| 254 | $(2)_PRE_CONFIGURE_HOOKS += LIBTOOL_PATCH_HOOK |
| 255 | endif |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 256 | $(2)_DEPENDENCIES += host-automake host-autoconf host-libtool |
Yann E. MORIN | 452c8da | 2014-11-12 01:25:53 +0100 | [diff] [blame] | 257 | |
| 258 | else # ! AUTORECONF = YES |
| 259 | |
| 260 | # default values are not evaluated yet, so don't rely on this defaulting to YES |
| 261 | ifneq ($$($(2)_LIBTOOL_PATCH),NO) |
| 262 | $(2)_POST_PATCH_HOOKS += LIBTOOL_PATCH_HOOK |
| 263 | endif |
| 264 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 265 | endif |
| 266 | |
Sam bobroff | 41444d7 | 2016-11-28 16:11:39 +1100 | [diff] [blame] | 267 | # Append a configure hook if building for a powerpc64 (or powerpc64le) arch. |
| 268 | # Must be added after other pre-configure hooks that might regenerate the |
| 269 | # configure script and overwrite the changes made here. |
| 270 | ifneq ($$(filter powerpc64%,$$(if $$(filter target,$(4)),$$(ARCH),$$(HOSTARCH))),) |
| 271 | $(2)_PRE_CONFIGURE_HOOKS += CONFIGURE_FIX_POWERPC64_HOOK |
| 272 | endif |
| 273 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 274 | # |
| 275 | # Build step. Only define it if not already defined by the package .mk |
| 276 | # file. |
| 277 | # |
| 278 | ifndef $(2)_BUILD_CMDS |
Thomas De Schampheleire | 26aef88 | 2014-02-05 10:44:03 +0100 | [diff] [blame] | 279 | ifeq ($(4),target) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 280 | define $(2)_BUILD_CMDS |
Thomas De Schampheleire | 0518a98 | 2014-09-27 21:32:38 +0200 | [diff] [blame] | 281 | $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 282 | endef |
| 283 | else |
| 284 | define $(2)_BUILD_CMDS |
Thomas De Schampheleire | 0518a98 | 2014-09-27 21:32:38 +0200 | [diff] [blame] | 285 | $$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 286 | endef |
| 287 | endif |
| 288 | endif |
| 289 | |
| 290 | # |
| 291 | # Host installation step. Only define it if not already defined by the |
| 292 | # package .mk file. |
| 293 | # |
| 294 | ifndef $(2)_INSTALL_CMDS |
| 295 | define $(2)_INSTALL_CMDS |
Thomas De Schampheleire | b199343 | 2014-09-27 21:32:39 +0200 | [diff] [blame] | 296 | $$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_OPTS) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 297 | endef |
| 298 | endif |
| 299 | |
| 300 | # |
| 301 | # Staging installation step. Only define it if not already defined by |
| 302 | # the package .mk file. |
| 303 | # |
| 304 | ifndef $(2)_INSTALL_STAGING_CMDS |
| 305 | define $(2)_INSTALL_STAGING_CMDS |
Thomas De Schampheleire | d6c32da | 2014-09-27 21:32:41 +0200 | [diff] [blame] | 306 | $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPTS) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 307 | endef |
| 308 | endif |
| 309 | |
| 310 | # |
| 311 | # Target installation step. Only define it if not already defined by |
| 312 | # the package .mk file. |
| 313 | # |
| 314 | ifndef $(2)_INSTALL_TARGET_CMDS |
| 315 | define $(2)_INSTALL_TARGET_CMDS |
Thomas De Schampheleire | 57f2b8d | 2014-09-27 21:32:40 +0200 | [diff] [blame] | 316 | $$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_TARGET_OPTS) -C $$($$(PKG)_SRCDIR) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 317 | endef |
| 318 | endif |
| 319 | |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 320 | # Call the generic package infrastructure to generate the necessary |
| 321 | # make targets |
Thomas De Schampheleire | 26aef88 | 2014-02-05 10:44:03 +0100 | [diff] [blame] | 322 | $(call inner-generic-package,$(1),$(2),$(3),$(4)) |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 323 | |
| 324 | endef |
| 325 | |
| 326 | ################################################################################ |
Arnout Vandecappelle (Essensium/Mind) | 46fa5cb | 2012-07-03 00:07:08 +0200 | [diff] [blame] | 327 | # autotools-package -- the target generator macro for autotools packages |
Thomas Petazzoni | d8b55b9 | 2009-11-08 18:37:49 +0100 | [diff] [blame] | 328 | ################################################################################ |
| 329 | |
Thomas De Schampheleire | 26aef88 | 2014-02-05 10:44:03 +0100 | [diff] [blame] | 330 | autotools-package = $(call inner-autotools-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target) |
| 331 | host-autotools-package = $(call inner-autotools-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host) |