1 # configure.ac -- Autoconf script for gps loc_api 2 # 3 # Process this file with autoconf to produce a configure script 4 5 # Requires autoconf tool later than 2.61 6 AC_PREREQ(2.61) 7 # Initialize the gps loc_api package version 1.0.0 8 AC_INIT([loc-api],1.0.0) 9 # Does not strictly follow GNU Coding standards 10 AM_INIT_AUTOMAKE([foreign]) 11 # Disables auto rebuilding of configure, Makefile.ins 12 AM_MAINTAINER_MODE 13 # Verifies the --srcdir is correct by checking for the path 14 AC_CONFIG_SRCDIR([utils/loc_cfg.cpp]) 15 # defines some macros variable to be included by source 16 AC_CONFIG_HEADERS([config.h]) 17 AC_CONFIG_MACRO_DIR([m4]) 18 19 # Checks for programs. 20 AC_PROG_LIBTOOL 21 AC_PROG_CXX 22 AC_PROG_CC 23 AM_PROG_CC_C_O 24 AC_PROG_AWK 25 AC_PROG_CPP 26 AC_PROG_INSTALL 27 AC_PROG_LN_S 28 AC_PROG_MAKE_SET 29 PKG_PROG_PKG_CONFIG 30 31 # Checks for libraries. 32 PKG_CHECK_MODULES([QMIF], [qmi-framework]) 33 AC_SUBST([QMIF_CFLAGS]) 34 AC_SUBST([QMIF_LIBS]) 35 36 AC_ARG_WITH([libhardware_includes], 37 AC_HELP_STRING([--with-libhardware-includes=@<:@dir@:>@], 38 [Specify the location of the libhardware headers]), 39 [libhardware_incdir=$withval], 40 with_libhardware_includes=no) 41 42 if test "x$with_libhardware_includes" != "xno"; then 43 CPPFLAGS="${CPPFLAGS} -I${libhardware_incdir}" 44 fi 45 46 AC_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 52 if test "x$with_core_includes" != "xno"; then 53 CPPFLAGS="${CPPFLAGS} -I${core_incdir}" 54 fi 55 56 AC_SUBST([CPPFLAGS]) 57 58 AC_ARG_WITH([glib], 59 AC_HELP_STRING([--with-glib], 60 [enable glib, building HLOS systems which use glib])) 61 62 if (test "x${with_glib}" = "xyes"); then 63 AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 64 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 65 AC_MSG_ERROR(GThread >= 2.16 is required)) 66 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 67 AC_MSG_ERROR(GLib >= 2.16 is required)) 68 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 69 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 70 71 AC_SUBST(GLIB_CFLAGS) 72 AC_SUBST(GLIB_LIBS) 73 fi 74 75 AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 76 77 AC_CONFIG_FILES([ \ 78 Makefile \ 79 utils/Makefile \ 80 loc_api/libloc_api_50001/Makefile \ 81 loc_api/loc_api_v02/Makefile \ 82 loc-api.pc \ 83 ]) 84 85 AC_OUTPUT 86