configure.ac 2.73 KB
Newer Older
Zeeshan Ali's avatar
Zeeshan Ali committed
1 2 3
AC_PREREQ([2.63])

AC_INIT([geoclue],
Bastien Nocera's avatar
Bastien Nocera committed
4
        [1.99.0],
Zeeshan Ali's avatar
Zeeshan Ali committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
        [http://bugs.freedesktop.org/enter_bug.cgi?product=GeoClue],
        [geoclue],
        [http://www.freedesktop.org/wiki/Software/GeoClue])

AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])

AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip tar-ustar foreign -Wall -Werror])
AM_MAINTAINER_MODE([enable])

AM_SILENT_RULES([yes])

# Check for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AM_PROG_AR
AC_CHECK_TOOL([DESKTOP_FILE_VALIDATE], [desktop-file-validate], [/bin/true])

# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])

# Pkg-config
PKG_PROG_PKG_CONFIG([0.22])

# i18 support
IT_PROG_INTLTOOL(0.40.0)

GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])

# GObject-introspection support
GOBJECT_INTROSPECTION_REQUIRE([0.9.6])

# Mallard help
YELP_HELP_INIT

# GSettings support
GLIB_GSETTINGS

48 49 50 51
GLIB_MIN_VERSION=2.34.0
JSON_GLIB_MIN_VERSION=0.14

AC_CHECK_LIB([m],[sin])
Zeeshan Ali's avatar
Zeeshan Ali committed
52 53 54 55 56

PKG_CHECK_MODULES(GEOCLUE, [
  glib-2.0 >= $GLIB_MIN_VERSION
  gio-2.0 >= $GLIB_MIN_VERSION
  gio-unix-2.0 >= $GLIB_MIN_VERSION
57 58
  json-glib-1.0 >= $JSON_GLIB_MIN_VERSION
  libsoup-2.4
Zeeshan Ali's avatar
Zeeshan Ali committed
59 60
])

61 62 63 64 65 66 67 68 69 70 71 72 73 74
# Requires for the geoip server
PKG_CHECK_MODULES(GEOIP_SERVER,
		  gio-2.0 >= $GLIB_MIN_VERSION
		  json-glib-1.0 >= $JSON_GLIB_MIN_VERSION
		  libsoup-2.4
                  geoip)

# Requires for the database update
PKG_CHECK_MODULES(GEOIP_DBUPDATE,
		  gio-2.0 >= $GLIB_MIN_VERSION)

GEOIP_DATABASE_PATH=`$PKG_CONFIG --variable=databasedir geoip`
AC_SUBST(GEOIP_DATABASE_PATH)

Zeeshan Ali's avatar
Zeeshan Ali committed
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
dnl Strict compiler
AC_ARG_ENABLE([strict-cc],
  AS_HELP_STRING([--enable-strict-cc],[Enable strict C compiler]))

AS_IF([test "x$enable_strict_cc" = "xyes"], [CFLAGS="$CFLAGS -Wall -Werror"],
      [CFLAGS="$CFLAGS -w"])

dnl Debugging
AC_ARG_ENABLE(debug,
	AS_HELP_STRING([--enable-debug],[enable debugging]),,
        enable_debug=no)
if test "x$enable_debug" = "xyes"; then
        CFLAGS="$CFLAGS -O0 -ggdb3"
fi

Zeeshan Ali's avatar
Zeeshan Ali committed
90 91 92 93 94 95 96 97 98
# DBus system directory
AC_ARG_WITH(dbus-sys-dir, AS_HELP_STRING([--with-dbus-sys-dir=DIR], [where D-BUS system.d directory is]))
if test -n "$with_dbus_sys_dir" ; then
    DBUS_SYS_DIR="$with_dbus_sys_dir"
else
    DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d"
fi
AC_SUBST(DBUS_SYS_DIR)

Zeeshan Ali's avatar
Zeeshan Ali committed
99 100
GOBJECT_INTROSPECTION_CHECK([0.6.2])

Zeeshan Ali's avatar
Zeeshan Ali committed
101 102 103
AC_CONFIG_FILES([
  Makefile
  src/Makefile
104
  src/geoclue-2.0.pc
105
  src/geoip-server/Makefile
Zeeshan Ali's avatar
Zeeshan Ali committed
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121
  po/Makefile.in
  data/Makefile
  demo/Makefile
])

AC_OUTPUT

dnl ==========================================================================
AC_MSG_NOTICE([

        GeoClue $VERSION
        =================

        prefix:                   ${prefix}
        c compiler:               ${CC} ${CFLAGS}
])