configure.ac 2.6 KB

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