13
13
AC_DEFUN([COMPILER_FLAGS], [
14
if (test "${CFLAGS}" = ""); then
17
15
if (test "$USE_MAINTAINER_MODE" = "yes"); then
18
CFLAGS="$CFLAGS -Werror -Wextra"
19
CFLAGS="$CFLAGS -Wno-unused-parameter"
20
CFLAGS="$CFLAGS -Wno-missing-field-initializers"
21
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
22
CFLAGS="$CFLAGS -Wmissing-declarations"
23
CFLAGS="$CFLAGS -Wredundant-decls"
24
CFLAGS="$CFLAGS -Wcast-align"
25
CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED"
16
with_cflags="$with_cflags -Wall -Werror -Wextra"
17
with_cflags="$with_cflags -Wno-unused-parameter"
18
with_cflags="$with_cflags -Wno-missing-field-initializers"
19
with_cflags="$with_cflags -Wdeclaration-after-statement"
20
with_cflags="$with_cflags -Wmissing-declarations"
21
with_cflags="$with_cflags -Wredundant-decls"
22
with_cflags="$with_cflags -Wcast-align"
23
with_cflags="$with_cflags -DG_DISABLE_DEPRECATED"
26
AC_SUBST([WARNING_CFLAGS], $with_cflags)
29
29
AC_DEFUN([AC_FUNC_PPOLL], [
94
94
AC_DEFUN([AC_PATH_DBUS], [
95
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, dummy=yes,
96
AC_MSG_ERROR(D-Bus library is required))
97
AC_CHECK_LIB(dbus-1, dbus_watch_get_unix_fd, dummy=yes,
98
AC_DEFINE(NEED_DBUS_WATCH_GET_UNIX_FD, 1,
99
[Define to 1 if you need the dbus_watch_get_unix_fd() function.]))
100
AC_CHECK_LIB(dbus-1, dbus_connection_can_send_type, dummy=yes,
101
AC_DEFINE(NEED_DBUS_CONNECTION_CAN_SEND_TYPE, 1,
102
[Define to 1 if you need the dbus_connection_can_send_type() function.]
95
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.4, dummy=yes,
96
AC_MSG_ERROR(D-Bus >= 1.4 is required))
104
97
AC_SUBST(DBUS_CFLAGS)
105
98
AC_SUBST(DBUS_LIBS)
108
101
AC_DEFUN([AC_PATH_GLIB], [
109
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
110
AC_MSG_ERROR(GLib library version 2.16 or later is required))
111
AC_CHECK_LIB(glib-2.0, g_slist_free_full, dummy=yes,
112
AC_DEFINE(NEED_G_SLIST_FREE_FULL, 1,
113
[Define to 1 if you need g_slist_free_full() function.]))
114
AC_CHECK_LIB(glib-2.0, g_list_free_full, dummy=yes,
115
AC_DEFINE(NEED_G_LIST_FREE_FULL, 1,
116
[Define to 1 if you need g_list_free_full() function.]))
102
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28, dummy=yes,
103
AC_MSG_ERROR(GLib >= 2.28 is required))
117
104
AC_SUBST(GLIB_CFLAGS)
118
105
AC_SUBST(GLIB_LIBS)
249
232
AC_SUBST([SAP_DRIVER], [sap-${sap_driver}.c])
251
AC_ARG_ENABLE(proximity, AC_HELP_STRING([--enable-proximity], [enable proximity plugin]), [
252
proximity_enable=${enableval}
255
AC_ARG_ENABLE(time, AC_HELP_STRING([--enable-time], [enable Time Profile plugin]), [
256
time_enable=${enableval}
259
AC_ARG_ENABLE(alert, AC_HELP_STRING([--enable-alert], [enable Phone Alert Profile plugin]), [
260
alert_enable=${enableval}
263
234
AC_ARG_ENABLE(serial, AC_HELP_STRING([--disable-serial], [disable serial plugin]), [
264
235
serial_enable=${enableval}
284
255
pnat_enable=${enableval}
287
AC_ARG_ENABLE(gatt-example, AC_HELP_STRING([--enable-gatt-example], [enable GATT example plugin]), [
288
gatt_example_enable=${enableval}
291
258
AC_ARG_ENABLE(gstreamer, AC_HELP_STRING([--enable-gstreamer], [enable GStreamer support]), [
292
259
gstreamer_enable=${enableval}
370
337
hal_enable=${enableval}
373
AC_ARG_ENABLE(thermometer, AC_HELP_STRING([--enable-thermometer], [enable thermometer plugin]), [
374
thermometer_enable=${enableval}
340
AC_ARG_ENABLE(gatt, AC_HELP_STRING([--enable-gatt], [enable gatt module]), [
341
gatt_enable=${enableval}
377
347
if (test "${fortify_enable}" = "yes"); then
378
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
348
misc_cflags="$misc_cflags -D_FORTIFY_SOURCE=2"
381
351
if (test "${pie_enable}" = "yes" && test "${ac_cv_prog_cc_pie}" = "yes"); then
382
CFLAGS="$CFLAGS -fPIC"
383
LDFLAGS="$LDFLAGS -pie"
352
misc_cflags="$misc_cflags -fPIC"
353
misc_ldflags="$misc_ldflags -pie"
386
356
if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then
357
misc_cflags="$misc_cflags -g"
390
360
if (test "${optimization_enable}" = "no"); then
361
misc_cflags="$misc_cflags -O0"
364
AC_SUBST([MISC_CFLAGS], $misc_cflags)
365
AC_SUBST([MISC_LDFLAGS], $misc_ldflags)
394
367
if (test "${usb_enable}" = "yes" && test "${usb_found}" = "yes"); then
395
368
AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.])
406
379
AM_CONDITIONAL(SERIALPLUGIN, test "${serial_enable}" = "yes")
407
380
AM_CONDITIONAL(NETWORKPLUGIN, test "${network_enable}" = "yes")
408
381
AM_CONDITIONAL(SAPPLUGIN, test "${sap_enable}" = "yes")
409
AM_CONDITIONAL(PROXIMITYPLUGIN, test "${proximity_enable}" = "yes")
410
AM_CONDITIONAL(TIMEPLUGIN, test "${time_enable}" = "yes")
411
AM_CONDITIONAL(ALERTPLUGIN, test "${alert_enable}" = "yes")
412
382
AM_CONDITIONAL(SERVICEPLUGIN, test "${service_enable}" = "yes")
413
383
AM_CONDITIONAL(HEALTHPLUGIN, test "${health_enable}" = "yes")
414
384
AM_CONDITIONAL(MCAP, test "${health_enable}" = "yes")
415
385
AM_CONDITIONAL(HAL, test "${hal_enable}" = "yes")
416
386
AM_CONDITIONAL(READLINE, test "${readline_found}" = "yes")
417
AM_CONDITIONAL(GATT_EXAMPLE_PLUGIN, test "${gatt_example_enable}" = "yes")
418
387
AM_CONDITIONAL(PNATPLUGIN, test "${pnat_enable}" = "yes")
419
388
AM_CONDITIONAL(HIDD, test "${hidd_enable}" = "yes")
420
389
AM_CONDITIONAL(PAND, test "${pand_enable}" = "yes")
430
399
AM_CONDITIONAL(MAEMO6PLUGIN, test "${maemo6_enable}" = "yes")
431
400
AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
432
401
AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes")
433
AM_CONDITIONAL(THERMOMETERPLUGIN, test "${thermometer_enable}" = "yes")
402
AM_CONDITIONAL(GATTMODULES, test "${gatt_enable}" = "yes")