summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2018-09-12 21:01:24 +0200
committerThomas Haller <thaller@redhat.com>2018-09-12 21:09:40 +0200
commit435cdc869c3ff1161c7b4824e061c0c00f0e191e (patch)
tree5381a9e5447f89658f8649f1b1dcc2923c927619
parentf879405cda926c1b258ea277a5b0da22e0a6c600 (diff)
downloadNetworkManager-bg/meson-paths.tar.gz
build/autotools: fail configure if netconfig/resolveconf tool is not foundbg/meson-paths
If the user explicitly passes --with-netconfig=$PATH or --with-resolvconf=$PATH, the path is accepted as is. We only do autodetection, if the binary was not found. In that case, if the binary cannot be found in the common paths fail compilation.
-rw-r--r--.travis.yml8
-rw-r--r--configure.ac21
2 files changed, 18 insertions, 11 deletions
diff --git a/.travis.yml b/.travis.yml
index 1bf7e8d515..de6ff770a0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -108,8 +108,8 @@ script:
-D dhcpcanon=/bin/nowhere/dhcpcanon \
-D dhcpcd=/bin/nowhere/dhcpd \
\
- -D netconfig=true \
- -D resolvconf=true \
+ -D netconfig=/bin/nowhere/netconfig \
+ -D resolvconf=/bin/nowhere/resolvconf \
\
-D ifcfg_rh=false \
-D ibft=true \
@@ -146,8 +146,8 @@ script:
--with-dhcpcd=yes \
--with-dhclient=yes \
\
- --with-netconfig=no \
- --with-resolvconf=yes \
+ --with-netconfig=/bin/nowhere/netconfig \
+ --with-resolvconf=/bin/nowhere/resolvconf \
\
--enable-ifcfg-rh=yes \
--enable-config-plugin-ibft=yes \
diff --git a/configure.ac b/configure.ac
index 527d6e8c85..f244d214e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -871,13 +871,12 @@ test -z "$config_dhcp_default" && config_dhcp_defaul
AC_DEFINE_UNQUOTED(NM_CONFIG_DEFAULT_MAIN_DHCP, "$config_dhcp_default", [Default configuration option for main.dhcp setting])
AC_SUBST(NM_CONFIG_DEFAULT_MAIN_DHCP, $config_dhcp_default)
-# resolvconf and netconfig support
AC_ARG_WITH(resolvconf, AS_HELP_STRING([--with-resolvconf=yes|no|path], [Enable resolvconf support]))
AC_ARG_WITH(netconfig, AS_HELP_STRING([--with-netconfig=yes|no], [Enable SUSE netconfig support]))
AC_ARG_WITH(config-dns-rc-manager-default, AS_HELP_STRING([--with-config-dns-rc-manager-default=symlink|file|netconfig|resolvconf], [Configure default value for main.rc-manager setting]), [config_dns_rc_manager_default=$withval])
-if test "$config_dns_rc_manager_default" != symlink -a \
+if test "$config_dns_rc_manager_default" != "" -a \
"$config_dns_rc_manager_default" != file -a \
- "$config_dns_rc_manager_default" != "" -a \
+ "$config_dns_rc_manager_default" != symlink -a \
"$config_dns_rc_manager_default" != netconfig -a \
"$config_dns_rc_manager_default" != resolvconf; then
AC_MSG_WARN([Unknown --with-config-dns-rc-manager-default=$config_dns_rc_manager_default setting.])
@@ -888,21 +887,29 @@ 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)
-# Find resolvconf and netconfig
+
if test "$with_resolvconf" = "yes"; then
- AC_PATH_PROGS(with_resolvconf, resolvconf, no, /sbin:/usr/sbin:/usr/local/sbin)
+ AC_PATH_PROGS(with_resolvconf, resolvconf, 'yes', /sbin:/usr/sbin:/usr/local/sbin)
+ if test "$with_resolvconf" = "yes"; then
+ AC_MSG_ERROR(cannot find resolvconf in path. Set the path explicitly via --with-resolvconf=PATH.)
+ fi
fi
if test "$with_resolvconf" != "no"; then
AS_IF([test -z "$config_dns_rc_manager_default"], config_dns_rc_manager_default=resolvconf)
fi
+
if test "$with_netconfig" = "yes"; then
- AC_PATH_PROGS(with_netconfig, netconfig, no, /sbin:/usr/sbin:/usr/local/sbin)
+ AC_PATH_PROGS(with_netconfig, netconfig, yes, /sbin:/usr/sbin:/usr/local/sbin)
+ if test "$with_netconfig" = "yes"; then
+ AC_MSG_ERROR(cannot find netconfig in path. Set the path explicitly via --with-netconfig=PATH.)
+ fi
fi
if test "$with_netconfig" != "no"; then
AS_IF([test -z "$config_dns_rc_manager_default"], config_dns_rc_manager_default=netconfig)
fi
+
AS_IF([test -z "$config_dns_rc_manager_default"], config_dns_rc_manager_default=symlink)
-# Define resolvconf and netconfig paths
+
if test "$with_resolvconf" != "no"; then
AC_DEFINE_UNQUOTED(RESOLVCONF_PATH, "$with_resolvconf", [Path to resolvconf])
fi