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(tizen-ext,
65 AC_HELP_STRING([--enable-tizen-ext], [enable TIZEN extensions]),
66 [if (test "${enableval}" = "yes"); then
67 CFLAGS="$CFLAGS -DTIZEN_EXT"
70 AC_ARG_ENABLE(telephony,
71 AC_HELP_STRING([--enable-telephony], [enable Telephony support]),
72 [enable_telephony=${enableval}], [enable_telephony="yes"])
73 AM_CONDITIONAL(TELEPHONY, test "${enable_telephony}" != "no")
74 AM_CONDITIONAL(TELEPHONY_BUILTIN, test "${enable_telephony}" = "builtin")
76 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
77 [specify location of openconnect binary]), [path_openconnect=${withval}])
79 AC_ARG_ENABLE(openconnect,
80 AC_HELP_STRING([--enable-openconnect], [enable openconnect support]),
81 [enable_openconnect=${enableval}], [enable_openconnect="no"])
82 if (test "${enable_openconnect}" != "no"); then
83 if (test -z "${path_openconnect}"); then
84 AC_PATH_PROG(OPENCONNECT, [openconnect], [], $PATH:/sbin:/usr/sbin)
85 if (test -z "${OPENCONNECT}"); then
86 AC_MSG_ERROR(openconnect binary not found)
89 OPENCONNECT="${path_openconnect}"
93 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
94 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
96 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
97 [specify location of openvpn binary]), [path_openvpn=${withval}])
99 AC_ARG_ENABLE(openvpn,
100 AC_HELP_STRING([--enable-openvpn], [enable openvpn support]),
101 [enable_openvpn=${enableval}], [enable_openvpn="no"])
102 if (test "${enable_openvpn}" != "no"); then
103 if (test -z "${path_openvpn}"); then
104 AC_PATH_PROG(OPENVPN, [openvpn], [], $PATH:/sbin:/usr/sbin)
105 if (test -z "${OPENVPN}"); then
106 AC_MSG_ERROR(openvpn binary not found)
109 OPENVPN="${path_openvpn}"
113 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
114 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
116 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
117 [specify location of vpnc binary]), [path_vpnc=${withval}])
120 AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
121 [enable_vpnc=${enableval}], [enable_vpnc="no"])
122 if (test "${enable_vpnc}" != "no"); then
123 if (test -z "${path_vpnc}"); then
124 AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/sbin:/usr/sbin)
125 if (test -z "${VPNC}"); then
126 AC_MSG_ERROR(vpnc binary not found)
133 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
134 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
137 AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
138 [enable_l2tp=${enableval}], [enable_l2tp="no"])
139 if (test "${enable_l2tp}" != "no"); then
140 if (test -z "${path_pppd}"); then
141 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
146 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
147 AC_MSG_ERROR(ppp header files are required))
148 if (test -z "${path_l2tp}"); then
149 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/sbin/xl2tpd], $PATH:/sbin:/usr/sbin)
155 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
156 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
159 AC_HELP_STRING([--enable-pptp], [enable pptp support]),
160 [enable_pptp=${enableval}], [enable_pptp="no"])
161 if (test "${enable_pptp}" != "no"); then
162 if (test -z "${path_pppd}"); then
163 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
168 AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
169 AC_MSG_ERROR(ppp header files are required))
170 if (test -z "${path_pptp}"); then
171 AC_PATH_PROG(PPTP, [pptp], [/usr/sbin/pptp], $PATH:/sbin:/usr/sbin)
177 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
178 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
180 AC_CHECK_HEADERS(resolv.h, dummy=yes,
181 AC_MSG_ERROR(resolver header files are required))
182 AC_CHECK_LIB(resolv, ns_initparse, dummy=yes, [
183 AC_CHECK_LIB(resolv, __ns_initparse, dummy=yes,
184 AC_MSG_ERROR(resolver library support is required))
187 AC_CHECK_FUNC(signalfd, dummy=yes,
188 AC_MSG_ERROR(signalfd support is required))
190 AC_CHECK_LIB(dl, dlopen, dummy=yes,
191 AC_MSG_ERROR(dynamic linking loader is required))
193 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
194 [enable Intel OSPM support]), [enable_iospm=${enableval}])
195 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
198 AC_HELP_STRING([--enable-tist], [enable TI Shared Transport support]),
199 [enable_tist=${enableval}], [enable_tist="no"])
200 AM_CONDITIONAL(TIST, test "${enable_tist}" != "no")
201 AM_CONDITIONAL(TIST_BUILTIN, test "${enable_tist}" = "builtin")
203 AC_ARG_ENABLE(session-policy-local,
204 AC_HELP_STRING([--enable-session-policy-local], [enable local file Session policy configuration support]),
205 [enable_session_policy_local=${enableval}], [enable_session_policy_local="no"])
206 AM_CONDITIONAL(SESSION_POLICY_LOCAL, test "${enable_session_policy_local}" != "no")
207 AM_CONDITIONAL(SESSION_POLICY_LOCAL_BUILTIN, test "${enable_session_policy_local}" = "builtin")
209 AC_ARG_WITH(stats-max-file-size, AC_HELP_STRING([--with-stats-max-file-size=SIZE],
210 [Maximal size of a statistics round robin file]),
211 [stats_max_file_size=${withval}])
213 if (test -z "${stats_max_file_size}"); then
214 # default size is 16 kByte
215 stats_max_file_size="16 * 8 * 128"
218 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
220 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
221 AC_MSG_ERROR(GLib >= 2.28 is required))
222 AC_SUBST(GLIB_CFLAGS)
225 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
226 AC_MSG_ERROR(D-Bus >= 1.4 is required))
227 AC_SUBST(DBUS_CFLAGS)
230 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
231 [path to D-Bus config directory]), [path_dbusconf=${withval}],
232 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
233 if (test -z "${path_dbusconf}"); then
234 DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
236 DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
238 AC_SUBST(DBUS_CONFDIR)
240 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
241 [path to D-Bus data directory]), [path_dbusdata=${withval}],
242 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
243 if (test -z "${path_dbusdata}"); then
244 DBUS_DATADIR="${datadir}/dbus-1/system-services"
246 DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
248 AC_SUBST(DBUS_DATADIR)
250 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
251 [path to systemd service directory]), [path_systemdunit=${withval}],
252 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
253 if (test -n "${path_systemdunit}"); then
254 SYSTEMD_UNITDIR="${path_systemdunit}"
255 AC_SUBST(SYSTEMD_UNITDIR)
257 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
259 PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, dummy=yes,
260 AC_MSG_ERROR(Xtables library is required))
261 AC_SUBST(XTABLES_CFLAGS)
262 AC_SUBST(XTABLES_LIBS)
264 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
265 [enable test/example scripts]), [enable_test=${enableval}])
266 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
268 AC_ARG_ENABLE(nmcompat, AC_HELP_STRING([--enable-nmcompat],
269 [enable Network Manager support]),
270 [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
271 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
273 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
274 [enable PolicyKit support]),
275 [enable_polkit=${enableval}], [enable_polkit="no"])
276 if (test "${enable_polkit}" != "no"); then
277 POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
279 if (test -z "${POLKIT_DATADIR}"); then
280 POLKIT_DATADIR="${datadir}/polkit-1/actions"
282 AC_SUBST(POLKIT_DATADIR)
284 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
286 AC_ARG_ENABLE(selinux, AC_HELP_STRING([--enable-selinux],
287 [enable selinux support]),
288 [enable_selinux=${enableval}], [enable_selinux="no"])
289 AM_CONDITIONAL(SELINUX, test "${enable_selinux}" != "no")
291 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--disable-loopback],
292 [disable loopback support]),
293 [enable_loopback=${enableval}])
294 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
296 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
297 [disable Ethernet support]),
298 [enable_ethernet=${enableval}])
299 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
301 AC_ARG_ENABLE(gadget, AC_HELP_STRING([--disable-gadget],
302 [disable USB Gadget support]),
303 [enable_gadget=${enableval}])
304 AM_CONDITIONAL(GADGET, test "${enable_gadget}" != "no")
306 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
307 [disable WiFi support]),
308 [enable_wifi=${enableval}])
309 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
311 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
312 [disable Bluetooth support]),
313 [enable_bluetooth=${enableval}])
314 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
316 AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
317 [disable oFono support]),
318 [enable_ofono=${enableval}])
319 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
321 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--disable-dundee],
322 [disable dundee support (Bluetooth DUN)]),
323 [enable_dundee=${enableval}])
324 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
326 AC_ARG_ENABLE(pacrunner, AC_HELP_STRING([--disable-pacrunner],
327 [disable PACrunner support]),
328 [enable_pacrunner=${enableval}])
329 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
331 AC_ARG_ENABLE(neard, AC_HELP_STRING([--disable-neard],
332 [disable Neard support]),
333 [enable_neard=${enableval}])
334 AM_CONDITIONAL(NEARD, test "${enable_neard}" != "no")
336 AC_ARG_ENABLE(wispr, AC_HELP_STRING([--disable-wispr],
337 [disable WISPr support]),
338 [enable_wispr=${enableval}])
339 AM_CONDITIONAL(WISPR, test "${enable_wispr}" != "no")
341 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
342 [disable testing tools]),
343 [enable_tools=${enableval}])
344 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
346 if (test "${enable_tools}" != "no"); then
347 AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
348 $PATH:/sbin:/usr/sbin)
349 IPTABLES_SAVE=$ac_cv_path_IPTABLES_SAVE
353 AC_SUBST(IPTABLES_SAVE)
355 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
356 [disable command line client]),
357 [enable_client=${enableval}])
358 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
360 if (test "${enable_wispr}" != "no"); then
361 PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
362 AC_MSG_ERROR(GnuTLS library is required))
367 AC_SUBST(GNUTLS_CFLAGS)
368 AC_SUBST(GNUTLS_LIBS)
370 if (test "${enable_loopback}" != "no"); then
371 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
372 AC_MSG_ERROR(inotify header files are required))
374 AC_CHECK_LIB(c, inotify_init, dummy=yes,
375 AC_MSG_ERROR(inotify library support is required))
378 if (test "${enable_wifi}" != "no"); then
379 AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
380 $PATH:/sbin:/usr/sbin)
383 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
384 [don't install configuration and data files]),
385 [enable_datafiles=${enableval}])
386 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
388 if (test "${enable_client}" != "no"); then
389 AC_CHECK_HEADERS(readline/readline.h, dummy=yes,
390 AC_MSG_ERROR(readline header files are required))
393 AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
394 "${enable_openvpn}" != "no" -o \
395 "${enable_vpnc}" != "no" -o \
396 "${enable_l2tp}" != "no" -o \
397 "${enable_pptp}" != "no")
399 AC_OUTPUT(Makefile include/version.h src/connman.service
400 vpn/connman-vpn.service vpn/net.connman.vpn.service
401 scripts/connman connman.pc src/net.connman.service)