4 AC_CONFIG_MACRO_DIR([m4])
6 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
7 AC_CONFIG_HEADERS([config.h])
9 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
13 AC_PREFIX_DEFAULT(/usr/local)
19 AC_SUBST(abs_top_srcdir)
20 AC_SUBST(abs_top_builddir)
30 m4_define([_LT_AC_TAGCONFIG], [])
31 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
38 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
39 [disable code optimization through compiler]), [
40 if (test "${enableval}" = "no"); then
41 CFLAGS="$CFLAGS -O0 -U_FORTIFY_SOURCE"
45 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
46 [enable compiling with debugging information]), [
47 if (test "${enableval}" = "yes" &&
48 test "${ac_cv_prog_cc_g}" = "yes"); then
53 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
54 [enable position independent executables flag]), [
55 if (test "${enableval}" = "yes" &&
56 test "${ac_cv_prog_cc_pie}" = "yes"); then
57 CFLAGS="$CFLAGS -fPIE"
58 LDFLAGS="$LDFLAGS -pie"
62 AC_ARG_ENABLE(hh2serial-gps,
63 AC_HELP_STRING([--enable-hh2serial-gps], [enable hh2serial GPS support]),
64 [enable_hh2serial_gps=${enableval}], [enable_hh2serial_gps="no"])
65 AM_CONDITIONAL(HH2SERIAL_GPS, test "${enable_hh2serial_gps}" != "no")
66 AM_CONDITIONAL(HH2SERIAL_GPS_BUILTIN, test "${enable_hh2serial_gps}" = "builtin")
68 AC_ARG_ENABLE(telephony,
69 AC_HELP_STRING([--enable-telephony], [enable Telephony support]),
70 [enable_telephony=${enableval}], [enable_telephony="yes"])
71 AM_CONDITIONAL(TELEPHONY, test "${enable_telephony}" != "no")
72 AM_CONDITIONAL(TELEPHONY_BUILTIN, test "${enable_telephony}" = "builtin")
74 AC_ARG_ENABLE(tizen-ext,
75 AC_HELP_STRING([--enable-tizen-ext], [enable TIZEN extensions]),
76 [if (test "${enableval}" = "yes"); then
77 CFLAGS="$CFLAGS -DTIZEN_EXT"
80 AM_CONDITIONAL(TIZEN_EXT, test "${enable-tizen-ext}" != "no")
82 AC_ARG_ENABLE(tizen-ext-wifi-mesh,
83 AC_HELP_STRING([--enable-tizen-ext-wifi-mesh], [enable TIZEN extensions for Wi-Fi Mesh]),
84 [CFLAGS="$CFLAGS -DTIZEN_EXT_WIFI_MESH"], [enable_tizen_ext_wifi_mesh="no"])
85 AM_CONDITIONAL(TIZEN_EXT_WIFI_MESH, test "${enable_tizen_ext_wifi_mesh}" != "no")
87 AC_ARG_ENABLE(tizen-maintain-online,
88 AC_HELP_STRING([--enable-tizen-maintain-online], [enable TIZEN extensions]),
89 [if (test "${enableval}" = "yes"); then
90 CFLAGS="$CFLAGS -DTIZEN_MAINTAIN_ONLINE"
94 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
95 [specify location of openconnect binary]), [path_openconnect=${withval}])
97 AC_ARG_ENABLE(openconnect,
98 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
99 [enable_openconnect=${enableval}], [enable_openconnect="no"])
100 if (test "${enable_openconnect}" != "no"); then
101 if (test -z "${path_openconnect}"); then
102 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/bin:/usr/bin)
103 if (test -z "${OPENCONNECT}"); then
104 AC_MSG_ERROR(openconnect binary not found)
107 OPENCONNECT="${path_openconnect}"
108 AC_SUBST(OPENCONNECT)
111 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
112 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
114 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
115 [specify location of openvpn binary]), [path_openvpn=${withval}])
117 AC_ARG_ENABLE(openvpn,
118 AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
119 [enable_openvpn=${enableval}], [enable_openvpn="no"])
120 if (test "${enable_openvpn}" != "no"); then
121 if (test -z "${path_openvpn}"); then
122 AC_PATH_PROG(OPENVPN, [openvpn], [/usr/bin/openvpn], $PATH:/bin:/usr/bin)
123 if (test -z "${OPENVPN}"); then
124 AC_MSG_ERROR(openvpn binary not found)
127 OPENVPN="${path_openvpn}"
131 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
132 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
134 AC_ARG_WITH(ipsec, AC_HELP_STRING([--with-ipsec=PROGRAM],
135 [specify location of ipsec binary]), [path_ipsec=${withval}])
138 AC_HELP_STRING([--enable-ipsec], [enable ipsec support]),
139 [enable_ipsec=${enableval}], [enable_ipsec="no"])
140 if (test "${enable_ipsec}" != "no"); then
141 PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.28, dummy=yes,
142 AC_MSG_ERROR(GIO >= 2.28 is required))
145 if (test -z "${path_ipsec}"); then
146 AC_PATH_PROG(IPSEC, [charon], [/usr/bin/charon], $PATH:/usr/bin)
147 if (test -z "${IPSEC}"); then
148 AC_MSG_ERROR(ipsec binary not found)
151 IPSEC="${path_ipsec}"
155 AM_CONDITIONAL(IPSEC, test "${enable_ipsec}" != "no")
156 AM_CONDITIONAL(IPSEC_BUILTIN, test "${enable_ipsec}" = "builtin")
158 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
159 [specify location of vpnc binary]), [path_vpnc=${withval}])
162 AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
163 [enable_vpnc=${enableval}], [enable_vpnc="no"])
164 if (test "${enable_vpnc}" != "no"); then
165 if (test -z "${path_vpnc}"); then
166 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/bin:/usr/bin)
167 if (test -z "${VPNC}"); then
168 AC_MSG_ERROR(vpnc binary not found)
175 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
176 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
178 AC_ARG_WITH(l2tp, AC_HELP_STRING([--with-l2tp=PROGRAM],
179 [specify location of l2tp binary]), [path_l2tp=${withval}])
182 AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
183 [enable_l2tp=${enableval}], [enable_l2tp="no"])
184 if (test "${enable_l2tp}" != "no"); then
185 if (test -z "${path_pppd}"); then
186 AC_PATH_PROG(PPPD, [pppd], [/usr/bin/pppd], $PATH:/bin:/usr/bin)
191 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
192 AC_MSG_ERROR(ppp header files are required))
193 if (test -z "${path_l2tp}"); then
194 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/bin/xl2tpd], $PATH:/bin:/usr/bin)
200 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
201 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
203 AC_ARG_WITH(pptp, AC_HELP_STRING([--with-pptp=PROGRAM],
204 [specify location of pptp binary]), [path_pptp=${withval}])
207 AC_HELP_STRING([--enable-pptp], [enable pptp support]),
208 [enable_pptp=${enableval}], [enable_pptp="no"])
209 if (test "${enable_pptp}" != "no"); then
210 if (test -z "${path_pppd}"); then
211 AC_PATH_PROG(PPPD, [pppd], [/usr/bin/pppd], $PATH:/bin:/usr/bin)
216 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
217 AC_MSG_ERROR(ppp header files are required))
218 if (test -z "${path_pptp}"); then
219 AC_PATH_PROG(PPTP, [pptp], [/usr/bin/pptp], $PATH:/bin:/usr/bin)
225 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
226 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
228 AC_CHECK_HEADERS(resolv.h, dummy=yes,
229 AC_MSG_ERROR(resolver header files are required))
230 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
231 AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
232 AC_MSG_ERROR(resolver library support is required))
235 AC_CHECK_FUNC(signalfd, dummy=yes,
236 AC_MSG_ERROR(signalfd support is required))
238 AC_CHECK_LIB(dl, dlopen, dummy=yes,
239 AC_MSG_ERROR(dynamic linking loader is required))
241 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
242 [enable Intel OSPM support]), [enable_iospm=${enableval}])
243 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
246 AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
247 [enable_tist=${enableval}], [enable_tist="no"])
248 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
249 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
251 AC_ARG_ENABLE(session-policy-local,
252 AC_HELP_STRING([--enable-session-policy-local], [enable local file Session policy configuration support]),
253 [enable_session_policy_local=${enableval}], [enable_session_policy_local="no"])
254 AM_CONDITIONAL(SESSION_POLICY_LOCAL, test "${enable_session_policy_local}" != "no")
255 AM_CONDITIONAL(SESSION_POLICY_LOCAL_BUILTIN, test "${enable_session_policy_local}" = "builtin")
257 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
258 [Maximal size of a statistics round robin file]),
259 [stats_max_file_size=${withval}])
261 if (test -z "${stats_max_file_size}"); then
262 # default size is 16 kByte
263 stats_max_file_size="16 * 8 * 128"
266 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
268 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
269 AC_MSG_ERROR(GLib >= 2.28 is required))
270 AC_SUBST(GLIB_CFLAGS)
273 PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd-daemon, dummy=yes,
274 AC_MSG_ERROR(libsystemd-daemon library is required))
275 AC_SUBST(LIBSYSTEMD_CFLAGS)
276 AC_SUBST(LIBSYSTEMD_LIBS)
278 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
279 AC_MSG_ERROR(D-Bus >= 1.4 is required))
280 AC_SUBST(DBUS_CFLAGS)
283 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
284 [path to D-Bus config directory]), [path_dbusconf=${withval}],
285 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
286 if (test -z "${path_dbusconf}"); then
287 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
289 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
291 AC_SUBST(DBUS_CONFDIR)
293 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
294 [path to D-Bus data directory]), [path_dbusdata=${withval}],
295 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
296 if (test -z "${path_dbusdata}"); then
297 DBUS_DATADIR="${datadir}/dbus-1/system-services"
299 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
301 AC_SUBST(DBUS_DATADIR)
303 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
304 [path to systemd service directory]), [path_systemdunit=${withval}],
305 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
306 if (test -n "${path_systemdunit}"); then
307 SYSTEMD_UNITDIR="${path_systemdunit}"
308 AC_SUBST(SYSTEMD_UNITDIR)
310 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
312 AC_ARG_WITH(firewall, AC_HELP_STRING([--with-firewall=TYPE],
313 [specify which firewall type is used iptables or nftables [default=iptables]]),
314 [firewall_type=${withval}],
315 [firewall_type="iptables"])
317 if (test "${firewall_type}" != "iptables" -a \
318 "${firewall_type}" != "nftables"); then
319 AC_MSG_ERROR(neither nftables nor iptables support enabled)
323 if (test "${firewall_type}" = "iptables"); then
324 PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, [found_iptables="yes"],
325 AC_MSG_ERROR(Xtables library is required))
326 AC_SUBST(XTABLES_CFLAGS)
327 AC_SUBST(XTABLES_LIBS)
329 AM_CONDITIONAL(XTABLES, test "${found_iptables}" != "no")
332 if (test "${firewall_type}" = "nftables"); then
333 PKG_CHECK_MODULES(NFTABLES, [libnftnl >= 1.0.4 libmnl >= 1.0.0], [found_nftables="yes"],
334 AC_MSG_ERROR([libnftnl >= 1.0.4 or libmnl >= 1.0.0 not found]))
335 AC_SUBST(NFTABLES_CFLAGS)
336 AC_SUBST(NFTABLES_LIBS)
338 AM_CONDITIONAL(NFTABLES, test "${found_nftables}" != "no")
340 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
341 [enable test/example scripts]), [enable_test=${enableval}])
342 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
344 AC_ARG_ENABLE(nmcompat, AC_HELP_STRING([--enable-nmcompat],
345 [enable Network Manager support]),
346 [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
347 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
349 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
350 [enable PolicyKit support]),
351 [enable_polkit=${enableval}], [enable_polkit="no"])
352 if (test "${enable_polkit}" != "no"); then
353 POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
355 if (test -z "${POLKIT_DATADIR}"); then
356 POLKIT_DATADIR="${datadir}/polkit-1/actions"
358 AC_SUBST(POLKIT_DATADIR)
360 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
362 AC_ARG_ENABLE(selinux, AC_HELP_STRING([--enable-selinux],
363 [enable selinux support]),
364 [enable_selinux=${enableval}], [enable_selinux="no"])
365 AM_CONDITIONAL(SELINUX, test "${enable_selinux}" != "no")
367 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--disable-loopback],
368 [disable loopback support]),
369 [enable_loopback=${enableval}])
370 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
372 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
373 [disable Ethernet support]),
374 [enable_ethernet=${enableval}])
375 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
377 AC_ARG_ENABLE(gadget, AC_HELP_STRING([--disable-gadget],
378 [disable USB Gadget support]),
379 [enable_gadget=${enableval}])
380 AM_CONDITIONAL(GADGET, test "${enable_gadget}" != "no")
382 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
383 [disable WiFi support]),
384 [enable_wifi=${enableval}])
385 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
387 AC_ARG_ENABLE(iwd, AC_HELP_STRING([--enable-iwd],
388 [enable iwd support]),
389 [enable_iwd=${enableval}])
390 AM_CONDITIONAL(IWD, test "${enable_iwd}" = "yes")
392 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
393 [disable Bluetooth support]),
394 [enable_bluetooth=${enableval}])
395 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
397 AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
398 [disable oFono support]),
399 [enable_ofono=${enableval}])
400 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
402 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--disable-dundee],
403 [disable dundee support (Bluetooth DUN)]),
404 [enable_dundee=${enableval}])
405 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
407 AC_ARG_ENABLE(pacrunner, AC_HELP_STRING([--disable-pacrunner],
408 [disable PACrunner support]),
409 [enable_pacrunner=${enableval}])
410 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
412 AC_ARG_ENABLE(neard, AC_HELP_STRING([--disable-neard],
413 [disable Neard support]),
414 [enable_neard=${enableval}])
415 AM_CONDITIONAL(NEARD, test "${enable_neard}" != "no")
417 AC_ARG_ENABLE(wispr, AC_HELP_STRING([--disable-wispr],
418 [disable WISPr support]),
419 [enable_wispr=${enableval}])
420 AM_CONDITIONAL(WISPR, test "${enable_wispr}" != "no")
422 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
423 [disable testing tools]),
424 [enable_tools=${enableval}])
425 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
427 if (test "${enable_tools}" != "no"); then
428 AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
430 IPTABLES_SAVE=$ac_cv_path_IPTABLES_SAVE
434 AC_SUBST(IPTABLES_SAVE)
436 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
437 [disable command line client]),
438 [enable_client=${enableval}])
439 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
441 if (test "${enable_wispr}" != "no"); then
442 PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
443 AC_MSG_ERROR(GnuTLS library is required))
448 AC_SUBST(GNUTLS_CFLAGS)
449 AC_SUBST(GNUTLS_LIBS)
451 if (test "${enable_loopback}" != "no"); then
452 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
453 AC_MSG_ERROR(inotify header files are required))
455 AC_CHECK_LIB(c, inotify_init, dummy=yes,
456 AC_MSG_ERROR(inotify library support is required))
459 if (test "${enable_wifi}" != "no"); then
460 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
464 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
465 [don't install configuration and data files]),
466 [enable_datafiles=${enableval}])
467 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
469 if (test "${enable_client}" != "no"); then
470 AC_CHECK_HEADERS(readline/readline.h, dummy=yes,
471 AC_MSG_ERROR(readline header files are required))
474 AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
475 "${enable_openvpn}" != "no" -o \
476 "${enable_ipsec}" != "no" -o \
477 "${enable_vpnc}" != "no" -o \
478 "${enable_l2tp}" != "no" -o \
479 "${enable_pptp}" != "no")
481 AC_OUTPUT(Makefile include/version.h connman.pc src/connman.service src/connman_tv.service vpn/connman-vpn.service)