1AC_PREREQ(2.61)
2AC_INIT([location-geofence], 1.0.0)
3AM_INIT_AUTOMAKE([foreign subdir-objects])
4AC_CONFIG_SRCDIR([Makefile.am])
5AC_CONFIG_HEADERS([config.h])
6AC_CONFIG_MACRO_DIR([m4])
7
8# Check for programs
9AC_PROG_LIBTOOL
10AC_PROG_CXX
11AC_PROG_CC
12AM_PROG_CC_C_O
13AC_PROG_AWK
14AC_PROG_CPP
15AC_PROG_INSTALL
16AC_PROG_LN_S
17AC_PROG_MAKE_SET
18PKG_PROG_PKG_CONFIG
19
20# Check for libraries
21PKG_CHECK_MODULES([GPSUTILS], [gps-utils])
22AC_SUBST([GPSUTILS_CFLAGS])
23AC_SUBST([GPSUTILS_LIBS])
24
25PKG_CHECK_MODULES([LOCCORE], [loc-core])
26AC_SUBST([LOCCORE_CFLAGS])
27AC_SUBST([LOCCORE_LIBS])
28
29AS_CASE([$host],
30        [arm*], [ARM=yes],
31        [ARM=no]
32)
33
34AC_ARG_WITH([locpla_includes],
35      AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@],
36         [specify the path to locpla-includes in loc-pla_git.bb]),
37      [locpla_incdir=$withval],
38      with_locpla_includes=no)
39
40if test "x$with_locpla_includes" != "xno"; then
41   AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}")
42fi
43
44AC_ARG_WITH([glib],
45      AC_HELP_STRING([--with-glib],
46         [enable glib, building HLOS systems which use glib]))
47
48if (test "x${with_glib}" = "xyes"); then
49        AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
50        PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
51                                AC_MSG_ERROR(GThread >= 2.16 is required))
52        PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
53                                AC_MSG_ERROR(GLib >= 2.16 is required))
54        GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
55        GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
56
57        AC_SUBST(GLIB_CFLAGS)
58        AC_SUBST(GLIB_LIBS)
59fi
60
61AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
62
63AC_SUBST([CFLAGS])
64AC_SUBST([CPPFLAGS])
65AC_SUBST([LIBS])
66
67AC_CONFIG_FILES([ \
68        Makefile \
69        location-geofence.pc
70        ])
71
72AC_OUTPUT
73