1# configure.ac -- Autoconf script for gps loc_hal
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 loc-hal package version 1.0.0
8AC_INIT([loc-hal],1.0.0)
9# Does not strictly follow GNU Coding standards
10AM_INIT_AUTOMAKE([foreign])
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([utils/loc_cfg.cpp])
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([QMI], [qmi])
33AC_SUBST([QMI_CFLAGS])
34AC_SUBST([QMI_LIBS])
35
36PKG_CHECK_MODULES([QMIF], [qmi-framework])
37AC_SUBST([QMIF_CFLAGS])
38AC_SUBST([QMIF_LIBS])
39
40PKG_CHECK_MODULES([DATA], [data])
41AC_SUBST([DATA_CFLAGS])
42AC_SUBST([DATA_LIBS])
43
44PKG_CHECK_MODULES([LOCPLA], [loc-pla])
45AC_SUBST([LOCPLA_CFLAGS])
46AC_SUBST([LOCPLA_LIBS])
47
48PKG_CHECK_MODULES([GPSUTILS], [gps-utils])
49AC_SUBST([GPSUTILS_CFLAGS])
50AC_SUBST([GPSUTILS_LIBS])
51
52AC_ARG_WITH([core_includes],
53      AC_HELP_STRING([--with-core-includes=@<:@dir@:>@],
54         [Specify the location of the core headers]),
55      [core_incdir=$withval],
56      with_core_includes=no)
57
58if test "x$with_core_includes" != "xno"; then
59   CPPFLAGS="${CPPFLAGS} -I${core_incdir}"
60fi
61
62AC_SUBST([CPPFLAGS])
63
64AC_ARG_WITH([glib],
65      AC_HELP_STRING([--with-glib],
66         [enable glib, building HLOS systems which use glib]))
67
68if (test "x${with_glib}" = "xyes"); then
69        AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
70        PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
71                                AC_MSG_ERROR(GThread >= 2.16 is required))
72        PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
73                                AC_MSG_ERROR(GLib >= 2.16 is required))
74        GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
75        GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
76
77        AC_SUBST(GLIB_CFLAGS)
78        AC_SUBST(GLIB_LIBS)
79fi
80
81AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
82
83AC_CONFIG_FILES([ \
84        Makefile \
85        utils/Makefile \
86        core/Makefile \
87        loc_api/Makefile \
88        loc-hal.pc \
89        ])
90
91AC_OUTPUT
92