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"
43 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
44 [enable compiling with debugging information]), [
45 if (test "${enableval}" = "yes" &&
46 test "${ac_cv_prog_cc_g}" = "yes"); then
51 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
52 [enable position independent executables flag]), [
53 if (test "${enableval}" = "yes" &&
54 test "${ac_cv_prog_cc_pie}" = "yes"); then
55 CFLAGS="$CFLAGS -fPIE"
56 LDFLAGS="$LDFLAGS -pie"
60 AC_ARG_ENABLE(threads,
61 AC_HELP_STRING([--enable-threads], [enable threading support]),
62 [enable_threads=${enableval}], [enable_threads="no"])
64 AC_ARG_ENABLE(hh2serial-gps,
65 AC_HELP_STRING([--enable-hh2serial-gps], [enable hh2serial GPS support]),
66 [enable_hh2serial_gps=${enableval}], [enable_hh2serial_gps="no"])
67 AM_CONDITIONAL(HH2SERIAL_GPS, test "${enable_hh2serial_gps}" != "no")
68 AM_CONDITIONAL(HH2SERIAL_GPS_BUILTIN, test "${enable_hh2serial_gps}" = "builtin")
70 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
71 [specify location of openconnect binary]), [path_openconnect=${withval}])
73 AC_ARG_ENABLE(openconnect,
74 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
75 [enable_openconnect=${enableval}], [enable_openconnect="no"])
76 if (test "${enable_openconnect}" != "no"); then
77 if (test -z "${path_openconnect}"); then
78 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin)
79 if (test -z "${OPENCONNECT}"); then
80 AC_MSG_ERROR(openconnect binary not found)
83 OPENCONNECT="${path_openconnect}"
87 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
88 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
90 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
91 [specify location of openvpn binary]), [path_openvpn=${withval}])
93 AC_ARG_ENABLE(openvpn,
94 AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
95 [enable_openvpn=${enableval}], [enable_openvpn="no"])
96 if (test "${enable_openvpn}" != "no"); then
97 if (test -z "${path_openvpn}"); then
98 AC_PATH_PROG(OPENVPN, [openvpn], [], $PATH:/sbin:/usr/sbin)
99 if (test -z "${OPENVPN}"); then
100 AC_MSG_ERROR(openvpn binary not found)
103 OPENVPN="${path_openvpn}"
107 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
108 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
110 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
111 [specify location of vpnc binary]), [path_vpnc=${withval}])
114 AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
115 [enable_vpnc=${enableval}], [enable_vpnc="no"])
116 if (test "${enable_vpnc}" != "no"); then
117 if (test -z "${path_vpnc}"); then
118 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/sbin:/usr/sbin)
119 if (test -z "${VPNC}"); then
120 AC_MSG_ERROR(vpnc binary not found)
127 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
128 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
131 AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
132 [enable_l2tp=${enableval}], [enable_l2tp="no"])
133 if (test "${enable_l2tp}" != "no"); then
134 if (test -z "${path_pppd}"); then
135 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
140 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
141 AC_MSG_ERROR(ppp header files are required))
142 if (test -z "${path_l2tp}"); then
143 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/sbin/xl2tpd], $PATH:/sbin:/usr/sbin)
149 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
150 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
153 AC_HELP_STRING([--enable-pptp], [enable pptp support]),
154 [enable_pptp=${enableval}], [enable_pptp="no"])
155 if (test "${enable_pptp}" != "no"); then
156 if (test -z "${path_pppd}"); then
157 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
162 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
163 AC_MSG_ERROR(ppp header files are required))
164 if (test -z "${path_pptp}"); then
165 AC_PATH_PROG(PPTP, [pptp], [/usr/sbin/pptp], $PATH:/sbin:/usr/sbin)
171 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
172 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
174 AC_CHECK_HEADERS(resolv.h, dummy=yes,
175 AC_MSG_ERROR(resolver header files are required))
176 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
177 AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
178 AC_MSG_ERROR(resolver library support is required))
181 AC_CHECK_FUNC(signalfd, dummy=yes,
182 AC_MSG_ERROR(signalfd support is required))
184 AC_CHECK_LIB(dl, dlopen, dummy=yes,
185 AC_MSG_ERROR(dynamic linking loader is required))
187 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
188 [enable Intel OSPM support]), [enable_iospm=${enableval}])
189 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
192 AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
193 [enable_tist=${enableval}], [enable_tist="no"])
194 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
195 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
197 AC_ARG_ENABLE(session-policy-local,
198 AC_HELP_STRING([--enable-session-policy-local], [enable local file Session policy configuration support]),
199 [enable_session_policy_local=${enableval}], [enable_session_policy_local="no"])
200 AM_CONDITIONAL(SESSION_POLICY_LOCAL, test "${enable_session_policy_local}" != "no")
201 AM_CONDITIONAL(SESSION_POLICY_LOCAL_BUILTIN, test "${enable_session_policy_local}" = "builtin")
203 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
204 [Maximal size of a statistics round robin file]),
205 [stats_max_file_size=${withval}])
207 if (test -z "${stats_max_file_size}"); then
208 # default size is 16 kByte
209 stats_max_file_size="16 * 8 * 128"
212 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
214 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
215 AC_MSG_ERROR(GLib >= 2.28 is required))
216 AC_SUBST(GLIB_CFLAGS)
219 if (test "${enable_threads}" = "yes"); then
220 AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
221 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
222 AC_MSG_ERROR(GThread >= 2.16 is required))
223 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
224 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
227 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
228 AC_MSG_ERROR(D-Bus >= 1.4 is required))
229 AC_SUBST(DBUS_CFLAGS)
232 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
233 [path to D-Bus config directory]), [path_dbusconf=${withval}],
234 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
235 if (test -z "${path_dbusconf}"); then
236 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
238 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
240 AC_SUBST(DBUS_CONFDIR)
242 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
243 [path to D-Bus data directory]), [path_dbusdata=${withval}],
244 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
245 if (test -z "${path_dbusdata}"); then
246 DBUS_DATADIR="${datadir}/dbus-1/system-services"
248 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
250 AC_SUBST(DBUS_DATADIR)
252 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
253 [path to systemd service directory]), [path_systemdunit=${withval}],
254 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
255 if (test -n "${path_systemdunit}"); then
256 SYSTEMD_UNITDIR="${path_systemdunit}"
257 AC_SUBST(SYSTEMD_UNITDIR)
259 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
261 PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, dummy=yes,
262 AC_MSG_ERROR(Xtables library is required))
263 AC_SUBST(XTABLES_CFLAGS)
264 AC_SUBST(XTABLES_LIBS)
266 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
267 [enable test/example scripts]), [enable_test=${enableval}])
268 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
270 AC_ARG_ENABLE(nmcompat, AC_HELP_STRING([--enable-nmcompat],
271 [enable Network Manager support]),
272 [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
273 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
275 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
276 [enable PolicyKit support]),
277 [enable_polkit=${enableval}], [enable_polkit="no"])
278 if (test "${enable_polkit}" != "no"); then
279 POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
281 if (test -z "${POLKIT_DATADIR}"); then
282 POLKIT_DATADIR="${datadir}/polkit-1/actions"
284 AC_SUBST(POLKIT_DATADIR)
286 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
288 AC_ARG_ENABLE(selinux, AC_HELP_STRING([--enable-selinux],
289 [enable selinux support]),
290 [enable_selinux=${enableval}], [enable_selinux="no"])
291 AM_CONDITIONAL(SELINUX, test "${enable_selinux}" != "no")
293 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--disable-loopback],
294 [disable loopback support]),
295 [enable_loopback=${enableval}])
296 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
298 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
299 [disable Ethernet support]),
300 [enable_ethernet=${enableval}])
301 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
303 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
304 [disable WiFi support]),
305 [enable_wifi=${enableval}])
306 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
308 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
309 [disable Bluetooth support]),
310 [enable_bluetooth=${enableval}])
311 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
313 AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
314 [disable oFono support]),
315 [enable_ofono=${enableval}])
316 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
318 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--disable-dundee],
319 [disable dundee support (Bluetooth DUN)]),
320 [enable_dundee=${enableval}])
321 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
323 AC_ARG_ENABLE(pacrunner, AC_HELP_STRING([--disable-pacrunner],
324 [disable PACrunner support]),
325 [enable_pacrunner=${enableval}])
326 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
328 AC_ARG_ENABLE(neard, AC_HELP_STRING([--disable-neard],
329 [disable Neard support]),
330 [enable_neard=${enableval}])
331 AM_CONDITIONAL(NEARD, test "${enable_neard}" != "no")
333 AC_ARG_ENABLE(wispr, AC_HELP_STRING([--disable-wispr],
334 [disable WISPr support]),
335 [enable_wispr=${enableval}])
336 AM_CONDITIONAL(WISPR, test "${enable_wispr}" != "no")
338 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
339 [disable testing tools]),
340 [enable_tools=${enableval}])
341 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
343 if (test "${enable_tools}" != "no"); then
344 AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
345 $PATH:/sbin:/usr/sbin)
346 IPTABLES_SAVE=$ac_cv_path_IPTABLES_SAVE
350 AC_SUBST(IPTABLES_SAVE)
352 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
353 [disable command line client]),
354 [enable_client=${enableval}])
355 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
357 if (test "${enable_wispr}" != "no"); then
358 PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
359 AC_MSG_ERROR(GnuTLS library is required))
364 AC_SUBST(GNUTLS_CFLAGS)
365 AC_SUBST(GNUTLS_LIBS)
367 if (test "${enable_loopback}" != "no"); then
368 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
369 AC_MSG_ERROR(inotify header files are required))
371 AC_CHECK_LIB(c, inotify_init, dummy=yes,
372 AC_MSG_ERROR(inotify library support is required))
375 if (test "${enable_wifi}" != "no"); then
376 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
377 $PATH:/sbin:/usr/sbin)
380 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
381 [don't install configuration and data files]),
382 [enable_datafiles=${enableval}])
383 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
385 if (test "${enable_client}" != "no"); then
386 AC_CHECK_HEADERS(readline/readline.h, dummy=yes,
387 AC_MSG_ERROR(readline header files are required))
390 AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
391 "${enable_openvpn}" != "no" -o \
392 "${enable_vpnc}" != "no" -o \
393 "${enable_l2tp}" != "no" -o \
394 "${enable_pptp}" != "no")
396 AC_OUTPUT(Makefile include/version.h src/connman.service
397 vpn/connman-vpn.service vpn/net.connman.vpn.service
398 scripts/connman doc/version.xml connman.pc)