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>
This commit is contained in:
Thomas Petazzoni 2014-03-21 05:34:03 +01:00 committed by Peter Korsgaard
parent eb52ebc8bb
commit f4642eea7e

View file

@ -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