Michael Bestas | 58e7cab | 2023-05-12 04:05:32 +0300 | [diff] [blame] | 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 |
| 6 | AC_PREREQ(2.61) |
| 7 | # Initialize the gps loc-hal package version 1.0.0 |
| 8 | AC_INIT([loc-hal],1.0.0) |
| 9 | # Does not strictly follow GNU Coding standards |
| 10 | AM_INIT_AUTOMAKE([foreign subdir-objects]) |
| 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([Makefile.am]) |
| 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([GPSUTILS], [gps-utils]) |
| 33 | AC_SUBST([GPSUTILS_CFLAGS]) |
| 34 | AC_SUBST([GPSUTILS_LIBS]) |
| 35 | |
| 36 | PKG_CHECK_MODULES([LOCCORE], [loc-core]) |
| 37 | AC_SUBST([LOCCORE_CFLAGS]) |
| 38 | AC_SUBST([LOCCORE_LIBS]) |
| 39 | |
| 40 | AC_ARG_WITH([core_includes], |
| 41 | AC_HELP_STRING([--with-core-includes=@<:@dir@:>@], |
| 42 | [Specify the location of the core headers]), |
| 43 | [core_incdir=$withval], |
| 44 | with_core_includes=no) |
| 45 | |
| 46 | if test "x$with_core_includes" != "xno"; then |
| 47 | CPPFLAGS="${CPPFLAGS} -I${core_incdir}" |
| 48 | fi |
| 49 | |
| 50 | AC_ARG_WITH([locpla_includes], |
| 51 | AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@], |
| 52 | [specify the path to locpla-includes in loc-pla_git.bb]), |
| 53 | [locpla_incdir=$withval], |
| 54 | with_locpla_includes=no) |
| 55 | |
| 56 | if test "x$with_locpla_includes" != "xno"; then |
| 57 | AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}") |
| 58 | fi |
| 59 | |
| 60 | AC_SUBST([CPPFLAGS]) |
| 61 | |
| 62 | AC_ARG_WITH([glib], |
| 63 | AC_HELP_STRING([--with-glib], |
| 64 | [enable glib, building HLOS systems which use glib])) |
| 65 | |
| 66 | if (test "x${with_glib}" = "xyes"); then |
| 67 | AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) |
| 68 | PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, |
| 69 | AC_MSG_ERROR(GThread >= 2.16 is required)) |
| 70 | PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, |
| 71 | AC_MSG_ERROR(GLib >= 2.16 is required)) |
| 72 | GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" |
| 73 | GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" |
| 74 | |
| 75 | AC_SUBST(GLIB_CFLAGS) |
| 76 | AC_SUBST(GLIB_LIBS) |
| 77 | fi |
| 78 | |
| 79 | AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") |
| 80 | |
| 81 | AC_CONFIG_FILES([ \ |
| 82 | Makefile \ |
| 83 | gnss/Makefile \ |
| 84 | loc-hal.pc \ |
| 85 | ]) |
| 86 | |
| 87 | AC_OUTPUT |