diff options
| author | Thomas Haller <thaller@redhat.com> | 2018-07-26 08:02:33 +0200 |
|---|---|---|
| committer | Thomas Haller <thaller@redhat.com> | 2018-07-26 08:51:45 +0200 |
| commit | 81e5b262da643414507a76c4db185d28e81d9a32 (patch) | |
| tree | 54f08764cd7cd6e8fa86589dd7ddc8cb37ef40d2 /configure.ac | |
| parent | 7d8d21ac78bfae8ad45c9c426268ef42ef5f4122 (diff) | |
| download | NetworkManager-81e5b262da643414507a76c4db185d28e81d9a32.tar.gz | |
build: avoid AC_CHECK_FILE() due to problems with cross-compilation
AC_CHECK_FILE() does not work for cross compilation. Autoconf
documentation says:
Be aware that, like most Autoconf macros, they test a feature of the
host machine, and therefore, they die when cross-compiling. [1]
Test for the existance of the file directly. Of course, when cross
compiling, it's not at all clear that the host machine will run the same
distribution. And thus detecting --enable-ifcfg-rh based on the build
machine is likely wrong. Note, that we already did
AS_IF([test -z "$hostname_persist" -a -f /etc/SuSE-release], hostname_persist=suse)
which has the same problem.
At least, build no longer fails, and the user can inspect the ./configure
summary and see which features were misdetected.
[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Files.html
Diffstat (limited to 'configure.ac')
| -rw-r--r-- | configure.ac | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index e27c90763b..a3d3963689 100644 --- a/configure.ac +++ b/configure.ac @@ -134,8 +134,8 @@ AC_ARG_ENABLE(config-plugin-ibft, AS_HELP_STRING([--enable-config-plugin-ibft], AC_ARG_ENABLE(ifcfg-rh, AS_HELP_STRING([--enable-ifcfg-rh], [enable ifcfg-rh configuration plugin (Fedora/RHEL)])) AC_ARG_ENABLE(ifupdown, AS_HELP_STRING([--enable-ifupdown], [enable ifupdown configuration plugin (Debian/Ubuntu)])) # Default alternative plugins by distribution -AS_IF([test -z "$enable_ifcfg_rh"], AC_CHECK_FILE(/etc/sysconfig/network-scripts, enable_ifcfg_rh=yes)) -AS_IF([test -z "$enable_ifupdown"], AC_CHECK_FILE(/etc/debian_version, enable_ifupdown=yes)) +AS_IF([test -z "$enable_ifcfg_rh" -a -d /etc/sysconfig/network-scripts], enable_ifcfg_rh=yes) +AS_IF([test -z "$enable_ifupdown" -a -f /etc/debian_version], enable_ifupdown=yes) # Otherwise plugins default to "no" AS_IF([test -z "$enable_ifcfg_rh"], enable_ifcfg_rh=no) AS_IF([test -z "$enable_ifupdown"], enable_ifupdown=no) @@ -921,7 +921,7 @@ if test "$config_dns_rc_manager_default" != symlink -a \ config_dns_rc_manager_default= fi # Use netconfig by default on SUSE -AS_IF([test -z "$with_netconfig"], AC_CHECK_FILE(/etc/SuSE-release, with_netconfig=yes)) +AS_IF([test -z "$with_netconfig" -a -f /etc/SuSE-release], with_netconfig=yes) # Otherwise default to "no" AS_IF([test -z "$with_resolvconf"], with_resolvconf=no) AS_IF([test -z "$with_netconfig"], with_netconfig=no) |
