2007-08-10 13:07:51 -06:00
|
|
|
################################################################################
|
2009-11-08 10:37:49 -07:00
|
|
|
# Autotools package infrastructure
|
2007-08-10 13:07:51 -06:00
|
|
|
#
|
2009-11-08 10:37:49 -07:00
|
|
|
# This file implements an infrastructure that eases development of
|
|
|
|
# package .mk files for autotools packages. It should be used for all
|
2012-04-17 08:45:20 -06:00
|
|
|
# packages that use the autotools as their build system.
|
2007-08-10 13:07:51 -06:00
|
|
|
#
|
2009-11-08 10:37:49 -07:00
|
|
|
# See the Buildroot documentation for details on the usage of this
|
|
|
|
# infrastructure
|
2007-08-10 13:07:51 -06:00
|
|
|
#
|
2009-11-08 10:37:49 -07:00
|
|
|
# In terms of implementation, this autotools infrastructure requires
|
2014-07-24 12:07:02 -06:00
|
|
|
# the .mk file to only specify metadata information about the
|
2009-11-08 10:37:49 -07:00
|
|
|
# package: name, version, download URL, etc.
|
2007-09-30 06:46:02 -06:00
|
|
|
#
|
2009-11-08 10:37:49 -07:00
|
|
|
# We still allow the package .mk file to override what the different
|
|
|
|
# steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is
|
|
|
|
# already defined, it is used as the list of commands to perform to
|
|
|
|
# build the package, instead of the default autotools behaviour. The
|
|
|
|
# package can also define some post operation hooks.
|
2007-09-30 06:46:02 -06:00
|
|
|
#
|
2007-08-10 13:07:51 -06:00
|
|
|
################################################################################
|
|
|
|
|
2011-08-31 15:35:06 -06:00
|
|
|
|
|
|
|
#
|
|
|
|
# Utility function to upgrade config.sub and config.guess files
|
|
|
|
#
|
|
|
|
# argument 1 : directory into which config.guess and config.sub need
|
|
|
|
# to be updated. Note that config.sub and config.guess are searched
|
|
|
|
# recursively in this directory.
|
|
|
|
#
|
|
|
|
define CONFIG_UPDATE
|
|
|
|
for file in config.guess config.sub; do \
|
|
|
|
for i in $$(find $(1) -name $$file); do \
|
|
|
|
cp support/gnuconfig/$$file $$i; \
|
|
|
|
done; \
|
|
|
|
done
|
|
|
|
endef
|
|
|
|
|
2014-03-20 22:34:03 -06:00
|
|
|
# This function generates the ac_cv_file_<foo> value for a given
|
|
|
|
# filename. This is needed to convince configure script doing
|
|
|
|
# AC_CHECK_FILE() tests that the file actually exists, since such
|
|
|
|
# tests cannot be done in a cross-compilation context. This function
|
|
|
|
# takes as argument the path of the file. An example usage is:
|
|
|
|
#
|
|
|
|
# FOOBAR_CONF_ENV = \
|
|
|
|
# $(call AUTOCONF_AC_CHECK_FILE_VAL,/dev/random)=yes
|
|
|
|
AUTOCONF_AC_CHECK_FILE_VAL = ac_cv_file_$(subst -,_,$(subst /,_,$(subst .,_,$(1))))
|
|
|
|
|
2014-11-11 17:25:47 -07:00
|
|
|
#
|
|
|
|
# Hook to update config.sub and config.guess if needed
|
|
|
|
#
|
|
|
|
define UPDATE_CONFIG_HOOK
|
|
|
|
@$(call MESSAGE,"Updating config.sub and config.guess")
|
|
|
|
$(call CONFIG_UPDATE,$(@D))
|
|
|
|
endef
|
|
|
|
|
|
|
|
#
|
|
|
|
# Hook to patch libtool to make it work properly for cross-compilation
|
|
|
|
#
|
|
|
|
define LIBTOOL_PATCH_HOOK
|
2014-11-11 17:25:52 -07:00
|
|
|
@$(call MESSAGE,"Patching libtool")
|
2016-12-07 11:41:20 -07:00
|
|
|
$(Q)for i in `find $($(PKG)_DIR) -name ltmain.sh`; do \
|
2015-07-06 22:34:00 -06:00
|
|
|
ltmain_version=`sed -n '/^[ \t]*VERSION=/{s/^[ \t]*VERSION=//;p;q;}' $$i | \
|
pkg-autotools: fix patching libtool for version 2.4
If the libtool used by the package is 2.4 (i.e. with no patchlevel), we
end up with error messages like this one, seen when building ntp-4.2.8p3:
/bin/sh: line 0: test: 2.4: integer expression expected
That's because the current sed expression "[0-9].[0-9]." only deletes content
like "2.4.", so it leaves "2.4" (no patch level *and* no second period) intact,
resulting in an ltmain_patchlevel of "2.4", not empty, and not "0". Then the
shell line goes bad, because the built in shell test -gt operates on integers
only, and fails on floating point numbers (like "2.4").
Additionally, the existing sed lines are problematic in other ways, because the
current expression "[0-9].[0-9]" will match "234" as well as "2.4", as an unescaped
period matches any character, not just a period. Also, the lack of an asterisk
after the first character may be a problem in the future, if a two digit initial
number is used.
So, this patch changes the sed regex as follows:
* Match a string of digits when searching for a number. I.e. "[0-9]*"
* Match specifically a period in between two numbers. I.e. "\."
* When searching for a patch level, make the second period optional. I.e. "\.*"
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-07-05 14:53:48 -06:00
|
|
|
sed -e 's/\([0-9]*\.[0-9]*\).*/\1/' -e 's/\"//'`; \
|
2015-07-06 22:34:00 -06:00
|
|
|
ltmain_patchlevel=`sed -n '/^[ \t]*VERSION=/{s/^[ \t]*VERSION=//;p;q;}' $$i | \
|
pkg-autotools: fix patching libtool for version 2.4
If the libtool used by the package is 2.4 (i.e. with no patchlevel), we
end up with error messages like this one, seen when building ntp-4.2.8p3:
/bin/sh: line 0: test: 2.4: integer expression expected
That's because the current sed expression "[0-9].[0-9]." only deletes content
like "2.4.", so it leaves "2.4" (no patch level *and* no second period) intact,
resulting in an ltmain_patchlevel of "2.4", not empty, and not "0". Then the
shell line goes bad, because the built in shell test -gt operates on integers
only, and fails on floating point numbers (like "2.4").
Additionally, the existing sed lines are problematic in other ways, because the
current expression "[0-9].[0-9]" will match "234" as well as "2.4", as an unescaped
period matches any character, not just a period. Also, the lack of an asterisk
after the first character may be a problem in the future, if a two digit initial
number is used.
So, this patch changes the sed regex as follows:
* Match a string of digits when searching for a number. I.e. "[0-9]*"
* Match specifically a period in between two numbers. I.e. "\."
* When searching for a patch level, make the second period optional. I.e. "\.*"
Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-07-05 14:53:48 -06:00
|
|
|
sed -e 's/\([0-9]*\.[0-9]*\.*\)\([0-9]*\).*/\2/' -e 's/\"//'`; \
|
2014-11-11 17:25:52 -07:00
|
|
|
if test $${ltmain_version} = '1.5'; then \
|
2016-08-17 10:01:08 -06:00
|
|
|
patch -i support/libtool/buildroot-libtool-v1.5.patch $${i}; \
|
2014-11-11 17:25:52 -07:00
|
|
|
elif test $${ltmain_version} = "2.2"; then\
|
2016-08-17 10:01:08 -06:00
|
|
|
patch -i support/libtool/buildroot-libtool-v2.2.patch $${i}; \
|
2014-11-11 17:25:52 -07:00
|
|
|
elif test $${ltmain_version} = "2.4"; then\
|
2015-01-26 16:30:24 -07:00
|
|
|
if test $${ltmain_patchlevel:-0} -gt 2; then\
|
2016-08-17 10:01:08 -06:00
|
|
|
patch -i support/libtool/buildroot-libtool-v2.4.4.patch $${i}; \
|
2014-12-16 07:08:15 -07:00
|
|
|
else \
|
2016-08-17 10:01:08 -06:00
|
|
|
patch -i support/libtool/buildroot-libtool-v2.4.patch $${i}; \
|
2014-12-16 07:08:15 -07:00
|
|
|
fi \
|
2014-11-11 17:25:52 -07:00
|
|
|
fi \
|
|
|
|
done
|
2014-11-11 17:25:47 -07:00
|
|
|
endef
|
|
|
|
|
2016-11-27 22:11:39 -07:00
|
|
|
#
|
|
|
|
# Hook to patch common issue with configure on powerpc64{,le} failing
|
|
|
|
# to detect shared library support:
|
|
|
|
#
|
|
|
|
define CONFIGURE_FIX_POWERPC64_HOOK
|
|
|
|
@$(call MESSAGE,"Checking configure (powerpc64/powerpc64le)")
|
|
|
|
support/scripts/fix-configure-powerpc64.sh $($(PKG)_DIR)
|
|
|
|
endef
|
|
|
|
|
2014-11-11 17:25:47 -07:00
|
|
|
#
|
|
|
|
# Hook to gettextize the package if needed
|
|
|
|
#
|
|
|
|
define GETTEXTIZE_HOOK
|
|
|
|
@$(call MESSAGE,"Gettextizing")
|
|
|
|
$(Q)cd $($(PKG)_SRCDIR) && $(GETTEXTIZE) $($(PKG)_GETTEXTIZE_OPTS)
|
|
|
|
endef
|
|
|
|
|
|
|
|
#
|
|
|
|
# Hook to autoreconf the package if needed
|
|
|
|
#
|
|
|
|
define AUTORECONF_HOOK
|
|
|
|
@$(call MESSAGE,"Autoreconfiguring")
|
|
|
|
$(Q)cd $($(PKG)_SRCDIR) && $($(PKG)_AUTORECONF_ENV) $(AUTORECONF) $($(PKG)_AUTORECONF_OPTS)
|
|
|
|
endef
|
|
|
|
|
2009-01-16 03:27:48 -07:00
|
|
|
################################################################################
|
2012-07-02 16:07:08 -06:00
|
|
|
# inner-autotools-package -- defines how the configuration, compilation and
|
2009-11-08 10:37:49 -07:00
|
|
|
# installation of an autotools package should be done, implements a
|
|
|
|
# few hooks to tune the build process for autotools specifities and
|
|
|
|
# calls the generic package infrastructure to generate the necessary
|
|
|
|
# make targets
|
2009-01-16 03:27:48 -07:00
|
|
|
#
|
2009-11-08 10:37:49 -07:00
|
|
|
# argument 1 is the lowercase package name
|
2014-07-24 12:57:41 -06:00
|
|
|
# argument 2 is the uppercase package name, including a HOST_ prefix
|
2009-11-08 10:37:49 -07:00
|
|
|
# for host packages
|
|
|
|
# argument 3 is the uppercase package name, without the HOST_ prefix
|
|
|
|
# for host packages
|
2014-02-05 02:44:03 -07:00
|
|
|
# argument 4 is the type (target or host)
|
2007-08-10 13:07:51 -06:00
|
|
|
################################################################################
|
|
|
|
|
2012-07-02 16:07:08 -06:00
|
|
|
define inner-autotools-package
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2010-04-28 15:40:45 -06:00
|
|
|
ifndef $(2)_LIBTOOL_PATCH
|
|
|
|
ifdef $(3)_LIBTOOL_PATCH
|
infra: consistently use double dollar signs inside inner-xxx-targets
The inner-xxx-targets in the buildroot package infrastructures are
evaluated using $(eval) which causes variable references to be a bit
different than in regular make code. As we want most references to be
expanded only at the time of the $(eval) we should not use standard
references $(VAR) but rather use double dollar signs $$(VAR). This includes
function references like $(call), $(subst), etc. The only exception is the
reference to pkgdir/pkgname and numbered variables, which are parameters to
the inner block: $(1), $(2), etc.
This patch introduces consistent usage of double-dollar signs throughout the
different inner-xxx-targets blocks.
In some cases, this would potentially cause circular references, in
particular when the value of HOST_FOO_VAR would be obtained from the
corresponding FOO_VAR if HOST_FOO_VAR is not defined. In these cases, a test
is added to check for a host package (the only case where such constructions
are relevant; these are not circular).
Benefits of these changes are:
- behavior of variables is now again as expected. For example, setting
$(2)_VERSION = virtual in pkg-virtual.mk will effectively work, while
originally it would cause very odd results.
- The output of 'make printvars' is now much more useful. This target shows
the value of all variables, and the expression that led to that value.
However, if the expression was coming from an inner-xxx-targets block, and
was using single dollar signs, it would show in printvars as
VAR = value (value)
while if double dollar signs are used, it would effectively look like
VAR = value (actual expression)
as is intended.
This improvement is for example effective for FOO_DL_VERSION, FOO_RAWNAME,
FOO_SITE_METHOD and FOO_MAKE.
The correctness of this patch has been verified using 'make printvars',
'make manual' and 'make legal-info' before and after applying this patch,
and comparing the output.
Insight-provided-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-11 13:12:24 -06:00
|
|
|
$(2)_LIBTOOL_PATCH = $$($(3)_LIBTOOL_PATCH)
|
2010-04-28 15:40:45 -06:00
|
|
|
else
|
|
|
|
$(2)_LIBTOOL_PATCH ?= YES
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2011-05-17 02:00:01 -06:00
|
|
|
ifndef $(2)_MAKE
|
|
|
|
ifdef $(3)_MAKE
|
infra: consistently use double dollar signs inside inner-xxx-targets
The inner-xxx-targets in the buildroot package infrastructures are
evaluated using $(eval) which causes variable references to be a bit
different than in regular make code. As we want most references to be
expanded only at the time of the $(eval) we should not use standard
references $(VAR) but rather use double dollar signs $$(VAR). This includes
function references like $(call), $(subst), etc. The only exception is the
reference to pkgdir/pkgname and numbered variables, which are parameters to
the inner block: $(1), $(2), etc.
This patch introduces consistent usage of double-dollar signs throughout the
different inner-xxx-targets blocks.
In some cases, this would potentially cause circular references, in
particular when the value of HOST_FOO_VAR would be obtained from the
corresponding FOO_VAR if HOST_FOO_VAR is not defined. In these cases, a test
is added to check for a host package (the only case where such constructions
are relevant; these are not circular).
Benefits of these changes are:
- behavior of variables is now again as expected. For example, setting
$(2)_VERSION = virtual in pkg-virtual.mk will effectively work, while
originally it would cause very odd results.
- The output of 'make printvars' is now much more useful. This target shows
the value of all variables, and the expression that led to that value.
However, if the expression was coming from an inner-xxx-targets block, and
was using single dollar signs, it would show in printvars as
VAR = value (value)
while if double dollar signs are used, it would effectively look like
VAR = value (actual expression)
as is intended.
This improvement is for example effective for FOO_DL_VERSION, FOO_RAWNAME,
FOO_SITE_METHOD and FOO_MAKE.
The correctness of this patch has been verified using 'make printvars',
'make manual' and 'make legal-info' before and after applying this patch,
and comparing the output.
Insight-provided-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-11 13:12:24 -06:00
|
|
|
$(2)_MAKE = $$($(3)_MAKE)
|
2011-05-17 02:00:01 -06:00
|
|
|
else
|
infra: consistently use double dollar signs inside inner-xxx-targets
The inner-xxx-targets in the buildroot package infrastructures are
evaluated using $(eval) which causes variable references to be a bit
different than in regular make code. As we want most references to be
expanded only at the time of the $(eval) we should not use standard
references $(VAR) but rather use double dollar signs $$(VAR). This includes
function references like $(call), $(subst), etc. The only exception is the
reference to pkgdir/pkgname and numbered variables, which are parameters to
the inner block: $(1), $(2), etc.
This patch introduces consistent usage of double-dollar signs throughout the
different inner-xxx-targets blocks.
In some cases, this would potentially cause circular references, in
particular when the value of HOST_FOO_VAR would be obtained from the
corresponding FOO_VAR if HOST_FOO_VAR is not defined. In these cases, a test
is added to check for a host package (the only case where such constructions
are relevant; these are not circular).
Benefits of these changes are:
- behavior of variables is now again as expected. For example, setting
$(2)_VERSION = virtual in pkg-virtual.mk will effectively work, while
originally it would cause very odd results.
- The output of 'make printvars' is now much more useful. This target shows
the value of all variables, and the expression that led to that value.
However, if the expression was coming from an inner-xxx-targets block, and
was using single dollar signs, it would show in printvars as
VAR = value (value)
while if double dollar signs are used, it would effectively look like
VAR = value (actual expression)
as is intended.
This improvement is for example effective for FOO_DL_VERSION, FOO_RAWNAME,
FOO_SITE_METHOD and FOO_MAKE.
The correctness of this patch has been verified using 'make printvars',
'make manual' and 'make legal-info' before and after applying this patch,
and comparing the output.
Insight-provided-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-11 13:12:24 -06:00
|
|
|
$(2)_MAKE ?= $$(MAKE)
|
2011-05-17 02:00:01 -06:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-10-02 15:37:58 -06:00
|
|
|
ifndef $(2)_AUTORECONF
|
|
|
|
ifdef $(3)_AUTORECONF
|
infra: consistently use double dollar signs inside inner-xxx-targets
The inner-xxx-targets in the buildroot package infrastructures are
evaluated using $(eval) which causes variable references to be a bit
different than in regular make code. As we want most references to be
expanded only at the time of the $(eval) we should not use standard
references $(VAR) but rather use double dollar signs $$(VAR). This includes
function references like $(call), $(subst), etc. The only exception is the
reference to pkgdir/pkgname and numbered variables, which are parameters to
the inner block: $(1), $(2), etc.
This patch introduces consistent usage of double-dollar signs throughout the
different inner-xxx-targets blocks.
In some cases, this would potentially cause circular references, in
particular when the value of HOST_FOO_VAR would be obtained from the
corresponding FOO_VAR if HOST_FOO_VAR is not defined. In these cases, a test
is added to check for a host package (the only case where such constructions
are relevant; these are not circular).
Benefits of these changes are:
- behavior of variables is now again as expected. For example, setting
$(2)_VERSION = virtual in pkg-virtual.mk will effectively work, while
originally it would cause very odd results.
- The output of 'make printvars' is now much more useful. This target shows
the value of all variables, and the expression that led to that value.
However, if the expression was coming from an inner-xxx-targets block, and
was using single dollar signs, it would show in printvars as
VAR = value (value)
while if double dollar signs are used, it would effectively look like
VAR = value (actual expression)
as is intended.
This improvement is for example effective for FOO_DL_VERSION, FOO_RAWNAME,
FOO_SITE_METHOD and FOO_MAKE.
The correctness of this patch has been verified using 'make printvars',
'make manual' and 'make legal-info' before and after applying this patch,
and comparing the output.
Insight-provided-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-11 13:12:24 -06:00
|
|
|
$(2)_AUTORECONF = $$($(3)_AUTORECONF)
|
2013-10-02 15:37:58 -06:00
|
|
|
else
|
|
|
|
$(2)_AUTORECONF ?= NO
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-07-16 16:00:35 -06:00
|
|
|
ifndef $(2)_GETTEXTIZE
|
|
|
|
ifdef $(3)_GETTEXTIZE
|
|
|
|
$(2)_GETTEXTIZE = $$($(3)_GETTEXTIZE)
|
|
|
|
else
|
|
|
|
$(2)_GETTEXTIZE ?= NO
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-07-18 15:02:31 -06:00
|
|
|
ifeq ($(4),host)
|
2014-09-27 13:32:46 -06:00
|
|
|
$(2)_GETTEXTIZE_OPTS ?= $$($(3)_GETTEXTIZE_OPTS)
|
2014-07-16 16:00:35 -06:00
|
|
|
endif
|
|
|
|
|
infra: consistently use double dollar signs inside inner-xxx-targets
The inner-xxx-targets in the buildroot package infrastructures are
evaluated using $(eval) which causes variable references to be a bit
different than in regular make code. As we want most references to be
expanded only at the time of the $(eval) we should not use standard
references $(VAR) but rather use double dollar signs $$(VAR). This includes
function references like $(call), $(subst), etc. The only exception is the
reference to pkgdir/pkgname and numbered variables, which are parameters to
the inner block: $(1), $(2), etc.
This patch introduces consistent usage of double-dollar signs throughout the
different inner-xxx-targets blocks.
In some cases, this would potentially cause circular references, in
particular when the value of HOST_FOO_VAR would be obtained from the
corresponding FOO_VAR if HOST_FOO_VAR is not defined. In these cases, a test
is added to check for a host package (the only case where such constructions
are relevant; these are not circular).
Benefits of these changes are:
- behavior of variables is now again as expected. For example, setting
$(2)_VERSION = virtual in pkg-virtual.mk will effectively work, while
originally it would cause very odd results.
- The output of 'make printvars' is now much more useful. This target shows
the value of all variables, and the expression that led to that value.
However, if the expression was coming from an inner-xxx-targets block, and
was using single dollar signs, it would show in printvars as
VAR = value (value)
while if double dollar signs are used, it would effectively look like
VAR = value (actual expression)
as is intended.
This improvement is for example effective for FOO_DL_VERSION, FOO_RAWNAME,
FOO_SITE_METHOD and FOO_MAKE.
The correctness of this patch has been verified using 'make printvars',
'make manual' and 'make legal-info' before and after applying this patch,
and comparing the output.
Insight-provided-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-11 13:12:24 -06:00
|
|
|
ifeq ($(4),host)
|
2014-09-27 13:32:43 -06:00
|
|
|
$(2)_AUTORECONF_OPTS ?= $$($(3)_AUTORECONF_OPTS)
|
infra: consistently use double dollar signs inside inner-xxx-targets
The inner-xxx-targets in the buildroot package infrastructures are
evaluated using $(eval) which causes variable references to be a bit
different than in regular make code. As we want most references to be
expanded only at the time of the $(eval) we should not use standard
references $(VAR) but rather use double dollar signs $$(VAR). This includes
function references like $(call), $(subst), etc. The only exception is the
reference to pkgdir/pkgname and numbered variables, which are parameters to
the inner block: $(1), $(2), etc.
This patch introduces consistent usage of double-dollar signs throughout the
different inner-xxx-targets blocks.
In some cases, this would potentially cause circular references, in
particular when the value of HOST_FOO_VAR would be obtained from the
corresponding FOO_VAR if HOST_FOO_VAR is not defined. In these cases, a test
is added to check for a host package (the only case where such constructions
are relevant; these are not circular).
Benefits of these changes are:
- behavior of variables is now again as expected. For example, setting
$(2)_VERSION = virtual in pkg-virtual.mk will effectively work, while
originally it would cause very odd results.
- The output of 'make printvars' is now much more useful. This target shows
the value of all variables, and the expression that led to that value.
However, if the expression was coming from an inner-xxx-targets block, and
was using single dollar signs, it would show in printvars as
VAR = value (value)
while if double dollar signs are used, it would effectively look like
VAR = value (actual expression)
as is intended.
This improvement is for example effective for FOO_DL_VERSION, FOO_RAWNAME,
FOO_SITE_METHOD and FOO_MAKE.
The correctness of this patch has been verified using 'make printvars',
'make manual' and 'make legal-info' before and after applying this patch,
and comparing the output.
Insight-provided-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-11 13:12:24 -06:00
|
|
|
endif
|
|
|
|
|
2007-08-10 13:07:51 -06:00
|
|
|
$(2)_CONF_ENV ?=
|
2014-09-27 13:32:44 -06:00
|
|
|
$(2)_CONF_OPTS ?=
|
2007-09-30 06:46:02 -06:00
|
|
|
$(2)_MAKE_ENV ?=
|
2014-09-27 13:32:38 -06:00
|
|
|
$(2)_MAKE_OPTS ?=
|
2014-09-27 13:32:39 -06:00
|
|
|
$(2)_INSTALL_OPTS ?= install
|
2014-09-27 13:32:41 -06:00
|
|
|
$(2)_INSTALL_STAGING_OPTS ?= DESTDIR=$$(STAGING_DIR) install
|
2015-07-12 09:06:50 -06:00
|
|
|
$(2)_INSTALL_TARGET_OPTS ?= DESTDIR=$$(TARGET_DIR) install
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
#
|
|
|
|
# Configure step. Only define it if not already defined by the package
|
|
|
|
# .mk file. And take care of the differences between host and target
|
|
|
|
# packages.
|
|
|
|
#
|
|
|
|
ifndef $(2)_CONFIGURE_CMDS
|
2014-02-05 02:44:03 -07:00
|
|
|
ifeq ($(4),target)
|
2009-11-08 10:37:49 -07:00
|
|
|
|
|
|
|
# Configure package for target
|
|
|
|
define $(2)_CONFIGURE_CMDS
|
|
|
|
(cd $$($$(PKG)_SRCDIR) && rm -rf config.cache && \
|
|
|
|
$$(TARGET_CONFIGURE_OPTS) \
|
|
|
|
$$(TARGET_CONFIGURE_ARGS) \
|
|
|
|
$$($$(PKG)_CONF_ENV) \
|
2014-08-22 03:12:53 -06:00
|
|
|
CONFIG_SITE=/dev/null \
|
2009-11-08 10:37:49 -07:00
|
|
|
./configure \
|
|
|
|
--target=$$(GNU_TARGET_NAME) \
|
|
|
|
--host=$$(GNU_TARGET_NAME) \
|
|
|
|
--build=$$(GNU_HOST_NAME) \
|
|
|
|
--prefix=/usr \
|
|
|
|
--exec-prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
2014-10-17 16:36:32 -06:00
|
|
|
--localstatedir=/var \
|
2011-08-09 16:12:34 -06:00
|
|
|
--program-prefix="" \
|
2014-02-05 06:51:00 -07:00
|
|
|
--disable-gtk-doc \
|
2014-10-19 03:59:03 -06:00
|
|
|
--disable-gtk-doc-html \
|
2014-02-05 06:51:00 -07:00
|
|
|
--disable-doc \
|
|
|
|
--disable-docs \
|
|
|
|
--disable-documentation \
|
|
|
|
--with-xmlto=no \
|
2014-02-08 17:00:22 -07:00
|
|
|
--with-fop=no \
|
2017-02-01 06:53:10 -07:00
|
|
|
$$(if $$($$(PKG)_OVERRIDE_SRCDIR),,--disable-dependency-tracking) \
|
2015-04-19 06:40:01 -06:00
|
|
|
--enable-ipv6 \
|
2009-11-08 10:37:49 -07:00
|
|
|
$$(DISABLE_NLS) \
|
package/autotools: add --{enable,disable}-{shared,static} automatically
For target packages, depending on BR2_PREFER_STATIC_LIB, add the
correct combination of --{enable,disable}-{shared,static} flags to
./configure calls.
* When BR2_PREFER_STATIC_LIB is enabled, we pass --enable-static
--disable-shared.
* When BR2_PREFER_STATIC_LIB is disabled, we pass --enable-static
--enable-shared. We enable static libraries since they can still be
useful to statically link applications against some libraries
(sometimes it is useful for size reasons). Static libraries are
anyway only installed in the STAGING_DIR, so it doesn't increase in
any way the size of the TARGET_DIR.
For host packages, always pass --enable-shared and --disable-static.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-05-30 15:57:02 -06:00
|
|
|
$$(SHARED_STATIC_LIBS_OPTS) \
|
2014-09-27 13:32:44 -06:00
|
|
|
$$(QUIET) $$($$(PKG)_CONF_OPTS) \
|
2009-11-08 10:37:49 -07:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
else
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
# Configure package for host
|
2012-12-11 21:07:22 -07:00
|
|
|
# disable all kind of documentation generation in the process,
|
|
|
|
# because it often relies on host tools which may or may not be
|
|
|
|
# installed.
|
2009-11-08 10:37:49 -07:00
|
|
|
define $(2)_CONFIGURE_CMDS
|
|
|
|
(cd $$($$(PKG)_SRCDIR) && rm -rf config.cache; \
|
2015-11-22 07:39:41 -07:00
|
|
|
$$(HOST_CONFIGURE_OPTS) \
|
|
|
|
CFLAGS="$$(HOST_CFLAGS)" \
|
|
|
|
LDFLAGS="$$(HOST_LDFLAGS)" \
|
|
|
|
$$($$(PKG)_CONF_ENV) \
|
|
|
|
CONFIG_SITE=/dev/null \
|
|
|
|
./configure \
|
2009-11-08 10:37:49 -07:00
|
|
|
--prefix="$$(HOST_DIR)/usr" \
|
|
|
|
--sysconfdir="$$(HOST_DIR)/etc" \
|
2014-10-17 16:36:32 -06:00
|
|
|
--localstatedir="$$(HOST_DIR)/var" \
|
package/autotools: add --{enable,disable}-{shared,static} automatically
For target packages, depending on BR2_PREFER_STATIC_LIB, add the
correct combination of --{enable,disable}-{shared,static} flags to
./configure calls.
* When BR2_PREFER_STATIC_LIB is enabled, we pass --enable-static
--disable-shared.
* When BR2_PREFER_STATIC_LIB is disabled, we pass --enable-static
--enable-shared. We enable static libraries since they can still be
useful to statically link applications against some libraries
(sometimes it is useful for size reasons). Static libraries are
anyway only installed in the STAGING_DIR, so it doesn't increase in
any way the size of the TARGET_DIR.
For host packages, always pass --enable-shared and --disable-static.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2011-05-30 15:57:02 -06:00
|
|
|
--enable-shared --disable-static \
|
2012-12-11 21:07:22 -07:00
|
|
|
--disable-gtk-doc \
|
2014-10-19 03:59:03 -06:00
|
|
|
--disable-gtk-doc-html \
|
2012-12-11 21:07:22 -07:00
|
|
|
--disable-doc \
|
|
|
|
--disable-docs \
|
|
|
|
--disable-documentation \
|
2014-10-19 03:59:01 -06:00
|
|
|
--disable-debug \
|
2012-12-11 21:07:22 -07:00
|
|
|
--with-xmlto=no \
|
|
|
|
--with-fop=no \
|
2017-02-01 06:53:10 -07:00
|
|
|
$$(if $$($$(PKG)_OVERRIDE_SRCDIR),,--disable-dependency-tracking) \
|
2014-09-27 13:32:44 -06:00
|
|
|
$$(QUIET) $$($$(PKG)_CONF_OPTS) \
|
2009-11-08 10:37:49 -07:00
|
|
|
)
|
|
|
|
endef
|
|
|
|
endif
|
|
|
|
endif
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
$(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK
|
2007-08-10 13:07:51 -06:00
|
|
|
|
autotools: fix autoreconf check
The autoreconf check was incorrect, missing a $ sign to properly
reference a package-specific variable. There was no visible effect
until now since :
* The existing syntax allowed to access the value defined in the
package specific .mk file, so when AUTORECONF was set to YES by a
package, it was working.
* The default value in Makefile.autotools.in was NO. In fact, when a
package .mkf file wasn't defining the AUTORECONF variable, the
Makefile.autotools.in test was testing the empty string against
'YES', which was false, leading to the AUTORECONF not being done,
which was the desired effect.
However, in a later patch, we intend to change this default value.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2010-04-28 15:40:42 -06:00
|
|
|
ifeq ($$($(2)_AUTORECONF),YES)
|
2014-11-11 17:25:53 -07:00
|
|
|
|
2014-07-16 16:00:35 -06:00
|
|
|
# This has to come before autoreconf
|
|
|
|
ifeq ($$($(2)_GETTEXTIZE),YES)
|
|
|
|
$(2)_PRE_CONFIGURE_HOOKS += GETTEXTIZE_HOOK
|
|
|
|
$(2)_DEPENDENCIES += host-gettext
|
|
|
|
endif
|
2010-11-03 20:50:24 -06:00
|
|
|
$(2)_PRE_CONFIGURE_HOOKS += AUTORECONF_HOOK
|
2014-11-11 17:25:50 -07:00
|
|
|
# default values are not evaluated yet, so don't rely on this defaulting to YES
|
|
|
|
ifneq ($$($(2)_LIBTOOL_PATCH),NO)
|
|
|
|
$(2)_PRE_CONFIGURE_HOOKS += LIBTOOL_PATCH_HOOK
|
|
|
|
endif
|
2007-08-22 09:52:01 -06:00
|
|
|
$(2)_DEPENDENCIES += host-automake host-autoconf host-libtool
|
2014-11-11 17:25:53 -07:00
|
|
|
|
|
|
|
else # ! AUTORECONF = YES
|
|
|
|
|
|
|
|
# default values are not evaluated yet, so don't rely on this defaulting to YES
|
|
|
|
ifneq ($$($(2)_LIBTOOL_PATCH),NO)
|
|
|
|
$(2)_POST_PATCH_HOOKS += LIBTOOL_PATCH_HOOK
|
|
|
|
endif
|
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
endif
|
|
|
|
|
2016-11-27 22:11:39 -07:00
|
|
|
# Append a configure hook if building for a powerpc64 (or powerpc64le) arch.
|
|
|
|
# Must be added after other pre-configure hooks that might regenerate the
|
|
|
|
# configure script and overwrite the changes made here.
|
|
|
|
ifneq ($$(filter powerpc64%,$$(if $$(filter target,$(4)),$$(ARCH),$$(HOSTARCH))),)
|
|
|
|
$(2)_PRE_CONFIGURE_HOOKS += CONFIGURE_FIX_POWERPC64_HOOK
|
|
|
|
endif
|
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
#
|
|
|
|
# Build step. Only define it if not already defined by the package .mk
|
|
|
|
# file.
|
|
|
|
#
|
|
|
|
ifndef $(2)_BUILD_CMDS
|
2014-02-05 02:44:03 -07:00
|
|
|
ifeq ($(4),target)
|
2009-11-08 10:37:49 -07:00
|
|
|
define $(2)_BUILD_CMDS
|
2014-09-27 13:32:38 -06:00
|
|
|
$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR)
|
2009-11-08 10:37:49 -07:00
|
|
|
endef
|
2007-08-10 13:07:51 -06:00
|
|
|
else
|
2009-11-08 10:37:49 -07:00
|
|
|
define $(2)_BUILD_CMDS
|
2014-09-27 13:32:38 -06:00
|
|
|
$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR)
|
2009-11-08 10:37:49 -07:00
|
|
|
endef
|
|
|
|
endif
|
2007-08-10 13:07:51 -06:00
|
|
|
endif
|
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
#
|
|
|
|
# Host installation step. Only define it if not already defined by the
|
|
|
|
# package .mk file.
|
|
|
|
#
|
|
|
|
ifndef $(2)_INSTALL_CMDS
|
|
|
|
define $(2)_INSTALL_CMDS
|
2014-09-27 13:32:39 -06:00
|
|
|
$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_OPTS) -C $$($$(PKG)_SRCDIR)
|
2009-11-08 10:37:49 -07:00
|
|
|
endef
|
|
|
|
endif
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
#
|
|
|
|
# Staging installation step. Only define it if not already defined by
|
|
|
|
# the package .mk file.
|
|
|
|
#
|
|
|
|
ifndef $(2)_INSTALL_STAGING_CMDS
|
|
|
|
define $(2)_INSTALL_STAGING_CMDS
|
2014-09-27 13:32:41 -06:00
|
|
|
$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_STAGING_OPTS) -C $$($$(PKG)_SRCDIR)
|
2009-11-08 10:37:49 -07:00
|
|
|
endef
|
|
|
|
endif
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
#
|
|
|
|
# Target installation step. Only define it if not already defined by
|
|
|
|
# the package .mk file.
|
|
|
|
#
|
|
|
|
ifndef $(2)_INSTALL_TARGET_CMDS
|
|
|
|
define $(2)_INSTALL_TARGET_CMDS
|
2014-09-27 13:32:40 -06:00
|
|
|
$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_INSTALL_TARGET_OPTS) -C $$($$(PKG)_SRCDIR)
|
2009-11-08 10:37:49 -07:00
|
|
|
endef
|
|
|
|
endif
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
# Call the generic package infrastructure to generate the necessary
|
|
|
|
# make targets
|
2014-02-05 02:44:03 -07:00
|
|
|
$(call inner-generic-package,$(1),$(2),$(3),$(4))
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
endef
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2009-11-08 10:37:49 -07:00
|
|
|
################################################################################
|
2012-07-02 16:07:08 -06:00
|
|
|
# autotools-package -- the target generator macro for autotools packages
|
2009-11-08 10:37:49 -07:00
|
|
|
################################################################################
|
2007-08-10 13:07:51 -06:00
|
|
|
|
2014-02-05 02:44:03 -07:00
|
|
|
autotools-package = $(call inner-autotools-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
|
|
|
|
host-autotools-package = $(call inner-autotools-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
|