configure.ac 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # configure.ac -- Autoconf script for gps location-api-iface
  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 location-api-iface package version 1.0.0
  7. AC_INIT([location-api-iface],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([location-api.pc.in])
  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. AC_ARG_WITH([core_includes],
  33. AC_HELP_STRING([--with-core-includes=@<:@dir@:>@],
  34. [Specify the location of the core headers]),
  35. [core_incdir=$withval],
  36. with_core_includes=no)
  37. if test "x$with_core_includes" != "xno"; then
  38. CPPFLAGS="${CPPFLAGS} -I${core_incdir}"
  39. fi
  40. AC_ARG_WITH([locpla_includes],
  41. AC_HELP_STRING([--with-locpla-includes=@<:@dir@:>@],
  42. [Specify the path to locpla-includes in loc-pla_git.bb]),
  43. [locpla_incdir=$withval],
  44. with_locpla_includes=no)
  45. if test "x${with_locpla_includes}" != "xno"; then
  46. AC_SUBST(LOCPLA_CFLAGS, "-I${locpla_incdir}")
  47. fi
  48. AC_SUBST([CPPFLAGS])
  49. AC_ARG_WITH([glib],
  50. AC_HELP_STRING([--with-glib],
  51. [enable glib, building HLOS systems which use glib]))
  52. if (test "x${with_glib}" = "xyes"); then
  53. AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib])
  54. PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
  55. AC_MSG_ERROR(GThread >= 2.16 is required))
  56. PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
  57. AC_MSG_ERROR(GLib >= 2.16 is required))
  58. GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
  59. GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
  60. AC_SUBST(GLIB_CFLAGS)
  61. AC_SUBST(GLIB_LIBS)
  62. fi
  63. AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
  64. # External AP
  65. AC_ARG_WITH([external_ap],
  66. AC_HELP_STRING([--with-external_ap=@<:@dir@:>@],
  67. [Using External Application Processor]),
  68. [],
  69. with_external_ap=no)
  70. if test "x$with_external_ap" != "xno"; then
  71. CPPFLAGS="${CPPFLAGS} -DFEATURE_EXTERNAL_AP"
  72. fi
  73. AM_CONDITIONAL(USE_EXTERNAL_AP, test "x${with_external_ap}" = "xyes")
  74. AC_CONFIG_FILES([ \
  75. Makefile \
  76. location-api.pc \
  77. ])
  78. AC_OUTPUT