client: Add agent auto argument support
[platform/upstream/bluez.git] / configure.ac
1 # SPDX-License-Identifier: GPL-2.0
2 AC_PREREQ(2.60)
3 AC_INIT(bluez, 5.68)
4
5 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests silent-rules
6                                         tar-pax no-dist-gzip dist-xz])
7 AC_CONFIG_HEADERS(config.h)
8 AC_USE_SYSTEM_EXTENSIONS
9
10 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11
12 AM_MAINTAINER_MODE
13
14 AC_PREFIX_DEFAULT(/usr/local)
15
16 PKG_PROG_PKG_CONFIG
17
18 COMPILER_FLAGS
19
20 AC_LANG([C])
21
22 AC_C_RESTRICT
23
24 AC_PROG_CC
25 AM_PROG_CC_C_O
26 AC_PROG_CC_PIE
27 AC_PROG_CC_ASAN
28 AC_PROG_CC_LSAN
29 AC_PROG_CC_UBSAN
30 AC_PROG_INSTALL
31 AC_PROG_MKDIR_P
32
33 m4_define([_LT_AC_TAGCONFIG], [])
34 m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
35
36 LT_PREREQ(2.2)
37 LT_INIT([disable-static])
38
39 if (test "$USE_MAINTAINER_MODE" = "yes"); then
40         AC_CHECK_PROG(enable_coverage, [lcov], [yes], [no])
41         AC_CHECK_PROG(enable_dbus_run_session, [dbus-run-session], [yes])
42         AC_CHECK_PROG(enable_valgrind, [valgrind], [yes])
43         AC_CHECK_HEADERS(valgrind/memcheck.h)
44 fi
45 AM_CONDITIONAL(COVERAGE, test "${enable_coverage}" = "yes")
46 AM_CONDITIONAL(DBUS_RUN_SESSION, test "${enable_dbus_run_session}" = "yes")
47
48 MISC_FLAGS
49
50 AM_CONDITIONAL(VALGRIND, test "${enable_valgrind}" = "yes" &&
51                 test "$ASAN_LIB" != "yes" && test "LSAN_LIB" != "yes")
52
53 AC_ARG_ENABLE(threads, AS_HELP_STRING([--enable-threads],
54                 [enable threading support]), [enable_threads=${enableval}])
55
56 AC_CHECK_FUNCS(explicit_bzero)
57
58 AC_CHECK_FUNCS(getrandom)
59
60 AC_CHECK_FUNCS(rawmemchr)
61
62 AC_CHECK_FUNC(signalfd, dummy=yes,
63                         AC_MSG_ERROR(signalfd support is required))
64
65 AC_CHECK_LIB(rt, clock_gettime, dummy=yes,
66                         AC_MSG_ERROR(realtime clock support is required))
67
68 AC_CHECK_LIB(pthread, pthread_create, dummy=yes,
69                         AC_MSG_ERROR(posix thread support is required))
70
71 AC_CHECK_LIB(dl, dlopen, dummy=yes,
72                         AC_MSG_ERROR(dynamic linking loader is required))
73
74 AC_CHECK_HEADERS(linux/types.h linux/if_alg.h linux/uinput.h linux/uhid.h sys/random.h)
75
76 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
77                                 AC_MSG_ERROR(GLib >= 2.28 is required))
78 AC_SUBST(GLIB_CFLAGS)
79 AC_SUBST(GLIB_LIBS)
80
81 if (test "${enable_threads}" = "yes"); then
82         AC_DEFINE(NEED_THREADS, 1, [Define if threading support is required])
83         PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
84                                 AC_MSG_ERROR(GThread >= 2.16 is required))
85         GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
86         GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
87 fi
88
89 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.10, dummy=yes,
90                                 AC_MSG_ERROR(D-Bus >= 1.10 is required))
91 AC_SUBST(DBUS_CFLAGS)
92 AC_SUBST(DBUS_LIBS)
93
94 PKG_CHECK_MODULES(LIBXML, libxml-2.0)
95 AC_SUBST(LIBXML_CFLAGS)
96 AC_SUBST(LIBXML_LIBS)
97
98 PKG_CHECK_MODULES(INIPARSER, iniparser)
99 AC_SUBST(INIPARSER_CFLAGS)
100 AC_SUBST(INIPARSER_LIBS)
101
102 AC_ARG_WITH([dbusconfdir], AS_HELP_STRING([--with-dbusconfdir=DIR],
103                                 [path to D-Bus configuration directory]),
104                                         [path_dbusconfdir=${withval}])
105 if (test -z "${path_dbusconfdir}"); then
106         AC_MSG_CHECKING([D-Bus configuration directory])
107         path_dbusconfdir="`$PKG_CONFIG --variable=sysconfdir dbus-1`"
108         if (test -z "${path_dbusconfdir}"); then
109                 AC_MSG_ERROR([D-Bus configuration directory is required])
110         fi
111         AC_MSG_RESULT([${path_dbusconfdir}])
112 fi
113 AC_SUBST(DBUS_CONFDIR, [${path_dbusconfdir}])
114
115 AC_ARG_WITH([dbussystembusdir], AS_HELP_STRING([--with-dbussystembusdir=DIR],
116                                 [path to D-Bus system bus services directory]),
117                                         [path_dbussystembusdir=${withval}])
118 if (test -z "${path_dbussystembusdir}"); then
119         AC_MSG_CHECKING([D-Bus system bus services dir])
120         path_dbussystembusdir="`$PKG_CONFIG --variable=system_bus_services_dir dbus-1`"
121         if (test -z "${path_dbussystembusdir}"); then
122                 AC_MSG_ERROR([D-Bus system bus services directory is required])
123         fi
124         AC_MSG_RESULT([${path_dbussystembusdir}])
125 fi
126 AC_SUBST(DBUS_SYSTEMBUSDIR, [${path_dbussystembusdir}])
127
128 AC_ARG_WITH([dbussessionbusdir], AS_HELP_STRING([--with-dbussessionbusdir=DIR],
129                                 [path to D-Bus session bus services directory]),
130                                         [path_dbussessionbusdir=${withval}])
131 if (test -z "${path_dbussessionbusdir}"); then
132         AC_MSG_CHECKING([D-Bus session bus services dir])
133         path_dbussessionbusdir="`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`"
134         if (test -z "${path_dbussessionbusdir}"); then
135                 AC_MSG_ERROR([D-Bus session bus services directory is required])
136         fi
137         AC_MSG_RESULT([${path_dbussessionbusdir}])
138 fi
139 AC_SUBST(DBUS_SESSIONBUSDIR, [${path_dbussessionbusdir}])
140
141 AC_ARG_ENABLE(backtrace, AS_HELP_STRING([--enable-backtrace],
142                 [compile backtrace support]), [enable_backtrace=${enableval}])
143
144 if (test "${enable_backtrace}" = "yes"); then
145         AC_CHECK_HEADER(elfutils/libdwfl.h, dummy=yes,
146                         AC_MSG_ERROR(elfutils support is required))
147         AC_DEFINE(HAVE_BACKTRACE_SUPPORT, 1,
148                         [Define to 1 if you have the backtrace support.])
149         BACKTRACE_CFLAGS=""
150         BACKTRACE_LIBS="-ldw"
151         AC_SUBST(BACKTRACE_CFLAGS)
152         AC_SUBST(BACKTRACE_LIBS)
153 fi
154
155 AC_ARG_ENABLE(library, AS_HELP_STRING([--enable-library],
156                 [install Bluetooth library]), [enable_library=${enableval}])
157 AM_CONDITIONAL(LIBRARY, test "${enable_library}" = "yes")
158
159 AC_ARG_ENABLE(test, AS_HELP_STRING([--enable-test],
160                 [enable test/example scripts]), [enable_test=${enableval}])
161 AM_CONDITIONAL(TEST, test "${enable_test}" = "yes")
162
163 AC_ARG_ENABLE(nfc, AS_HELP_STRING([--enable-nfc],
164                 [enable TIZEN_NFC_PLUGIN paring]), [enable_nfc=${enableval}])
165 AM_CONDITIONAL(TIZEN_NFC_PLUGIN, test "${enable_nfc}" = "yes")
166
167 AC_ARG_ENABLE(bap, AS_HELP_STRING([--disable-bap],
168                 [disable BAP profile]), [enable_bap=${enableval}])
169 AM_CONDITIONAL(BAP, test "${enable_bap}" != "no")
170
171 AC_ARG_ENABLE(bass, AS_HELP_STRING([--disable-bass],
172                 [disable BASS service]), [enable_bass=${enableval}])
173 AM_CONDITIONAL(BASS, test "${enable_bass}" != "no")
174
175 AC_ARG_ENABLE(vcp, AS_HELP_STRING([--disable-vcp],
176                 [disable VCP profile]), [enable_vcp=${enableval}])
177 AM_CONDITIONAL(VCP, test "${enable_vcp}" != "no")
178
179 AC_ARG_ENABLE(csip, AS_HELP_STRING([--disable-csip],
180                 [disable CSIP profile]), [enable_csip=${enableval}])
181 AM_CONDITIONAL(CSIP, test "${enable_csip}" != "no")
182
183 AC_ARG_ENABLE(tools, AS_HELP_STRING([--disable-tools],
184                 [disable Bluetooth tools]), [enable_tools=${enableval}])
185 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
186
187 AC_ARG_ENABLE(monitor, AS_HELP_STRING([--disable-monitor],
188                 [disable Bluetooth monitor]), [enable_monitor=${enableval}])
189 AM_CONDITIONAL(MONITOR, test "${enable_monitor}" != "no")
190
191 AC_ARG_ENABLE(udev, AS_HELP_STRING([--disable-udev],
192                 [disable udev device support]), [enable_udev=${enableval}])
193 if (test "${enable_tools}" != "no" && test "${enable_udev}" != "no"); then
194         PKG_CHECK_MODULES(UDEV, libudev >= 172, dummy=yes,
195                                 AC_MSG_ERROR(libudev >= 172 is required))
196         AC_SUBST(UDEV_CFLAGS)
197         AC_SUBST(UDEV_LIBS)
198         AC_CHECK_LIB(udev, udev_hwdb_new,
199                 AC_DEFINE(HAVE_UDEV_HWDB_NEW, 1,
200                         [Define to 1 if you have the udev_hwdb_new() function.]))
201 fi
202 AM_CONDITIONAL(UDEV, test "${enable_udev}" != "no")
203
204 AC_ARG_WITH([udevdir], AS_HELP_STRING([--with-udevdir=DIR],
205                         [path to udev directory]), [path_udevdir=${withval}])
206 if (test "${enable_udev}" != "no" && test -z "${path_udevdir}"); then
207         AC_MSG_CHECKING([udev directory])
208         path_udevdir="`$PKG_CONFIG --variable=udevdir udev`"
209         if (test -z "${path_udevdir}"); then
210                 AC_MSG_ERROR([udev directory is required])
211         fi
212         AC_MSG_RESULT([${path_udevdir}])
213 fi
214 AC_SUBST(UDEV_DIR, [${path_udevdir}])
215
216 AC_ARG_ENABLE(cups, AS_HELP_STRING([--disable-cups],
217                 [disable CUPS printer support]), [enable_cups=${enableval}])
218 AM_CONDITIONAL(CUPS, test "${enable_cups}" != "no")
219
220 AC_ARG_ENABLE(mesh, AS_HELP_STRING([--enable-mesh],
221                 [enable Mesh profile support]), [enable_mesh=${enableval}])
222 AM_CONDITIONAL(MESH, test "${enable_mesh}" = "yes")
223
224 if (test "${enable_mesh}" == "yes"); then
225         PKG_CHECK_MODULES(JSONC, json-c >= 0.13, dummy=yes,
226                                 AC_MSG_ERROR(json-c >= 0.13 is required))
227         AC_SUBST(JSON_CFLAGS)
228         AC_SUBST(JSON_LIBS)
229 fi
230
231 AC_ARG_ENABLE(midi, AS_HELP_STRING([--enable-midi],
232                 [enable MIDI support]), [enable_midi=${enableval}])
233 AM_CONDITIONAL(MIDI, test "${enable_midi}" = "yes")
234
235 if (test "${enable_midi}" = "yes"); then
236         PKG_CHECK_MODULES(ALSA, alsa, dummy=yes,
237                         AC_MSG_ERROR(ALSA lib is required for MIDI support))
238         AC_SUBST(ALSA_CFLAGS)
239         AC_SUBST(ALSA_LIBS)
240 fi
241
242
243 AC_ARG_ENABLE(obex, AS_HELP_STRING([--disable-obex],
244                 [disable OBEX profile support]), [enable_obex=${enableval}])
245
246 AC_SUBST(ICAL_CFLAGS)
247 AC_SUBST(ICAL_LIBS)
248
249 AM_CONDITIONAL(OBEX, test "${enable_obex}" != "no")
250
251 AC_ARG_ENABLE(btpclient, AS_HELP_STRING([--enable-btpclient],
252                 [enable BTP client]), [enable_btpclient=${enableval}])
253 AM_CONDITIONAL(BTPCLIENT, test "${enable_btpclient}" = "yes")
254
255 AC_ARG_ENABLE([external_ell], AS_HELP_STRING([--enable-external-ell],
256                                 [enable external Embedded Linux library]),
257                                         [enable_external_ell=${enableval}])
258 if (test "${enable_external_ell}" = "yes"); then
259         PKG_CHECK_MODULES(ELL, ell >= 0.28, dummy=yes,
260                 AC_MSG_ERROR(Embedded Linux library >= 0.28 is required))
261         AC_SUBST(ELL_CFLAGS)
262         AC_SUBST(ELL_LIBS)
263 fi
264 if (test "${enable_external_ell}" != "yes"); then
265         if (test ! -f ${srcdir}/ell/ell.h) &&
266                         (test ! -f ${srcdir}/../ell/ell/ell.h); then
267                                 AC_MSG_ERROR(ELL source is required or use --enable-external-ell)
268         fi
269 fi
270 AM_CONDITIONAL(EXTERNAL_ELL, test "${enable_external_ell}" = "yes" ||
271                                 (test "${enable_btpclient}" != "yes" &&
272                                                 test "${enable_mesh}" != "yes"))
273 AM_CONDITIONAL(LIBSHARED_ELL, test "${enable_btpclient}" = "yes" ||
274                                                 test "${enable_mesh}" = "yes")
275
276 AC_ARG_ENABLE(client, AS_HELP_STRING([--disable-client],
277                 [disable command line client]), [enable_client=${enableval}])
278 AM_CONDITIONAL(CLIENT, test "${enable_client}" != "no")
279
280 if (test "${enable_client}" != "no" || test "${enable_mesh}" == "yes"); then
281         AC_CHECK_HEADERS(readline/readline.h, enable_readline=yes,
282                 AC_MSG_ERROR(readline header files are required))
283 fi
284 AM_CONDITIONAL(READLINE, test "${enable_readline}" = "yes")
285
286 AC_ARG_ENABLE(systemd, AS_HELP_STRING([--disable-systemd],
287                 [disable systemd integration]), [enable_systemd=${enableval}])
288 AM_CONDITIONAL(SYSTEMD, test "${enable_systemd}" != "no")
289
290 AC_ARG_WITH([systemdsystemunitdir],
291                         AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
292                         [path to systemd system unit directory]),
293                                         [path_systemunitdir=${withval}])
294 if (test "${enable_systemd}" != "no" && test -z "${path_systemunitdir}"); then
295         AC_MSG_CHECKING([systemd system unit dir])
296         path_systemunitdir="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"
297         if (test -z "${path_systemunitdir}"); then
298                 AC_MSG_ERROR([systemd system unit directory is required])
299         fi
300         AC_MSG_RESULT([${path_systemunitdir}])
301 fi
302 AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}])
303
304 AC_ARG_WITH([systemduserunitdir],
305                         AS_HELP_STRING([--with-systemduserunitdir=DIR],
306                         [path to systemd user unit directory]),
307                                         [path_userunitdir=${withval}])
308 if (test "${enable_systemd}" != "no" && test -z "${path_userunitdir}"); then
309         AC_MSG_CHECKING([systemd user unit dir])
310         path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir systemd`"
311         if (test -z "${path_userunitdir}"); then
312                 AC_MSG_ERROR([systemd user unit directory is required])
313         fi
314         AC_MSG_RESULT([${path_userunitdir}])
315 fi
316 AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}])
317
318 AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles],
319                         [do not install configuration and data files]),
320                                         [enable_datafiles=${enableval}])
321 AM_CONDITIONAL(DATAFILES, test "${enable_datafiles}" != "no")
322
323 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--enable-manpages],
324                         [enable building of manual pages]),
325                                         [enable_manpages=${enableval}])
326 if (test "${enable_manpages}" != "no"); then
327         AC_CHECK_PROGS(RST2MAN, [rst2man rst2man.py], "no")
328 fi
329 AM_CONDITIONAL(MANPAGES, test "${enable_manpages}" = "yes")
330 AM_CONDITIONAL(RUN_RST2MAN, test "${enable_manpages}" = "yes" && test "${RST2MAN}" != "no")
331
332 AC_ARG_ENABLE(testing, AS_HELP_STRING([--enable-testing],
333                         [enable testing tools]),
334                                         [enable_testing=${enableval}])
335 AM_CONDITIONAL(TESTING, test "${enable_testing}" = "yes")
336
337 AC_ARG_ENABLE(experimental, AS_HELP_STRING([--enable-experimental],
338                         [enable experimental tools]),
339                                         [enable_experimental=${enableval}])
340 AM_CONDITIONAL(EXPERIMENTAL, test "${enable_experimental}" = "yes")
341
342 # Start of TIZEN_FEATURE_BLUEZ_MODIFY
343 AC_ARG_ENABLE(wearable, AS_HELP_STRING([--enable-wearable],
344                         [enable wearable profile]), [enable_wearable=${enableval}])
345 AM_CONDITIONAL(WEARABLE, test "${enable_wearable}" = "yes")
346
347 AC_ARG_ENABLE(autopair, AS_HELP_STRING([--enable-autopair],
348                         [Enable Autopair Plugin]), [enable_autopair=${enableval}])
349 AM_CONDITIONAL(AUTOPAIR, test "${enable_autopair}" = "yes")
350
351 AC_ARG_ENABLE(hid, AS_HELP_STRING([--disable-hid],
352                         [disable HID Plugin]), [enable_hid=${enableval}])
353 AM_CONDITIONAL(TIZEN_HID_PLUGIN, test "${enable_hid}" != "no")
354
355 AC_ARG_ENABLE(health, AS_HELP_STRING([--enable-health],
356                 [enable HEALTH profiles]), [enable_health=${enableval}])
357 AM_CONDITIONAL(TIZEN_HEALTH_PLUGIN, test "${enable_health}" = "yes")
358
359 AC_ARG_ENABLE(proximity, AS_HELP_STRING([--enable-proximity],
360                   [Enable PROXIMITY Plugin]), [enable_proximity=${enableval}])
361 AM_CONDITIONAL(TIZEN_PROXIMITY_PLUGIN, test "${enable_proximity}" = "yes")
362
363 AC_ARG_ENABLE(tds, AS_HELP_STRING([--enable-tds],
364                   [Enable TDS Plugin]), [enable_tds=${enableval}])
365 AM_CONDITIONAL(TIZEN_TDS_PLUGIN, test "${enable_tds}" = "yes")
366
367 AC_ARG_ENABLE(tizenunusedplugin, AS_HELP_STRING([--enable-tizenunusedplugin],
368                 [Enable Unused Plugin]), [enable_tizenunusedplugin=${enableval}])
369 AM_CONDITIONAL(TIZEN_UNUSED_PLUGIN, test "${enable_tizenunusedplugin}" = "yes")
370
371 AC_ARG_ENABLE(sap, AS_HELP_STRING([--enable-sap],
372                         [Enable SAP Plugin]), [enable_sap=${enableval}])
373 AM_CONDITIONAL(TIZEN_SAP_PLUGIN, test "${enable_sap}" = "yes")
374
375 AC_ARG_ENABLE(a2dp, AS_HELP_STRING([--disable-a2dp],
376                 [disable A2DP profile]), [enable_a2dp=${enableval}])
377 AM_CONDITIONAL(TIZEN_A2DP_PLUGIN, test "${enable_a2dp}" != "no")
378
379 AC_ARG_ENABLE(avrcp, AS_HELP_STRING([--disable-avrcp],
380                 [disable AVRCP profile]), [enable_avrcp=${enableval}])
381 AM_CONDITIONAL(TIZEN_AVRCP_PLUGIN, test "${enable_avrcp}" != "no")
382
383 AC_ARG_ENABLE(network, AS--disable-hid_HELP_STRING([--disable-network],
384                 [disable NETWORK profile]), [enable_network=${enableval}])
385 AM_CONDITIONAL(TIZEN_NETWORK_PLUGIN, test "${enable_network}" != "no")
386
387 AC_ARG_ENABLE(bredr, AS_HELP_STRING([--enable-bredr],
388                         [Enable BREDR Plugin]), [enable_bredr=${enableval}])
389 AM_CONDITIONAL(TIZEN_BREDR_PLUGIN, test "${enable_bredr}" = "yes")
390
391 AC_ARG_ENABLE(le, AS_HELP_STRING([--enable-le],
392                         [Enable LE Plugin]), [enable_le=${enableval}])
393 AM_CONDITIONAL(TIZEN_LE_PLUGIN, test "${enable_le}" = "yes")
394
395 AC_ARG_ENABLE(crypto-tests, AS_HELP_STRING([--disable-crypto-tests],
396                 [Disable CRYPTO testcases]), [enable_crypto_tests=${enableval}])
397 AM_CONDITIONAL(TIZEN_CRYPTO_TESTS, test "${enable_crypto_tests}" != "no")
398
399 # End of TIZEN_FEATURE_BLUEZ_MODIFY
400
401 AC_ARG_ENABLE(deprecated, AS_HELP_STRING([--enable-deprecated],
402                         [enable deprecated tools]),
403                                         [enable_deprecated=${enableval}])
404 AM_CONDITIONAL(DEPRECATED, test "${enable_deprecated}" = "yes")
405
406 AC_ARG_ENABLE(sixaxis, AS_HELP_STRING([--enable-sixaxis],
407                 [enable sixaxis plugin]), [enable_sixaxis=${enableval}])
408 AM_CONDITIONAL(SIXAXIS, test "${enable_sixaxis}" = "yes" &&
409                                          test "${enable_udev}" != "no")
410
411 AC_ARG_ENABLE(hid2hci, AS_HELP_STRING([--enable-hid2hci],
412                 [enable hid2hci tool]), [enable_hid2hci=${enableval}])
413 AM_CONDITIONAL(HID2HCI, test "${enable_hid2hci}" = "yes" &&
414                                         test "${enable_udev}" != "no")
415
416 AC_ARG_ENABLE(logger, AS_HELP_STRING([--enable-logger],
417                 [enable HCI logger service]), [enable_logger=${enableval}])
418 AM_CONDITIONAL(LOGGER, test "${enable_logger}" = "yes")
419
420 AC_ARG_ENABLE(admin, AS_HELP_STRING([--enable-admin],
421                 [enable admin policy plugin]), [enable_admin=${enableval}])
422 AM_CONDITIONAL(ADMIN, test "${enable_admin}" = "yes")
423
424 if (test "${prefix}" = "NONE"); then
425         dnl no prefix and no localstatedir, so default to /var
426         if (test "$localstatedir" = '${prefix}/var'); then
427                 AC_SUBST([localstatedir], ['/var'])
428         fi
429
430         prefix="${ac_default_prefix}"
431 fi
432
433 if (test "$localstatedir" = '${prefix}/var'); then
434         storagedir="${prefix}/var/lib/bluetooth"
435 else
436         storagedir="${localstatedir}/lib/bluetooth"
437 fi
438 AC_DEFINE_UNQUOTED(STORAGEDIR, "${storagedir}",
439                         [Directory for the storage files])
440
441 if (test "$sysconfdir" = '${prefix}/etc'); then
442         configdir="${prefix}/etc/bluetooth"
443 else
444         configdir="${sysconfdir}/bluetooth"
445 fi
446 AC_DEFINE_UNQUOTED(CONFIGDIR, "${configdir}",
447                         [Directory for the configuration files])
448 AC_SUBST(CONFIGDIR, "${configdir}")
449
450
451 AC_DEFINE_UNQUOTED(MESH_STORAGEDIR, "${storagedir}/mesh",
452                         [Directory for the mesh daemon storage files])
453 AC_SUBST(MESH_STORAGEDIR, "${storagedir}/mesh")
454
455 AC_ARG_ENABLE(android, AS_HELP_STRING([--enable-android],
456                         [enable BlueZ for Android]),
457                                         [enable_android=${enableval}])
458 AM_CONDITIONAL(ANDROID, test "${enable_android}" = "yes")
459
460 if (test "${enable_android}" = "yes"); then
461         PKG_CHECK_MODULES(SBC, sbc >= 1.2, dummy=yes,
462                         AC_MSG_ERROR(SBC library >= 1.2 is required))
463         AC_SUBST(SBC_CFLAGS)
464         AC_SUBST(SBC_LIBS)
465 fi
466
467 if (test "${enable_android}" = "yes"); then
468         PKG_CHECK_MODULES(SPEEXDSP, speexdsp >= 1.2, dummy=yes,
469                         AC_MSG_ERROR(SPEEXDSP library >= 1.2 is required))
470         AC_SUBST(SPEEXDSP_CFLAGS)
471         AC_SUBST(SPEEXDSP_LIBS)
472 fi
473
474 AC_DEFINE_UNQUOTED(ANDROID_STORAGEDIR, "${storagedir}/android",
475                         [Directory for the Android daemon storage files])
476
477 AC_CONFIG_FILES(Makefile src/bluetoothd.rst lib/bluez.pc mesh/bluetooth-meshd.rst)
478 AC_OUTPUT