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_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
65 [specify location of openconnect binary]), [path_openconnect=${withval}])
67 AC_ARG_ENABLE(openconnect,
68 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
69 [enable_openconnect=${enableval}], [enable_openconnect="no"])
70 if (test "${enable_openconnect}" != "no"); then
71 if (test -z "${path_openconnect}"); then
72 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin)
73 if (test -z "${OPENCONNECT}"); then
74 AC_MSG_ERROR(openconnect binary not found)
77 OPENCONNECT="${path_openconnect}"
81 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
82 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
84 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
85 [specify location of openvpn binary]), [path_openvpn=${withval}])
87 AC_ARG_ENABLE(openvpn,
88 AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
89 [enable_openvpn=${enableval}], [enable_openvpn="no"])
90 if (test "${enable_openvpn}" != "no"); then
91 if (test -z "${path_openvpn}"); then
92 AC_PATH_PROG(OPENVPN, [openvpn], [], $PATH:/sbin:/usr/sbin)
93 if (test -z "${OPENVPN}"); then
94 AC_MSG_ERROR(openvpn binary not found)
97 OPENVPN="${path_openvpn}"
101 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
102 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
104 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
105 [specify location of vpnc binary]), [path_vpnc=${withval}])
108 AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
109 [enable_vpnc=${enableval}], [enable_vpnc="no"])
110 if (test "${enable_vpnc}" != "no"); then
111 if (test -z "${path_vpnc}"); then
112 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/sbin:/usr/sbin)
113 if (test -z "${VPNC}"); then
114 AC_MSG_ERROR(vpnc binary not found)
121 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
122 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
125 AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
126 [enable_l2tp=${enableval}], [enable_l2tp="no"])
127 if (test "${enable_l2tp}" != "no"); then
128 if (test -z "${path_pppd}"); then
129 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
134 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
135 AC_MSG_ERROR(ppp header files are required))
136 if (test -z "${path_l2tp}"); then
137 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/sbin/xl2tpd], $PATH:/sbin:/usr/sbin)
143 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
144 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
147 AC_HELP_STRING([--enable-pptp], [enable pptp support]),
148 [enable_pptp=${enableval}], [enable_pptp="no"])
149 if (test "${enable_pptp}" != "no"); then
150 if (test -z "${path_pppd}"); then
151 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
156 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
157 AC_MSG_ERROR(ppp header files are required))
158 if (test -z "${path_pptp}"); then
159 AC_PATH_PROG(PPTP, [pptp], [/usr/sbin/pptp], $PATH:/sbin:/usr/sbin)
165 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
166 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
168 AC_CHECK_HEADERS(resolv.h, dummy=yes,
169 AC_MSG_ERROR(resolver header files are required))
170 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
171 AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
172 AC_MSG_ERROR(resolver library support is required))
175 AC_CHECK_FUNC(signalfd, dummy=yes,
176 AC_MSG_ERROR(signalfd support is required))
178 AC_CHECK_LIB(dl, dlopen, dummy=yes,
179 AC_MSG_ERROR(dynamic linking loader is required))
181 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
182 [enable Intel OSPM support]), [enable_iospm=${enableval}])
183 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
186 AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
187 [enable_tist=${enableval}], [enable_tist="no"])
188 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
189 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
191 AC_ARG_ENABLE(session-policy-local,
192 AC_HELP_STRING([--enable-session-policy-local], [enable local file Session policy configuration support]),
193 [enable_session_policy_local=${enableval}], [enable_session_policy_local="no"])
194 AM_CONDITIONAL(SESSION_POLICY_LOCAL, test "${enable_session_policy_local}" != "no")
195 AM_CONDITIONAL(SESSION_POLICY_LOCAL_BUILTIN, test "${enable_session_policy_local}" = "builtin")
197 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
198 [Maximal size of a statistics round robin file]),
199 [stats_max_file_size=${withval}])
201 if (test -z "${stats_max_file_size}"); then
202 # default size is 16 kByte
203 stats_max_file_size="16 * 8 * 128"
206 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
208 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
209 AC_MSG_ERROR(GLib >= 2.28 is required))
210 AC_SUBST(GLIB_CFLAGS)
213 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
214 AC_MSG_ERROR(D-Bus >= 1.4 is required))
215 AC_SUBST(DBUS_CFLAGS)
218 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
219 [path to D-Bus config directory]), [path_dbusconf=${withval}],
220 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
221 if (test -z "${path_dbusconf}"); then
222 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
224 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
226 AC_SUBST(DBUS_CONFDIR)
228 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
229 [path to D-Bus data directory]), [path_dbusdata=${withval}],
230 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
231 if (test -z "${path_dbusdata}"); then
232 DBUS_DATADIR="${datadir}/dbus-1/system-services"
234 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
236 AC_SUBST(DBUS_DATADIR)
238 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
239 [path to systemd service directory]), [path_systemdunit=${withval}],
240 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
241 if (test -n "${path_systemdunit}"); then
242 SYSTEMD_UNITDIR="${path_systemdunit}"
243 AC_SUBST(SYSTEMD_UNITDIR)
245 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
247 PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, dummy=yes,
248 AC_MSG_ERROR(Xtables library is required))
249 AC_SUBST(XTABLES_CFLAGS)
250 AC_SUBST(XTABLES_LIBS)
252 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
253 [enable test/example scripts]), [enable_test=${enableval}])
254 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
256 AC_ARG_ENABLE(nmcompat, AC_HELP_STRING([--enable-nmcompat],
257 [enable Network Manager support]),
258 [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
259 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
261 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
262 [enable PolicyKit support]),
263 [enable_polkit=${enableval}], [enable_polkit="no"])
264 if (test "${enable_polkit}" != "no"); then
265 POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
267 if (test -z "${POLKIT_DATADIR}"); then
268 POLKIT_DATADIR="${datadir}/polkit-1/actions"
270 AC_SUBST(POLKIT_DATADIR)
272 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
274 AC_ARG_ENABLE(selinux, AC_HELP_STRING([--enable-selinux],
275 [enable selinux support]),
276 [enable_selinux=${enableval}], [enable_selinux="no"])
277 AM_CONDITIONAL(SELINUX, test "${enable_selinux}" != "no")
279 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--disable-loopback],
280 [disable loopback support]),
281 [enable_loopback=${enableval}])
282 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
284 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
285 [disable Ethernet support]),
286 [enable_ethernet=${enableval}])
287 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
289 AC_ARG_ENABLE(gadget, AC_HELP_STRING([--disable-gadget],
290 [disable USB Gadget support]),
291 [enable_gadget=${enableval}])
292 AM_CONDITIONAL(GADGET, test "${enable_gadget}" != "no")
294 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
295 [disable WiFi support]),
296 [enable_wifi=${enableval}])
297 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
299 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
300 [disable Bluetooth support]),
301 [enable_bluetooth=${enableval}])
302 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
304 AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
305 [disable oFono support]),
306 [enable_ofono=${enableval}])
307 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
309 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--disable-dundee],
310 [disable dundee support (Bluetooth DUN)]),
311 [enable_dundee=${enableval}])
312 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
314 AC_ARG_ENABLE(pacrunner, AC_HELP_STRING([--disable-pacrunner],
315 [disable PACrunner support]),
316 [enable_pacrunner=${enableval}])
317 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
319 AC_ARG_ENABLE(neard, AC_HELP_STRING([--disable-neard],
320 [disable Neard support]),
321 [enable_neard=${enableval}])
322 AM_CONDITIONAL(NEARD, test "${enable_neard}" != "no")
324 AC_ARG_ENABLE(wispr, AC_HELP_STRING([--disable-wispr],
325 [disable WISPr support]),
326 [enable_wispr=${enableval}])
327 AM_CONDITIONAL(WISPR, test "${enable_wispr}" != "no")
329 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
330 [disable testing tools]),
331 [enable_tools=${enableval}])
332 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
334 if (test "${enable_tools}" != "no"); then
335 AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
336 $PATH:/sbin:/usr/sbin)
337 IPTABLES_SAVE=$ac_cv_path_IPTABLES_SAVE
341 AC_SUBST(IPTABLES_SAVE)
343 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
344 [disable command line client]),
345 [enable_client=${enableval}])
346 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
348 if (test "${enable_wispr}" != "no"); then
349 PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
350 AC_MSG_ERROR(GnuTLS library is required))
355 AC_SUBST(GNUTLS_CFLAGS)
356 AC_SUBST(GNUTLS_LIBS)
358 if (test "${enable_loopback}" != "no"); then
359 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
360 AC_MSG_ERROR(inotify header files are required))
362 AC_CHECK_LIB(c, inotify_init, dummy=yes,
363 AC_MSG_ERROR(inotify library support is required))
366 if (test "${enable_wifi}" != "no"); then
367 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
368 $PATH:/sbin:/usr/sbin)
371 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
372 [don't install configuration and data files]),
373 [enable_datafiles=${enableval}])
374 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
376 if (test "${enable_client}" != "no"); then
377 AC_CHECK_HEADERS(readline/readline.h, dummy=yes,
378 AC_MSG_ERROR(readline header files are required))
381 AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
382 "${enable_openvpn}" != "no" -o \
383 "${enable_vpnc}" != "no" -o \
384 "${enable_l2tp}" != "no" -o \
385 "${enable_pptp}" != "no")
387 AC_OUTPUT(Makefile include/version.h src/connman.service
388 vpn/connman-vpn.service vpn/net.connman.vpn.service
389 scripts/connman connman.pc src/net.connman.service)