summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac43
1 files changed, 43 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6067a88fbe..e963b4f3a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,10 @@ AC_PROG_CXX
AC_PROG_LN_S
+# Prefer gcc-* variants; the ones libtool would choose don't work with LTO
+AC_CHECK_TOOLS(AR, [gcc-ar ar], false)
+AC_CHECK_TOOLS(RANLIB, [gcc-ranlib ranlib], :)
+
dnl Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])
@@ -553,6 +557,18 @@ else
fi
AM_CONDITIONAL(WITH_TEAMDCTL, test "${enable_teamdctl}" = "yes")
+PKG_CHECK_MODULES(JANSSON, jansson, [have_jansson=yes], [have_jansson=no])
+AC_ARG_ENABLE(json-validation, AS_HELP_STRING([--enable-json-validation], [Enable JSON validation in libnm]),
+ [enable_json_validation=${enableval}], [enable_json_validation=${have_jansson}])
+if (test "${enable_json_validation}" = "yes"); then
+ if test x"$have_jansson" = x"no"; then
+ AC_MSG_ERROR(Jansson is required for JSON validation)
+ fi
+ AC_DEFINE(WITH_JANSSON, 1, [Define if JANSSON is enabled])
+else
+ AC_DEFINE(WITH_JANSSON, 0, [Define if JANSSON is enabled])
+fi
+
# we usually compile with polkit support. --enable-polkit=yes|no only sets the
# default configuration for main.auth-polkit. User can always enable/disable polkit
# autorization via config. Only when specifying --enable-polkit=disabled, we do
@@ -763,6 +779,11 @@ fi
# 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 "$config_dns_rc_manager_default" != file -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.])
+ 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))
# Otherwise default to "no"
@@ -772,9 +793,16 @@ AS_IF([test -z "$with_netconfig"], with_netconfig=no)
if test "$with_resolvconf" = "yes"; then
AC_PATH_PROGS(with_resolvconf, resolvconf, no, /sbin:/usr/sbin:/usr/local/sbin)
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)
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])
@@ -782,6 +810,8 @@ fi
if test "$with_netconfig" != "no"; then
AC_DEFINE_UNQUOTED(NETCONFIG_PATH, "$with_netconfig", [Path to netconfig])
fi
+AC_DEFINE_UNQUOTED(NM_CONFIG_DEFAULT_DNS_RC_MANAGER, "$config_dns_rc_manager_default", [Default value for main.rc-manager setting (--with-config-dns-rc-manager-default)])
+AC_SUBST(NM_CONFIG_DEFAULT_DNS_RC_MANAGER, $config_dns_rc_manager_default)
# iptables path
AC_ARG_WITH(iptables, AS_HELP_STRING([--with-iptables=/path/to/iptables], [path to iptables]))
@@ -919,6 +949,16 @@ else
enable_lto='no'
fi
+AC_ARG_ENABLE(ld-gc, AS_HELP_STRING([--enable-ld-gc], [Enable garbage collection of unused symbols on linking (default: auto)]))
+if (test "${enable_ld_gc}" != "no"); then
+ NM_COMPILER_FLAG([-fdata-sections -ffunction-sections -Wl,--gc-sections], [enable_ld_gc='yes'], [
+ if (test "${enable_ld_gc}" = "yes"); then
+ AC_MSG_ERROR([Unused symbol eviction requested but not supported.])
+ else
+ enable_ld_gc='no'
+ fi
+ ])
+fi
dnl -------------------------
dnl Vala bindings
@@ -1164,6 +1204,7 @@ echo
echo "Handlers for /etc/resolv.conf:"
echo " resolvconf: ${with_resolvconf}"
echo " netconfig: ${with_netconfig}"
+echo " config-dns-rc-manager-default: ${config_dns_rc_manager_default}"
echo
echo "DHCP clients:"
@@ -1178,4 +1219,6 @@ echo " more-asserts: $more_asserts"
echo " valgrind: $with_valgrind $with_valgrind_suppressions"
echo " code coverage: $enable_code_coverage"
echo " LTO: $enable_lto"
+echo " linker garbage collection: $enable_ld_gc"
+echo " JSON validation: $enable_json_validation"
echo