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)
247
230
AC_SUBST([SAP_DRIVER], [sap-${sap_driver}.c])
249
AC_ARG_ENABLE(proximity, AC_HELP_STRING([--enable-proximity], [enable proximity plugin]), [
250
proximity_enable=${enableval}
253
AC_ARG_ENABLE(time, AC_HELP_STRING([--enable-time], [enable Time Profile plugin]), [
254
time_enable=${enableval}
257
AC_ARG_ENABLE(alert, AC_HELP_STRING([--enable-alert], [enable Phone Alert Profile plugin]), [
258
alert_enable=${enableval}
261
232
AC_ARG_ENABLE(serial, AC_HELP_STRING([--disable-serial], [disable serial plugin]), [
262
233
serial_enable=${enableval}
282
253
pnat_enable=${enableval}
285
AC_ARG_ENABLE(gatt-example, AC_HELP_STRING([--enable-gatt-example], [enable GATT example plugin]), [
286
gatt_example_enable=${enableval}
289
256
AC_ARG_ENABLE(gstreamer, AC_HELP_STRING([--enable-gstreamer], [enable GStreamer support]), [
290
257
gstreamer_enable=${enableval}
368
335
hal_enable=${enableval}
371
AC_ARG_ENABLE(thermometer, AC_HELP_STRING([--enable-thermometer], [enable thermometer plugin]), [
372
thermometer_enable=${enableval}
338
AC_ARG_ENABLE(gatt, AC_HELP_STRING([--enable-gatt], [enable gatt module]), [
339
gatt_enable=${enableval}
375
345
if (test "${fortify_enable}" = "yes"); then
376
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2"
346
misc_cflags="$misc_cflags -D_FORTIFY_SOURCE=2"
379
349
if (test "${pie_enable}" = "yes" && test "${ac_cv_prog_cc_pie}" = "yes"); then
380
CFLAGS="$CFLAGS -fPIC"
381
LDFLAGS="$LDFLAGS -pie"
350
misc_cflags="$misc_cflags -fPIC"
351
misc_ldflags="$misc_ldflags -pie"
384
354
if (test "${debug_enable}" = "yes" && test "${ac_cv_prog_cc_g}" = "yes"); then
355
misc_cflags="$misc_cflags -g"
388
358
if (test "${optimization_enable}" = "no"); then
359
misc_cflags="$misc_cflags -O0"
362
AC_SUBST([MISC_CFLAGS], $misc_cflags)
363
AC_SUBST([MISC_LDFLAGS], $misc_ldflags)
392
365
if (test "${usb_enable}" = "yes" && test "${usb_found}" = "yes"); then
393
366
AC_DEFINE(HAVE_LIBUSB, 1, [Define to 1 if you have USB library.])
404
377
AM_CONDITIONAL(SERIALPLUGIN, test "${serial_enable}" = "yes")
405
378
AM_CONDITIONAL(NETWORKPLUGIN, test "${network_enable}" = "yes")
406
379
AM_CONDITIONAL(SAPPLUGIN, test "${sap_enable}" = "yes")
407
AM_CONDITIONAL(PROXIMITYPLUGIN, test "${proximity_enable}" = "yes")
408
AM_CONDITIONAL(TIMEPLUGIN, test "${time_enable}" = "yes")
409
AM_CONDITIONAL(ALERTPLUGIN, test "${alert_enable}" = "yes")
410
380
AM_CONDITIONAL(SERVICEPLUGIN, test "${service_enable}" = "yes")
411
381
AM_CONDITIONAL(HEALTHPLUGIN, test "${health_enable}" = "yes")
412
382
AM_CONDITIONAL(MCAP, test "${health_enable}" = "yes")
413
383
AM_CONDITIONAL(HAL, test "${hal_enable}" = "yes")
414
384
AM_CONDITIONAL(READLINE, test "${readline_found}" = "yes")
415
AM_CONDITIONAL(GATT_EXAMPLE_PLUGIN, test "${gatt_example_enable}" = "yes")
416
385
AM_CONDITIONAL(PNATPLUGIN, test "${pnat_enable}" = "yes")
417
386
AM_CONDITIONAL(HIDD, test "${hidd_enable}" = "yes")
418
387
AM_CONDITIONAL(PAND, test "${pand_enable}" = "yes")
428
397
AM_CONDITIONAL(MAEMO6PLUGIN, test "${maemo6_enable}" = "yes")
429
398
AM_CONDITIONAL(DBUSOOBPLUGIN, test "${dbusoob_enable}" = "yes")
430
399
AM_CONDITIONAL(WIIMOTEPLUGIN, test "${wiimote_enable}" = "yes")
431
AM_CONDITIONAL(THERMOMETERPLUGIN, test "${thermometer_enable}" = "yes")
400
AM_CONDITIONAL(GATTMODULES, test "${gatt_enable}" = "yes")