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
This commit is contained in:
@@ -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(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)]))
|
AC_ARG_ENABLE(ifupdown, AS_HELP_STRING([--enable-ifupdown], [enable ifupdown configuration plugin (Debian/Ubuntu)]))
|
||||||
# Default alternative plugins by distribution
|
# 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_ifcfg_rh" -a -d /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_ifupdown" -a -f /etc/debian_version], enable_ifupdown=yes)
|
||||||
# Otherwise plugins default to "no"
|
# Otherwise plugins default to "no"
|
||||||
AS_IF([test -z "$enable_ifcfg_rh"], enable_ifcfg_rh=no)
|
AS_IF([test -z "$enable_ifcfg_rh"], enable_ifcfg_rh=no)
|
||||||
AS_IF([test -z "$enable_ifupdown"], enable_ifupdown=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=
|
config_dns_rc_manager_default=
|
||||||
fi
|
fi
|
||||||
# Use netconfig by default on SUSE
|
# 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"
|
# Otherwise default to "no"
|
||||||
AS_IF([test -z "$with_resolvconf"], with_resolvconf=no)
|
AS_IF([test -z "$with_resolvconf"], with_resolvconf=no)
|
||||||
AS_IF([test -z "$with_netconfig"], with_netconfig=no)
|
AS_IF([test -z "$with_netconfig"], with_netconfig=no)
|
||||||
|
Reference in New Issue
Block a user