4 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
5 AC_CONFIG_HEADERS([config.h])
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 AC_PREFIX_DEFAULT(/usr/local)
17 AC_SUBST(abs_top_srcdir)
18 AC_SUBST(abs_top_builddir)
28 m4_define([_LT_AC_TAGCONFIG], [])
29 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
34 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
35 [disable code optimization through compiler]), [
36 if (test "${enableval}" = "no"); then
37 CFLAGS="$CFLAGS -O0 -U_FORTIFY_SOURCE"
41 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
42 [enable compiling with debugging information]), [
43 if (test "${enableval}" = "yes" &&
44 test "${ac_cv_prog_cc_g}" = "yes"); then
49 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
50 [enable position independent executables flag]), [
51 if (test "${enableval}" = "yes" &&
52 test "${ac_cv_prog_cc_pie}" = "yes"); then
53 CFLAGS="$CFLAGS -fPIE"
54 LDFLAGS="$LDFLAGS -pie"
58 AC_ARG_ENABLE(hh2serial-gps,
59 AC_HELP_STRING([--enable-hh2serial-gps], [enable hh2serial GPS support]),
60 [enable_hh2serial_gps=${enableval}], [enable_hh2serial_gps="no"])
61 AM_CONDITIONAL(HH2SERIAL_GPS, test "${enable_hh2serial_gps}" != "no")
62 AM_CONDITIONAL(HH2SERIAL_GPS_BUILTIN, test "${enable_hh2serial_gps}" = "builtin")
64 AC_ARG_ENABLE(telephony,
65 AC_HELP_STRING([--enable-telephony], [enable Telephony support]),
66 [enable_telephony=${enableval}], [enable_telephony="yes"])
67 AM_CONDITIONAL(TELEPHONY, test "${enable_telephony}" != "no")
68 AM_CONDITIONAL(TELEPHONY_BUILTIN, test "${enable_telephony}" = "builtin")
70 AC_ARG_ENABLE(tizen-ext,
71 AC_HELP_STRING([--enable-tizen-ext], [enable TIZEN extensions]),
72 [if (test "${enableval}" = "yes"); then
73 CFLAGS="$CFLAGS -DTIZEN_EXT"
76 AM_CONDITIONAL(TIZEN_EXT, test "${enable-tizen-ext}" != "no")
78 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
79 [specify location of openconnect binary]), [path_openconnect=${withval}])
81 AC_ARG_ENABLE(openconnect,
82 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
83 [enable_openconnect=${enableval}], [enable_openconnect="no"])
84 if (test "${enable_openconnect}" != "no"); then
85 if (test -z "${path_openconnect}"); then
86 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/bin:/usr/bin)
87 if (test -z "${OPENCONNECT}"); then
88 AC_MSG_ERROR(openconnect binary not found)
91 OPENCONNECT="${path_openconnect}"
95 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
96 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
98 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
99 [specify location of openvpn binary]), [path_openvpn=${withval}])
101 AC_ARG_ENABLE(openvpn,
102 AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
103 [enable_openvpn=${enableval}], [enable_openvpn="no"])
104 if (test "${enable_openvpn}" != "no"); then
105 if (test -z "${path_openvpn}"); then
106 AC_PATH_PROG(OPENVPN, [openvpn], [/usr/bin/openvpn], $PATH:/bin:/usr/bin)
107 if (test -z "${OPENVPN}"); then
108 AC_MSG_ERROR(openvpn binary not found)
111 OPENVPN="${path_openvpn}"
115 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
116 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
118 AC_ARG_WITH(ipsec, AC_HELP_STRING([--with-ipsec=PROGRAM],
119 [specify location of ipsec binary]), [path_ipsec=${withval}])
122 AC_HELP_STRING([--enable-ipsec], [enable ipsec support]),
123 [enable_ipsec=${enableval}], [enable_ipsec="no"])
124 if (test "${enable_ipsec}" != "no"); then
125 PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.28, dummy=yes,
126 AC_MSG_ERROR(GIO >= 2.28 is required))
129 PKG_CHECK_MODULES(OPENSSL, openssl, dummy=yes,
130 AC_MSG_ERROR(openssl library is required))
131 AC_SUBST(OPENSSL_CFLAGS)
132 AC_SUBST(OPENSSL_LIBS)
133 if (test -z "${path_ipsec}"); then
134 AC_PATH_PROG(IPSEC, [charon], [/usr/bin/charon], $PATH:/usr/bin)
135 if (test -z "${IPSEC}"); then
136 AC_MSG_ERROR(ipsec binary not found)
139 IPSEC="${path_ipsec}"
143 AM_CONDITIONAL(IPSEC, test "${enable_ipsec}" != "no")
144 AM_CONDITIONAL(IPSEC_BUILTIN, test "${enable_ipsec}" = "builtin")
146 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
147 [specify location of vpnc binary]), [path_vpnc=${withval}])
150 AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
151 [enable_vpnc=${enableval}], [enable_vpnc="no"])
152 if (test "${enable_vpnc}" != "no"); then
153 if (test -z "${path_vpnc}"); then
154 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/bin:/usr/bin)
155 if (test -z "${VPNC}"); then
156 AC_MSG_ERROR(vpnc binary not found)
163 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
164 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
166 AC_ARG_WITH(l2tp, AC_HELP_STRING([--with-l2tp=PROGRAM],
167 [specify location of l2tp binary]), [path_l2tp=${withval}])
170 AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
171 [enable_l2tp=${enableval}], [enable_l2tp="no"])
172 if (test "${enable_l2tp}" != "no"); then
173 if (test -z "${path_pppd}"); then
174 AC_PATH_PROG(PPPD, [pppd], [/usr/bin/pppd], $PATH:/bin:/usr/bin)
179 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
180 AC_MSG_ERROR(ppp header files are required))
181 if (test -z "${path_l2tp}"); then
182 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/bin/xl2tpd], $PATH:/bin:/usr/bin)
188 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
189 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
191 AC_ARG_WITH(pptp, AC_HELP_STRING([--with-pptp=PROGRAM],
192 [specify location of pptp binary]), [path_pptp=${withval}])
195 AC_HELP_STRING([--enable-pptp], [enable pptp support]),
196 [enable_pptp=${enableval}], [enable_pptp="no"])
197 if (test "${enable_pptp}" != "no"); then
198 if (test -z "${path_pppd}"); then
199 AC_PATH_PROG(PPPD, [pppd], [/usr/bin/pppd], $PATH:/bin:/usr/bin)
204 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
205 AC_MSG_ERROR(ppp header files are required))
206 if (test -z "${path_pptp}"); then
207 AC_PATH_PROG(PPTP, [pptp], [/usr/bin/pptp], $PATH:/bin:/usr/bin)
213 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
214 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
216 AC_CHECK_HEADERS(resolv.h, dummy=yes,
217 AC_MSG_ERROR(resolver header files are required))
218 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
219 AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
220 AC_MSG_ERROR(resolver library support is required))
223 AC_CHECK_FUNC(signalfd, dummy=yes,
224 AC_MSG_ERROR(signalfd support is required))
226 AC_CHECK_LIB(dl, dlopen, dummy=yes,
227 AC_MSG_ERROR(dynamic linking loader is required))
229 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
230 [enable Intel OSPM support]), [enable_iospm=${enableval}])
231 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
234 AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
235 [enable_tist=${enableval}], [enable_tist="no"])
236 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
237 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
239 AC_ARG_ENABLE(session-policy-local,
240 AC_HELP_STRING([--enable-session-policy-local], [enable local file Session policy configuration support]),
241 [enable_session_policy_local=${enableval}], [enable_session_policy_local="no"])
242 AM_CONDITIONAL(SESSION_POLICY_LOCAL, test "${enable_session_policy_local}" != "no")
243 AM_CONDITIONAL(SESSION_POLICY_LOCAL_BUILTIN, test "${enable_session_policy_local}" = "builtin")
245 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
246 [Maximal size of a statistics round robin file]),
247 [stats_max_file_size=${withval}])
249 if (test -z "${stats_max_file_size}"); then
250 # default size is 16 kByte
251 stats_max_file_size="16 * 8 * 128"
254 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
256 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
257 AC_MSG_ERROR(GLib >= 2.28 is required))
258 AC_SUBST(GLIB_CFLAGS)
261 PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd-daemon, dummy=yes,
262 AC_MSG_ERROR(libsystemd-daemon library is required))
263 AC_SUBST(LIBSYSTEMD_CFLAGS)
264 AC_SUBST(LIBSYSTEMD_LIBS)
266 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
267 AC_MSG_ERROR(D-Bus >= 1.4 is required))
268 AC_SUBST(DBUS_CFLAGS)
271 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
272 [path to D-Bus config directory]), [path_dbusconf=${withval}],
273 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
274 if (test -z "${path_dbusconf}"); then
275 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
277 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
279 AC_SUBST(DBUS_CONFDIR)
281 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
282 [path to D-Bus data directory]), [path_dbusdata=${withval}],
283 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
284 if (test -z "${path_dbusdata}"); then
285 DBUS_DATADIR="${datadir}/dbus-1/system-services"
287 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
289 AC_SUBST(DBUS_DATADIR)
291 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
292 [path to systemd service directory]), [path_systemdunit=${withval}],
293 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
294 if (test -n "${path_systemdunit}"); then
295 SYSTEMD_UNITDIR="${path_systemdunit}"
296 AC_SUBST(SYSTEMD_UNITDIR)
298 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
300 PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, dummy=yes,
301 AC_MSG_ERROR(Xtables library is required))
302 AC_SUBST(XTABLES_CFLAGS)
303 AC_SUBST(XTABLES_LIBS)
305 PKG_CHECK_MODULES(TPKP_GNUTLS, tpkp-gnutls, dummy=yes,
306 AC_MSG_ERROR(tpkp-gnutls library is required))
307 AC_SUBST(TPKP_GNUTLS_CFLAGS)
308 AC_SUBST(TPKP_GNUTLS_LIBS)
310 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
311 [enable test/example scripts]), [enable_test=${enableval}])
312 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
314 AC_ARG_ENABLE(nmcompat, AC_HELP_STRING([--enable-nmcompat],
315 [enable Network Manager support]),
316 [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
317 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
319 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
320 [enable PolicyKit support]),
321 [enable_polkit=${enableval}], [enable_polkit="no"])
322 if (test "${enable_polkit}" != "no"); then
323 POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
325 if (test -z "${POLKIT_DATADIR}"); then
326 POLKIT_DATADIR="${datadir}/polkit-1/actions"
328 AC_SUBST(POLKIT_DATADIR)
330 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
332 AC_ARG_ENABLE(selinux, AC_HELP_STRING([--enable-selinux],
333 [enable selinux support]),
334 [enable_selinux=${enableval}], [enable_selinux="no"])
335 AM_CONDITIONAL(SELINUX, test "${enable_selinux}" != "no")
337 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--disable-loopback],
338 [disable loopback support]),
339 [enable_loopback=${enableval}])
340 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
342 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
343 [disable Ethernet support]),
344 [enable_ethernet=${enableval}])
345 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
347 AC_ARG_ENABLE(gadget, AC_HELP_STRING([--disable-gadget],
348 [disable USB Gadget support]),
349 [enable_gadget=${enableval}])
350 AM_CONDITIONAL(GADGET, test "${enable_gadget}" != "no")
352 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
353 [disable WiFi support]),
354 [enable_wifi=${enableval}])
355 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
357 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
358 [disable Bluetooth support]),
359 [enable_bluetooth=${enableval}])
360 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
362 AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
363 [disable oFono support]),
364 [enable_ofono=${enableval}])
365 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
367 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--disable-dundee],
368 [disable dundee support (Bluetooth DUN)]),
369 [enable_dundee=${enableval}])
370 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
372 AC_ARG_ENABLE(pacrunner, AC_HELP_STRING([--disable-pacrunner],
373 [disable PACrunner support]),
374 [enable_pacrunner=${enableval}])
375 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
377 AC_ARG_ENABLE(neard, AC_HELP_STRING([--disable-neard],
378 [disable Neard support]),
379 [enable_neard=${enableval}])
380 AM_CONDITIONAL(NEARD, test "${enable_neard}" != "no")
382 AC_ARG_ENABLE(wispr, AC_HELP_STRING([--disable-wispr],
383 [disable WISPr support]),
384 [enable_wispr=${enableval}])
385 AM_CONDITIONAL(WISPR, test "${enable_wispr}" != "no")
387 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
388 [disable testing tools]),
389 [enable_tools=${enableval}])
390 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
392 if (test "${enable_tools}" != "no"); then
393 AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
395 IPTABLES_SAVE=$ac_cv_path_IPTABLES_SAVE
399 AC_SUBST(IPTABLES_SAVE)
401 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
402 [disable command line client]),
403 [enable_client=${enableval}])
404 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
406 if (test "${enable_wispr}" != "no"); then
407 PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
408 AC_MSG_ERROR(GnuTLS library is required))
413 AC_SUBST(GNUTLS_CFLAGS)
414 AC_SUBST(GNUTLS_LIBS)
416 if (test "${enable_loopback}" != "no"); then
417 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
418 AC_MSG_ERROR(inotify header files are required))
420 AC_CHECK_LIB(c, inotify_init, dummy=yes,
421 AC_MSG_ERROR(inotify library support is required))
424 if (test "${enable_wifi}" != "no"); then
425 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
429 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
430 [don't install configuration and data files]),
431 [enable_datafiles=${enableval}])
432 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
434 if (test "${enable_client}" != "no"); then
435 AC_CHECK_HEADERS(readline/readline.h, dummy=yes,
436 AC_MSG_ERROR(readline header files are required))
439 AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
440 "${enable_openvpn}" != "no" -o \
441 "${enable_ipsec}" != "no" -o \
442 "${enable_vpnc}" != "no" -o \
443 "${enable_l2tp}" != "no" -o \
444 "${enable_pptp}" != "no")
446 AC_OUTPUT(Makefile include/version.h connman.pc src/connman.service src/connman_tv.service vpn/connman-vpn.service)