device: renew dhcp leases on awake for software devices
[NetworkManager.git] / configure.ac
1 AC_PREREQ([2.63])
2
3 dnl The NM version number
4 m4_define([nm_major_version], [1])
5 m4_define([nm_minor_version], [1])
6 m4_define([nm_micro_version], [92])
7 m4_define([nm_version],
8           [nm_major_version.nm_minor_version.nm_micro_version])
9 m4_define([nm_git_sha], [m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])])
10
11 AC_INIT([NetworkManager], [nm_version],
12         [http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager],
13         [NetworkManager])
14
15 AC_CONFIG_HEADERS([config.h])
16 AC_CONFIG_MACRO_DIR([m4])
17 AC_CONFIG_AUX_DIR([build-aux])
18 AC_REQUIRE_AUX_FILE([tap-driver.sh])
19
20 AM_INIT_AUTOMAKE(1.12 tar-ustar no-dist-gzip dist-xz -Wno-portability)  dnl NB: Do not [quote] this parameter.
21 AM_MAINTAINER_MODE([enable])
22 AM_SILENT_RULES([yes])
23
24 dnl Define _SYSTEM_EXTENSIONS for various things like strcasestr()
25 AC_USE_SYSTEM_EXTENSIONS
26
27 dnl
28 dnl Require programs
29 dnl
30 AC_PROG_CC
31 AM_PROG_CC_C_O
32
33 # C++ only required if --enable-qt=yes
34 AC_PROG_CXX
35
36 AC_PROG_LN_S
37
38 dnl Initialize libtool
39 LT_PREREQ([2.2])
40 LT_INIT([disable-static])
41
42 dnl Version stuff
43 NM_MAJOR_VERSION=nm_major_version
44 NM_MINOR_VERSION=nm_minor_version
45 NM_MICRO_VERSION=nm_micro_version
46 NM_VERSION=nm_version
47 NM_GIT_SHA=nm_git_sha
48 AC_SUBST(NM_MAJOR_VERSION)
49 AC_SUBST(NM_MINOR_VERSION)
50 AC_SUBST(NM_MICRO_VERSION)
51 AC_SUBST(NM_VERSION)
52 AC_DEFINE_UNQUOTED(NM_GIT_SHA,"$NM_GIT_SHA",[git commit id of the original source code version])
53
54 dnl
55 dnl Checks for typedefs, structures, and compiler characteristics.
56 dnl
57 AC_TYPE_PID_T
58 AC_CHECK_SIZEOF(dev_t)
59
60 dnl
61 dnl translation support
62 dnl
63 IT_PROG_INTLTOOL([0.40.0])
64
65 AM_GNU_GETTEXT([external])
66 AM_GNU_GETTEXT_VERSION([0.17])
67
68 GETTEXT_PACKAGE=NetworkManager
69 AC_SUBST(GETTEXT_PACKAGE)
70 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
71
72 dnl
73 dnl Make sha1.c happy on big endian systems
74 dnl
75 AC_C_BIGENDIAN
76
77 # Add runstatedir if not specified manually in autoconf < 2.70
78 AS_IF([test -z "$runstatedir"], runstatedir="$localstatedir/run")
79 AC_SUBST(runstatedir)
80
81 # NetworkManager paths
82 AC_SUBST(nmbinary, '${sbindir}'/$PACKAGE, [NetworkManager binary executable])
83 AC_SUBST(nmconfdir, '${sysconfdir}'/$PACKAGE, [NetworkManager configuration directory])
84 AC_SUBST(nmlibdir, '${prefix}'/lib/$PACKAGE, [NetworkManager library directory])
85 AC_SUBST(nmdatadir, '${datadir}'/$PACKAGE, [NetworkManager shared data directory])
86 AC_SUBST(nmstatedir, '${localstatedir}'/lib/$PACKAGE, [NetworkManager persistent state directory])
87 AC_SUBST(nmrundir, '${runstatedir}'/$PACKAGE, [NetworkManager runtime state directory])
88
89 AC_GNU_SOURCE
90 AC_CHECK_FUNCS([__secure_getenv secure_getenv])
91
92 # Alternative configuration plugins
93 AC_ARG_ENABLE(config-plugin-ibft, AS_HELP_STRING([--enable-config-plugin-ibft], [enable ibft configuration plugin]))
94 AC_ARG_ENABLE(ifcfg-rh, AS_HELP_STRING([--enable-ifcfg-rh], [enable ifcfg-rh configuration plugin (Fedora/RHEL)]))
95 AC_ARG_ENABLE(ifcfg-suse, AS_HELP_STRING([--enable-ifcfg-suse], [enable ifcfg-suse configuration plugin (SUSE) (deprecated)]))
96 AC_ARG_ENABLE(ifupdown, AS_HELP_STRING([--enable-ifupdown], [enable ifupdown configuration plugin (Debian/Ubuntu)]))
97 AC_ARG_ENABLE(ifnet, AS_HELP_STRING([--enable-ifnet], [enable ifnet configuration plugin (Gentoo)]))
98 # Default alternative plugins by distribution
99 AS_IF([test -z "$enable_ifcfg_rh"], AC_CHECK_FILE(/etc/redhat-release, enable_ifcfg_rh=yes))
100 AS_IF([test -z "$enable_ifcfg_rh"], AC_CHECK_FILE(/etc/fedora-release, enable_ifcfg_rh=yes))
101 AS_IF([test -z "$enable_ifcfg_rh"], AC_CHECK_FILE(/etc/mandriva-release, enable_ifcfg_rh=yes))
102 AS_IF([test -z "$enable_ifcfg_suse"], AC_CHECK_FILE(/etc/SuSE-release, enable_ifcfg_suse=yes))
103 AS_IF([test -z "$enable_ifupdown"], AC_CHECK_FILE(/etc/debian_version, enable_ifupdown=yes))
104 AS_IF([test -z "$enable_ifnet"], AC_CHECK_FILE(/etc/gentoo-release, enable_ifnet=yes))
105 # Otherwise plugins default to "no"
106 AS_IF([test -z "$enable_ifcfg_rh"], enable_ifcfg_rh=no)
107 AS_IF([test -z "$enable_ifcfg_suse"], enable_ifcfg_suse=no)
108 AS_IF([test -z "$enable_ifupdown"], enable_ifupdown=no)
109 AS_IF([test -z "$enable_ifnet"], enable_ifnet=no)
110 # Enable ibft by default
111 AS_IF([test -z "$enable_config_plugin_ibft"], enable_config_plugin_ibft="yes")
112 # Create automake conditionals
113 AM_CONDITIONAL(CONFIG_PLUGIN_IBFT, test "$enable_config_plugin_ibft" = "yes")
114 AM_CONDITIONAL(CONFIG_PLUGIN_IFCFG_RH, test "$enable_ifcfg_rh" = "yes")
115 AM_CONDITIONAL(CONFIG_PLUGIN_IFUPDOWN, test "$enable_ifupdown" = "yes")
116 AM_CONDITIONAL(CONFIG_PLUGIN_IFNET, test "$enable_ifnet" = "yes")
117
118 AC_ARG_WITH(config-plugins-default, AS_HELP_STRING([--with-config-plugins-default=PLUGINS], [Default configuration option for main.plugins setting, used as fallback if the configuration option is unset]), [config_plugins_default="$withval"], [config_plugins_default=""])
119 if test -z "$config_plugins_default" -o "$config_plugins_default" = no; then
120     config_plugins_default=''
121     test "$enable_ifcfg_rh" = "yes"           && config_plugins_default="$config_plugins_default,ifcfg-rh"
122     test "$enable_ifupdown" = "yes"           && config_plugins_default="$config_plugins_default,ifupdown"
123     test "$enable_ifnet" = "yes"              && config_plugins_default="$config_plugins_default,ifnet"
124     test "$enable_config_plugin_ibft" = "yes" && config_plugins_default="$config_plugins_default,ibft"
125     config_plugins_default="${config_plugins_default#,}"
126 fi
127
128 test "$enable_ifcfg_rh" = "yes"           && distro_plugins="$distro_plugins,ifcfg-rh"
129 test "$enable_ifcfg_suse" = "yes"         && distro_plugins="$distro_plugins,ifcfg-suse"
130 test "$enable_ifupdown" = "yes"           && distro_plugins="$distro_plugins,ifupdown"
131 test "$enable_ifnet" = "yes"              && distro_plugins="$distro_plugins,ifnet"
132 distro_plugins="${distro_plugins#,}"
133
134 AC_DEFINE_UNQUOTED(CONFIG_PLUGINS_DEFAULT, "$config_plugins_default", [Default configuration option for main.plugins setting])
135 if test "${enable_config_plugin_ibft}" = yes; then
136         AC_DEFINE(WITH_SETTINGS_PLUGIN_IBFT, 1, [Whether compilation of ibft setting plugin is enabled])
137 else
138         AC_DEFINE(WITH_SETTINGS_PLUGIN_IBFT, 0, [Whether compilation of ibft setting plugin is enabled])
139 fi
140
141 if test "$enable_ifcfg_rh" = "yes"; then
142     DISTRO_NETWORK_SERVICE=network.service
143 fi
144 AC_SUBST(DISTRO_NETWORK_SERVICE)
145
146 # Code coverage
147 GNOME_CODE_COVERAGE
148
149 dnl
150 dnl Distribution version string
151 dnl
152 AC_ARG_WITH(dist-version, AS_HELP_STRING([--with-dist-version=<NM-distribution-version>], [Define the NM''s distribution version string]), ac_distver=$withval, ac_distver="")
153 if ! test x"$ac_distver" = x""; then
154   AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
155 fi
156
157 AC_ARG_ENABLE(wifi, AS_HELP_STRING([--enable-wifi], [enable Wi-Fi support]))
158 if test "${enable_wifi}" != "no"; then
159         enable_wifi='yes'
160         AC_DEFINE(WITH_WIFI, 1, [Define if you have Wi-Fi support])
161 else
162         AC_DEFINE(WITH_WIFI, 0, [Define if you have Wi-Fi support])
163 fi
164 AM_CONDITIONAL(WITH_WIFI, test "${enable_wifi}" = "yes")
165
166 dnl
167 dnl Default to using WEXT but allow it to be disabled
168 dnl
169 AC_ARG_WITH(wext, AS_HELP_STRING([--with-wext=yes], [Enable or disable Linux Wireless Extensions]), ac_with_wext=$withval, ac_with_wext="$enable_wifi")
170 if test "$ac_with_wext" != 'no'; then
171         ac_with_wext='yes'
172 fi
173 if test x"$ac_with_wext" = x"yes"; then
174         if test "$enable_wifi" != "yes"; then
175                 AC_MSG_ERROR(Enabling WEXT support and disabling Wi-Fi makes no sense)
176         fi
177         AC_MSG_CHECKING([Linux kernel WEXT headers])
178         AC_COMPILE_IFELSE(
179                 [AC_LANG_PROGRAM(
180                       [[#ifndef __user
181                         #define __user
182                         #endif
183                         #include <sys/types.h>
184                         #include <linux/types.h>
185                         #include <sys/socket.h>
186                         #include <linux/wireless.h>]],
187                       [[#ifndef IWEVGENIE
188                         #error "not found"
189                         #endif]])],
190                 [ac_have_iwevgenie=yes],
191                 [ac_have_iwevgenie=no])
192         AC_MSG_RESULT($ac_have_iwevgenie)
193         if test "$ac_have_iwevgenie" = no; then
194                AC_MSG_ERROR(Linux kernel development header linux/wireless.h not installed or not functional)
195         fi
196         AC_DEFINE(HAVE_WEXT, 1, [Define if you have Linux Wireless Extensions support])
197 else
198         AC_DEFINE(HAVE_WEXT, 0, [Define if you have Linux Wireless Extensions support])
199 fi
200 AM_CONDITIONAL(WITH_WEXT, test x"${ac_with_wext}" = x"yes")
201
202 AC_MSG_CHECKING([Linux kernel nl80211 headers])
203 AC_COMPILE_IFELSE(
204         [AC_LANG_PROGRAM(
205               [[#ifndef __user
206                 #define __user
207                 #endif
208                 #include <sys/types.h>
209                 #include <linux/types.h>
210                 #include <sys/socket.h>
211                 #include <linux/nl80211.h>]],
212               [[int a = NL80211_RATE_INFO_BITRATE; a++;]])],
213         [ac_have_nl80211=yes],
214         [ac_have_nl80211=no])
215 AC_MSG_RESULT($ac_have_nl80211)
216 if test "$ac_have_nl80211" = no; then
217         AC_MSG_ERROR(Linux kernel development header linux/nl80211.h not installed or not functional)
218 fi
219
220 if test "$with_wifi" = "yes"; then
221         AC_MSG_CHECKING([Linux kernel nl80211 Critical Protocol Start/Stop])
222         AC_COMPILE_IFELSE(
223                 [AC_LANG_PROGRAM(
224                   [[#ifndef __user
225                     #define __user
226                     #endif
227                     #include <sys/types.h>
228                     #include <linux/types.h>
229                     #include <sys/socket.h>
230                     #include <linux/nl80211.h>]],
231                   [[unsigned int a = NL80211_CMD_CRIT_PROTOCOL_START; a++;]])],
232                 [ac_have_nl80211_critproto=yes],
233                 [ac_have_nl80211_critproto=no])
234         AC_MSG_RESULT($ac_have_nl80211_critproto)
235 else
236         ac_have_nl80211_critproto='no'
237 fi
238 if test "$ac_have_nl80211_critproto" = yes; then
239         AC_DEFINE(HAVE_NL80211_CRITICAL_PROTOCOL_CMDS, 1, [Define if nl80211 has critical protocol support])
240 else
241         AC_DEFINE(HAVE_NL80211_CRITICAL_PROTOCOL_CMDS, 0, [Define if nl80211 has critical protocol support])
242 fi
243
244 dnl
245 dnl Check for newer VLAN flags
246 dnl
247 AC_MSG_CHECKING([Linux kernel VLAN_FLAG_LOOSE_BINDING enum value])
248 AC_COMPILE_IFELSE(
249         [AC_LANG_PROGRAM(
250               [[#ifndef __user
251                 #define __user
252                 #endif
253                 #include <sys/types.h>
254                 #include <linux/types.h>
255                 #include <linux/if_vlan.h>]],
256               [[unsigned int a = VLAN_FLAG_LOOSE_BINDING;]])],
257         [ac_have_vlan_flag_loose_binding=yes],
258         [ac_have_vlan_flag_loose_binding=no])
259 AC_MSG_RESULT($ac_have_vlan_flag_loose_binding)
260 if test "$ac_have_vlan_flag_loose_binding" = yes; then
261         AC_DEFINE(HAVE_VLAN_FLAG_LOOSE_BINDING, 1, [Define if you have VLAN_FLAG_LOOSE_BINDING])
262 else
263         AC_DEFINE(HAVE_VLAN_FLAG_LOOSE_BINDING, 0, [Define if you have VLAN_FLAG_LOOSE_BINDING])
264 fi
265
266 dnl
267 dnl Checks for libm - needed for pow()
268 dnl
269 LT_LIB_M
270
271 dnl
272 dnl Checks for libdl - on certain platforms its part of libc
273 dnl
274 AC_CHECK_LIB([dl], [dladdr], LIBDL="-ldl", LIBDL="")
275 AC_SUBST(LIBDL)
276
277 PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
278         [AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/tap-driver.sh')
279          AC_SUBST(AM_TESTS_FD_REDIRECT, '--tap')],
280         [PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.32 gmodule-2.0)
281          AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/test-driver')])
282
283 dnl GLIB_VERSION_MIN_REQUIRED should match the version above.
284 dnl GLIB_VERSION_MAX_ALLOWED should be set to the same version;
285 dnl nm-glib.h will cause it to be overridden for the functions
286 dnl we have compat versions of.
287 GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_32 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32"
288
289 AC_SUBST(GLIB_CFLAGS)
290 AC_SUBST(GLIB_LIBS)
291
292 AC_ARG_WITH(libnm-glib, AS_HELP_STRING([--without-libnm-glib], [don't build legacy libraries]))
293 if test "$with_libnm_glib" != "no"; then
294     PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.1 dbus-glib-1 >= 0.94, :,
295                             [AC_MSG_FAILURE([$DBUS_PKG_ERRORS
296
297 Configure with --without-libnm-glib if you do not need the legacy libraries])])
298     with_libnm_glib=yes
299 fi
300 AM_CONDITIONAL(WITH_LEGACY_LIBRARIES, test "$with_libnm_glib" != "no")
301
302 PKG_CHECK_MODULES(GUDEV, gudev-1.0 >= 165)
303
304 GOBJECT_INTROSPECTION_CHECK([0.9.6])
305
306 # Qt4
307 PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no])
308 AC_ARG_ENABLE(qt, AS_HELP_STRING([--enable-qt], [enable Qt examples]),
309                      [enable_qt=${enableval}], [enable_qt=${have_qt}])
310 if (test "${enable_qt}" = "yes"); then
311         if test x"$have_qt" = x"no"; then
312                 AC_MSG_ERROR(Qt development headers are required)
313         fi
314         # Check for moc-qt4 and if not found then moc
315         QT4_BINDIR=`$PKG_CONFIG QtCore --variable moc_location`
316         AC_CHECK_PROGS(MOC, [moc-qt4 moc],, [$QT4_BINDIR:$PATH])
317 fi
318 AM_CONDITIONAL(WITH_QT, test "${enable_qt}" = "yes")
319
320 AC_ARG_WITH(udev-dir, AS_HELP_STRING([--with-udev-dir=DIR], [Absolute path of the udev base directory. Set to 'no' not to install the udev rules]), [], [with_udev_dir="yes"])
321 if (test "$with_udev_dir" != 'no'); then
322         if (test "$with_udev_dir" != 'yes' && printf '%s' "$with_udev_dir" | grep -v -q '^/'); then
323                 AC_MSG_ERROR([--with-udev-dir must be an absolute path or 'yes' or 'no'. Instead it is '$with_udev_dir'])
324         fi
325         if (test "$with_udev_dir" = 'yes'); then
326                 with_udev_dir="\$(prefix)/lib/udev"
327         fi
328         UDEV_DIR="$with_udev_dir"
329         AC_SUBST(UDEV_DIR)
330 fi
331 AM_CONDITIONAL(WITH_UDEV_DIR, test "$with_udev_dir" != 'no')
332
333 # systemd unit support
334 AC_ARG_WITH([systemdsystemunitdir], AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
335         [Directory for systemd service files]))
336 # default location
337 AS_IF([test -z "$with_systemdsystemunitdir" && $PKG_CONFIG systemd],
338         with_systemdsystemunitdir="\$(prefix)/lib/systemd/system")
339 AS_IF([test -z "$with_systemdsystemunitdir"], with_systemdsystemunitdir=no)
340 # add conditional and subst
341 AM_CONDITIONAL(HAVE_SYSTEMD, [test "$with_systemdsystemunitdir" != no])
342 if test "$with_systemdsystemunitdir" != no; then
343         AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
344         AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd support is available])
345 else
346         AC_DEFINE(HAVE_SYSTEMD, 0, [Define if systemd support is available])
347 fi
348
349 PKG_CHECK_MODULES(SYSTEMD_200, [systemd >= 200], [have_systemd_200=yes],[have_systemd_200=no])
350 AM_CONDITIONAL(HAVE_SYSTEMD_200, test "${have_systemd_200}" = "yes")
351
352 # Hostname persist mode
353 AC_ARG_WITH(hostname-persist, AS_HELP_STRING([--with-hostname-persist=default|suse|gentoo|slackware],
354         [Hostname persist method]))
355
356 AS_IF([test "$with_hostname_persist" = "suse"], hostname_persist=suse)
357 AS_IF([test "$with_hostname_persist" = "gentoo"], hostname_persist=gentoo)
358 AS_IF([test "$with_hostname_persist" = "slackware"], hostname_persist=slackware)
359 AS_IF([test "$with_hostname_persist" = "default"], hostname_persist=default)
360 # if the method was not explicitly set, try to guess it from the enabled plugins
361 AS_IF([test -z "$hostname_persist" -a "$distro_plugins" = "ifcfg-suse"], hostname_persist=suse)
362 AS_IF([test -z "$hostname_persist" -a "$distro_plugins" = "ifnet"], hostname_persist=gentoo)
363 AS_IF([test -z "$hostname_persist" -a -f /etc/slackware-version], hostname_persist=slackware)
364 AS_IF([test -z "$hostname_persist"], hostname_persist=default)
365
366 if test "$hostname_persist" = suse; then
367         AC_DEFINE(HOSTNAME_PERSIST_SUSE, 1, [Enable SuSE hostname persist method])
368 elif test "$hostname_persist" = gentoo; then
369         AC_DEFINE(HOSTNAME_PERSIST_GENTOO, 1, [Enable Gentoo hostname persist method])
370 elif test "$hostname_persist" = slackware; then
371         AC_DEFINE(HOSTNAME_PERSIST_SLACKWARE, 1, [Enable Slackware hostname persist method])
372 fi
373
374 AC_ARG_WITH(systemd-journal, AS_HELP_STRING([--with-systemd-journal=yes|no], [Use systemd journal for logging]))
375 have_systemd_journal=no
376 if test "$with_systemd_journal" != "no"; then
377         PKG_CHECK_MODULES(SYSTEMD_JOURNAL,
378                           [libsystemd >= 209],
379                           [have_systemd_journal=yes],
380                           [PKG_CHECK_MODULES(SYSTEMD_JOURNAL,
381                                              [libsystemd-journal],
382                                              [have_systemd_journal=yes],
383                                              [have_systemd_journal=no])])
384         if test "$have_systemd_journal" != "yes"; then
385                 if test "$with_systemd_journal" = "yes"; then
386                         AC_MSG_ERROR([Missing systemd-journald support])
387                 fi
388         fi
389 fi
390 if test "$have_systemd_journal" = "yes"; then
391         AC_DEFINE([SYSTEMD_JOURNAL], 1, [Define to 1 if libsystemd-journald is available])
392 else
393         AC_DEFINE([SYSTEMD_JOURNAL], 0, [Define to 1 if libsystemd-journald is available])
394 fi
395
396 AC_ARG_WITH(config-logging-backend-default, AS_HELP_STRING([--with-logging-backend-default=backend], [Default value for logging.backend]), nm_config_logging_backend_default="$withval", nm_config_logging_backend_default="")
397 if test "$nm_config_logging_backend_default" != 'debug' \
398      -a "$nm_config_logging_backend_default" != 'syslog' \
399      -a "$nm_config_logging_backend_default" != 'journal' \
400      -a "$nm_config_logging_backend_default" != 'journal-syslog-style'; then
401         # unknown backend. Reset to default. Silently accept the invalid value to
402         # be future proof.
403         nm_config_logging_backend_default=''
404 fi
405 if test "$nm_config_logging_backend_default" = ""; then
406         if test "$have_systemd_journal" = "yes"; then
407                 nm_config_logging_backend_default='journal'
408         else
409                 nm_config_logging_backend_default='syslog'
410         fi
411 fi
412 AC_DEFINE_UNQUOTED(NM_CONFIG_LOGGING_BACKEND_DEFAULT, "$nm_config_logging_backend_default", [Default configuration option for logging.backend])
413 NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT="$nm_config_logging_backend_default"
414 AC_SUBST(NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT)
415
416 # Session tracking support
417 AC_ARG_WITH(systemd-logind, AS_HELP_STRING([--with-systemd-logind=yes|no],
418         [Support systemd session tracking]))
419 AC_ARG_WITH(consolekit, AS_HELP_STRING([--with-consolekit=yes|no],
420         [Support consolekit session tracking]))
421 AC_ARG_WITH(session-tracking, AS_HELP_STRING([--with-session-tracking=systemd|consolekit|no],
422         [Compatibility option to choose one session tracking module]))
423 # backwards compatibility
424 AS_IF([test "$with_session_tracking" = "ck"], [use_consolekit="yes" use_systemd_logind="no"])
425 AS_IF([test "$with_session_tracking" = "consolekit"], [use_consolekit="yes" use_systemd_logind="no"])
426 AS_IF([test "$with_session_tracking" = "systemd"], [use_consolekit="no" use_systemd_logind="yes"])
427 AS_IF([test "$with_session_tracking" = "no"], [use_consolekit="no" use_systemd_logind="no"])
428 AS_IF([test "$with_session_tracking" = "none"], [use_consolekit="no" use_systemd_logind="no"])
429 # current options
430 AS_IF([test -n "$with_systemd_logind" ], [use_systemd_logind="$with_systemd_logind"])
431 AS_IF([test -n "$with_consolekit" ], [use_consolekit="$with_consolekit"])
432 # defaults
433 AS_IF([test -z "$use_systemd_logind"], [use_systemd_logind="auto"])
434 AS_IF([test -z "$use_consolekit"], [use_consolekit="yes"])
435 # output
436 session_tracking=
437 if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then
438     PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd], [have_systemd_logind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login], [have_systemd_logind=yes], [have_systemd_logind=no])])
439 else
440     have_systemd_logind=no
441 fi
442 if test "$use_systemd_logind" = "yes" -a "$have_systemd_logind" = "no"; then
443     AC_MSG_ERROR([You must have libsystemd installed to build with systemd-logind support.])
444 fi
445 if test "$have_systemd_logind" = "yes"; then
446         AC_DEFINE([SESSION_TRACKING_SYSTEMD], 1, [Define to 1 if libsystemd-login is available])
447         session_tracking="$session_tracking, systemd-logind"
448 fi
449 if test "$use_consolekit" = "yes"; then
450         AC_DEFINE([SESSION_TRACKING_CONSOLEKIT], 1, [Define to 1 if ConsoleKit is available])
451         AC_DEFINE([CKDB_PATH], "/var/run/ConsoleKit/database", [Path to ConsoleKit database])
452         session_tracking="$session_tracking, consolekit"
453 fi
454 session_tracking="$(printf '%s' "${session_tracking}" | sed 's/^, //')"
455
456 AC_ARG_WITH(suspend-resume, AS_HELP_STRING([--with-suspend-resume=upower|systemd|consolekit], [Build NetworkManager with specific suspend/resume support]))
457 if test "z$with_suspend_resume" = "z"; then
458     PKG_CHECK_EXISTS([libsystemd >= 209], [have_systemd_inhibit=yes],
459                      [PKG_CHECK_EXISTS([libsystemd-login >= 183], [have_systemd_inhibit=yes], [have_systemd_inhibit=no])])
460     if test "z${have_systemd_inhibit}" = "zyes"; then
461         # Use systemd if it's new enough
462         with_suspend_resume="systemd"
463     else
464         if test "$use_consolekit" = "yes"; then
465                 # Use consolekit suspend if session tracking is consolekit
466                 with_suspend_resume="consolekit"
467         else
468                 # Fall back to upower
469                 with_suspend_resume="upower"
470         fi
471     fi
472 fi
473
474 case $with_suspend_resume in
475     upower) ;;
476     systemd)
477         PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd >= 209],,
478                           [PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183])])
479         AC_DEFINE([SUSPEND_RESUME_SYSTEMD], 1, [Define to 1 to use systemd suspend api])
480         ;;
481     consolekit)
482         AC_DEFINE([SUSPEND_RESUME_CONSOLEKIT], 1, [Define to 1 to use ConsoleKit2 suspend api])
483         ;;
484     *)
485         AC_MSG_ERROR(--with-suspend-resume must be one of [upower, systemd, consolekit])
486         ;;
487 esac
488 AM_CONDITIONAL(SUSPEND_RESUME_UPOWER, test "x$with_suspend_resume" = "xupower")
489 AM_CONDITIONAL(SUSPEND_RESUME_SYSTEMD, test "x$with_suspend_resume" = "xsystemd")
490 AM_CONDITIONAL(SUSPEND_RESUME_CONSOLEKIT, test "x$with_suspend_resume" = "xconsolekit")
491
492 # SELinux support
493 AC_ARG_WITH(selinux, AS_HELP_STRING([--with-selinux=yes|no|auto], [Build with SELinux (default: auto)]),,[with_selinux=auto])
494 if test "$with_selinux" = "yes" -o "$with_selinux" = "auto"; then
495     PKG_CHECK_MODULES(SELINUX, libselinux, [have_selinux=yes], [have_selinux=no])
496 else
497     have_selinux=no
498 fi
499 if test "$with_selinux" = "yes" -a "$have_selinux" = "no"; then
500     AC_MSG_ERROR([You must have libselinux installed to build --with-selinux=yes.])
501 fi
502 if test "$have_selinux" = "yes"; then
503     AC_DEFINE(HAVE_SELINUX, 1, [Define if you have SELinux support])
504 else
505     AC_DEFINE(HAVE_SELINUX, 0, [Define if you have SELinux support])
506 fi
507
508 # libaudit support
509 AC_ARG_WITH(libaudit, AS_HELP_STRING([--with-libaudit=yes|yes-disabled-by-default|no|auto], [Build with audit daemon support (default: auto). yes-disabled-by-default enables support, but disables it unless explicitly configured via NetworkManager.conf]),,[with_libaudit=auto])
510 if test "$with_libaudit" = "yes" -o "$with_libaudit" = "yes-disabled-by-default" -o "$with_libaudit" = "auto"; then
511     PKG_CHECK_MODULES(LIBAUDIT, audit, [have_libaudit=yes], [have_libaudit=no])
512     if test "$with_libaudit" != "auto" -a "$have_libaudit" = "no"; then
513         AC_MSG_ERROR([You must have libaudit installed to build --with-libaudit=$with_libaudit.])
514     fi
515 else
516     have_libaudit=no
517 fi
518 if test "$have_libaudit" = "yes"; then
519     AC_DEFINE(HAVE_LIBAUDIT, 1, [Define if you have libaudit support])
520         if test "$with_libaudit" = "yes-disabled-by-default"; then
521                 AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, FALSE, [The default value of the logging.audit configuration option])
522                 NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false'
523         else
524                 AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, TRUE,  [The default value of the logging.audit configuration option])
525                 NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='true'
526         fi
527 else
528     AC_DEFINE(HAVE_LIBAUDIT, 0, [Define if you have libaudit support])
529         AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, FALSE, [The default value of the logging.audit configuration option])
530     NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false'
531 fi
532 AC_SUBST(NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT)
533
534 # libnl support for the linux platform
535 PKG_CHECK_MODULES(LIBNL, libnl-3.0 >= 3.2.8)
536
537 # uuid library
538 PKG_CHECK_MODULES(UUID, uuid)
539
540 # Teamd control checks
541 PKG_CHECK_MODULES(LIBTEAMDCTL, [libteamdctl >= 1.9], [have_teamdctl=yes],[have_teamdctl=no])
542 AC_ARG_ENABLE(teamdctl, AS_HELP_STRING([--enable-teamdctl], [enable Teamd control support]),
543                      [enable_teamdctl=${enableval}], [enable_teamdctl=${have_teamdctl}])
544 if (test "${enable_teamdctl}" = "yes"); then
545         if test x"$have_teamdctl" = x"no"; then
546                 AC_MSG_ERROR(Teamd control is required)
547         fi
548         # temporary bug workaround
549         LIBTEAMDCTL_CFLAGS=`echo $LIBTEAMDCTL_CFLAGS | sed -e 's:/teamdctl.h::'`
550         AC_DEFINE(WITH_TEAMDCTL, 1, [Define if you have Teamd control support])
551 else
552         AC_DEFINE(WITH_TEAMDCTL, 0, [Define if you have Teamd control support])
553 fi
554 AM_CONDITIONAL(WITH_TEAMDCTL, test "${enable_teamdctl}" = "yes")
555
556 # we usually compile with polkit support. --enable-polkit=yes|no only sets the
557 # default configuration for main.auth-polkit. User can always enable/disable polkit
558 # autorization via config. Only when specifying --enable-polkit=disabled, we do
559 # not compile support. In this case, the user cannot enable polkit authorization via
560 # configuration.
561 AC_ARG_ENABLE(polkit, AS_HELP_STRING([--enable-polkit=yes|no|disabled], [set default value for auth-polkit configuration option. This value can be overwritten by NM configuration. 'disabled' compiles NM without any support]),
562                      [enable_polkit=${enableval}], [enable_polkit=yes])
563 if (test "${enable_polkit}" != "no" -a "${enable_polkit}" != "disabled"); then
564         enable_polkit=yes
565         AC_DEFINE(NM_CONFIG_DEFAULT_AUTH_POLKIT, TRUE, [The default value of the auth-polkit configuration option])
566         NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT='true'
567 else
568         AC_DEFINE(NM_CONFIG_DEFAULT_AUTH_POLKIT, FALSE, [The default value of the auth-polkit configuration option])
569         NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT='false'
570 fi
571 if (test "${enable_polkit}" != "disabled"); then
572         AC_DEFINE(WITH_POLKIT, 1, [whether to compile polkit support])
573 else
574         AC_DEFINE(WITH_POLKIT, 0, [whether to compile polkit support])
575 fi
576 AC_SUBST(NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT)
577
578 PKG_CHECK_MODULES(POLKIT, [polkit-agent-1 >= 0.97], [have_pk_agent=yes],[have_pk_agent=no])
579 AC_ARG_ENABLE(polkit-agent, AS_HELP_STRING([--enable-polkit-agent], [enable polkit agent for clients]),
580                      [enable_polkit_agent=${enableval}], [enable_polkit_agent=${have_pk_agent}])
581 if (test "${enable_polkit_agent}" = "yes"); then
582         if test x"$have_pk_agent" = x"no"; then
583                 AC_MSG_ERROR(Polkit agent is required)
584         fi
585         AC_DEFINE(WITH_POLKIT_AGENT, 1, [Define if you have polkit agent])
586 else
587         AC_DEFINE(WITH_POLKIT_AGENT, 0, [Define if you have polkit agent])
588 fi
589 AM_CONDITIONAL(WITH_POLKIT_AGENT, test "${enable_polkit_agent}" = "yes")
590
591 AC_ARG_ENABLE(modify-system,
592               AS_HELP_STRING([--enable-modify-system], [Allow users to modify system connections]))
593 if test "${enable_modify_system}" = "yes"; then
594         NM_MODIFY_SYSTEM_POLICY="yes"
595 else
596         NM_MODIFY_SYSTEM_POLICY="auth_admin_keep"
597 fi
598 AC_SUBST(NM_MODIFY_SYSTEM_POLICY)
599
600 AC_ARG_WITH(crypto, AS_HELP_STRING([--with-crypto=nss|gnutls], [Cryptography library to use for certificate and key operations]),ac_crypto=$withval, ac_crypto=nss)
601
602 with_nss=no
603 with_gnutls=no
604 if test x"$ac_crypto" = xnss; then
605   PKG_CHECK_MODULES(NSS, [nss])
606
607   # Work around a pkg-config bug (fdo #29801) where exists != usable
608   FOO=`$PKG_CONFIG --cflags --libs nss`
609   if test x"$?" != "x0"; then
610     AC_MSG_ERROR([No usable NSS found])
611   fi
612
613   AC_DEFINE(HAVE_NSS, 1, [Define if you have NSS])
614   with_nss=yes
615 elif test x"$ac_crypto" = xgnutls; then
616   PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.12])
617   AC_DEFINE(HAVE_GNUTLS, 1, [Define if you have libgnutls])
618   with_gnutls=yes
619 else
620   AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and crypto operations])
621 fi
622 AM_CONDITIONAL(WITH_NSS, test x"$with_nss" != xno)
623 AM_CONDITIONAL(WITH_GNUTLS, test x"$with_gnutls" != xno)
624
625 # Shouldn't ever trigger this, but just in case...
626 if test x"$ac_nss" = xno -a x"$ac_gnutls" = xno; then
627   AC_MSG_ERROR([Could not find required development headers and libraries for '$ac_crypto'])
628 fi
629
630 GLIB_MAKEFILE='$(top_srcdir)/Makefile.glib'
631 AC_SUBST(GLIB_MAKEFILE)
632 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
633 AC_SUBST(GLIB_GENMARSHAL)
634 GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
635 AC_SUBST(GLIB_MKENUMS)
636
637 AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
638
639 if test -n "$with_dbus_sys_dir" ; then
640     DBUS_SYS_DIR="$with_dbus_sys_dir"
641 else
642     DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
643 fi
644 AC_SUBST(DBUS_SYS_DIR)
645
646 # pppd
647 AC_ARG_ENABLE(ppp, AS_HELP_STRING([--enable-ppp], [enable PPP/PPPoE support]),
648                      [enable_ppp=${enableval}], [enable_ppp=yes])
649 if (test "${enable_ppp}" = "yes"); then
650         AC_CHECK_HEADERS(pppd/pppd.h,,
651                 AC_MSG_ERROR("couldn't find pppd.h. pppd development headers are required."))
652
653         AC_DEFINE(WITH_PPP, 1, [Define if you have PPP support])
654 else
655         AC_DEFINE(WITH_PPP, 0, [Define if you have PPP support])
656 fi
657 AM_CONDITIONAL(WITH_PPP, test "${enable_ppp}" = "yes")
658
659 AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory]))
660
661 if test -n "$with_pppd_plugin_dir" ; then
662         PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
663 else
664         PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.5"
665 fi
666 AC_SUBST(PPPD_PLUGIN_DIR)
667
668 AC_ARG_WITH(pppd, AS_HELP_STRING([--with-pppd=/path/to/pppd], [path to pppd binary]))
669 if test "x${with_pppd}" = x; then
670   AC_PATH_PROG(PPPD_PATH, pppd, [], $PATH:/sbin:/usr/sbin)
671 else
672   PPPD_PATH="$with_pppd"
673 fi
674 AC_DEFINE_UNQUOTED(PPPD_PATH, "$PPPD_PATH", [Define to path of pppd binary])
675 AC_SUBST(PPPD_PATH)
676
677 # ModemManager1 with libmm-glib
678 AC_ARG_WITH(modem-manager-1, AS_HELP_STRING([--with-modem-manager-1], [Enable new ModemManager1 interface support]),,[with_modem_manager_1=auto])
679 if (test "${with_modem_manager_1}" != "no"); then
680     PKG_CHECK_MODULES(MM_GLIB,
681                       [mm-glib >= 0.7.991],
682                       [have_libmm_glib=yes],
683                       [have_libmm_glib=no])
684
685     if (test "${have_libmm_glib}" = "no"); then
686         if (test "${with_modem_manager_1}" = "yes"); then
687             AC_MSG_ERROR([Couldn't find libmm-glib])
688         else
689             with_modem_manager_1="no"
690         fi
691     else
692         with_modem_manager_1="yes"
693     fi
694 fi
695
696 if (test "${with_modem_manager_1}" = "yes"); then
697     AC_DEFINE(WITH_MODEM_MANAGER_1, 1, [Define if you have ModemManager1 support])
698 else
699         AC_DEFINE(WITH_MODEM_MANAGER_1, 0, [Define if you have ModemManager1 support])
700 fi
701 AM_CONDITIONAL(WITH_MODEM_MANAGER_1, test "${with_modem_manager_1}" = "yes")
702
703 # Bluez5 DUN support
704 PKG_CHECK_MODULES(BLUEZ5, [bluez >= 5], [have_bluez5=yes],[have_bluez5=no])
705 AC_ARG_ENABLE(bluez5-dun, AS_HELP_STRING([--enable-bluez5-dun], [enable Bluez5 DUN support]),
706                 [enable_bluez5_dun=${enableval}], [enable_bluez5_dun=${have_bluez5}])
707 if (test "${enable_bluez5_dun}" = "yes"); then
708         if test x"$have_bluez5" = x"no"; then
709                 AC_MSG_ERROR(Bluez 5.x development headers are required)
710         fi
711         AC_DEFINE(WITH_BLUEZ5_DUN, 1, [Define if you have Bluez 5 libraries])
712 else
713         AC_DEFINE(WITH_BLUEZ5_DUN, 0, [Define if you have Bluez 5 libraries])
714 fi
715 AM_CONDITIONAL(WITH_BLUEZ5_DUN, test "${enable_bluez5_dun}" = "yes")
716
717 # DHCP client support
718 AC_ARG_WITH([dhclient], AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient 4.x support]))
719 AC_ARG_WITH([dhcpcd], AS_HELP_STRING([--with-dhcpcd=yes|no|path], [Enable dhcpcd 4.x support]))
720 # Default to "yes"
721 AS_IF([test -z "$with_dhclient"], with_dhclient=yes)
722 AS_IF([test -z "$with_dhcpcd"], with_dhcpcd=yes)
723 # Search and check the executables
724 if test "$with_dhclient" = "yes"; then
725         AC_PATH_PROGS(with_dhclient, dhclient, no, /sbin:/usr/sbin:/usr/local/sbin)
726         if test "$with_dhclient" != "no"; then
727                 if ! $with_dhclient --version 2>&1 | grep -q "^isc-dhclient-4\."; then
728                         AC_MSG_WARN([Cannot use dhclient, version 4.x is required])
729                         with_dhclient=no
730                 fi
731         fi
732 fi
733 if test "$with_dhcpcd" = "yes"; then
734         AC_PATH_PROGS(with_dhcpcd, dhcpcd, no, /sbin:/usr/sbin:/usr/local/sbin)
735         if test "$with_dhcpcd" != "no"; then
736                 if ! $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [[456789]]\."; then
737                         AC_MSG_WARN([Cannot use dhcpcd, version 4.x or higher is required])
738                         with_dhcpcd=no
739                 elif $with_dhcpcd --version 2>&1 | grep -q "^dhcpcd [[6789]]\."; then
740                         AC_DEFINE(DHCPCD_SUPPORTS_IPV6, 1, [Define if dhcpcd supports IPv6 (6.x+)])
741                 fi
742         fi
743 fi
744 # Fallback
745 if test "$with_dhclient" = "no" -a "$with_dhcpcd" = "no"; then
746         AC_MSG_WARN([Could not find a suitable DHCP client, falling back to dhclient])
747         with_dhclient=/sbin/dhclient
748 fi
749 # Add substitutions
750 if test "$with_dhclient" != "no"; then
751         AC_DEFINE(WITH_DHCLIENT, TRUE, [Define if you have dhclient])
752         AC_SUBST(DHCLIENT_PATH, $with_dhclient)
753 else
754         AC_DEFINE(WITH_DHCLIENT, FALSE, [Define if you have dhclient])
755 fi
756 if test "$with_dhcpcd" != "no"; then
757         AC_DEFINE(WITH_DHCPCD, TRUE, [Define if you have dhcpcd])
758         AC_SUBST(DHCPCD_PATH, $with_dhcpcd)
759 else
760         AC_DEFINE(WITH_DHCPCD, FALSE, [Define if you have dhcpcd])
761 fi
762
763 # resolvconf and netconfig support
764 AC_ARG_WITH(resolvconf, AS_HELP_STRING([--with-resolvconf=yes|no|path], [Enable resolvconf support]))
765 AC_ARG_WITH(netconfig, AS_HELP_STRING([--with-netconfig=yes|no], [Enable SUSE netconfig support]))
766 # Use netconfig by default on SUSE
767 AS_IF([test -z "$with_netconfig"], AC_CHECK_FILE(/etc/SuSE-release, with_netconfig=yes))
768 # Otherwise default to "no"
769 AS_IF([test -z "$with_resolvconf"], with_resolvconf=no)
770 AS_IF([test -z "$with_netconfig"], with_netconfig=no)
771 # Find resolvconf and netconfig
772 if test "$with_resolvconf" = "yes"; then
773         AC_PATH_PROGS(with_resolvconf, resolvconf, no, /sbin:/usr/sbin:/usr/local/sbin)
774 fi
775 if test "$with_netconfig" = "yes"; then
776         AC_PATH_PROGS(with_netconfig, netconfig, no, /sbin:/usr/sbin:/usr/local/sbin)
777 fi
778 # Define resolvconf and netconfig paths
779 if test "$with_resolvconf" != "no"; then
780         AC_DEFINE_UNQUOTED(RESOLVCONF_PATH, "$with_resolvconf", [Path to resolvconf])
781 fi
782 if test "$with_netconfig" != "no"; then
783         AC_DEFINE_UNQUOTED(NETCONFIG_PATH, "$with_netconfig", [Path to netconfig])
784 fi
785
786 # iptables path
787 AC_ARG_WITH(iptables, AS_HELP_STRING([--with-iptables=/path/to/iptables], [path to iptables]))
788 if test "x${with_iptables}" = x; then
789   AC_PATH_PROG(IPTABLES_PATH, iptables, [], $PATH:/sbin:/usr/sbin)
790   if ! test -x "$IPTABLES_PATH"; then
791         AC_MSG_ERROR(iptables was not installed.)
792   fi
793 else
794   IPTABLES_PATH="$with_iptables"
795 fi
796 AC_DEFINE_UNQUOTED(IPTABLES_PATH, "$IPTABLES_PATH", [Define to path of iptables binary])
797 AC_SUBST(IPTABLES_PATH)
798
799 # dnsmasq path
800 AC_ARG_WITH(dnsmasq, AS_HELP_STRING([--with-dnsmasq=/path/to/dnsmasq], [path to dnsmasq]))
801 if test "x${with_dnsmasq}" = x; then
802   AC_PATH_PROG(DNSMASQ_PATH, dnsmasq, [], $PATH:/sbin:/usr/sbin)
803 else
804   DNSMASQ_PATH="$with_dnsmasq"
805 fi
806 AC_DEFINE_UNQUOTED(DNSMASQ_PATH, "$DNSMASQ_PATH", [Define to path of dnsmasq binary])
807 AC_SUBST(DNSMASQ_PATH)
808
809 # dnssec-trigger-script path
810 AC_ARG_WITH(dnssec_trigger, AS_HELP_STRING([--with-dnssec-trigger=/path/to/dnssec-trigger-script], [path to unbound dnssec-trigger-script]))
811 if test "x${with_dnssec_trigger}" = x; then
812   AC_PATH_PROG(DNSSEC_TRIGGER_SCRIPT, dnssec-trigger-script, /usr/libexec/dnssec-trigger-script, /usr/local/libexec:/usr/local/lib:/usr/local/lib/dnssec-trigger:/usr/libexec:/usr/lib:/usr/lib/dnssec-trigger)
813 else
814   DNSSEC_TRIGGER_SCRIPT="$with_dnssec_trigger"
815 fi
816 AC_DEFINE_UNQUOTED(DNSSEC_TRIGGER_SCRIPT, "$DNSSEC_TRIGGER_SCRIPT", [Define to path of unbound dnssec-trigger-script])
817 AC_SUBST(DNSSEC_TRIGGER_SCRIPT)
818
819 # system CA certificates path
820 AC_ARG_WITH(system-ca-path, AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates])) 
821 if test "x${with_system_ca_path}" = x; then
822   SYSTEM_CA_PATH=/etc/ssl/certs
823 else
824   SYSTEM_CA_PATH="$with_system_ca_path"
825 fi
826 AC_DEFINE_UNQUOTED(SYSTEM_CA_PATH, "$SYSTEM_CA_PATH", [Define to path to system CA certificates])
827 AC_SUBST(SYSTEM_CA_PATH)
828
829 AC_ARG_WITH(kernel-firmware-dir, AS_HELP_STRING([--with-kernel-firmware-dir=DIR], [where kernel firmware directory is (default is /lib/firmware)]))
830
831 if test -n "$with_kernel_firmware_dir" ; then
832     KERNEL_FIRMWARE_DIR="$with_kernel_firmware_dir"
833 else
834     KERNEL_FIRMWARE_DIR="/lib/firmware"
835 fi
836 AC_DEFINE_UNQUOTED(KERNEL_FIRMWARE_DIR, "$KERNEL_FIRMWARE_DIR", [Define to path of the kernel firmware directory])
837 AC_SUBST(KERNEL_FIRMWARE_DIR)
838
839 PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= 2.40], [have_libsoup=yes],[have_libsoup=no])
840 AC_ARG_WITH(libsoup, AS_HELP_STRING([--with-libsoup=yes|no], [Link against libsoup]), [], [with_libsoup=${have_libsoup}])
841 if test "$with_libsoup" != "no"; then
842         if test "$have_libsoup" != "yes"; then
843                 AC_MSG_ERROR(libsoup library not found)
844         fi
845         with_libsoup='yes'
846         AC_DEFINE(WITH_LIBSOUP, 1, [Define if you have libsoup])
847 else
848         AC_DEFINE(WITH_LIBSOUP, 0, [Define if you have libsoup])
849 fi
850 AM_CONDITIONAL(WITH_LIBSOUP, test "$with_libsoup" != "no")
851 LIBSOUP_CFLAGS="$LIBSOUP_CFLAGS -DSOUP_VERSION_MIN_REQUIRED=SOUP_VERSION_2_40 -DSOUP_VERSION_MAX_ALLOWED=SOUP_VERSION_2_40"
852
853 AC_ARG_ENABLE(concheck, AS_HELP_STRING([--enable-concheck], [enable connectivity checking support]),
854                      [enable_concheck=${enableval}], [enable_concheck=${with_libsoup}])
855 if (test "${enable_concheck}" = "yes"); then
856         if test x"$with_libsoup" = x"no"; then
857                 AC_MSG_ERROR(Connectivity checking requires libsoup)
858         fi
859         AC_DEFINE(WITH_CONCHECK, 1, [Define if you want connectivity checking support])
860 else
861         AC_DEFINE(WITH_CONCHECK, 0, [Define if you want connectivity checking support])
862 fi
863 AM_CONDITIONAL(WITH_CONCHECK, test "${enable_concheck}" = "yes")
864
865 PKG_CHECK_MODULES(LIBNDP, [libndp])
866
867 AC_ARG_WITH(nmcli, AS_HELP_STRING([--with-nmcli=yes|no], [Build nmcli]))
868 if test "$with_nmcli" != no; then
869     AX_LIB_READLINE
870     build_nmcli=yes
871 else
872     build_nmcli=no
873 fi
874 AM_CONDITIONAL(BUILD_NMCLI, test "$build_nmcli" = yes)
875
876 AC_ARG_WITH(nmtui, AS_HELP_STRING([--with-nmtui=yes|no], [Build nmtui]))
877 if test "$with_nmtui" != no; then
878     PKG_CHECK_MODULES(NEWT, [libnewt >= 0.52.15], [build_nmtui=yes], [build_nmtui=no])
879 else
880     build_nmtui=no
881 fi
882 if test "$with_nmtui" = yes -a "$build_nmtui" = no; then
883     AC_MSG_ERROR([You must have libnewt installed to build nmtui.])
884 fi
885 AM_CONDITIONAL(BUILD_NMTUI, test "$build_nmtui" = yes)
886
887
888 NM_COMPILER_WARNINGS
889
890 AC_ARG_ENABLE(more-asserts,
891               AS_HELP_STRING([--enable-more-asserts], [Enable more assertions for debugging (default: no). Deprecated option. Use --with-more-asserts=level]))
892 more_asserts=0
893 if test "${enable_more_asserts}" = "yes"; then
894     more_asserts=100
895 fi
896 AC_ARG_WITH(more-asserts,
897             AS_HELP_STRING([--with-more-asserts=level], [Enable more assertions for debugging (default: 0)]),
898             [more_asserts=${with_more_asserts}],
899             [])
900 if test "${more_asserts}" = "no"; then
901     more_asserts=0
902 else
903     if test "${more_asserts}" = "yes"; then
904         more_asserts=100
905     fi
906 fi
907 AC_DEFINE_UNQUOTED(NM_MORE_ASSERTS, $more_asserts, [Define if more asserts are enabled])
908
909 AC_ARG_ENABLE(more-logging,
910               AS_HELP_STRING([--enable-more-logging], [Enable more debug logging (default: no)]))
911 if test "${enable_more_logging}" = "yes"; then
912     AC_DEFINE(NM_MORE_LOGGING, [1], [Define if more debug logging is enabled])
913 fi
914
915 AC_ARG_ENABLE(lto, AS_HELP_STRING([--enable-lto], [Enable Link Time Optimization for smaller size (default: no)]))
916 if (test "${enable_lto}" = "yes"); then
917     CFLAGS="-flto $CFLAGS"
918 else
919     enable_lto='no'
920 fi
921
922
923 dnl -------------------------
924 dnl Vala bindings
925 dnl -------------------------
926
927 VAPIGEN_CHECK(0.17.1.24)
928
929 # Tests, utilities and documentation
930 AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests=root|yes|no], [Build NetworkManager tests (default: yes)]))
931 AC_ARG_WITH(valgrind, AS_HELP_STRING([--with-valgrind=yes|no|path], [Use valgrind to memory-check the tests (default: no)]))
932 # Fallback to --with-tests
933 AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build NetworkManager tests (deprecated)]))
934 AS_IF([test -n "$with_tests"], enable_tests="$with_tests")
935 # Default to --enable-tests --with-valgrind=no
936 AS_IF([test -z "$enable_tests"], enable_tests="yes")
937 AS_IF([test -z "$with_valgrind"], with_valgrind="no")
938 # Normalize values
939 AS_IF([test "$enable_tests" != "yes" -a "$enable_tests" != "root"], enable_tests="no")
940 # Search for tools
941 AS_IF([test "$with_valgrind" == "yes"],
942         [AC_PATH_PROGS(with_valgrind, valgrind, no)])
943 # Add conditionals and substitutions
944 AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" != "no")
945 AM_CONDITIONAL(REQUIRE_ROOT_TESTS, test "$enable_tests" == "root")
946 AC_ARG_WITH(valgrind-suppressions, AS_HELP_STRING([--with-valgrind-suppressions=path], [Use specific valgrind suppression file]))
947 if test "$with_valgrind" == no; then
948         with_valgrind_suppressions=
949 else
950         if test  "$with_valgrind_suppressions" == ""; then
951                 with_valgrind_suppressions='$(top_srcdir)/valgrind.suppressions'
952         fi
953 fi
954 AS_IF([test "$with_valgrind" != "no"],
955         AC_SUBST(VALGRIND_RULES, 'LOG_COMPILER = "$(top_srcdir)/tools/run-test-valgrind.sh" --called-from-make "$(LIBTOOL)" "$(with_valgrind)" '"$with_valgrind_suppressions"),
956         AC_SUBST(VALGRIND_RULES, []))
957 AM_CONDITIONAL(WITH_VALGRIND, test "${with_valgrind}" != "no")
958
959 GTK_DOC_CHECK(1.0)
960
961 # check for pregenerated manpages to be installed
962 install_pregen_manpages=no
963 if test "$enable_gtk_doc" != "yes" \
964         -a -f man/NetworkManager.conf.5 \
965         -a -f man/nm-settings.5 \
966         -a -f man/nm-settings-keyfile.5 \
967         -a -f man/nm-settings-ifcfg-rh.5 \
968         -a -f man/nmcli-examples.5 \
969         -a -f man/NetworkManager.8; then
970         install_pregen_manpages=yes
971 fi
972 AM_CONDITIONAL(INSTALL_PREGEN_MANPAGES, test "x${install_pregen_manpages}" = "xyes")
973
974 # check if we can build setting property documentation
975 if test -n "$INTROSPECTION_MAKEFILE" -a "$enable_gtk_doc" = "yes"; then
976     # If g-i is installed we know we have python, but we might not have pygobject
977     if python -c 'from gi.repository import GObject' >& /dev/null; then
978         have_pyobject=yes
979     fi
980
981     # gtk-doc depends on perl, but we can check for it anyway
982     AC_PATH_PROG(PERL, perl, no)
983     # check for needed perl modules (use YAML; YAML::XS is better, but may not be so widespread)
984     required_perl_modules="YAML"
985     for module in $required_perl_modules; do
986       AC_MSG_CHECKING([checking for perl module '$module'])
987       if ${PERL} -e 'use '$module 2>/dev/null ; then
988           AC_MSG_RESULT([Ok])
989           have_perl_modules=yes
990       else
991           AC_MSG_RESULT([Failed])
992           AC_MSG_ERROR([You must have Perl modules to build settings plugin docs: $required_perl_modules.])
993       fi
994     done
995
996     if test "$have_pyobject" = "yes" -a "$have_perl_modules" = "yes"; then
997         AC_DEFINE(BUILD_SETTING_DOCS, [1], [Define if you we can build nm-setting-docs.xml, nm-keyfile-docs.xml and nm-ifcfg-rh-docs.xml])
998         build_setting_docs=yes
999     fi
1000 fi
1001
1002 # check for pre-built setting docs
1003 if test "$build_setting_docs" != "yes" \
1004         -a -f man/nm-settings.xml \
1005         -a -f man/nm-settings-keyfile.xml \
1006         -a -f man/nm-settings-ifcfg-rh.xml \
1007         -a -f docs/api/settings-spec.xml \
1008         -a -f clients/cli/settings-docs.c; then
1009     AC_DEFINE(HAVE_SETTING_DOCS, [1], [Define if you have pre-built settings docs])
1010     have_setting_docs=yes
1011 fi
1012
1013 AM_CONDITIONAL(BUILD_SETTING_DOCS, test "$build_setting_docs" = "yes")
1014 AM_CONDITIONAL(SETTING_DOCS_AVAILABLE, test "$build_setting_docs" = "yes" -o "$have_setting_docs" = "yes")
1015
1016
1017 AC_CONFIG_FILES([
1018 Makefile
1019 shared/Makefile
1020 shared/nm-version-macros.h
1021 src/Makefile
1022 src/tests/Makefile
1023 src/tests/config/Makefile
1024 src/dhcp-manager/Makefile
1025 src/dhcp-manager/tests/Makefile
1026 src/dnsmasq-manager/tests/Makefile
1027 src/supplicant-manager/tests/Makefile
1028 src/supplicant-manager/tests/certs/Makefile
1029 src/ppp-manager/Makefile
1030 src/settings/plugins/Makefile
1031 src/settings/plugins/ifupdown/Makefile
1032 src/settings/plugins/ifupdown/tests/Makefile
1033 src/settings/plugins/ifnet/Makefile
1034 src/settings/plugins/ifnet/tests/Makefile
1035 src/settings/plugins/ifcfg-rh/Makefile
1036 src/settings/plugins/ifcfg-rh/tests/Makefile
1037 src/settings/plugins/ifcfg-rh/tests/network-scripts/Makefile
1038 src/settings/plugins/ibft/Makefile
1039 src/settings/plugins/ibft/tests/Makefile
1040 src/settings/plugins/keyfile/Makefile
1041 src/settings/plugins/keyfile/tests/Makefile
1042 src/settings/plugins/keyfile/tests/keyfiles/Makefile
1043 src/platform/Makefile
1044 src/platform/tests/Makefile
1045 src/rdisc/Makefile
1046 src/rdisc/tests/Makefile
1047 src/devices/Makefile
1048 src/devices/tests/Makefile
1049 src/devices/adsl/Makefile
1050 src/devices/bluetooth/Makefile
1051 src/devices/team/Makefile
1052 src/devices/wifi/Makefile
1053 src/devices/wifi/tests/Makefile
1054 src/devices/wwan/Makefile
1055 libnm-core/Makefile
1056 libnm-core/tests/Makefile
1057 libnm/libnm.pc
1058 libnm/Makefile
1059 libnm/tests/Makefile
1060 libnm-util/libnm-util.pc
1061 libnm-util/Makefile
1062 libnm-util/tests/Makefile
1063 libnm-glib/libnm-glib.pc
1064 libnm-glib/libnm-glib-vpn.pc
1065 libnm-glib/Makefile
1066 libnm-glib/tests/Makefile
1067 callouts/Makefile
1068 callouts/tests/Makefile
1069 tools/Makefile
1070 clients/Makefile
1071 clients/cli/Makefile
1072 clients/tui/Makefile
1073 clients/tui/newt/Makefile
1074 introspection/Makefile
1075 introspection/all.xml
1076 man/Makefile
1077 man/nm-system-settings.conf.5
1078 man/nm-online.1
1079 man/nmcli.1
1080 man/nmtui.1
1081 po/Makefile.in
1082 policy/Makefile
1083 policy/org.freedesktop.NetworkManager.policy.in
1084 data/Makefile
1085 docs/Makefile
1086 docs/api/Makefile
1087 docs/api/version.xml
1088 docs/libnm-glib/Makefile
1089 docs/libnm-glib/version.xml
1090 docs/libnm-util/Makefile
1091 docs/libnm-util/version.xml
1092 docs/libnm/Makefile
1093 docs/libnm/version.xml
1094 NetworkManager.pc
1095 examples/Makefile
1096 examples/shell/Makefile
1097 examples/python/Makefile
1098 examples/python/dbus/Makefile
1099 examples/python/gi/Makefile
1100 examples/python/python-networkmanager/Makefile
1101 examples/ruby/Makefile
1102 examples/lua/Makefile
1103 examples/lua/lgi/Makefile
1104 examples/C/Makefile
1105 examples/C/glib/Makefile
1106 examples/C/qt/Makefile
1107 examples/dispatcher/Makefile
1108 vapi/Makefile
1109 ])
1110 AC_CONFIG_SUBDIRS([libndp])
1111 AC_OUTPUT
1112
1113 # Print build configuration
1114 echo
1115 echo "System paths:"
1116 echo "  prefix: $prefix"
1117 echo "  exec_prefix: $exec_prefix"
1118 echo "  systemdunitdir: $with_systemdsystemunitdir"
1119 echo "  nmbinary: $nmbinary"
1120 echo "  nmconfdir: $nmconfdir"
1121 echo "  nmlibdir: $nmlibdir"
1122 echo "  nmdatadir: $nmdatadir"
1123 echo "  nmstatedir: $nmstatedir"
1124 echo "  nmrundir: $nmrundir"
1125 echo
1126
1127 echo "Platform:"
1128 echo "  session tracking: $session_tracking"
1129 echo "  suspend/resume: $with_suspend_resume"
1130 if test "${enable_polkit}" = "yes"; then
1131         if test "${enable_modify_system}" = "yes"; then
1132                 echo "  policykit: yes (permissive modify.system) (default: main.auth-polkit=${enable_polkit})"
1133         else
1134                 echo "  policykit: yes (restrictive modify.system) (default: main.auth-polkit=${enable_polkit})"
1135         fi
1136 else
1137         echo  "  policykit: no"
1138 fi
1139 echo "  polkit agent: ${enable_polkit_agent}"
1140 echo "  selinux: $have_selinux"
1141 echo "  systemd-journald: $have_systemd_journal (default: logging.backend=${nm_config_logging_backend_default})"
1142 echo "  hostname persist: ${hostname_persist}"
1143 echo "  libaudit: $have_libaudit (default: logging.audit=${NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT})"
1144 echo
1145
1146 echo "Features:"
1147 echo "  wext: $ac_with_wext"
1148 echo "  wifi: $enable_wifi"
1149 echo "  ppp: $enable_ppp"
1150 echo "  modemmanager-1: $with_modem_manager_1"
1151 echo "  concheck: $enable_concheck"
1152 echo "  libteamdctl: $enable_teamdctl"
1153 echo "  libnm-glib: $with_libnm_glib"
1154 echo "  nmcli: $build_nmcli"
1155 echo "  nmtui: $build_nmtui"
1156 echo
1157
1158 echo "Configuration plugins (main.plugins=${config_plugins_default})"
1159 echo "  ibft: ${enable_config_plugin_ibft}"
1160 echo "  ifcfg-rh: ${enable_ifcfg_rh}"
1161 echo "  ifupdown: ${enable_ifupdown}"
1162 echo "  ifnet: ${enable_ifnet}"
1163 echo
1164
1165 echo "Handlers for /etc/resolv.conf:"
1166 echo "  resolvconf: ${with_resolvconf}"
1167 echo "  netconfig: ${with_netconfig}"
1168 echo
1169
1170 echo "DHCP clients:"
1171 echo "  dhclient: $with_dhclient"
1172 echo "  dhcpcd: $with_dhcpcd"
1173 echo
1174
1175 echo "Miscellaneous:"
1176 echo "  documentation: $enable_gtk_doc"
1177 echo "  tests: $enable_tests"
1178 echo "  more-asserts: $more_asserts"
1179 echo "  valgrind: $with_valgrind   $with_valgrind_suppressions"
1180 echo "  code coverage: $enable_code_coverage"
1181 echo "  LTO: $enable_lto"
1182 echo