summaryrefslogtreecommitdiff
path: root/package/pkg-autotools.mk
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-03-21 05:34:03 +0100
committerPeter Korsgaard <peter@korsgaard.com>2014-03-21 07:26:53 +0100
commitf4642eea7e5c0c375f1b892074a3c22637042deb (patch)
tree7ec2d4e54e32839e2fa74717878037438da77e97 /package/pkg-autotools.mk
parenteb52ebc8bb5cdda9039da3992d813251068e2694 (diff)
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>
Diffstat (limited to 'package/pkg-autotools.mk')
-rw-r--r--package/pkg-autotools.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk
index 32ceef208..a6466120b 100644
--- a/package/pkg-autotools.mk
+++ b/package/pkg-autotools.mk
@@ -36,6 +36,16 @@ define CONFIG_UPDATE
done
endef
+# 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))))
+
################################################################################
# inner-autotools-package -- defines how the configuration, compilation and
# installation of an autotools package should be done, implements a