3 AC_INIT([location-module], 0.1)
4 AC_CONFIG_AUX_DIR([build-aux])
5 AC_CONFIG_MACRO_DIR([m4])
6 AC_CONFIG_HEADER([config.h])
7 AC_CONFIG_SRCDIR([modules])
8 AM_INIT_AUTOMAKE([1.10.2 foreign -Wall -Werror])
10 # Check programs for making executable
11 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
16 # Check programs for making libraries.
19 # Add default build options to CFLAGS, LDFLAGS
20 if test "x$GCC" = "xyes"; then
21 CFLAGS="$CFLAGS -Wall"
22 LDFLAGS="$LDFLAGS -Wl,-z,defs -Wl,--as-needed -Wl,--hash-style=both"
25 # Add -g option to CFLAGS
26 AC_ARG_ENABLE([debug],
27 [AC_HELP_STRING([--enable-debug],[turn on debugging [default=no]])],
28 [case "${enableval}" in
29 yes) enable_dbg=yes ;;
31 *) AC_MSG_ERROR([Bad value ${enableval} for --enable-debug]) ;;
32 esac],[enable_dbg=no])
33 if ([test "x$enable_dbg" = xyes]); then
37 # Check GCC EFL visibility
38 AC_MSG_CHECKING(for ELF visibility)
41 __attribute__((visibility("default")))
45 AC_DEFINE([EXPORT_API], [__attribute__((visibility("default")))], [Symbol visibility prefix])
46 CFLAGS="$CFLAGS -fvisibility=hidden"],
48 AC_DEFINE([EXPORT_API], [], [Symbol visibility prefix]) ]
50 AC_MSG_RESULT($has_visibility)
53 PKG_CHECK_MODULES(MODULE, [glib-2.0 gmodule-2.0 geoclue location libcurl json-glib-1.0 dlog])
55 AC_SUBST(MODULE_CFLAGS)
59 [AC_HELP_STRING([--enable-dlog],[show dlog message [default=no]])],
60 [case "${enableval}" in
61 yes) enable_dlog=yes ;;
63 *) AC_MSG_ERROR([Bad value ${enableval} for --enable-dlog]) ;;
64 esac],[enable_dlog=no])
65 if ([test "x$enable_dlog" = xyes]); then
66 PKG_CHECK_MODULES(DLOG, [dlog], have_dlog="yes", have_dlog="no")
67 if test "x$have_dlog" = "xyes"; then
68 MODULE_CFLAGS="$MODULE_CFLAGS $DLOG_CFLAGS -DMOD_DLOG_DEBUG"
69 MODULE_LIBS="$MODULE_LIBS $DLOG_LIBS"
73 # Check D-Bus service path
74 DBUS_SERVICES_DIR="${datadir}/dbus-1/services"
75 AC_SUBST(DBUS_SERVICES_DIR)
76 AC_DEFINE_UNQUOTED(DBUS_SERVICES_DIR, "$DBUS_SERVICES_DIR", [Where services dir for D-Bus is])