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"
77 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
78 [specify location of openconnect binary]), [path_openconnect=${withval}])
80 AC_ARG_ENABLE(openconnect,
81 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
82 [enable_openconnect=${enableval}], [enable_openconnect="no"])
83 if (test "${enable_openconnect}" != "no"); then
84 if (test -z "${path_openconnect}"); then
85 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin)
86 if (test -z "${OPENCONNECT}"); then
87 AC_MSG_ERROR(openconnect binary not found)
90 OPENCONNECT="${path_openconnect}"
94 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
95 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
97 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
98 [specify location of openvpn binary]), [path_openvpn=${withval}])
100 AC_ARG_ENABLE(openvpn,
101 AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
102 [enable_openvpn=${enableval}], [enable_openvpn="no"])
103 if (test "${enable_openvpn}" != "no"); then
104 if (test -z "${path_openvpn}"); then
105 AC_PATH_PROG(OPENVPN, [openvpn], [], $PATH:/sbin:/usr/sbin)
106 if (test -z "${OPENVPN}"); then
107 AC_MSG_ERROR(openvpn binary not found)
110 OPENVPN="${path_openvpn}"
114 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
115 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
117 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
118 [specify location of vpnc binary]), [path_vpnc=${withval}])
121 AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
122 [enable_vpnc=${enableval}], [enable_vpnc="no"])
123 if (test "${enable_vpnc}" != "no"); then
124 if (test -z "${path_vpnc}"); then
125 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/sbin:/usr/sbin)
126 if (test -z "${VPNC}"); then
127 AC_MSG_ERROR(vpnc binary not found)
134 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
135 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
138 AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
139 [enable_l2tp=${enableval}], [enable_l2tp="no"])
140 if (test "${enable_l2tp}" != "no"); then
141 if (test -z "${path_pppd}"); then
142 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
147 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
148 AC_MSG_ERROR(ppp header files are required))
149 if (test -z "${path_l2tp}"); then
150 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/sbin/xl2tpd], $PATH:/sbin:/usr/sbin)
156 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
157 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
160 AC_HELP_STRING([--enable-pptp], [enable pptp support]),
161 [enable_pptp=${enableval}], [enable_pptp="no"])
162 if (test "${enable_pptp}" != "no"); then
163 if (test -z "${path_pppd}"); then
164 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
169 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
170 AC_MSG_ERROR(ppp header files are required))
171 if (test -z "${path_pptp}"); then
172 AC_PATH_PROG(PPTP, [pptp], [/usr/sbin/pptp], $PATH:/sbin:/usr/sbin)
178 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
179 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
181 AC_CHECK_HEADERS(resolv.h, dummy=yes,
182 AC_MSG_ERROR(resolver header files are required))
183 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
184 AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
185 AC_MSG_ERROR(resolver library support is required))
188 AC_CHECK_FUNC(signalfd, dummy=yes,
189 AC_MSG_ERROR(signalfd support is required))
191 AC_CHECK_LIB(dl, dlopen, dummy=yes,
192 AC_MSG_ERROR(dynamic linking loader is required))
194 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
195 [enable Intel OSPM support]), [enable_iospm=${enableval}])
196 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
199 AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
200 [enable_tist=${enableval}], [enable_tist="no"])
201 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
202 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
204 AC_ARG_ENABLE(session-policy-local,
205 AC_HELP_STRING([--enable-session-policy-local], [enable local file Session policy configuration support]),
206 [enable_session_policy_local=${enableval}], [enable_session_policy_local="no"])
207 AM_CONDITIONAL(SESSION_POLICY_LOCAL, test "${enable_session_policy_local}" != "no")
208 AM_CONDITIONAL(SESSION_POLICY_LOCAL_BUILTIN, test "${enable_session_policy_local}" = "builtin")
210 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
211 [Maximal size of a statistics round robin file]),
212 [stats_max_file_size=${withval}])
214 if (test -z "${stats_max_file_size}"); then
215 # default size is 16 kByte
216 stats_max_file_size="16 * 8 * 128"
219 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
221 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
222 AC_MSG_ERROR(GLib >= 2.28 is required))
223 AC_SUBST(GLIB_CFLAGS)
226 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
227 AC_MSG_ERROR(D-Bus >= 1.4 is required))
228 AC_SUBST(DBUS_CFLAGS)
231 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
232 [path to D-Bus config directory]), [path_dbusconf=${withval}],
233 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
234 if (test -z "${path_dbusconf}"); then
235 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
237 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
239 AC_SUBST(DBUS_CONFDIR)
241 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
242 [path to D-Bus data directory]), [path_dbusdata=${withval}],
243 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
244 if (test -z "${path_dbusdata}"); then
245 DBUS_DATADIR="${datadir}/dbus-1/system-services"
247 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
249 AC_SUBST(DBUS_DATADIR)
251 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
252 [path to systemd service directory]), [path_systemdunit=${withval}],
253 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
254 if (test -n "${path_systemdunit}"); then
255 SYSTEMD_UNITDIR="${path_systemdunit}"
256 AC_SUBST(SYSTEMD_UNITDIR)
258 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
260 PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, dummy=yes,
261 AC_MSG_ERROR(Xtables library is required))
262 AC_SUBST(XTABLES_CFLAGS)
263 AC_SUBST(XTABLES_LIBS)
265 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
266 [enable test/example scripts]), [enable_test=${enableval}])
267 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
269 AC_ARG_ENABLE(nmcompat, AC_HELP_STRING([--enable-nmcompat],
270 [enable Network Manager support]),
271 [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
272 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
274 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
275 [enable PolicyKit support]),
276 [enable_polkit=${enableval}], [enable_polkit="no"])
277 if (test "${enable_polkit}" != "no"); then
278 POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
280 if (test -z "${POLKIT_DATADIR}"); then
281 POLKIT_DATADIR="${datadir}/polkit-1/actions"
283 AC_SUBST(POLKIT_DATADIR)
285 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
287 AC_ARG_ENABLE(selinux, AC_HELP_STRING([--enable-selinux],
288 [enable selinux support]),
289 [enable_selinux=${enableval}], [enable_selinux="no"])
290 AM_CONDITIONAL(SELINUX, test "${enable_selinux}" != "no")
292 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--disable-loopback],
293 [disable loopback support]),
294 [enable_loopback=${enableval}])
295 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
297 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
298 [disable Ethernet support]),
299 [enable_ethernet=${enableval}])
300 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
302 AC_ARG_ENABLE(gadget, AC_HELP_STRING([--disable-gadget],
303 [disable USB Gadget support]),
304 [enable_gadget=${enableval}])
305 AM_CONDITIONAL(GADGET, test "${enable_gadget}" != "no")
307 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
308 [disable WiFi support]),
309 [enable_wifi=${enableval}])
310 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
312 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
313 [disable Bluetooth support]),
314 [enable_bluetooth=${enableval}])
315 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
317 AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
318 [disable oFono support]),
319 [enable_ofono=${enableval}])
320 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
322 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--disable-dundee],
323 [disable dundee support (Bluetooth DUN)]),
324 [enable_dundee=${enableval}])
325 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
327 AC_ARG_ENABLE(pacrunner, AC_HELP_STRING([--disable-pacrunner],
328 [disable PACrunner support]),
329 [enable_pacrunner=${enableval}])
330 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
332 AC_ARG_ENABLE(neard, AC_HELP_STRING([--disable-neard],
333 [disable Neard support]),
334 [enable_neard=${enableval}])
335 AM_CONDITIONAL(NEARD, test "${enable_neard}" != "no")
337 AC_ARG_ENABLE(wispr, AC_HELP_STRING([--disable-wispr],
338 [disable WISPr support]),
339 [enable_wispr=${enableval}])
340 AM_CONDITIONAL(WISPR, test "${enable_wispr}" != "no")
342 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
343 [disable testing tools]),
344 [enable_tools=${enableval}])
345 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
347 if (test "${enable_tools}" != "no"); then
348 AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
349 $PATH:/sbin:/usr/sbin)
350 IPTABLES_SAVE=$ac_cv_path_IPTABLES_SAVE
354 AC_SUBST(IPTABLES_SAVE)
356 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
357 [disable command line client]),
358 [enable_client=${enableval}])
359 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
361 if (test "${enable_wispr}" != "no"); then
362 PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
363 AC_MSG_ERROR(GnuTLS library is required))
368 AC_SUBST(GNUTLS_CFLAGS)
369 AC_SUBST(GNUTLS_LIBS)
371 if (test "${enable_loopback}" != "no"); then
372 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
373 AC_MSG_ERROR(inotify header files are required))
375 AC_CHECK_LIB(c, inotify_init, dummy=yes,
376 AC_MSG_ERROR(inotify library support is required))
379 if (test "${enable_wifi}" != "no"); then
380 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
381 $PATH:/sbin:/usr/sbin)
384 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
385 [don't install configuration and data files]),
386 [enable_datafiles=${enableval}])
387 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
389 if (test "${enable_client}" != "no"); then
390 AC_CHECK_HEADERS(readline/readline.h, dummy=yes,
391 AC_MSG_ERROR(readline header files are required))
394 AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
395 "${enable_openvpn}" != "no" -o \
396 "${enable_vpnc}" != "no" -o \
397 "${enable_l2tp}" != "no" -o \
398 "${enable_pptp}" != "no")
400 AC_OUTPUT(Makefile include/version.h src/connman.service
401 vpn/connman-vpn.service vpn/net.connman.vpn.service
402 scripts/connman connman.pc src/net.connman.service)