From: Thomas Petazzoni Date: Fri, 21 Mar 2014 04:34:03 +0000 (+0100) Subject: pkg-autotools: add a AUTOCONF_AC_CHECK_FILE_VAL macro X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4642eea7e5c0c375f1b892074a3c22637042deb;p=buildroot.git 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_=yes variable, 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 Signed-off-by: Peter Korsgaard --- diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk index 32ceef2086..a6466120b6 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_ 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