[connman] Add IPv6 gateway address after service IP bound.
[platform/upstream/connman.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT(connman, 1.29)
3
4 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
5 AC_CONFIG_HEADERS([config.h])
6
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9 AM_MAINTAINER_MODE
10
11 AC_PREFIX_DEFAULT(/usr/local)
12
13 PKG_PROG_PKG_CONFIG
14
15 COMPILER_FLAGS
16
17 AC_SUBST(abs_top_srcdir)
18 AC_SUBST(abs_top_builddir)
19
20 AC_LANG_C
21
22 AC_PROG_CC
23 AM_PROG_CC_C_O
24 AC_PROG_CC_PIE
25 AC_PROG_INSTALL
26 AC_PROG_MKDIR_P
27
28 m4_define([_LT_AC_TAGCONFIG], [])
29 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
30
31 AC_DISABLE_STATIC
32 AC_PROG_LIBTOOL
33
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"
38         fi
39 ])
40
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
45                 CFLAGS="$CFLAGS -g"
46         fi
47 ])
48
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"
55         fi
56 ])
57
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")
63
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")
69
70 AC_ARG_WITH(openconnect, AC_HELP_STRING([--with-openconnect=PROGRAM],
71         [specify location of openconnect binary]), [path_openconnect=${withval}])
72
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)
81                 fi
82         else
83                 OPENCONNECT="${path_openconnect}"
84                 AC_SUBST(OPENCONNECT)
85         fi
86 fi
87 AM_CONDITIONAL(OPENCONNECT, test "${enable_openconnect}" != "no")
88 AM_CONDITIONAL(OPENCONNECT_BUILTIN, test "${enable_openconnect}" = "builtin")
89
90 AC_ARG_WITH(openvpn, AC_HELP_STRING([--with-openvpn=PROGRAM],
91         [specify location of openvpn binary]), [path_openvpn=${withval}])
92
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)
101                 fi
102         else
103                 OPENVPN="${path_openvpn}"
104                 AC_SUBST(OPENVPN)
105         fi
106 fi
107 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
108 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
109
110 AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
111         [specify location of vpnc binary]), [path_vpnc=${withval}])
112
113 AC_ARG_ENABLE(vpnc,
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)
121                 fi
122         else
123                 VPNC="${path_vpnc}"
124                 AC_SUBST(VPNC)
125         fi
126 fi
127 AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
128 AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
129
130 AC_ARG_WITH(l2tp, AC_HELP_STRING([--with-l2tp=PROGRAM],
131         [specify location of l2tp binary]), [path_l2tp=${withval}])
132
133 AC_ARG_ENABLE(l2tp,
134         AC_HELP_STRING([--enable-l2tp], [enable l2tp support]),
135                         [enable_l2tp=${enableval}], [enable_l2tp="no"])
136 if (test "${enable_l2tp}" != "no"); then
137         if (test -z "${path_pppd}"); then
138                 AC_PATH_PROG(PPPD, [pppd], [/usr/sbin/pppd], $PATH:/sbin:/usr/sbin)
139         else
140                 PPPD="${path_pppd}"
141                 AC_SUBST(PPPD)
142         fi
143         AC_CHECK_HEADERS(pppd/pppd.h, dummy=yes,
144                         AC_MSG_ERROR(ppp header files are required))
145         if (test -z "${path_l2tp}"); then
146                 AC_PATH_PROG(L2TP, [xl2tpd], [/usr/sbin/xl2tpd], $PATH:/sbin:/usr/sbin)
147         else
148                 L2TP="${path_l2tp}"
149                 AC_SUBST(L2TP)
150         fi
151 fi
152 AM_CONDITIONAL(L2TP, test "${enable_l2tp}" != "no")
153 AM_CONDITIONAL(L2TP_BUILTIN, test "${enable_l2tp}" = "builtin")
154
155 AC_ARG_WITH(pptp, AC_HELP_STRING([--with-pptp=PROGRAM],
156         [specify location of pptp binary]), [path_pptp=${withval}])
157
158 AC_ARG_ENABLE(pptp,
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)
164         else
165                 PPPD="${path_pppd}"
166                 AC_SUBST(PPPD)
167         fi
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)
172         else
173                 PPTP="${path_pptp}"
174                 AC_SUBST(PPTP)
175         fi
176 fi
177 AM_CONDITIONAL(PPTP, test "${enable_pptp}" != "no")
178 AM_CONDITIONAL(PPTP_BUILTIN, test "${enable_pptp}" = "builtin")
179
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))
185 ])
186
187 AC_CHECK_FUNC(signalfd, dummy=yes,
188                         AC_MSG_ERROR(signalfd support is required))
189
190 AC_CHECK_LIB(dl, dlopen, dummy=yes,
191                         AC_MSG_ERROR(dynamic linking loader is required))
192
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")
196
197 AC_ARG_ENABLE(tist,
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")
202
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")
208
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}])
212
213 if (test -z "${stats_max_file_size}"); then
214    # default size is 16 kByte
215    stats_max_file_size="16 * 8 * 128"
216 fi
217
218 AC_DEFINE_UNQUOTED([STATS_MAX_FILE_SIZE], (${stats_max_file_size}), [Maximal size of a statistics round robin file])
219
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)
223 AC_SUBST(GLIB_LIBS)
224
225 PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd-daemon, dummy=yes,
226                                 AC_MSG_ERROR(libsystemd-daemon library is required))
227 AC_SUBST(LIBSYSTEMD_CFLAGS)
228 AC_SUBST(LIBSYSTEMD_LIBS)
229
230 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
231                                 AC_MSG_ERROR(D-Bus >= 1.4 is required))
232 AC_SUBST(DBUS_CFLAGS)
233 AC_SUBST(DBUS_LIBS)
234
235 AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
236         [path to D-Bus config directory]), [path_dbusconf=${withval}],
237                 [path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
238 if (test -z "${path_dbusconf}"); then
239         DBUS_CONFDIR="${sysconfdir}/dbus-1/system.d"
240 else
241         DBUS_CONFDIR="${path_dbusconf}/dbus-1/system.d"
242 fi
243 AC_SUBST(DBUS_CONFDIR)
244
245 AC_ARG_WITH(dbusdatadir, AC_HELP_STRING([--with-dbusdatadir=PATH],
246         [path to D-Bus data directory]), [path_dbusdata=${withval}],
247                 [path_dbusdata="`$PKG_CONFIG --variable=datadir dbus-1`"])
248 if (test -z "${path_dbusdata}"); then
249         DBUS_DATADIR="${datadir}/dbus-1/system-services"
250 else
251         DBUS_DATADIR="${path_dbusdata}/dbus-1/system-services"
252 fi
253 AC_SUBST(DBUS_DATADIR)
254
255 AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
256         [path to systemd service directory]), [path_systemdunit=${withval}],
257                 [path_systemdunit="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
258 if (test -n "${path_systemdunit}"); then
259         SYSTEMD_UNITDIR="${path_systemdunit}"
260         AC_SUBST(SYSTEMD_UNITDIR)
261 fi
262 AM_CONDITIONAL(SYSTEMD, test -n "${path_systemdunit}")
263
264 PKG_CHECK_MODULES(XTABLES, xtables >= 1.4.11, dummy=yes,
265                                 AC_MSG_ERROR(Xtables library is required))
266 AC_SUBST(XTABLES_CFLAGS)
267 AC_SUBST(XTABLES_LIBS)
268
269 PKG_CHECK_MODULES(TPKP_GNUTLS, tpkp-gnutls, dummy=yes,
270                                                                 AC_MSG_ERROR(tpkp-gnutls library is required))
271 AC_SUBST(TPKP_GNUTLS_CFLAGS)
272 AC_SUBST(TPKP_GNUTLS_LIBS)
273
274 AC_ARG_ENABLE(test, AC_HELP_STRING([--enable-test],
275                 [enable test/example scripts]), [enable_test=${enableval}])
276 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
277
278 AC_ARG_ENABLE(nmcompat, AC_HELP_STRING([--enable-nmcompat],
279                                 [enable Network Manager support]),
280                         [enable_nmcompat=${enableval}], [enable_nmcompat="no"])
281 AM_CONDITIONAL(NMCOMPAT, test "${enable_nmcompat}" != "no")
282
283 AC_ARG_ENABLE(polkit, AC_HELP_STRING([--enable-polkit],
284                                 [enable PolicyKit support]),
285                         [enable_polkit=${enableval}], [enable_polkit="no"])
286 if (test "${enable_polkit}" != "no"); then
287         POLKIT_DATADIR="`$PKG_CONFIG --variable=actiondir polkit`"
288         POLKIT_DATADIR=""
289         if (test -z "${POLKIT_DATADIR}"); then
290                 POLKIT_DATADIR="${datadir}/polkit-1/actions"
291         fi
292         AC_SUBST(POLKIT_DATADIR)
293 fi
294 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
295
296 AC_ARG_ENABLE(selinux, AC_HELP_STRING([--enable-selinux],
297                                 [enable selinux support]),
298                         [enable_selinux=${enableval}], [enable_selinux="no"])
299 AM_CONDITIONAL(SELINUX, test "${enable_selinux}" != "no")
300
301 AC_ARG_ENABLE(loopback, AC_HELP_STRING([--disable-loopback],
302                                 [disable loopback support]),
303                                         [enable_loopback=${enableval}])
304 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
305
306 AC_ARG_ENABLE(ethernet, AC_HELP_STRING([--disable-ethernet],
307                                 [disable Ethernet support]),
308                                         [enable_ethernet=${enableval}])
309 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
310
311 AC_ARG_ENABLE(gadget, AC_HELP_STRING([--disable-gadget],
312                                 [disable USB Gadget support]),
313                                         [enable_gadget=${enableval}])
314 AM_CONDITIONAL(GADGET, test "${enable_gadget}" != "no")
315
316 AC_ARG_ENABLE(wifi, AC_HELP_STRING([--disable-wifi],
317                                 [disable WiFi support]),
318                                         [enable_wifi=${enableval}])
319 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
320
321 AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
322                                 [disable Bluetooth support]),
323                                         [enable_bluetooth=${enableval}])
324 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
325
326 AC_ARG_ENABLE(ofono, AC_HELP_STRING([--disable-ofono],
327                                 [disable oFono support]),
328                                         [enable_ofono=${enableval}])
329 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
330
331 AC_ARG_ENABLE(dundee, AC_HELP_STRING([--disable-dundee],
332                                 [disable dundee support (Bluetooth DUN)]),
333                                         [enable_dundee=${enableval}])
334 AM_CONDITIONAL(DUNDEE, test "${enable_dundee}" != "no")
335
336 AC_ARG_ENABLE(pacrunner, AC_HELP_STRING([--disable-pacrunner],
337                                 [disable PACrunner support]),
338                                         [enable_pacrunner=${enableval}])
339 AM_CONDITIONAL(PACRUNNER, test "${enable_pacrunner}" != "no")
340
341 AC_ARG_ENABLE(neard, AC_HELP_STRING([--disable-neard],
342                                 [disable Neard support]),
343                                         [enable_neard=${enableval}])
344 AM_CONDITIONAL(NEARD, test "${enable_neard}" != "no")
345
346 AC_ARG_ENABLE(wispr, AC_HELP_STRING([--disable-wispr],
347                                 [disable WISPr support]),
348                                         [enable_wispr=${enableval}])
349 AM_CONDITIONAL(WISPR, test "${enable_wispr}" != "no")
350
351 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
352                                 [disable testing tools]),
353                                         [enable_tools=${enableval}])
354 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
355
356 if (test "${enable_tools}" != "no"); then
357         AC_PATH_PROGS(IPTABLES_SAVE, [iptables-save], [],
358                                                 $PATH:/sbin:/usr/sbin)
359         IPTABLES_SAVE=$ac_cv_path_IPTABLES_SAVE
360 else
361         IPTABLES_SAVE=""
362 fi
363 AC_SUBST(IPTABLES_SAVE)
364
365 AC_ARG_ENABLE(client, AC_HELP_STRING([--disable-client],
366                                 [disable command line client]),
367                                         [enable_client=${enableval}])
368 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
369
370 if (test "${enable_wispr}" != "no"); then
371         PKG_CHECK_MODULES(GNUTLS, gnutls, dummy=yes,
372                                 AC_MSG_ERROR(GnuTLS library is required))
373 else
374         GNUTLS_CFLAGS=""
375         GNUTLS_LIBS=""
376 fi
377 AC_SUBST(GNUTLS_CFLAGS)
378 AC_SUBST(GNUTLS_LIBS)
379
380 if (test "${enable_loopback}" != "no"); then
381         AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
382                         AC_MSG_ERROR(inotify header files are required))
383
384         AC_CHECK_LIB(c, inotify_init, dummy=yes,
385                         AC_MSG_ERROR(inotify library support is required))
386 fi
387
388 if (test "${enable_wifi}" != "no"); then
389         AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
390                                                 $PATH:/sbin:/usr/sbin)
391 fi
392
393 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
394                         [don't install configuration and data files]),
395                                         [enable_datafiles=${enableval}])
396 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
397
398 if (test "${enable_client}" != "no"); then
399         AC_CHECK_HEADERS(readline/readline.h, dummy=yes,
400                 AC_MSG_ERROR(readline header files are required))
401 fi
402
403 AM_CONDITIONAL(VPN, test "${enable_openconnect}" != "no" -o \
404                         "${enable_openvpn}" != "no" -o \
405                         "${enable_vpnc}" != "no" -o \
406                         "${enable_l2tp}" != "no" -o \
407                         "${enable_pptp}" != "no")
408
409 AC_OUTPUT(Makefile include/version.h connman.pc src/connman.service src/connman_tv.service)