Commit Graph

28 Commits

Author SHA1 Message Date
Romain Naour
f8d4fe376c package/pkg-autotools: don't use config.site when cross-compiling
On fedora 20 64bits host, the file /usr/share/config.site contains
a fix for installing libraries into /lib/lib64 on 64bits systems
that redefine libdir in the generated Makefile

For safety and avoid the bug #7262 [1], disable loading this file
when running the configure script for the target and the host.

Note: configure scripts generated with autoconf < 2.65 will source
the /dev/null and print this line:
"configure: loading site script /dev/null"

[1]: https://bugs.busybox.net/show_bug.cgi?id=7262

Signed-off-by: Romain Naour <romain.naour@openwide.fr>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-09-15 00:35:58 +02:00
Thomas Petazzoni
3e37b0fc6c pkg-autotools: use --disable-dependency-tracking
By default, automake does "dependency tracking", which allows the
generated Makefile to contain the necessary dependencies to
automatically rebuild the appropriate C files when included header
files are changed. This dependency tracking is nice when doing active
development on the package, but not really useful when doing a
one-time build of the package. According to automake's
documentation[1], disabling the dependency tracking provides a small
speed-up.

In some very unscientific measurements (i.e repeated only once), we
have noticed a ~3.6% reduction of the total build time of a Buildroot
toolchain after applying this patch.

[1] http://www.gnu.org/software/automake/manual/html_node/Dependency-Tracking.html

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-08-29 09:17:33 +02:00
Thomas De Schampheleire
60714bb2ed trivial: fix typo 'informations'
In English, unlike in French, almost all usages of the word 'information'
are uncountable, meaning that 'informations' is invalid.
This patch fixes this typo throughout the tree, except in CHANGES and
docs/news.html (historic text).

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-24 22:31:20 +02:00
Thomas De Schampheleire
5bd9ed6fe6 trivial: fix typo 'an host'
In English, unlike in French, the 'h' in 'host' is pronounced, meaning that
the article should be 'a' instead of 'an'.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-24 22:29:54 +02:00
Rick Taylor
5af28fe6a1 pkg-autotools: add support for <pkg>_AUTORECONF_ENV
This commit improves the autotools-package infrastructure to support a
<pkg>_AUTORECONF_ENV variable, which allows a package maintainer to
pass additional variables in the environment of the autoreconf
execution. This is useful in the situation where configure.ac contains
shell commands using environment variables that are only executed when
autoreconf is run.

Signed-off-by: Rick Taylor <rick.taylor@cassidian.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-23 23:49:10 +02:00
Yann E. MORIN
bea8f267d5 infra/pkg-autotools: cleanup the gettextize step
Align the way we call gettextize to the way we call autoreconf:
  - provide the $(GETTEXTIZE) variable
  - pass $(HOST_CONFIGURE_OPTS) in the environment
  - pass the fully-qualified path to autom4te
  - use of -f even if the package provides its own options

Some eye-candy in the output of gettextize.

Thanks to Gustavo for pointing out the discrepancy between the way we
call gettextize and the way we call autoreconf, and to Thomas for the
live debug session. ;-)

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-19 11:35:22 +02:00
Gustavo Zacarias
eada19f244 pkg-autotools: fix bad GETTEXTIZE_OPT assignment
HOST_PKG_GETTEXTIZE_OPT should get assigned PKG_GETTEXTIZE_OPT and not
PKG_GETTEXTIZE. Fixes:
http://autobuild.buildroot.net/results/087/087e860173069f58fa9ceb2460d7455d31b2dff8/

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-17 17:30:26 +02:00
Yann E. MORIN
899258344f pkg-autotools: add support to gettextize a package
In case a package comes with a gettext infra which is different from
the one Buildroot provides, we'd get autoreconf errors, like:
    http://autobuild.buildroot.net/results/c0f/c0f7c801f61fdc310cde64342060b00a70155431/

To avoid that, we need to gettextize the package prior to running
autoreconf.

Provide the necessary infrastructure in the autotools infrastructure,
so we can do it consistently across packages.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gustavo Zacarias <gustavo@zacarias.com.ar>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-07-17 09:49:25 +02:00
Thomas De Schampheleire
18a0e07350 infra: fix autotools .la fixing when no .la files are present
Commit 6f638ea9c9 ("infra: /usr support:
STAGING_DIR can be outside BASE_DIR") changed a for-construct around 'sed
-i' in a 'find | xargs sed -i'. However, if the find returns no results,
sed complains with:
    '/bin/sed: no input files'

This commit adds the extra parameter -r / --no-run-if-empty to the xargs
call, effectively fixing this problem case.

Reported-by: Rohit Kumar <rkthebest@gmail.com>
Fix-suggested-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-07-06 22:22:52 +02:00
Thomas De Schampheleire
6f638ea9c9 infra: /usr support: STAGING_DIR can be outside BASE_DIR
If the user sets a custom BR2_HOST_DIR, then STAGING_DIR is not under
BASE_DIR. The .pc/.la file fixup commands incorrectly made this assumption
and thus should be corrected.

Additionally, this patch:
- rewords the comment in pkg-autotools that explains the replacements.
- removes a for statement in favor of xargs

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-07-04 15:49:59 +02:00
Thomas De Schampheleire
7701fc53d1 infra: support buildroot being located in /usr
pkg-generic and pkg-autotools both perform sed replacements of /usr to
$(STAGING_DIR)/usr, in .pc and .la files respectively. However, if buildroot
itself is located in /usr, then STAGING_DIR also starts with /usr, and naive
replacements of '/usr' can result in paths of the form:
    /usr/buildroot/.../sysroot/usr/buildroot/.../sysroot/...

This patch makes the replacements more careful, by first replacing the known
paths BASE_DIR and STAGING_DIR to tokens, then performing the actual
replacement, and finally replacing the tokens with the corresponding paths.

Additionally it removes the unnecessary making of a backup copy in
pkg-autotools.

Partially fixes bug #5750 (https://bugs.busybox.net/show_bug.cgi?id=5750)

[Thomas: improve pkg-autotools.mk by including the explanation comment
proposed by Arnout.]

Partially-based-on-a-patch-from: Ben Stoltz <benstoltz@gmail.com>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-06-29 12:38:17 +02:00
Thomas De Schampheleire
54456cc698 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-14 19:09:54 +02:00
Thomas Petazzoni
f4642eea7e pkg-autotools: add a AUTOCONF_AC_CHECK_FILE_VAL macro
When configure.ac scripts do AC_CHECK_FILE tests, they always fail in
cross-compilation contexts because it is not possible to check for
file existence during the build process. Therefore we have to preseed
the configure environment with ac_cv_file_<foo>=yes variable, <foo>
being the path of the file, where all slashes, dots or dashes have
been replaced by underscores.

In the context of the boot-wrapper-aarch64, we will have to use three
of these variables, with fairly complex paths. So instead of
replicating the logic each time, we create a
AUTOCONF_AC_CHECK_FILE_VAL macro to help defining such variables.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-03-21 07:26:53 +01:00
Fabio Porcedda
b2fd9f90e2 package: add toolchain dependency to every target package
This commit makes the dependency from the target toolchain explicit.
This way we can buid from command line a package that use
inner-generic-package right after the configuration phase, example:

	make clean <package-name>

Also remove TARGETS_ALL because the only purpose was to add toolchain
dependency so it's superseded by this commit.

To prevent circular dependency add the new variable
<pkgname>_ADD_TOOLCHAIN_DEPENDENCY to avoid adding the toolchain
dependency for toolchain packages.

This is also a step forward supporting top-level parallel make.

Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-14 21:08:35 +01:00
Peter Korsgaard
4e0cd2e289 pkg-autotools: fixup pkg_CONFIGURE_CMDS after DISABLE_DOCUMENTATION removal
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-09 01:00:22 +01:00
Thomas De Schampheleire
e20df632c4 infra: remove separate definition of DISABLE_DOCUMENTATION
Since we now always disable documentation on target, there is no need to
have a separate variable DISABLE_DOCUMENTATION anymore.

Suggested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-08 23:44:48 +01:00
Thomas De Schampheleire
26aef889f1 infra: remove unused 4th parameter to package infrastructures (pkgparentdir)
The fourth parameter to inner-generic-package is no longer used. Removing
this parameters requires renaming all usages of $(5) to $(4), and updating
the calls to inner-generic-package (and equivalent for the other package
infrastructures).

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-05 12:10:35 +01:00
Thomas De Schampheleire
3880a6ab3c infra: remove redundant $(call) on pkgdir, pkgname, pkgparentdir
When calling make 'functions', the $(call) keyword is only needed if the
function takes arguments. For pkgdir, pkgname and pkgparentdir this is not
the case, so we can remove the call to make things more readable.

Suggested-by: Arnout Vandecappelle <arnout@mind.be>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-05 12:09:35 +01:00
Thomas De Schampheleire
47e82829c2 infra: remove package clean commands
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-12-08 19:42:14 +01:00
Thomas De Schampheleire
b64273db75 infra: remove uninstall commands
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-12-06 09:40:24 +01:00
Peter Korsgaard
97c687000a pkg-autotools.mk: default host AUTORECONF{,_OPT} to the target values
When we have patches touching configure.ac and hence need to set
<pkg>_AUTORECONF = YES we also have to remember to set
HOST_<pkg>_AUTORECONF = YES if we build both host and target versions,
which is often forgotten (latest case was bison).

Fix it by making the host versions of _AUTORECONF and _AUTORECONF_OPT
default to whatever the target versions are set to, similar to how we
handle a number of the other variables.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2013-10-02 23:42:19 +02:00
Peter Korsgaard
9f5a9deb8c pkg-autotools.mk: also use QUIET for host configure runs
Similar to how we do it for target configure runs. For make -s invocations.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-07-17 09:37:36 +02:00
Thomas Petazzoni
598ade90a8 package: allow to override the make install target for host packages
In order to convert gcc to the package infrastructure, we need a way
of overriding the name of the make target used for the installation of
host packages, just like we have for target packages.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-07-03 07:35:52 +02:00
przemyslaw
3400663620 Fix autoreconf libtool patching
Some ltmain.sh files enclose the version number in quotes. This is
already handled corretly by pkg-autotools.mk in LIBTOOL_PATCH_HOOK.
This patch adds the same fix for AUTORECONF_HOOK.

Signed-off-by: przemyslaw <przemyslaw.wrzos@calyptech.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-03-24 22:15:58 +01:00
Danomi Manchego
28bb03ac9d pkg-autotools.mk: remove extra space from config-update message
If you do a "make -s", you will notice that the UPDATE_CONFIG_HOOK message
has an extra space compared to other highlighted messages.  For example:

>>> util-linux 2.20.1  Updating config.sub and config.guess
>>> util-linux 2.20.1 Patching libtool
>>> util-linux 2.20.1 Autoreconfiguring

A grep shows this is the only instance of the extra space. This patch
removes the extra space.

Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2013-03-18 22:45:11 +01:00
Arnout Vandecappelle
489970e047 pkg-infra: pass --disable-doc if documentation is not enabled
Many configure scripts support an option like --disable-doc, --disable-docs
or --disable-documentation.  Pass all of these to configure.

In addition, not all Xorg packages accept the --disable-xxx. Instead they
look for xmlto and/or fop and build documentation if they exist.  For host
packages, this may lead to build errors because /usr/bin/xmlto uses libxml2
and we set LD_LIBRARY_PATH to point to $(HOST_DIR)/lib, which may contain
a libxml2 as well.  So it's essential to disable xmlto for host packages.

Also some whitespace cleanup.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-12-12 17:11:15 +01:00
Samuel Martin
9ba9bfb9a0 pkg-*targets.mk: factorize and fix $(PKG)_SRCDIR and $(PKG)_BUILDDIR declaration
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-22 19:28:42 +02:00
Arnout Vandecappelle (Essensium/Mind)
2359e1223f Clean up naming of old GENTARGETS infrastructure
With the renaming of XXXTARGETS to xxx-package, the names of the
pkg-xxx.mk files is inconsistent, as well as some internal names in
the documentation.  These inconsistencies are cleaned up here.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 ...kages-autotargets.txt => adding-packages-autotools.txt} |    4 ++--
 ...packages-cmaketargets.txt => adding-packages-cmake.txt} |    4 ++--
 docs/manual/adding-packages-directory.txt                  |   12 ++++++------
 ...packages-gentargets.txt => adding-packages-generic.txt} |    4 ++--
 docs/manual/adding-packages.txt                            |    6 +++---
 package/Makefile.in                                        |    6 +++---
 package/{pkg-autotargets.mk => pkg-autotools.mk}           |    0
 package/{pkg-cmaketargets.mk => pkg-cmake.mk}              |    0
 package/{pkg-gentargets.mk => pkg-generic.mk}              |    0
 9 files changed, 18 insertions(+), 18 deletions(-)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2012-07-17 20:24:03 +02:00