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_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
88 [specify location of openconnect binary]), [path_openconnect=${withval}])
90 AC_ARG_ENABLE(openconnect,
91 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
92 [enable_openconnect=${enableval}], [enable_openconnect="no"])
93 if (test "${enable_openconnect}" != "no"); then
94 if (test -z "${path_openconnect}"); then
95 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/bin:/usr/bin)
96 if (test -z "${OPENCONNECT}"); then
97 AC_MSG_ERROR(openconnect binary not found)
100 OPENCONNECT="${path_openconnect}"
101 AC_SUBST(OPENCONNECT)
104 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
105 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
107 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
108 [specify location of openvpn binary]), [path_openvpn=${withval}])
110 AC_ARG_ENABLE(openvpn,
111 AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
112 [enable_openvpn=${enableval}], [enable_openvpn="no"])
113 if (test "${enable_openvpn}" != "no"); then
114 if (test -z "${path_openvpn}"); then
115 AC_PATH_PROG(OPENVPN, [openvpn], [/usr/bin/openvpn], $PATH:/bin:/usr/bin)
116 if (test -z "${OPENVPN}"); then
117 AC_MSG_ERROR(openvpn binary not found)
120 OPENVPN="${path_openvpn}"
124 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
125 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
127 AC_ARG_WITH(ipsec, AC_HELP_STRING([--with-ipsec=PROGRAM],
128 [specify location of ipsec binary]), [path_ipsec=${withval}])
131 AC_HELP_STRING([--enable-ipsec], [enable ipsec support]),
132 [enable_ipsec=${enableval}], [enable_ipsec="no"])
133 if (test "${enable_ipsec}" != "no"); then
134 PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.28, dummy=yes,
135 AC_MSG_ERROR(GIO >= 2.28 is required))
138 if (test -z "${path_ipsec}"); then
139 AC_PATH_PROG(IPSEC, [charon], [/usr/bin/charon], $PATH:/usr/bin)
140 if (test -z "${IPSEC}"); then
141 AC_MSG_ERROR(ipsec binary not found)
144 IPSEC="${path_ipsec}"
148 AM_CONDITIONAL(IPSEC, test "${enable_ipsec}" != "no")
149 AM_CONDITIONAL(IPSEC_BUILTIN, test "${enable_ipsec}" = "builtin")
151 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
152 [specify location of vpnc binary]), [path_vpnc=${withval}])
155 AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
156 [enable_vpnc=${enableval}], [enable_vpnc="no"])
157 if (test "${enable_vpnc}" != "no"); then
158 if (test -z "${path_vpnc}"); then
159 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/bin:/usr/bin)
160 if (test -z "${VPNC}"); then
161 AC_MSG_ERROR(vpnc binary not found)
168 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
169 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
171 AC_ARG_WITH(l2tp, AC_HELP_STRING([--with-l2tp=PROGRAM],
172 [specify location of l2tp binary]), [path_l2tp=${withval}])
175 AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
176 [enable_l2tp=${enableval}], [enable_l2tp="no"])
177 if (test "${enable_l2tp}" != "no"); then
178 if (test -z "${path_pppd}"); then
179 AC_PATH_PROG(PPPD, [pppd], [/usr/bin/pppd], $PATH:/bin:/usr/bin)
184 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
185 AC_MSG_ERROR(ppp header files are required))
186 if (test -z "${path_l2tp}"); then
187 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/bin/xl2tpd], $PATH:/bin:/usr/bin)
193 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
194 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
196 AC_ARG_WITH(pptp, AC_HELP_STRING([--with-pptp=PROGRAM],
197 [specify location of pptp binary]), [path_pptp=${withval}])
200 AC_HELP_STRING([--enable-pptp], [enable pptp support]),
201 [enable_pptp=${enableval}], [enable_pptp="no"])
202 if (test "${enable_pptp}" != "no"); then
203 if (test -z "${path_pppd}"); then
204 AC_PATH_PROG(PPPD, [pppd], [/usr/bin/pppd], $PATH:/bin:/usr/bin)
209 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
210 AC_MSG_ERROR(ppp header files are required))
211 if (test -z "${path_pptp}"); then
212 AC_PATH_PROG(PPTP, [pptp], [/usr/bin/pptp], $PATH:/bin:/usr/bin)
218 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
219 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
221 AC_CHECK_HEADERS(resolv.h, dummy=yes,
222 AC_MSG_ERROR(resolver header files are required))
223 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
224 AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
225 AC_MSG_ERROR(resolver library support is required))
228 AC_CHECK_FUNC(signalfd, dummy=yes,
229 AC_MSG_ERROR(signalfd support is required))
231 AC_CHECK_LIB(dl, dlopen, dummy=yes,
232 AC_MSG_ERROR(dynamic linking loader is required))
234 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
235 [enable Intel OSPM support]), [enable_iospm=${enableval}])
236 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
239 AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
240 [enable_tist=${enableval}], [enable_tist="no"])
241 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
242 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
244 AC_ARG_ENABLE(session-policy-local,
245 AC_HELP_STRING([--enable-session-policy-local], [enable local file Session policy configuration support]),
246 [enable_session_policy_local=${enableval}], [enable_session_policy_local="no"])
247 AM_CONDITIONAL(SESSION_POLICY_LOCAL, test "${enable_session_policy_local}" != "no")
248 AM_CONDITIONAL(SESSION_POLICY_LOCAL_BUILTIN, test "${enable_session_policy_local}" = "builtin")
250 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
251 [Maximal size of a statistics round robin file]),
252 [stats_max_file_size=${withval}])
254 if (test -z "${stats_max_file_size}"); then
255 # default size is 16 kByte
256 stats_max_file_size="16 * 8 * 128"
259 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
261 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
262 AC_MSG_ERROR(GLib >= 2.28 is required))
263 AC_SUBST(GLIB_CFLAGS)
266 PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd-daemon, dummy=yes,
267 AC_MSG_ERROR(libsystemd-daemon library is required))
268 AC_SUBST(LIBSYSTEMD_CFLAGS)
269 AC_SUBST(LIBSYSTEMD_LIBS)
271 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
272 AC_MSG_ERROR(D-Bus >= 1.4 is required))
273 AC_SUBST(DBUS_CFLAGS)
276 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
277 [path to D-Bus config directory]), [path_dbusconf=${withval}],
278 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
279 if (test -z "${path_dbusconf}"); then
280 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
282 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
284 AC_SUBST(DBUS_CONFDIR)
286 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
287 [path to D-Bus data directory]), [path_dbusdata=${withval}],
288 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
289 if (test -z "${path_dbusdata}"); then
290 DBUS_DATADIR="${datadir}/dbus-1/system-services"
292 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
294 AC_SUBST(DBUS_DATADIR)
296 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
297 [path to systemd service directory]), [path_systemdunit=${withval}],
298 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
299 if (test -n "${path_systemdunit}"); then
300 SYSTEMD_UNITDIR="${path_systemdunit}"
301 AC_SUBST(SYSTEMD_UNITDIR)
303 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
305 AC_ARG_WITH(firewall, AC_HELP_STRING([--with-firewall=TYPE],
306 [specify which firewall type is used iptables or nftables [default=iptables]]),
307 [firewall_type=${withval}],
308 [firewall_type="iptables"])
310 if (test "${firewall_type}" != "iptables" -a \
311 "${firewall_type}" != "nftables"); then
312 AC_MSG_ERROR(neither nftables nor iptables support enabled)
316 if (test "${firewall_type}" = "iptables"); then
317 PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, [found_iptables="yes"],
318 AC_MSG_ERROR(Xtables library is required))
319 AC_SUBST(XTABLES_CFLAGS)
320 AC_SUBST(XTABLES_LIBS)
322 AM_CONDITIONAL(XTABLES, test "${found_iptables}" != "no")
325 if (test "${firewall_type}" = "nftables"); then
326 PKG_CHECK_MODULES(NFTABLES, [libnftnl >= 1.0.4 libmnl >= 1.0.0], [found_nftables="yes"],
327 AC_MSG_ERROR([libnftnl >= 1.0.4 or libmnl >= 1.0.0 not found]))
328 AC_SUBST(NFTABLES_CFLAGS)
329 AC_SUBST(NFTABLES_LIBS)
331 AM_CONDITIONAL(NFTABLES, test "${found_nftables}" != "no")
333 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
334 [enable test/example scripts]), [enable_test=${enableval}])
335 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
337 AC_ARG_ENABLE(nmcompat, AC_HELP_STRING([--enable-nmcompat],
338 [enable Network Manager support]),
339 [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
340 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
342 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
343 [enable PolicyKit support]),
344 [enable_polkit=${enableval}], [enable_polkit="no"])
345 if (test "${enable_polkit}" != "no"); then
346 POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
348 if (test -z "${POLKIT_DATADIR}"); then
349 POLKIT_DATADIR="${datadir}/polkit-1/actions"
351 AC_SUBST(POLKIT_DATADIR)
353 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
355 AC_ARG_ENABLE(selinux, AC_HELP_STRING([--enable-selinux],
356 [enable selinux support]),
357 [enable_selinux=${enableval}], [enable_selinux="no"])
358 AM_CONDITIONAL(SELINUX, test "${enable_selinux}" != "no")
360 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--disable-loopback],
361 [disable loopback support]),
362 [enable_loopback=${enableval}])
363 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
365 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
366 [disable Ethernet support]),
367 [enable_ethernet=${enableval}])
368 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
370 AC_ARG_ENABLE(gadget, AC_HELP_STRING([--disable-gadget],
371 [disable USB Gadget support]),
372 [enable_gadget=${enableval}])
373 AM_CONDITIONAL(GADGET, test "${enable_gadget}" != "no")
375 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
376 [disable WiFi support]),
377 [enable_wifi=${enableval}])
378 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
380 AC_ARG_ENABLE(iwd, AC_HELP_STRING([--enable-iwd],
381 [enable iwd support]),
382 [enable_iwd=${enableval}])
383 AM_CONDITIONAL(IWD, test "${enable_iwd}" = "yes")
385 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
386 [disable Bluetooth support]),
387 [enable_bluetooth=${enableval}])
388 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
390 AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
391 [disable oFono support]),
392 [enable_ofono=${enableval}])
393 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
395 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--disable-dundee],
396 [disable dundee support (Bluetooth DUN)]),
397 [enable_dundee=${enableval}])
398 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
400 AC_ARG_ENABLE(pacrunner, AC_HELP_STRING([--disable-pacrunner],
401 [disable PACrunner support]),
402 [enable_pacrunner=${enableval}])
403 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
405 AC_ARG_ENABLE(neard, AC_HELP_STRING([--disable-neard],
406 [disable Neard support]),
407 [enable_neard=${enableval}])
408 AM_CONDITIONAL(NEARD, test "${enable_neard}" != "no")
410 AC_ARG_ENABLE(wispr, AC_HELP_STRING([--disable-wispr],
411 [disable WISPr support]),
412 [enable_wispr=${enableval}])
413 AM_CONDITIONAL(WISPR, test "${enable_wispr}" != "no")
415 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
416 [disable testing tools]),
417 [enable_tools=${enableval}])
418 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
420 if (test "${enable_tools}" != "no"); then
421 AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
423 IPTABLES_SAVE=$ac_cv_path_IPTABLES_SAVE
427 AC_SUBST(IPTABLES_SAVE)
429 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
430 [disable command line client]),
431 [enable_client=${enableval}])
432 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
434 if (test "${enable_wispr}" != "no"); then
435 PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
436 AC_MSG_ERROR(GnuTLS library is required))
441 AC_SUBST(GNUTLS_CFLAGS)
442 AC_SUBST(GNUTLS_LIBS)
444 if (test "${enable_loopback}" != "no"); then
445 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
446 AC_MSG_ERROR(inotify header files are required))
448 AC_CHECK_LIB(c, inotify_init, dummy=yes,
449 AC_MSG_ERROR(inotify library support is required))
452 if (test "${enable_wifi}" != "no"); then
453 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
457 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
458 [don't install configuration and data files]),
459 [enable_datafiles=${enableval}])
460 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
462 if (test "${enable_client}" != "no"); then
463 AC_CHECK_HEADERS(readline/readline.h, dummy=yes,
464 AC_MSG_ERROR(readline header files are required))
467 AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
468 "${enable_openvpn}" != "no" -o \
469 "${enable_ipsec}" != "no" -o \
470 "${enable_vpnc}" != "no" -o \
471 "${enable_l2tp}" != "no" -o \
472 "${enable_pptp}" != "no")
474 AC_OUTPUT(Makefile include/version.h connman.pc src/connman.service src/connman_tv.service vpn/connman-vpn.service)