1# configure.ac -- Autoconf script for gps location-batching
2#
3# Process this file with autoconf to produce a configure script
4
5# Requires autoconf tool later than 2.61
6AC_PREREQ(2.61)
7# Initialize the gps location-batching package version 1.0.0
8AC_INIT([location-batching],1.0.0)
9# Does not strictly follow GNU Coding standards
10AM_INIT_AUTOMAKE([foreign subdir-objects])
11# Disables auto rebuilding of configure, Makefile.ins
12AM_MAINTAINER_MODE
13# Verifies the --srcdir is correct by checking for the path
14AC_CONFIG_SRCDIR([Makefile.am])
15# defines some macros variable to be included by source
16AC_CONFIG_HEADERS([config.h])
17AC_CONFIG_MACRO_DIR([m4])
18
19# Checks for programs.
20AC_PROG_LIBTOOL
21AC_PROG_CXX
22AC_PROG_CC
23AM_PROG_CC_C_O
24AC_PROG_AWK
25AC_PROG_CPP
26AC_PROG_INSTALL
27AC_PROG_LN_S
28AC_PROG_MAKE_SET
29PKG_PROG_PKG_CONFIG
30
31# Checks for libraries.
32PKG_CHECK_MODULES([GPSUTILS], [gps-utils])
33AC_SUBST([GPSUTILS_CFLAGS])
34AC_SUBST([GPSUTILS_LIBS])
35
36PKG_CHECK_MODULES([LOCCORE], [loc-core])
37AC_SUBST([LOCCORE_CFLAGS])
38AC_SUBST([LOCCORE_LIBS])
39
40PKG_CHECK_MODULES([GEOFENCE], [location-geofence])
41AC_SUBST([GEOFENCE_CFLAGS])
42AC_SUBST([GEOFENCE_LIBS])
43
44AC_ARG_WITH([locpla_includes],
45      AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@],
46         [specify the path to locpla-includes in loc-pla_git.bb]),
47      [locpla_incdir=$withval],
48      with_locpla_includes=no)
49
50if test "x$with_locpla_includes" != "xno"; then
51   AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}")
52fi
53
54AC_ARG_WITH([glib],
55      AC_HELP_STRING([--with-glib],
56         [enable glib, building HLOS systems which use glib]))
57
58if (test "x${with_glib}" = "xyes"); then
59        AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
60        PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
61                                AC_MSG_ERROR(GThread >= 2.16 is required))
62        PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
63                                AC_MSG_ERROR(GLib >= 2.16 is required))
64        GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
65        GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
66
67        AC_SUBST(GLIB_CFLAGS)
68        AC_SUBST(GLIB_LIBS)
69fi
70
71AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
72
73AC_CONFIG_FILES([ \
74        Makefile \
75        location-batching.pc
76        ])
77
78AC_OUTPUT
79