Remove the obsolete shave support
[framework/connectivity/connman.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT()
3
4 AM_INIT_AUTOMAKE(connman, 0.19)
5 AM_CONFIG_HEADER(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 COMPILER_FLAGS
14
15 AC_SUBST(abs_top_srcdir)
16 AC_SUBST(abs_top_builddir)
17
18 AC_LANG_C
19
20 AC_PROG_CC
21 AM_PROG_CC_C_O
22 AC_PROG_CC_PIE
23 AC_PROG_INSTALL
24
25 m4_define([_LT_AC_TAGCONFIG], [])
26 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
27
28 AC_DISABLE_STATIC
29 AC_PROG_LIBTOOL
30
31 GTK_DOC_CHECK
32
33 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
34                         [enable compiling with debugging information]), [
35         if (test "${enableval}" = "yes" &&
36                                 test "${ac_cv_prog_cc_g}" = "yes"); then
37                 CFLAGS="$CFLAGS -g -O0"
38         fi
39 ])
40
41 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
42                         [enable position independent executables flag]), [
43         if (test "${enableval}" = "yes" &&
44                                 test "${ac_cv_prog_cc_pie}" = "yes"); then
45                 CFLAGS="$CFLAGS -fPIE"
46                 LDFLAGS="$LDFLAGS -pie"
47         fi
48 ])
49
50 AC_ARG_ENABLE(threads,
51         AC_HELP_STRING([--enable-threads], [enable threading support]),
52                         [enable_threads=${enableval}], [enable_threads="no"])
53
54 AC_ARG_ENABLE(loopback,
55         AC_HELP_STRING([--enable-loopback], [enable loopback support]),
56                         [enable_loopback=${enableval}], [enable_loopback="no"])
57 AM_CONDITIONAL(LOOPBACK, test "${enable_loopback}" != "no")
58 AM_CONDITIONAL(LOOPBACK_BUILTIN, test "${enable_loopback}" = "builtin")
59
60 AC_ARG_ENABLE(ethernet,
61         AC_HELP_STRING([--enable-ethernet], [enable Ethernet support]),
62                         [enable_ethernet=${enableval}], [enable_ethernet="no"])
63 AM_CONDITIONAL(ETHERNET, test "${enable_ethernet}" != "no")
64 AM_CONDITIONAL(ETHERNET_BUILTIN, test "${enable_ethernet}" = "builtin")
65
66 AC_ARG_ENABLE(wifi,
67         AC_HELP_STRING([--enable-wifi], [enable WiFi support]),
68                         [enable_wifi=${enableval}], [enable_wifi="no"])
69 if (test "${enable_wifi}" != "no"); then
70         AC_PATH_PROG(WPASUPPLICANT, [wpa_supplicant], [],
71                                                 $PATH:/sbin:/usr/sbin)
72 fi
73 AM_CONDITIONAL(WIFI, test "${enable_wifi}" != "no")
74 AM_CONDITIONAL(WIFI_BUILTIN, test "${enable_wifi}" = "builtin")
75
76 AC_ARG_ENABLE(bluetooth,
77         AC_HELP_STRING([--enable-bluetooth], [enable Bluetooth support]),
78                         [enable_bluetooth=${enableval}], [enable_bluetooth="no"])
79 AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
80 AM_CONDITIONAL(BLUETOOTH_BUILTIN, test "${enable_bluetooth}" = "builtin")
81
82 AC_ARG_ENABLE(ofono,
83         AC_HELP_STRING([--enable-ofono], [enable oFono support]),
84                         [enable_ofono=${enableval}], [enable_ofono="no"])
85 AM_CONDITIONAL(OFONO, test "${enable_ofono}" != "no")
86 AM_CONDITIONAL(OFONO_BUILTIN, test "${enable_ofono}" = "builtin")
87
88 AC_ARG_ENABLE(modemmgr,
89         AC_HELP_STRING([--enable-modemmgr], [enable Modem Manager support]),
90                         [enable_modemmgr=${enableval}], [enable_modemmgr="no"])
91 AM_CONDITIONAL(MODEMMGR, test "${enable_modemmgr}" != "no")
92 AM_CONDITIONAL(MODEMMGR_BUILTIN, test "${enable_modemmgr}" = "builtin")
93
94 AC_ARG_WITH(udhcpc, AC_HELP_STRING([--with-udhcpc=PROGRAM],
95         [specify location of udhcpc binary]), [path_udhcpc=${withval}])
96
97 AC_ARG_ENABLE(udhcp,
98         AC_HELP_STRING([--enable-udhcp], [enable uDHCP support]),
99                         [enable_udhcp=${enableval}], [enable_udhcp="no"])
100 if (test "${enable_udhcp}" != "no"); then
101         if (test -z "${path_udhcpc}"); then
102                 AC_PATH_PROG(UDHCPC, [udhcpc], [], $PATH:/sbin:/usr/sbin)
103         else
104                 UDHCPC="${path_udhcpc}"
105                 AC_SUBST(UDHCPC)
106         fi
107 fi
108 AM_CONDITIONAL(UDHCP, test "${enable_udhcp}" != "no")
109 AM_CONDITIONAL(UDHCP_BUILTIN, test "${enable_udhcp}" = "builtin")
110
111 AC_ARG_WITH(dhclient, AC_HELP_STRING([--with-dhclient=PROGRAM],
112         [specify location of dhclient binary]), [path_dhclient=${withval}])
113
114 AC_ARG_ENABLE(dhclient,
115         AC_HELP_STRING([--enable-dhclient], [enable dhclient support]),
116                         [enable_dhclient=${enableval}], [enable_dhclient="no"])
117 if (test "${enable_dhclient}" != "no"); then
118         if (test -z "${path_dhclient}"); then
119                 AC_PATH_PROG(DHCLIENT, [dhclient], [], $PATH:/sbin:/usr/sbin)
120         else
121                 DHCLIENT="${path_dhclient}"
122                 AC_SUBST(DHCLIENT)
123         fi
124 fi
125 AM_CONDITIONAL(DHCLIENT, test "${enable_dhclient}" != "no")
126 AM_CONDITIONAL(DHCLIENT_BUILTIN, test "${enable_dhclient}" = "builtin")
127
128 AC_ARG_WITH(resolvconf, AC_HELP_STRING([--with-resolvconf=PROGRAM],
129         [specify location of resolvconf binary]), [path_resolvconf=${withval}])
130
131 AC_ARG_ENABLE(resolvconf,
132         AC_HELP_STRING([--enable-resolvconf], [enable resolvconf support]),
133                         [enable_resolvconf=${enableval}], [enable_resolvconf="no"])
134 if (test "${enable_resolvconf}" != "no"); then
135         if (test -z "${path_resolvconf}"); then
136                 AC_PATH_PROG(RESOLVCONF, [resolvconf], [], $PATH:/sbin:/usr/sbin)
137         else
138                 RESOLVCONF="${path_resolvconf}"
139                 AC_SUBST(RESOLVCONF)
140         fi
141 fi
142 AM_CONDITIONAL(RESOLVCONF, test "${enable_resolvconf}" != "no")
143 AM_CONDITIONAL(RESOLVCONF_BUILTIN, test "${enable_resolvconf}" = "builtin")
144
145 AC_ARG_ENABLE(dnsproxy,
146         AC_HELP_STRING([--enable-dnsproxy], [enable DNS proxy support]),
147                         [enable_dnsproxy=${enableval}], [enable_dnsproxy="no"])
148 AM_CONDITIONAL(DNSPROXY, test "${enable_dnsproxy}" != "no")
149 AM_CONDITIONAL(DNSPROXY_BUILTIN, test "${enable_dnsproxy}" = "builtin")
150
151 AC_ARG_ENABLE(novatel, AC_HELP_STRING([--enable-novatel],
152                 [enable Novatel support]), [enable_novatel=${enableval}])
153 AM_CONDITIONAL(NOVATEL, test "${enable_novatel}" = "yes")
154
155 AC_ARG_ENABLE(huawei, AC_HELP_STRING([--enable-huawei],
156                 [enable HUAWEI support]), [enable_huawei=${enableval}])
157 AM_CONDITIONAL(HUAWEI, test "${enable_huawei}" = "yes")
158
159 AC_ARG_ENABLE(hso,
160         AC_HELP_STRING([--enable-hso], [enable HSO support]),
161                         [enable_hso=${enableval}], [enable_hso="no"])
162 AM_CONDITIONAL(HSO, test "${enable_hso}" != "no")
163 AM_CONDITIONAL(HSO_BUILTIN, test "${enable_hso}" = "builtin")
164
165 AC_ARG_ENABLE(mbm,
166         AC_HELP_STRING([--enable-mbm], [enable MBM support]),
167                         [enable_mbm=${enableval}], [enable_mbm="no"])
168 AM_CONDITIONAL(MBM, test "${enable_mbm}" != "no")
169 AM_CONDITIONAL(MBM_BUILTIN, test "${enable_mbm}" = "builtin")
170
171 AC_ARG_WITH(pppd, AC_HELP_STRING([--with-pppd=PROGRAM],
172         [specify location of pppd binary]), [path_pppd=${withval}])
173
174 AC_ARG_ENABLE(ppp, AC_HELP_STRING([--enable-ppp],
175                 [enable PPP support]), [enable_ppp=${enableval}])
176 if (test "${enable_ppp}" = "yes" || test "${enable_novatel}" = "yes" ||
177                                         test "${enable_huawei}" = "yes"); then
178         if (test -z "${path_pppd}"); then
179                 AC_PATH_PROG(PPPD, [pppd], [], $PATH:/sbin:/usr/sbin)
180         else
181                 PPPD="${path_pppd}"
182                 AC_SUBST(PPPD)
183         fi
184         AC_CHECK_HEADERS(pppd/pppd.h, enable_ppp=yes,
185                         AC_MSG_ERROR(PPP development files are required))
186 fi
187 AM_CONDITIONAL(PPPD, test "${enable_ppp}" = "yes")
188
189 AC_CHECK_HEADERS(sys/inotify.h, dummy=yes,
190                         AC_MSG_ERROR(inotify header files are required))
191
192 AC_CHECK_LIB(c, inotify_init, dummy=yes,
193                         AC_MSG_ERROR(inotify library support is required))
194
195 AC_CHECK_LIB(dl, dlopen, dummy=yes,
196                         AC_MSG_ERROR(dynamic linking loader is required))
197
198 AC_ARG_ENABLE(udev, AC_HELP_STRING([--enable-udev],
199                 [enable udev support]), [enable_udev=${enableval}])
200 if (test "${enable_udev}" = "yes"); then
201         AC_DEFINE(HAVE_UDEV, 1, [Define if udev support is available])
202         PKG_CHECK_MODULES(UDEV, libudev >= 129, dummy=yes,
203                                 AC_MSG_ERROR(udev >= 129 is required))
204         AC_CHECK_LIB(udev, udev_enumerate_add_match_property, dummy=yes,
205                 AC_DEFINE(NEED_UDEV_ENUMERATE_ADD_MATCH_PROPERTY, 1,
206                         [Define to 1 if you need the
207                                 udev_enumerate_add_match_property() function.]))
208         AC_CHECK_LIB(udev, udev_device_get_parent_with_subsystem_devtype, dummy=yes,
209                 AC_DEFINE(NEED_UDEV_DEVICE_GET_PARENT_WITH_SUBSYSTEM_DEVTYPE, 1,
210                         [Define to 1 if you need the
211                                 udev_device_get_parent_with_subsystem_devtype()
212                                                                         function.]))
213         UDEV_DATADIR="`$PKG_CONFIG --variable=rulesdir libudev`"
214         if (test -z "${UDEV_DATADIR}"); then
215                 UDEV_DATADIR="${sysconfdir}/udev/rules.d"
216         fi
217         AC_SUBST(UDEV_DATADIR)
218 fi
219 AC_SUBST(UDEV_CFLAGS)
220 AC_SUBST(UDEV_LIBS)
221 AM_CONDITIONAL(UDEV, test "${enable_udev}" = "yes")
222
223 AC_ARG_WITH(iwmxsdk, AC_HELP_STRING([--with-iwmxsdk=PATH],
224                                                 [path to Intel WiMAX SDK]),
225                                 [pkgconfig_iwmxsdk=${withval}/lib/pkgconfig])
226
227 AC_ARG_ENABLE(iwmx, AC_HELP_STRING([--enable-iwmx],
228                 [enable Intel WiMAX support]), [enable_iwmx=${enableval}])
229 if (test "${enable_iwmx}" = "yes"); then
230         enable_threads="yes"
231         export PKG_CONFIG_PATH="${pkgconfig_iwmxsdk}"
232         PKG_CHECK_MODULES(IWMXSDK, libiWmxSdk-0, dummy=yes,
233                                 AC_MSG_ERROR(Intel WiMAX SDK is required))
234         PKG_CONFIG_PATH=""
235         AC_SUBST(IWMXSDK_CFLAGS)
236         AC_SUBST(IWMXSDK_LIBS)
237 fi
238 AM_CONDITIONAL(IWMX, test "${enable_iwmx}" = "yes")
239
240 AC_ARG_ENABLE(iospm, AC_HELP_STRING([--enable-iospm],
241                 [enable Intel OSPM support]), [enable_iospm=${enableval}])
242 AM_CONDITIONAL(IOSPM, test "${enable_iospm}" = "yes")
243
244 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
245                                 AC_MSG_ERROR(GLib >= 2.16 is required))
246 AC_SUBST(GLIB_CFLAGS)
247 AC_SUBST(GLIB_LIBS)
248
249 if (test "${enable_threads}" = "yes"); then
250         AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
251         PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
252                                 AC_MSG_ERROR(GThread >= 2.16 is required))
253         GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
254         GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
255 fi
256
257 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
258                                 AC_MSG_ERROR(D-Bus >= 1.0 is required))
259 AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
260         AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
261                 [Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
262 AC_SUBST(DBUS_CFLAGS)
263 AC_SUBST(DBUS_LIBS)
264 DBUS_DATADIR="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
265 if (test -z "{DBUS_DATADIR}"); then
266         DBUS_DATADIR="${sysconfdir}/dbus-1/system.d"
267 else
268         DBUS_DATADIR="$DBUS_DATADIR/dbus-1/system.d"
269 fi
270 AC_SUBST(DBUS_DATADIR)
271
272 AC_SUBST([GDBUS_CFLAGS], ['$(DBUS_CFLAGS) -I$(top_srcdir)/gdbus'])
273 AC_SUBST([GDBUS_LIBS], ['$(top_builddir)/gdbus/libgdbus.la $(DBUS_LIBS)'])
274
275 AC_SUBST([GATCHAT_CFLAGS], ['-I$(top_srcdir)/gatchat'])
276 AC_SUBST([GATCHAT_LIBS], ['$(top_builddir)/gatchat/libgatchat.la'])
277
278 AC_ARG_ENABLE(polkit,
279         AC_HELP_STRING([--enable-polkit], [enable PolicyKit support]),
280                         [enable_polkit=${enableval}], [enable_polkit="no"])
281 if (test "${enable_polkit}" != "no"); then
282         PKG_CHECK_MODULES(POLKIT, polkit-dbus >= 0.7, dummy=yes,
283                                 AC_MSG_ERROR(PolicyKit >= 0.7 is required))
284         AC_SUBST(POLKIT_CFLAGS)
285         AC_SUBST(POLKIT_LIBS)
286         POLKIT_DATADIR="`$PKG_CONFIG --variable=policydir polkit`"
287         if (test -z "${POLKIT_DATADIR}"); then
288                 POLKIT_DATADIR="${datadir}/PolicyKit/policy"
289         fi
290         AC_SUBST(POLKIT_DATADIR)
291 fi
292 AM_CONDITIONAL(POLKIT, test "${enable_polkit}" != "no")
293 AM_CONDITIONAL(POLKIT_BUILTIN, test "${enable_polkit}" = "builtin")
294
295 AC_ARG_ENABLE(client, AC_HELP_STRING([--enable-client],
296                 [enable command line client]), [enable_client=${enableval}])
297 AM_CONDITIONAL(CLIENT, test "${enable_client}" = "yes")
298
299 AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
300                 [enable testing tools]), [enable_tools=${enableval}])
301 if (test "${enable_tools}" = "yes"); then
302         PKG_CHECK_MODULES(NETLINK, libnl-1, dummy=yes,
303                                 AC_MSG_ERROR(Netlink library is required))
304         AC_SUBST(NETLINK_CFLAGS)
305         AC_SUBST(NETLINK_LIBS)
306 fi
307 AM_CONDITIONAL(TOOLS, test "${enable_tools}" = "yes")
308
309 AC_ARG_ENABLE(fake, AC_HELP_STRING([--enable-fake],
310                 [enable fake device support]), [enable_fake=${enableval}])
311 AM_CONDITIONAL(FAKE, test "${enable_fake}" = "yes")
312
313 AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
314                         [don't install configuration and data files]),
315                                         [enable_datafiles=${enableval}])
316 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
317
318 AC_OUTPUT(Makefile gdbus/Makefile gatchat/Makefile
319                                 include/Makefile include/version.h
320                                 src/Makefile src/connman.service
321                                 scripts/connman scripts/Makefile
322                                 plugins/Makefile client/Makefile
323                                 tools/Makefile test/Makefile
324                                 doc/Makefile doc/version.xml connman.pc)