configure.ac 52.3 KB
Newer Older
1
AC_PREREQ([2.63])
Dan Williams's avatar
Dan Williams committed
2

3
dnl The NM version number
4
dnl
5
dnl NOTE: When incrementing version also:
6 7 8
dnl  - add corresponding NM_VERSION_x_y_z macros in
dnl    "shared/nm-version-macros.h.in"
dnl  - update number in meson.build
9
m4_define([nm_major_version], [1])
10
m4_define([nm_minor_version], [19])
11
m4_define([nm_micro_version], [2])
12
m4_define([nm_version],
13
          [nm_major_version.nm_minor_version.nm_micro_version])
14 15

AC_INIT([NetworkManager], [nm_version],
16
        [http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager],
17
        [NetworkManager])
Dan Williams's avatar
Dan Williams committed
18

19
AC_CONFIG_HEADERS([config.h])
Michael Biebl's avatar
Michael Biebl committed
20
AC_CONFIG_MACRO_DIR([m4])
21
AC_CONFIG_AUX_DIR([build-aux])
22
AC_REQUIRE_AUX_FILE([tap-driver.sh])
Michael Biebl's avatar
Michael Biebl committed
23

24
AM_INIT_AUTOMAKE(1.12 tar-ustar no-dist-gzip dist-xz -Wno-portability)  dnl NB: Do not [quote] this parameter.
25
AM_MAINTAINER_MODE([enable])
Adrian Bunk's avatar
Adrian Bunk committed
26
AM_SILENT_RULES([yes])
27 28 29

dnl Define _SYSTEM_EXTENSIONS for various things like strcasestr()
AC_USE_SYSTEM_EXTENSIONS
Michael Biebl's avatar
Michael Biebl committed
30

31 32 33
dnl
dnl Require programs
dnl
Dan Williams's avatar
Dan Williams committed
34
AC_PROG_CC
35
AM_PROG_CC_C_O
36

37 38 39
# C++ only required if --enable-qt=yes
AC_PROG_CXX

40
AC_PROG_LN_S
41
AC_PROG_MKDIR_P
42

43 44 45
# 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], :)
46
AC_CHECK_TOOLS(NM, [$BINUTILS_NM gcc-nm nm])
47

48 49
dnl Initialize libtool
LT_PREREQ([2.2])
50
LT_INIT([disable-static])
51

52 53 54 55 56 57 58 59 60
dnl Version stuff
NM_MAJOR_VERSION=nm_major_version
NM_MINOR_VERSION=nm_minor_version
NM_MICRO_VERSION=nm_micro_version
NM_VERSION=nm_version
AC_SUBST(NM_MAJOR_VERSION)
AC_SUBST(NM_MINOR_VERSION)
AC_SUBST(NM_MICRO_VERSION)
AC_SUBST(NM_VERSION)
61 62

GIT_SHA_RECORD(NM_GIT_SHA)
63

64 65 66 67
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_TYPE_PID_T
68
AC_CHECK_SIZEOF(dev_t)
69
AC_CHECK_SIZEOF(time_t)
70
AC_CHECK_SIZEOF(pid_t)
71

72 73 74 75 76
AC_CHECK_DECLS([
	explicit_bzero],
	[], [], [[
#include <string.h>
]])
77

78 79 80 81 82 83
AC_CHECK_DECLS([
	reallocarray],
	[], [], [[
#include <malloc.h>
]])

84 85 86 87 88 89
AC_CHECK_DECLS([
	memfd_create],
	[], [], [[
#include <sys/mman.h>
]])

90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
AC_CHECK_HEADERS(sys/auxv.h)

AC_CHECK_DECLS([getrandom],
               [AC_DEFINE([USE_SYS_RANDOM_H], [1], [sys/random.h is usable])
                AC_DEFINE([HAVE_GETRANDOM], [1], [has getrandom])
               ],
               [AC_CHECK_DECLS([getrandom],
                               [AC_DEFINE([USE_SYS_RANDOM_H], [0], [sys/random.h is usable])
                                AC_DEFINE([HAVE_GETRANDOM], [1], [has getrandom])],
                               [AC_DEFINE([USE_SYS_RANDOM_H], [0], [sys/random.h is usable])
                                AC_DEFINE([HAVE_GETRANDOM], [0], [has getrandom])],
                               [[#include <linux/random.h>
                                 ]])],
               [[#include <sys/random.h>
                 ]])
105

106 107 108
dnl
dnl translation support
dnl
109 110 111 112 113
IT_PROG_INTLTOOL([0.40.0])

AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])

114 115 116 117
GETTEXT_PACKAGE=NetworkManager
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])

118 119 120 121
# Add runstatedir if not specified manually in autoconf < 2.70
AS_IF([test -z "$runstatedir"], runstatedir="$localstatedir/run")
AC_SUBST(runstatedir)

122
# NetworkManager paths
123 124 125 126 127 128
AC_SUBST(nmbinary, '${sbindir}'/$PACKAGE, [NetworkManager binary executable])
AC_SUBST(nmconfdir, '${sysconfdir}'/$PACKAGE, [NetworkManager configuration directory])
AC_SUBST(nmlibdir, '${prefix}'/lib/$PACKAGE, [NetworkManager library directory])
AC_SUBST(nmdatadir, '${datadir}'/$PACKAGE, [NetworkManager shared data directory])
AC_SUBST(nmstatedir, '${localstatedir}'/lib/$PACKAGE, [NetworkManager persistent state directory])
AC_SUBST(nmrundir, '${runstatedir}'/$PACKAGE, [NetworkManager runtime state directory])
129

130 131 132
AC_GNU_SOURCE
AC_CHECK_FUNCS([__secure_getenv secure_getenv])

133
# Alternative configuration plugins
134
AC_ARG_ENABLE(config-plugin-ibft, AS_HELP_STRING([--enable-config-plugin-ibft], [enable ibft configuration plugin]))
135 136 137
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
138 139
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)
140 141 142
# 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)
143 144
# Disable obsolete ibft plugin by default
AS_IF([test -z "$enable_config_plugin_ibft"], enable_config_plugin_ibft="no")
145
# Create automake conditionals
146
AM_CONDITIONAL(CONFIG_PLUGIN_IBFT, test "$enable_config_plugin_ibft" = "yes")
147 148
AM_CONDITIONAL(CONFIG_PLUGIN_IFCFG_RH, test "$enable_ifcfg_rh" = "yes")
AM_CONDITIONAL(CONFIG_PLUGIN_IFUPDOWN, test "$enable_ifupdown" = "yes")
149

150 151 152 153
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=""])
154
if test -z "$config_plugins_default" -o "$config_plugins_default" = no; then
155 156 157 158 159
	config_plugins_default=''
	test "$enable_ifcfg_rh" = "yes"           && config_plugins_default="$config_plugins_default,ifcfg-rh"
	test "$enable_ifupdown" = "yes"           && config_plugins_default="$config_plugins_default,ifupdown"
	test "$enable_config_plugin_ibft" = "yes" && config_plugins_default="$config_plugins_default,ibft"
	config_plugins_default="${config_plugins_default#,}"
160
fi
161 162 163 164 165

test "$enable_ifcfg_rh" = "yes"           && distro_plugins="$distro_plugins,ifcfg-rh"
test "$enable_ifupdown" = "yes"           && distro_plugins="$distro_plugins,ifupdown"
distro_plugins="${distro_plugins#,}"

166
AC_DEFINE_UNQUOTED(NM_CONFIG_DEFAULT_MAIN_PLUGINS, "$config_plugins_default", [Default configuration option for main.plugins setting])
167 168 169 170 171
if test "${enable_config_plugin_ibft}" = yes; then
	AC_DEFINE(WITH_SETTINGS_PLUGIN_IBFT, 1, [Whether compilation of ibft setting plugin is enabled])
else
	AC_DEFINE(WITH_SETTINGS_PLUGIN_IBFT, 0, [Whether compilation of ibft setting plugin is enabled])
fi
172

173
if test "$enable_ifcfg_rh" = "yes"; then
174
	DISTRO_NETWORK_SERVICE=network.service
175 176 177
fi
AC_SUBST(DISTRO_NETWORK_SERVICE)

178 179
# Code coverage
GNOME_CODE_COVERAGE
180

181 182 183
dnl
dnl Distribution version string
dnl
184 185 186
AC_ARG_WITH(dist-version,
            AS_HELP_STRING([--with-dist-version=<NM-distribution-version>],
                           [Define the NM''s distribution version string]),
187 188 189
            ac_distver=$withval, ac_distver=$NM_VERSION)
AC_DEFINE_UNQUOTED(NM_DIST_VERSION, "$ac_distver", [Define the distribution version string])
AC_SUBST(NM_DIST_VERSION, "$ac_distver")
190

191 192 193 194 195 196
AC_ARG_ENABLE(wifi, AS_HELP_STRING([--enable-wifi], [enable Wi-Fi support]))
if test "${enable_wifi}" != "no"; then
	enable_wifi='yes'
fi
AM_CONDITIONAL(WITH_WIFI, test "${enable_wifi}" = "yes")

197 198 199
dnl
dnl Default to using WEXT but allow it to be disabled
dnl
200 201 202 203
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")
204 205 206
if test "$ac_with_wext" != 'no'; then
	ac_with_wext='yes'
fi
207
if test x"$ac_with_wext" = x"yes"; then
208 209 210
	if test "$enable_wifi" != "yes"; then
		AC_MSG_ERROR(Enabling WEXT support and disabling Wi-Fi makes no sense)
	fi
211 212 213
	AC_DEFINE(HAVE_WEXT, 1, [Define if you have Linux Wireless Extensions support])
else
	AC_DEFINE(HAVE_WEXT, 0, [Define if you have Linux Wireless Extensions support])
214
fi
215
AM_CONDITIONAL(WITH_WEXT, test x"${ac_with_wext}" = x"yes")
216

217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
dnl
dnl Default to using wpa_supplicant but allow IWD as wifi backend
dnl
AC_ARG_WITH(iwd,
            AS_HELP_STRING([--with-iwd=yes],
                           [Support IWD as wifi-backend in addition to wpa_supplicant (experimental)]),
            ac_with_iwd=$withval, ac_with_iwd="no")
if test "$ac_with_iwd" != 'no'; then
	ac_with_iwd='yes'
fi
if test x"$ac_with_iwd" = x"yes"; then
	if test "$enable_wifi" != "yes"; then
		AC_MSG_ERROR(Enabling IWD support and disabling Wi-Fi makes no sense)
	fi
	AC_DEFINE(WITH_IWD, 1, [Define to compile with the IWD wifi-backend])
else
	AC_DEFINE(WITH_IWD, 0, [Define to compile without the IWD wifi-backend])
fi
AM_CONDITIONAL(WITH_IWD, test x"${ac_with_iwd}" = x"yes")

237 238 239
dnl
dnl Checks for libdl - on certain platforms its part of libc
dnl
240 241 242
AC_SEARCH_LIBS([dlopen], [dl dld],
	[test "$ac_cv_search_dlopen" = "none required" || AC_SUBST([DL_LIBS], "$ac_cv_search_dlopen"]),
	[])
243

244
PKG_CHECK_MODULES(GLIB, [gio-unix-2.0 >= 2.37.6 gmodule-2.0],
245 246
                  [AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/tap-driver.sh')
                   AC_SUBST(AM_TESTS_FD_REDIRECT, '--tap')],
Lubomir Rintel's avatar
Lubomir Rintel committed
247
                  [PKG_CHECK_MODULES(GLIB, gio-unix-2.0 >= 2.40 gmodule-2.0)
248
                   AC_SUBST(LOG_DRIVER, '$(top_srcdir)/build-aux/test-driver')])
249

Lubomir Rintel's avatar
Lubomir Rintel committed
250
GLIB_CFLAGS="$GLIB_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_40 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_40"
251

252 253 254
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)

255 256
GOBJECT_INTROSPECTION_CHECK([0.9.6])

257
PKG_CHECK_MODULES([LIBUDEV], [libudev >= 175])
258

259
# Qt4
260
PKG_CHECK_MODULES(QT, [QtCore >= 4 QtDBus QtNetwork], [have_qt=yes],[have_qt=no])
261 262 263
AC_ARG_ENABLE(qt,
              AS_HELP_STRING([--enable-qt], [enable Qt examples]),
              [enable_qt=${enableval}], [enable_qt=${have_qt}])
264 265 266 267
if (test "${enable_qt}" = "yes"); then
	if test x"$have_qt" = x"no"; then
		AC_MSG_ERROR(Qt development headers are required)
	fi
268
	# Check for moc-qt4 and if not found then moc
269
	QT4_BINDIR=`$PKG_CONFIG QtCore --variable moc_location`
270
	AC_CHECK_PROGS(MOC, [moc-qt4 moc],, [$QT4_BINDIR:$PATH])
271 272 273
fi
AM_CONDITIONAL(WITH_QT, test "${enable_qt}" = "yes")

274 275 276 277
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"])
278
if (test "$with_udev_dir" != 'no'); then
279
	if (test "$with_udev_dir" != 'yes' && printf '%s' "$with_udev_dir" | grep -v -q '^/'); then
280 281 282
		AC_MSG_ERROR([--with-udev-dir must be an absolute path or 'yes' or 'no'. Instead it is '$with_udev_dir'])
	fi
	if (test "$with_udev_dir" = 'yes'); then
283
		with_udev_dir="\$(prefix)/lib/udev"
284 285 286
	fi
	UDEV_DIR="$with_udev_dir"
	AC_SUBST(UDEV_DIR)
287
fi
288
AM_CONDITIONAL(WITH_UDEV_DIR, test "$with_udev_dir" != 'no')
289

290
# systemd unit support
291 292 293
AC_ARG_WITH([systemdsystemunitdir],
            AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
                           [Directory for systemd service files]))
294 295
# default location
AS_IF([test -z "$with_systemdsystemunitdir" && $PKG_CONFIG systemd],
296
      with_systemdsystemunitdir="\$(prefix)/lib/systemd/system")
297 298 299 300
AS_IF([test -z "$with_systemdsystemunitdir"], with_systemdsystemunitdir=no)
# add conditional and subst
AM_CONDITIONAL(HAVE_SYSTEMD, [test "$with_systemdsystemunitdir" != no])
if test "$with_systemdsystemunitdir" != no; then
301 302
	AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
fi
303

304
PKG_CHECK_MODULES(SYSTEMD_200, [systemd >= 200], [have_systemd_200=yes], [have_systemd_200=no])
305 306
AM_CONDITIONAL(HAVE_SYSTEMD_200, test "${have_systemd_200}" = "yes")

307
# Hostname persist mode
308 309 310
AC_ARG_WITH(hostname-persist,
            AS_HELP_STRING([--with-hostname-persist=default|suse|gentoo|slackware],
                           [Hostname persist method]))
311 312 313

AS_IF([test "$with_hostname_persist" = "suse"], hostname_persist=suse)
AS_IF([test "$with_hostname_persist" = "gentoo"], hostname_persist=gentoo)
314
AS_IF([test "$with_hostname_persist" = "slackware"], hostname_persist=slackware)
315 316
AS_IF([test "$with_hostname_persist" = "default"], hostname_persist=default)
# if the method was not explicitly set, try to guess it from the enabled plugins
317
AS_IF([test -z "$hostname_persist" -a -f /etc/SuSE-release], hostname_persist=suse)
318
AS_IF([test -z "$hostname_persist" -a -f /etc/gentoo-release], hostname_persist=gentoo)
319
AS_IF([test -z "$hostname_persist" -a -f /etc/slackware-version], hostname_persist=slackware)
320 321 322 323 324 325
AS_IF([test -z "$hostname_persist"], hostname_persist=default)

if test "$hostname_persist" = suse; then
	AC_DEFINE(HOSTNAME_PERSIST_SUSE, 1, [Enable SuSE hostname persist method])
elif test "$hostname_persist" = gentoo; then
	AC_DEFINE(HOSTNAME_PERSIST_GENTOO, 1, [Enable Gentoo hostname persist method])
326 327
elif test "$hostname_persist" = slackware; then
	AC_DEFINE(HOSTNAME_PERSIST_SLACKWARE, 1, [Enable Slackware hostname persist method])
328 329
fi

330
PKG_CHECK_MODULES(LIBSYSTEMD, [libsystemd >= 209],
331 332
                  [AC_DEFINE([HAVE_LIBSYSTEMD], 1, [Define to 1 if libsystemd is available])],
                  [AC_DEFINE([HAVE_LIBSYSTEMD], 0, [Define to 1 if libsystemd is available])])
333

334 335 336
AC_ARG_WITH(systemd-journal,
            AS_HELP_STRING([--with-systemd-journal=yes|no],
                           [Use systemd journal for logging]))
337 338
have_systemd_journal=no
if test "$with_systemd_journal" != "no"; then
339
	PKG_CHECK_MODULES(SYSTEMD_JOURNAL, [libsystemd >= 209], [have_systemd_journal=yes],
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355
	                  [PKG_CHECK_MODULES(SYSTEMD_JOURNAL,
	                                     [libsystemd-journal],
	                                     [have_systemd_journal=yes],
	                                     [have_systemd_journal=no])])
	if test "$have_systemd_journal" != "yes"; then
		if test "$with_systemd_journal" = "yes"; then
			AC_MSG_ERROR([Missing systemd-journald support])
		fi
	fi
fi
if test "$have_systemd_journal" = "yes"; then
	AC_DEFINE([SYSTEMD_JOURNAL], 1, [Define to 1 if libsystemd-journald is available])
else
	AC_DEFINE([SYSTEMD_JOURNAL], 0, [Define to 1 if libsystemd-journald is available])
fi

356 357 358 359 360
AC_ARG_WITH(config-logging-backend-default,
            AS_HELP_STRING([--with-config-logging-backend-default=backend],
                           [Default value for logging.backend]),
            nm_config_logging_backend_default="$withval",
            nm_config_logging_backend_default="")
361

362 363
if test "$nm_config_logging_backend_default" != 'syslog' \
     -a "$nm_config_logging_backend_default" != 'journal'; then
364 365 366 367 368 369
	# unknown backend. Reset to default. Silently accept the invalid value to
	# be future proof.
	nm_config_logging_backend_default=''
fi
if test "$nm_config_logging_backend_default" = ""; then
	if test "$have_systemd_journal" = "yes"; then
370
		nm_config_logging_backend_default='journal'
371 372 373 374
	else
		nm_config_logging_backend_default='syslog'
	fi
fi
375 376 377
AC_DEFINE_UNQUOTED(NM_CONFIG_DEFAULT_LOGGING_BACKEND, "$nm_config_logging_backend_default", [Default configuration option for logging.backend])
NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT="$nm_config_logging_backend_default"
AC_SUBST(NM_CONFIG_DEFAULT_LOGGING_BACKEND_TEXT)
378

379
# Session tracking support
380 381 382 383 384 385 386 387 388
AC_ARG_WITH(systemd-logind,
            AS_HELP_STRING([--with-systemd-logind=yes|no],
                           [Support systemd session tracking]))
AC_ARG_WITH(consolekit,
            AS_HELP_STRING([--with-consolekit=yes|no],
                           [Support consolekit session tracking]))
AC_ARG_WITH(session-tracking,
            AS_HELP_STRING([--with-session-tracking=systemd|elogind|consolekit|no],
                           [Compatibility option to choose one session tracking module]))
389
# backwards compatibility
Sven Eden's avatar
Sven Eden committed
390 391 392 393 394 395
AS_IF([test "$with_session_tracking" = "ck"], [use_consolekit="yes" use_systemd_logind="no" use_elogind="no"])
AS_IF([test "$with_session_tracking" = "consolekit"], [use_consolekit="yes" use_systemd_logind="no" use_elogind="no"])
AS_IF([test "$with_session_tracking" = "systemd"], [use_consolekit="no" use_systemd_logind="yes" use_elogind="no"])
AS_IF([test "$with_session_tracking" = "elogind"], [use_consolekit="no" use_systemd_logind="no" use_elogind="yes"])
AS_IF([test "$with_session_tracking" = "no"], [use_consolekit="no" use_systemd_logind="no" use_elogind="no"])
AS_IF([test "$with_session_tracking" = "none"], [use_consolekit="no" use_systemd_logind="no" use_elogind="no"])
396 397 398 399
# current options
AS_IF([test -n "$with_systemd_logind" ], [use_systemd_logind="$with_systemd_logind"])
AS_IF([test -n "$with_consolekit" ], [use_consolekit="$with_consolekit"])
# defaults
400
AS_IF([test -z "$use_systemd_logind"], [use_systemd_logind="auto"])
401
AS_IF([test -z "$use_consolekit"], [use_consolekit="yes"])
402 403
# output
session_tracking=
404
if test "$use_systemd_logind" = "yes" -o "$use_systemd_logind" = "auto"; then
405
	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])])
406
else
407
	have_systemd_logind=no
408 409
fi
if test "$use_systemd_logind" = "yes" -a "$have_systemd_logind" = "no"; then
410
	AC_MSG_ERROR([You must have libsystemd installed to build with systemd-logind support.])
411 412
fi
if test "$have_systemd_logind" = "yes"; then
413 414
	AC_DEFINE([SESSION_TRACKING_SYSTEMD], 1, [Define to 1 if libsystemd-login is available])
	session_tracking="$session_tracking, systemd-logind"
415 416
else
	AC_DEFINE([SESSION_TRACKING_SYSTEMD], 0, [Define to 1 if libsystemd-login is available])
417
fi
Sven Eden's avatar
Sven Eden committed
418

419
if test "$use_elogind" = "yes" -a "$have_systemd_logind" = "yes"; then
420
	AC_MSG_ERROR([Cannot enable systemd-logind together with elogind.])
421 422
fi
if test "$use_elogind" = "yes"; then
423
	PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libelogind], [have_elogind=yes], [PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libelogind], [have_elogind=yes], [have_elogind=no])])
Sven Eden's avatar
Sven Eden committed
424
else
425
	have_elogind=no
Sven Eden's avatar
Sven Eden committed
426 427
fi
if test "$use_elogind" = "yes" -a "$have_elogind" = "no"; then
428
	AC_MSG_ERROR([You must have libelogind installed to build with elogind support.])
Sven Eden's avatar
Sven Eden committed
429 430
fi
if test "$have_elogind" = "yes"; then
431 432
	AC_DEFINE([SESSION_TRACKING_ELOGIND], 1, [Define to 1 if libelogin is available])
	session_tracking="$session_tracking, elogind"
433 434
else
	AC_DEFINE([SESSION_TRACKING_ELOGIND], 0, [Define to 1 if libelogin is available])
Sven Eden's avatar
Sven Eden committed
435 436
fi

437
if test "$use_consolekit" = "yes"; then
438 439
	AC_DEFINE([SESSION_TRACKING_CONSOLEKIT], 1, [Define to 1 if ConsoleKit is available])
	session_tracking="$session_tracking, consolekit"
440 441
else
	AC_DEFINE([SESSION_TRACKING_CONSOLEKIT], 0, [Define to 1 if ConsoleKit is available])
442
fi
443
session_tracking="$(printf '%s' "${session_tracking}" | sed 's/^, //')"
444

445 446 447
AC_ARG_WITH(suspend-resume,
            AS_HELP_STRING([--with-suspend-resume=upower|systemd|elogind|consolekit],
                           [Build NetworkManager with specific suspend/resume support]))
448
if test "z$with_suspend_resume" = "z"; then
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469
	PKG_CHECK_EXISTS([libsystemd >= 209], [have_systemd_inhibit=yes],
	                 [PKG_CHECK_EXISTS([libsystemd-login >= 183], [have_systemd_inhibit=yes], [have_systemd_inhibit=no])])
	if test "z${have_systemd_inhibit}" = "zyes"; then
		# Use systemd if it's new enough
		with_suspend_resume="systemd"
	else
		PKG_CHECK_EXISTS([libelogind >= 219], [have_elogind_inhibit=yes],
		                 [PKG_CHECK_EXISTS([libelogind >= 219], [have_elogind_inhibit=yes], [have_elogind_inhibit=no])])
		if test "z${have_elogind_inhibit}" = "zyes"; then
			# Use elogind if it's new enough
			with_suspend_resume="elogind"
		else
			if test "$use_consolekit" = "yes"; then
				# Use consolekit suspend if session tracking is consolekit
				with_suspend_resume="consolekit"
			else
				# Fall back to upower
				with_suspend_resume="upower"
			fi
		fi
	fi
Sven Eden's avatar
Sven Eden committed
470
fi
471 472

case $with_suspend_resume in
473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491
	upower)
		AC_DEFINE([SUSPEND_RESUME_UPOWER], 1, [Define to 1 to use UPower suspend api])
		;;
	systemd)
		PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd >= 209],,
		                  [PKG_CHECK_MODULES(SYSTEMD_INHIBIT, [libsystemd-login >= 183])])
		AC_DEFINE([SUSPEND_RESUME_SYSTEMD], 1, [Define to 1 to use systemd suspend api])
		;;
	elogind)
		PKG_CHECK_MODULES(ELOGIND_INHIBIT, [libelogind >= 219],,
		                  [PKG_CHECK_MODULES(ELOGIND_INHIBIT, [libelogind >= 219])])
		AC_DEFINE([SUSPEND_RESUME_ELOGIND], 1, [Define to 1 to use elogind suspend api])
		;;
	consolekit)
		AC_DEFINE([SUSPEND_RESUME_CONSOLEKIT], 1, [Define to 1 to use ConsoleKit2 suspend api])
		;;
	*)
		AC_MSG_ERROR(--with-suspend-resume must be one of [upower, systemd, elogind, consolekit])
		;;
492 493
esac

494 495
# eBPF support
AC_ARG_WITH(ebpf,
496
            AS_HELP_STRING([--with-ebpf=yes|no|auto], [Build with eBPF support [default=auto]]),
497
            [], [with_ebpf=auto])
498 499
# 'auto' means 'false' because there are still some issues.
if test "$with_ebpf" = "yes" ; then
500 501 502 503 504 505
	AC_CHECK_HEADER(linux/bpf.h, [have_ebpf=yes], [have_ebpf=no])
else
	have_ebpf=no
fi
if test "$with_ebpf" = "yes" -a "$have_ebpf" = "no"; then
	AC_MSG_ERROR([--with-ebpf=yes requires eBPF kernel header])
506
fi
507
AM_CONDITIONAL(WITH_EBPF, test "${have_ebpf}" = "yes")
508

509
# SELinux support
510
AC_ARG_WITH(selinux,
511
            AS_HELP_STRING([--with-selinux=yes|no|auto], [Build with SELinux [default=auto]]),
512
            [], [with_selinux=auto])
513
if test "$with_selinux" = "yes" -o "$with_selinux" = "auto"; then
514
	PKG_CHECK_MODULES(SELINUX, libselinux, [have_selinux=yes], [have_selinux=no])
515
else
516
	have_selinux=no
517 518
fi
if test "$with_selinux" = "yes" -a "$have_selinux" = "no"; then
519
	AC_MSG_ERROR([You must have libselinux installed to build --with-selinux=yes.])
520 521
fi
if test "$have_selinux" = "yes"; then
522
	AC_DEFINE(HAVE_SELINUX, 1, [Define if you have SELinux support])
523
else
524
	AC_DEFINE(HAVE_SELINUX, 0, [Define if you have SELinux support])
525 526
fi

527
# libaudit support
528
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])
529
if test "$with_libaudit" = "yes" -o "$with_libaudit" = "yes-disabled-by-default" -o "$with_libaudit" = "auto"; then
530 531 532 533
	PKG_CHECK_MODULES(LIBAUDIT, audit, [have_libaudit=yes], [have_libaudit=no])
	if test "$with_libaudit" != "auto" -a "$have_libaudit" = "no"; then
		AC_MSG_ERROR([You must have libaudit installed to build --with-libaudit=$with_libaudit.])
	fi
534
else
535
	have_libaudit=no
536 537
fi
if test "$have_libaudit" = "yes"; then
538 539 540 541 542 543 544 545
	AC_DEFINE(HAVE_LIBAUDIT, 1, [Define if you have libaudit support])
	if test "$with_libaudit" = "yes-disabled-by-default"; then
		AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, "false", [The default value of the logging.audit configuration option])
		NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false'
	else
		AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, "true",  [The default value of the logging.audit configuration option])
		NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='true'
	fi
546
else
547 548 549
	AC_DEFINE(HAVE_LIBAUDIT, 0, [Define if you have libaudit support])
	AC_DEFINE(NM_CONFIG_DEFAULT_LOGGING_AUDIT, "false", [The default value of the logging.audit configuration option])
	NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT='false'
550
fi
551
AC_SUBST(NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT)
552

553
# uuid library
554 555
PKG_CHECK_MODULES(UUID, uuid)

556
# Teamd control checks
557

558
PKG_CHECK_MODULES(JANSSON, [jansson >= 2.5], [have_jansson=yes], [have_jansson=no])
559 560
if test "$have_jansson" = "yes"; then
	AC_DEFINE(WITH_JANSSON, 1, [Define if JANSSON is enabled])
561 562 563 564 565 566 567 568 569

	AC_CHECK_TOOLS(READELF, [eu-readelf readelf])
	JANSSON_LIBDIR=`$PKG_CONFIG --variable=libdir jansson`
	JANSSON_SONAME=`$READELF -d $JANSSON_LIBDIR/libjansson.so |sed -n 's/.*SONAME.*\[[\([^]]*\)]]/\1/p'`

	if test "$JANSSON_SONAME" = ""; then
		AC_MSG_ERROR(Unable to locate the Jansson library)
	fi
	AC_DEFINE_UNQUOTED(JANSSON_SONAME, "$JANSSON_SONAME", [Define to path to the Jansson shared library])
570 571 572 573 574
else
	AC_DEFINE(WITH_JANSSON, 0, [Define if JANSSON is enabled])
fi
AM_CONDITIONAL(WITH_JANSSON, test "${have_jansson}" = "yes")

575
PKG_CHECK_MODULES(LIBTEAMDCTL, [libteamdctl >= 1.9], [have_teamdctl=yes],[have_teamdctl=no])
576 577 578 579 580 581
if test "$have_jansson" = "yes" -a "$have_teamdctl" = "yes"; then
	have_team_prereq=yes
else
	have_team_prereq=no
fi

582 583 584 585
AC_ARG_ENABLE(teamdctl,
              AS_HELP_STRING([--enable-teamdctl], [enable Teamd control support]),
              [enable_teamdctl=${enableval}], [enable_teamdctl=${have_team_prereq}])
if (test "${enable_teamdctl}" = "yes"); then
586 587 588 589 590
	if test "$have_teamdctl" = "no"; then
		AC_MSG_ERROR(Libteamdctl is required for team support)
	fi
	if test "$have_jansson" = "no"; then
		AC_MSG_ERROR(Jansson is required for team support)
591 592 593
	fi
	# temporary bug workaround
	LIBTEAMDCTL_CFLAGS=`echo $LIBTEAMDCTL_CFLAGS | sed -e 's:/teamdctl.h::'`
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608
fi
AM_CONDITIONAL(WITH_TEAMDCTL, test "${enable_teamdctl}" = "yes")

# Jansson for team configuration validation
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}" == "no"); then
	AC_DEFINE(WITH_JSON_VALIDATION, 0, [Define if JSON validation in libnm is enabled])
else
	if test "$have_jansson" = "no"; then
		AC_MSG_ERROR([jansson is needed for team configuration validation. Use --disable-json-validation to build without it.])
	fi
		AC_DEFINE(WITH_JSON_VALIDATION, 1, [Define if JSON validation in libnm is enabled])
609
fi
610
AM_CONDITIONAL(WITH_JSON_VALIDATION, test "${enable_json_validation}" != "no")
611

612 613
# 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
luz.paz's avatar
luz.paz committed
614
# authorization via config.
615
AC_ARG_ENABLE(polkit,
616 617
              AS_HELP_STRING([--enable-polkit=yes|no],
                             [set default value for auth-polkit configuration option. This value can be overwritten by NM configuration. 'disabled' is an alias for 'no']),
618
              [enable_polkit=${enableval}], [enable_polkit=yes])
619
if (test "${enable_polkit}" != "no" -a "${enable_polkit}" != "disabled"); then
620
	enable_polkit=true
621 622
	AC_DEFINE(NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT, "true", [The default value of the auth-polkit configuration option])
	AC_SUBST(NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT, true)
623
else
624
	enable_polkit=false
625 626
	AC_DEFINE(NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT, "false", [The default value of the auth-polkit configuration option])
	AC_SUBST(NM_CONFIG_DEFAULT_MAIN_AUTH_POLKIT_TEXT, false)
627
fi
628

629
PKG_CHECK_MODULES(POLKIT, [polkit-agent-1 >= 0.97], [have_pk_agent=yes],[have_pk_agent=no])
630 631 632
AC_ARG_ENABLE(polkit-agent,
              AS_HELP_STRING([--enable-polkit-agent], [enable polkit agent for clients]),
              [enable_polkit_agent=${enableval}], [enable_polkit_agent=${have_pk_agent}])
633 634 635 636 637 638 639 640 641 642
if (test "${enable_polkit_agent}" = "yes"); then
	if test x"$have_pk_agent" = x"no"; then
		AC_MSG_ERROR(Polkit agent is required)
	fi
	AC_DEFINE(WITH_POLKIT_AGENT, 1, [Define if you have polkit agent])
else
	AC_DEFINE(WITH_POLKIT_AGENT, 0, [Define if you have polkit agent])
fi
AM_CONDITIONAL(WITH_POLKIT_AGENT, test "${enable_polkit_agent}" = "yes")

643
AC_ARG_ENABLE(modify-system, AS_HELP_STRING([--enable-modify-system], [Allow users to modify system connections]))
644 645 646 647 648 649 650
if test "${enable_modify_system}" = "yes"; then
	NM_MODIFY_SYSTEM_POLICY="yes"
else
	NM_MODIFY_SYSTEM_POLICY="auth_admin_keep"
fi
AC_SUBST(NM_MODIFY_SYSTEM_POLICY)

651 652 653 654 655 656 657 658 659 660 661 662
PKG_CHECK_MODULES(GNUTLS, [gnutls >= 2.12], [have_crypto_gnutls=yes], [have_crypto_gnutls=no])
PKG_CHECK_MODULES(NSS, [nss], [have_crypto_nss=yes], [have_crypto_nss=yes])
if test "${have_crypto_nss}" = "yes"; then
	# Work around a pkg-config bug (fdo #29801) where exists != usable
	FOO=`$PKG_CONFIG --cflags --libs nss`
	if test x"$?" != "x0"; then
		have_crypto_nss=no
	fi
fi
AM_CONDITIONAL(HAVE_CRYPTO_GNUTLS, test "${have_crypto_gnutls}" = 'yes')
AM_CONDITIONAL(HAVE_CRYPTO_NSS, test "${have_crypto_nss}" = 'yes')

663 664 665
AC_ARG_WITH(crypto,
            AS_HELP_STRING([--with-crypto=nss|gnutls],
                           [Cryptography library to use for certificate and key operations]),
666 667 668
            with_crypto=$withval,
            with_crypto=nss)
if test "$with_crypto" = 'nss'; then
669 670
	if test "${have_crypto_nss}" != "yes"; then
		AC_MSG_ERROR([No usable NSS found for --with-crypto=nss])
671
	fi
672
elif test "$with_crypto" = 'gnutls'; then
673 674 675
	if test "${have_crypto_gnutls}" != "yes"; then
		AC_MSG_ERROR([No usable gnutls found for --with-crypto=gnutls])
	fi
676
else
677
	AC_MSG_ERROR([Please choose either 'nss' or 'gnutls' for certificate and crypto operations])
678
fi
679 680
AM_CONDITIONAL(WITH_NSS, test "$with_crypto" = 'nss')
AM_CONDITIONAL(WITH_GNUTLS, test "$with_crypto" = 'gnutls')
681

682 683
GLIB_MAKEFILE='$(top_srcdir)/Makefile.glib'
AC_SUBST(GLIB_MAKEFILE)
684
GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
685
AC_SUBST(GLIB_MKENUMS)
686

687 688
AC_ARG_WITH(dbus-sys-dir,
            AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
689

690
if test -n "$with_dbus_sys_dir" ; then
691
	DBUS_SYS_DIR="$with_dbus_sys_dir"
692
else
693
	DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
694 695 696
fi
AC_SUBST(DBUS_SYS_DIR)

697
# pppd
698 699 700
AC_ARG_ENABLE(ppp,
              AS_HELP_STRING([--enable-ppp], [enable PPP/PPPoE support]),
              [enable_ppp=${enableval}], [enable_ppp=yes])
701 702
if (test "${enable_ppp}" = "yes"); then
	AC_CHECK_HEADERS(pppd/pppd.h,,
703
	                 AC_MSG_ERROR("couldn't find pppd.h. pppd development headers are required."))
704 705

	AC_DEFINE(WITH_PPP, 1, [Define if you have PPP support])
706 707
else
	AC_DEFINE(WITH_PPP, 0, [Define if you have PPP support])
708 709
fi
AM_CONDITIONAL(WITH_PPP, test "${enable_ppp}" = "yes")
710

711 712
AC_ARG_WITH([pppd-plugin-dir],
            AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory]))
713 714 715 716

if test -n "$with_pppd_plugin_dir" ; then
	PPPD_PLUGIN_DIR="$with_pppd_plugin_dir"
else
717
	PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.5"
718 719
fi
AC_SUBST(PPPD_PLUGIN_DIR)
720

721 722
AC_ARG_WITH(pppd, AS_HELP_STRING([--with-pppd=/path/to/pppd], [path to pppd binary]))
if test "x${with_pppd}" = x; then
723
	AC_PATH_PROG(PPPD_PATH, pppd, [], $PATH:/sbin:/usr/sbin)
724
else
725
	PPPD_PATH="$with_pppd"
726 727 728 729
fi
AC_DEFINE_UNQUOTED(PPPD_PATH, "$PPPD_PATH", [Define to path of pppd binary])
AC_SUBST(PPPD_PATH)

730
# ModemManager1 with libmm-glib
731 732 733 734
AC_ARG_WITH(modem-manager-1,
            AS_HELP_STRING([--with-modem-manager-1],
                           [Enable new ModemManager1 interface support]),
            [], [with_modem_manager_1=auto])
735
if (test "${with_modem_manager_1}" != "no"); then
736 737 738 739 740 741 742 743 744 745 746 747 748 749
	PKG_CHECK_MODULES(MM_GLIB,
	                  [mm-glib >= 0.7.991],
	                  [have_libmm_glib=yes],
	                  [have_libmm_glib=no])

	if (test "${have_libmm_glib}" = "no"); then
		if (test "${with_modem_manager_1}" = "yes"); then
			AC_MSG_ERROR([Couldn't find libmm-glib])
		else
			with_modem_manager_1="no"
		fi
	else
		with_modem_manager_1="yes"
	fi
750 751
fi
AM_CONDITIONAL(WITH_MODEM_MANAGER_1, test "${with_modem_manager_1}" = "yes")
752

753 754
# Bluez5 DUN support
PKG_CHECK_MODULES(BLUEZ5, [bluez >= 5], [have_bluez5=yes],[have_bluez5=no])
755 756 757
AC_ARG_ENABLE(bluez5-dun,
              AS_HELP_STRING([--enable-bluez5-dun], [enable Bluez5 DUN support]),
              [enable_bluez5_dun=${enableval}], [enable_bluez5_dun=${have_bluez5}])
758 759 760 761 762 763
if (test "${enable_bluez5_dun}" = "yes"); then
	if test x"$have_bluez5" = x"no"; then
		AC_MSG_ERROR(Bluez 5.x development headers are required)
	fi
	AC_DEFINE(WITH_BLUEZ5_DUN, 1, [Define if you have Bluez 5 libraries])
else
764
	AC_DEFINE(WITH_BLUEZ5_DUN, 0, [Define if you have Bluez 5 libraries])
765 766 767
fi
AM_CONDITIONAL(WITH_BLUEZ5_DUN, test "${enable_bluez5_dun}" = "yes")

768
# OFONO
769 770 771
AC_ARG_WITH(ofono,
            AS_HELP_STRING([--with-ofono], [Enable oFono support (experimental)]),
            [], [with_ofono=no])
772
if (test "${with_ofono}" = "yes"); then
773
	AC_DEFINE(WITH_OFONO, 1, [Define if you have oFono support (experimental)])
774
else
775
	AC_DEFINE(WITH_OFONO, 0, [Define if you have oFono support (experimental)])
776 777 778
fi
AM_CONDITIONAL(WITH_OFONO, test "${with_ofono}" = "yes")

779 780 781 782 783 784 785 786 787 788 789 790 791 792 793
# DHCP client support with dhcpcanon
AC_ARG_WITH([dhcpcanon],
            AS_HELP_STRING([--with-dhcpcanon=yes|no|path], [Enable dhcpcanon support (experimental)]))
if test "$with_dhcpcanon" != "no"; then
    with_dhcpcanon_="$with_dhcpcanon"
    AC_PATH_PROGS(with_dhcpcanon, dhcpcanon, no, /sbin:/usr/sbin:/usr/local/sbin:/usr/bin:/usr/local/bin)
    if test "$with_dhcpcanon" == "no"; then
        if test "$with_dhcpcanon_" == yes; then
            AC_MSG_WARN([dhcpcanon not found, assume path /sbin/dhcpcanon])
            with_dhcpcanon=/sbin/dhcpcanon
        fi
    fi
fi
if test "$with_dhcpcanon" != "no"; then
    AC_DEFINE(WITH_DHCPCANON, 1, [Define if you have dhcpcanon])
794
    AC_DEFINE_UNQUOTED(DHCPCANON_PATH, "$with_dhcpcanon", [Define path to dhcpcanon])
795 796 797
else
    AC_DEFINE(WITH_DHCPCANON, 0, [Define if you have dhcpcanon])
fi
798

799 800
# Open vSwitch integration
AC_ARG_ENABLE(ovs, AS_HELP_STRING([--enable-ovs], [enable Open vSwitch support]))
801 802 803 804 805 806 807 808
if test "${enable_ovs}" != "no"; then
	enable_ovs='yes'
	if test "$have_jansson" = "no"; then
		AC_MSG_ERROR(Jansson is required for ovs support)
	fi
fi
AM_CONDITIONAL(WITH_OPENVSWITCH, test "${enable_ovs}" = "yes")

809
# DHCP client support
810
AC_ARG_WITH([dhclient],
811
            AS_HELP_STRING([--with-dhclient=yes|no|path], [Enable dhclient support]))
812 813
if test "$with_dhclient" != "no"; then
	with_dhclient_="$with_dhclient"
814
	AC_PATH_PROGS(with_dhclient, dhclient, no, /sbin:/usr/sbin:/usr/local/sbin)
815 816 817 818 819
	if test "$with_dhclient" == "no"; then
		if test "$with_dhclient_" == yes; then
			AC_MSG_WARN([dhclient not found, assume path /usr/sbin/dhclient])
			with_dhclient=/usr/sbin/dhclient
		fi
820 821
	fi
fi
822 823
if test "$with_dhclient" != "no"; then
	AC_DEFINE(WITH_DHCLIENT, 1, [Define if you have dhclient])
824
	AC_DEFINE_UNQUOTED(DHCLIENT_PATH, "$with_dhclient", [Define path to dhclient])
825 826 827 828
else
	AC_DEFINE(WITH_DHCLIENT, 0, [Define if you have dhclient])
fi

829 830
AC_ARG_WITH([dhcpcd],
            AS_HELP_STRING([--with-dhcpcd=yes|no|path], [Enable dhcpcd 4.x support]))
831 832
if test "$with_dhcpcd" != "no"; then
	with_dhcpcd_="$with_dhcpcd"
833
	AC_PATH_PROGS(with_dhcpcd, dhcpcd, no, /sbin:/usr/sbin:/usr/local/sbin)
834 835 836 837
	if test "$with_dhcpcd" == "no"; then
		if test "$with_dhcpcd_" == yes; then
			AC_MSG_WARN([dhcpcd not found, assume path /usr/sbin/dhcpcd])
			with_dhcpcd=/usr/sbin/dhcpcd
838 839 840 841
		fi
	fi
fi
if test "$with_dhcpcd" != "no"; then
842
	AC_DEFINE(WITH_DHCPCD, 1, [Define if you have dhcpcd])
843
	AC_DEFINE_UNQUOTED(DHCPCD_PATH, "$with_dhcpcd", [Define path to dhcpcd])
844
else
845
	AC_DEFINE(WITH_DHCPCD, 0, [Define if you have dhcpcd])
846 847
fi

848 849
AC_ARG_WITH(config-dhcp-default,
            AS_HELP_STRING([--with-config-dhcp-default=dhclient|dhcpcd|internal],
850
                           [Default configuration option for main.dhcp setting, used as fallback if the configuration option is unset [default=internal]]),
851
            [config_dhcp_default="$withval"], [config_dhcp_default=""])
852 853
if test "$config_dhcp_default" = yes -o "$config_dhcp_default" = no -o -z "$config_dhcp_default"; then
	config_dhcp_default='internal'
854
fi
855 856
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)
857

858 859
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]))
860
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])
861
if test "$config_dns_rc_manager_default" != "" -a \
862
        "$config_dns_rc_manager_default" != file -a \
863
        "$config_dns_rc_manager_default" != symlink -a \
864 865
        "$config_dns_rc_manager_default" != netconfig -a \
        "$config_dns_rc_manager_default" != resolvconf; then
866 867 868
	AC_MSG_WARN([Unknown --with-config-dns-rc-manager-default=$config_dns_rc_manager_default setting.])
	config_dns_rc_manager_default=
fi
869
# Use netconfig by default on SUSE
870
AS_IF([test -z "$with_netconfig" -a -f /etc/SuSE-release], with_netconfig=yes)
871 872 873
# Otherwise default to "no"
AS_IF([test -z "$with_resolvconf"], with_resolvconf=no)
AS_IF([test -z "$with_netconfig"], with_netconfig=no)
874

875
if test "$with_resolvconf" = "yes"; then
876 877 878 879
	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
880
fi
881 882 883
if test "$with_resolvconf" != "no"; then
	AS_IF([test -z "$config_dns_rc_manager_default"], config_dns_rc_manager_default=resolvconf)
fi
884

885
if test "$with_netconfig" = "yes"; then
886 887 888 889
	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
890
fi
891 892 893
if test "$with_netconfig" != "no"; then
	AS_IF([test -z "$config_dns_rc_manager_default"], config_dns_rc_manager_default=netconfig)
fi
894

895
AS_IF([test -z "$config_dns_rc_manager_default"], config_dns_rc_manager_default=symlink)
896

897
if test "$with_resolvconf" != "no"; then
898
	AC_DEFINE_UNQUOTED(RESOLVCONF_PATH, "$with_resolvconf", [Path to resolvconf])
899
fi
900
if test "$with_netconfig" != "no"; then
901
	AC_DEFINE_UNQUOTED(NETCONFIG_PATH, "$with_netconfig", [Path to netconfig])
902
fi
903 904
AC_DEFINE_UNQUOTED(NM_CONFIG_DEFAULT_MAIN_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_MAIN_RC_MANAGER, $config_dns_rc_manager_default)
905

906
# iptables path
907 908
AC_ARG_WITH(iptables,
            AS_HELP_STRING([--with-iptables=/path/to/iptables], [path to iptables]))
909
if test "x${with_iptables}" = x; then
910 911 912 913
	AC_PATH_PROG(IPTABLES_PATH, iptables, [], $PATH:/sbin:/usr/sbin)
	if ! test -x "$IPTABLES_PATH"; then
		AC_MSG_ERROR(iptables was not installed.)
	fi
914
else
915
	IPTABLES_PATH="$with_iptables"
916 917 918 919
fi
AC_DEFINE_UNQUOTED(IPTABLES_PATH, "$IPTABLES_PATH", [Define to path of iptables binary])
AC_SUBST(IPTABLES_PATH)

920
# dnsmasq path
921 922
AC_ARG_WITH(dnsmasq,
            AS_HELP_STRING([--with-dnsmasq=/path/to/dnsmasq], [path to dnsmasq]))
923
if test "x${with_dnsmasq}" = x; then
924
	AC_PATH_PROG(DNSMASQ_PATH, dnsmasq, [], $PATH:/sbin:/usr/sbin)
925
else
926
	DNSMASQ_PATH="$with_dnsmasq"
927 928 929 930
fi
AC_DEFINE_UNQUOTED(DNSMASQ_PATH, "$DNSMASQ_PATH", [Define to path of dnsmasq binary])
AC_SUBST(DNSMASQ_PATH)

931
# dnssec-trigger-script path
932 933
AC_ARG_WITH(dnssec_trigger,
            AS_HELP_STRING([--with-dnssec-trigger=/path/to/dnssec-trigger-script], [path to unbound dnssec-trigger-script]))
934
if test "x${with_dnssec_trigger}" = x; then
935
	AC_PATH_PROG(DNSSEC_TRIGGER_PATH, dnssec-trigger-script, /usr/libexec/dnssec-trigger-script,
936
	             /usr/local/libexec:/usr/local/lib:/usr/local/lib/dnssec-trigger:/usr/libexec:/usr/lib:/usr/lib/dnssec-trigger)
937
else
938
	DNSSEC_TRIGGER_PATH="$with_dnssec_trigger"
939
fi
940 941
AC_DEFINE_UNQUOTED(DNSSEC_TRIGGER_PATH, "$DNSSEC_TRIGGER_PATH", [Define to path of unbound dnssec-trigger-script])
AC_SUBST(DNSSEC_TRIGGER_PATH)
942

943
# system CA certificates path
944
AC_ARG_WITH(system-ca-path,
945
            AS_HELP_STRING([--with-system-ca-path=/path/to/ssl/certs], [path to system CA certificates]))
946
if test "x${with_system_ca_path}" = x; then
947
	SYSTEM_CA_PATH=/etc/ssl/certs
948
else
949
	SYSTEM_CA_PATH="$with_system_ca_path"
950 951 952 953
fi
AC_DEFINE_UNQUOTED(SYSTEM_CA_PATH, "$SYSTEM_CA_PATH", [Define to path to system CA certificates])
AC_SUBST(SYSTEM_CA_PATH)

954
AC_ARG_WITH(kernel-firmware-dir,
955
            AS_HELP_STRING([--with-kernel-firmware-dir=DIR], [where kernel firmware directory is [default=/lib/firmware]]))
956
if test -n "$with_kernel_firmware_dir" ; then
957
	KERNEL_FIRMWARE_DIR="$with_kernel_firmware_dir"
958
else
959
	KERNEL_FIRMWARE_DIR="/lib/firmware"
960 961 962 963
fi
AC_DEFINE_UNQUOTED(KERNEL_FIRMWARE_DIR, "$KERNEL_FIRMWARE_DIR", [Define to path of the kernel firmware directory])
AC_SUBST(KERNEL_FIRMWARE_DIR)

964
PKG_CHECK_MODULES(LIBPSL, [libpsl >= 0.1], [have_libpsl=yes],[have_libpsl=no])
965 966 967
AC_ARG_WITH(libpsl,
            AS_HELP_STRING([--with-libpsl=yes|no], [Link against libpsl]),
            [], [with_libpsl=${have_libpsl}])
968 969 970 971 972 973 974 975 976 977 978
if test "$with_libpsl" != "no"; then
	if test "$have_libpsl" != "yes"; then
		AC_MSG_ERROR(libpsl library not found)
	fi
	with_libpsl='yes'
	AC_DEFINE(WITH_LIBPSL, 1, [Define if you have libpsl])
else
	AC_DEFINE(WITH_LIBPSL, 0, [Define if you have libpsl])
fi
AM_CONDITIONAL(WITH_LIBPSL, test "$with_libpsl" != "no")

979

980 981
AC_ARG_ENABLE(concheck,
              AS_HELP_STRING([--enable-concheck], [enable connectivity checking support]),
982
              [enable_concheck=${enableval}], [enable_concheck=yes])
983
if test "${enable_concheck}" = "yes"; then
984
	PKG_CHECK_MODULES(LIBCURL, [libcurl >= 7.24.0], [have_libcurl=yes], [have_libcurl=no])
985
	if test "$have_libcurl" != "yes"; then
986
		AC_MSG_ERROR(--enable-concheck requires libcurl library.)
987
	fi
988 989
	AC_DEFINE(WITH_CONCHECK, 1, [Define if you want connectivity checking support])
else
990
	enable_concheck=no
991 992 993
	AC_DEFINE(WITH_CONCHECK, 0, [Define if you want connectivity checking support])
fi

994
PKG_CHECK_MODULES(LIBNDP, [libndp])
995

996 997
AC_ARG_WITH(nmcli,
            AS_HELP_STRING([--with-nmcli=yes|no], [Build nmcli]))
998
if test "$with_nmcli" != no; then
999 1000
	AX_LIB_READLINE
	build_nmcli=yes
1001
else
1002
	build_nmcli=no
1003 1004 1005
fi
AM_CONDITIONAL(BUILD_NMCLI, test "$build_nmcli" = yes)

1006 1007
AC_ARG_WITH(nmtui,
            AS_HELP_STRING([--with-nmtui=yes|no], [Build nmtui]))
1008
if test "$with_nmtui" != no; then
1009
	PKG_CHECK_MODULES(NEWT, [libnewt >= 0.52.15], [build_nmtui=yes], [build_nmtui=no])
1010
else
1011
	build_nmtui=no
1012 1013
fi
if test "$with_nmtui" = yes -a "$build_nmtui" = no; then
1014
	AC_MSG_ERROR([You must have libnewt installed to build nmtui.])
1015 1016 1017
fi
AM_CONDITIONAL(BUILD_NMTUI, test "$build_nmtui" = yes)

1018
if test $(( ${NM_MINOR_VERSION} % 2 )) = "1"; then
1019 1020 1021 1022
	# A development version
	more_warnings_default=error
	more_asserts_default=100
	more_logging_default=yes
1023
else
1024 1025 1026 1027
	# A release version
	more_warnings_default=yes
	more_asserts_default=0
	more_logging_default=no
1028
fi
1029

1030
NM_COMPILER_WARNINGS(AM_CFLAGS, ${more_warnings_default})
1031

1032 1033 1034
NM_COMPILER_FLAG(LIBSYSTEMD_NM_CFLAGS, "-Wno-gnu-variable-sized-type-not-at-end")
AC_SUBST(LIBSYSTEMD_NM_CFLAGS)

1035 1036 1037
CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
	-fno-strict-aliasing \
])
1038
AM_CFLAGS="$AM_CFLAGS $with_cflags"
1039

1040
AC_ARG_ENABLE(more-asserts,
1041
              AS_HELP_STRING([--enable-more-asserts],
1042
                             [Enable more assertions for debugging [default=auto]. Deprecated option. Use --with-more-asserts=level]))
1043
if test "${enable_more_asserts}" = "yes"; then
1044
	more_asserts=100
1045 1046
fi
AC_ARG_WITH(more-asserts,
1047
            AS_HELP_STRING([--with-more-asserts=level], [Enable more assertions for debugging (0 = none, 100 = all) [default=auto]]),
1048 1049 1050
            [more_asserts=${with_more_asserts}],
            [])
if test "${more_asserts}" = "no"; then
1051
	more_asserts=0
1052
else
1053 1054 1055
	if test "${more_asserts}" = "yes"; then
		more_asserts=100
	fi
1056
fi
1057
if test "${more_asserts}" = ""; then
1058
	more_asserts=${more_asserts_default}
1059
fi
1060
AC_DEFINE_UNQUOTED(NM_MORE_ASSERTS, $more_asserts, [Define if more asserts are enabled])
1061

1062
AC_ARG_ENABLE(more-logging, AS_HELP_STRING([--enable-more-logging], [Enable more debug logging [default=auto]]))
1063
if test "${enable_more_logging}" = ""; then
1064
	enable_more_logging=${more_logging_default}
1065
fi
1066
if test "${enable_more_logging}" = "yes"; then
1067
	AC_DEFINE(NM_MORE_LOGGING, [1], [Define if more debug logging is enabled])
1068 1069
else
	AC_DEFINE(NM_MORE_LOGGING, [0], [Define if more debug logging is enabled])
1070 1071
fi

1072 1073
NM_LTO
NM_LD_GC
1074

1075
AC_ARG_WITH(address-sanitizer,
1076
            AS_HELP_STRING([--with-address-sanitizer=yes|no|exec], [Enable address sanitizer [default=no]]))
1077
if test "$with_address_sanitizer" = yes -o "$with_address_sanitizer" = "exec"; then
1078 1079 1080 1081
	CC_CHECK_FLAGS_APPEND([asan_cflags], [CFLAGS], [-fsanitize=address])
	AS_IF([test -z "$asan_cflags"],
		[AC_MSG_ERROR([*** -fsanitize=address is not supported])])

1082 1083
	sanitizer_exec_cflags="$sanitizer_exec_cflags -fsanitize=address"
	sanitizer_exec_ldflags="$sanitizer_exec_ldflags -Wc,-fsanitize=address"
1084
	AC_DEFINE(ASAN_BUILD, 1, [Whether NM is built with address sanitizer])
1085 1086 1087 1088 1089 1090 1091 1092 1093

	if test "$with_address_sanitizer" = "yes"; then
		sanitizer_lib_cflags="$sanitizer_lib_cflags -fsanitize=address"
		sanitizer_lib_ldflags="$sanitizer_lib_ldflags -Wc,-fsanitize=address"
		sanitizers="${sanitizers}address "
		asan_options="ASAN_OPTIONS=detect_leaks=0"
	else
		sanitizers="${sanitizers}address(executables-only) "
	fi
1094 1095
fi

1096 1097
AC_ARG_ENABLE(undefined-sanitizer,
              AS_HELP_STRING([--enable-undefined-sanitizer],
1098
                             [Compile with undefined behavior sanitizer [default=no]]))
1099 1100 1101
if (test "${enable_undefined_sanitizer}" = "yes"); then
	CC_CHECK_FLAGS_APPEND([ubsan_cflags], [CFLAGS], [-fsanitize=undefined])
	AS_IF([test -z "$ubsan_cflags"],
1102
	      [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])])
1103

1104 1105 1106 1107 1108
	sanitizer_exec_cflags="$sanitizer_exec_cflags -fsanitize=undefined"
	sanitizer_lib_cflags="$sanitizer_lib_cflags -fsanitize=undefined"
	sanitizer_exec_ldflags="$sanitizer_exec_ldflags -Wc,-fsanitize=undefined"
	sanitizer_lib_ldflags="$sanitizer_lib_ldflags -Wc,-fsanitize=undefined"
	sanitizers="${sanitizers}undefined-behavior "
1109 1110 1111 1112
fi

if test -n "$sanitizers"; then
	sanitizers="${sanitizers% }"
1113 1114 1115 1116 1117
	AC_SUBST(SANITIZER_ENV, ["$asan_options"])
	AC_SUBST(SANITIZER_EXEC_CFLAGS, ["$sanitizer_exec_cflags -DVALGRIND=1 -fno-omit-frame-pointer"])
	AC_SUBST(SANITIZER_LIB_CFLAGS, ["$sanitizer_lib_cflags -DVALGRIND=1 -fno-omit-frame-pointer"])
	AC_SUBST(SANITIZER_EXEC_LDFLAGS, [$sanitizer_exec_ldflags])
	AC_SUBST(SANITIZER_LIB_LDFLAGS, [$sanitizer_lib_ldflags])
1118 1119
fi

1120
AC_MSG_CHECKING([CC support C11 _Generic()])
1121 1122
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int foo(void); int foo() { int a = 0; int b = _Generic (a, int: 4); return b + a; }]],
                                  [[foo();]])],
1123 1124 1125 1126 1127 1128
                  [cc_support_generic=1],
                  [cc_support_generic=0])
AC_MSG_RESULT($cc_support_generic)
AC_DEFINE_UNQUOTED(_NM_CC_SUPPORT_GENERIC, $cc_support_generic, [Define whether the compiler supports C11 _Generic()])

AC_MSG_CHECKING([CC support gcc __auto_type])
1129 1130
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int foo(void); int foo() { int a = 0; __auto_type b = a; return b + a; }]],
                                  [[foo();]])],
1131 1132 1133 1134 1135
                  [cc_support_auto_type=1],
                  [cc_support_auto_type=0])
AC_MSG_RESULT($cc_support_auto_type)
AC_DEFINE_UNQUOTED(_NM_CC_SUPPORT_AUTO_TYPE, $cc_support_auto_type, [Define whether the compiler support gcc __auto_type])

1136 1137 1138 1139
dnl -------------------------
dnl Vala bindings
dnl -------------------------

1140
VAPIGEN_CHECK(0.17.1.24)
1141
AC_CONFIG_COMMANDS([vapi], [$MKDIR_P vapi])
1142

1143
# Tests, utilities and documentation
1144
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests=root|yes|no], [Build NetworkManager tests [default=yes]]))
1145
AC_ARG_WITH(valgrind,
1146
            AS_HELP_STRING([--with-valgrind=yes|no|path], [Use valgrind to memory-check the tests [default=no]]))
1147
# Fallback to --with-tests
1148 1149
AC_ARG_WITH(tests,
            AS_HELP_STRING([--with-tests], [Build NetworkManager tests (deprecated)]))
1150
AS_IF([test -n "$with_tests"], enable_tests="$with_tests")
1151
# Default to --enable-tests --with-valgrind=no
1152
AS_IF([test -z "$enable_tests"], enable_tests="yes")
1153
AS_IF([test -z "$with_valgrind"], with_valgrind="no")
1154
# Normalize values
1155
AS_IF([test "$enable_tests" != "yes" -a "$enable_tests" != "root"], enable_tests="no")
1156 1157
# Search for tools
AS_IF([test "$with_valgrind" == "yes"],
1158
      [AC_PATH_PROGS(with_valgrind, valgrind, no)])
1159
# Add conditionals and substitutions
1160
AM_CONDITIONAL(ENABLE_TESTS, test "$enable_tests" != "no")
1161
AM_CONDITIONAL(REQUIRE_ROOT_TESTS, test "$enable_tests" == "root")
1162 1163
AC_ARG_WITH(valgrind-suppressions,
            AS_HELP_STRING([--with-valgrind-suppressions=path], [Use specific valgrind suppression file]))
1164 1165 1166 1167 1168 1169 1170
if test "$with_valgrind" == no; then
	with_valgrind_suppressions=
else
	if test  "$with_valgrind_suppressions" == ""; then
		with_valgrind_suppressions='$(top_srcdir)/valgrind.suppressions'
	fi
fi
1171
AC_SUBST(NM_LOG_COMPILER, 'LOG_COMPILER = "$(top_srcdir)/tools/run-nm-test.sh" --called-from-make "$(abs_top_builddir)" "$(LIBTOOL)" "$(with_valgrind)" "'"$with_valgrind_suppressions"'" --launch-dbus=auto')
1172

1173 1174 1175 1176
AM_PATH_PYTHON([], [], [PYTHON=python])
AC_SUBST(PYTHON, [$PYTHON])
AC_DEFINE_UNQUOTED(TEST_NM_PYTHON, "$PYTHON", [Define python path for test binary])

1177
GTK_DOC_CHECK(1.0)
1178

1179
# check if we can build setting property documentation
1180
build_docs=no
1181
if test -n "$INTROSPECTION_MAKEFILE"; then
1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199
	# If g-i is installed we know we have python, but we might not have pygobject
	if ! "$PYTHON" -c 'from gi.repository import GObject' >& /dev/null; then
		AC_MSG_ERROR(["--enable-introspection aims to build the settings documentation. This requires GObject introspection for python (pygobject)])
	fi

	AC_PATH_PROG(PERL, perl)
	if test -z "$PERL"; then
		AC_MSG_ERROR([--enable-introspection requires perl])
	fi
	AC_PATH_PROG(XSLTPROC, xsltproc)
	if test -z "$XSLTPROC"; then
		AC_MSG_ERROR([--enable-introspection requires xsltproc])
	fi

	have_introspection=yes
	if test "$enable_gtk_doc" = "yes"; then
		build_docs=yes
	fi
1200
else
1201 1202 1203
	if test "$enable_gtk_doc" = "yes"; then
		# large parts of the documentation require introspection/pygobject to extract
		# the documentation out of the source files. You cannot enable gtk-doc without alone.
1204
		AC_MSG_ERROR(["--enable-gtk-doc requires --enable-introspection"])
1205 1206
	fi
	have_introspection=no
1207 1208
fi

1209 1210
# check for pregenerated manpages and documentation to be installed
use_pregen_docs=no
1211
if test "$build_docs" != "yes" -a \
1212 1213 1214 1215 1216 1217
        -f "$srcdir"/man/NetworkManager.8 -a \
        -f "$srcdir"/man/NetworkManager.conf.5 -a \
        -f "$srcdir"/man/nm-online.1 -a \
        -f "$srcdir"/man/nmcli-examples.7 -a \
        -f "$srcdir"/man/nmcli.1 -a \
        -f "$srcdir"/man/nmtui.1 -a \
1218
        \
1219 1220
        -f "$srcdir"/man/nm-openvswitch.7 -a \
        \
1221 1222 1223
        -f "$srcdir"/man/nm-settings-ifcfg-rh.5 -a \
        -f "$srcdir"/man/nm-settings-keyfile.5 -a \
        -f "$srcdir"/man/nm-settings.5 -a \
1224
        \
1225 1226 1227
        -f "$srcdir"/man/nm-settings.xml -a \
        -f "$srcdir"/man/nm-settings-keyfile.xml -a \
        -f "$srcdir"/man/nm-settings-ifcfg-rh.xml -a \
1228
        \
1229
        -f "$srcdir"/docs/api/settings-spec.xml; then
1230
	use_pregen_docs=yes
1231 1232
fi

1233 1234
AM_CONDITIONAL(BUILD_DOCS, test "$build_docs" = "yes")
AM_CONDITIONAL(HAVE_DOCS, test "$build_docs" = "yes" -o "$use_pregen_docs" = "yes")
1235
AC_SUBST(AM_CFLAGS)
1236

1237
AC_CONFIG_FILES([
Dan Williams's avatar
Dan Williams committed
1238
Makefile
1239
shared/nm-version-macros.h
1240
libnm/libnm.pc
1241
po/Makefile.in
1242
data/org.freedesktop.NetworkManager.policy.in
1243 1244
docs/api/Makefile
docs/api/version.xml
1245 1246
docs/libnm/Makefile
docs/libnm/version.xml
1247
NetworkManager.pc
Dan Williams's avatar
Dan Williams committed
1248
])
1249
AC_OUTPUT
1250

1251 1252
# Print build configuration
echo
1253 1254 1255
echo "System paths:"
echo "  prefix: $prefix"
echo "  exec_prefix: $exec_prefix"
1256 1257 1258 1259
echo "  sysconfdir: $sysconfdir"
echo "  localstatedir: $localstatedir"
echo "  runstatedir: $runstatedir"
echo "  datadir: $datadir"
1260
echo "  systemdunitdir: $with_systemdsystemunitdir"
1261 1262
echo "  nmbinary: $nmbinary"
echo "  nmconfdir: $nmconfdir"