blob: 2a04f450d67171d22ce9352ed5be8b92b76d1212 [file] [log] [blame]
Naresh Munagala06e6d682016-12-23 10:42:44 +05301# configure.ac -- Autoconf script for gps gps-utils
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 gps-utils package version 1.0.0
8AC_INIT([gps-utils],1.0.0)
9# Does not strictly follow GNU Coding standards
Harikrishnan Hariharanbf12ff22019-09-23 15:49:43 +053010AM_INIT_AUTOMAKE([foreign subdir-objects])
Naresh Munagala06e6d682016-12-23 10:42:44 +053011# 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
Mike Caileandc0efb42018-12-13 10:08:18 -080031AC_ARG_WITH([external_ap],
32 AC_HELP_STRING([--with-external_ap=@<:@dir@:>@],
33 [Using External Application Processor]),
34 [],
35 with_external_ap=no)
36
37if test "x$with_external_ap" != "xno"; then
38 CPPFLAGS="${CPPFLAGS} -DFEATURE_EXTERNAL_AP"
39else
40 # Checks for libraries.
41 PKG_CHECK_MODULES([CUTILS], [libcutils])
42 AC_SUBST([CUTILS_CFLAGS])
43 AC_SUBST([CUTILS_LIBS])
44fi
Kevin Tang61de97e2016-09-12 17:20:55 -070045
46AC_ARG_WITH([core_includes],
47 AC_HELP_STRING([--with-core-includes=@<:@dir@:>@],
48 [Specify the location of the core headers]),
49 [core_incdir=$withval],
50 with_core_includes=no)
51
52if test "x$with_core_includes" != "xno"; then
53 CPPFLAGS="${CPPFLAGS} -I${core_incdir}"
54fi
55
56AC_ARG_WITH([locpla_includes],
57 AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@],
58 [specify the path to locpla-includes in loc-pla_git.bb]),
59 [locpla_incdir=$withval],
60 with_locpla_includes=no)
61
62if test "x$with_locpla_includes" != "xno"; then
63 AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}")
64fi
65
66AC_SUBST([CPPFLAGS])
Naresh Munagala06e6d682016-12-23 10:42:44 +053067
68AC_ARG_WITH([glib],
69 AC_HELP_STRING([--with-glib],
70 [enable glib, building HLOS systems which use glib]))
71
72if (test "x${with_glib}" = "xyes"); then
73 AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
74 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
75 AC_MSG_ERROR(GThread >= 2.16 is required))
76 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
77 AC_MSG_ERROR(GLib >= 2.16 is required))
78 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
79 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
80
81 AC_SUBST(GLIB_CFLAGS)
82 AC_SUBST(GLIB_LIBS)
83fi
84
85AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
86
87AC_CONFIG_FILES([ \
88 Makefile \
89 gps-utils.pc
90 ])
91
92AC_OUTPUT