| 1 |
dnl $Id$ |
|---|
| 2 |
dnl |
|---|
| 3 |
dnl Process this file with autoconf to produce a configure script. |
|---|
| 4 |
dnl |
|---|
| 5 |
dnl The Midgard version number is changed from here. First edit |
|---|
| 6 |
dnl this file, then write a ChangeLog entry about the new version, |
|---|
| 7 |
dnl and finally commit the source tree and give it a tag. |
|---|
| 8 |
dnl |
|---|
| 9 |
dnl If the version contains user visible changes then you should |
|---|
| 10 |
dnl have updated the NEWS file. Remember also to test the release |
|---|
| 11 |
dnl before committing. |
|---|
| 12 |
dnl |
|---|
| 13 |
AC_INIT([midgard2-core],[9.09.99]) |
|---|
| 14 |
AC_PREREQ(2.50) |
|---|
| 15 |
AC_CONFIG_MACRO_DIR([m4]) |
|---|
| 16 |
AC_CONFIG_HEADERS([config.h]) |
|---|
| 17 |
AC_CONFIG_SRCDIR(src/midgard.c) |
|---|
| 18 |
|
|---|
| 19 |
dnl Automake is needed for the build system. |
|---|
| 20 |
dnl |
|---|
| 21 |
AM_INIT_AUTOMAKE([-Wno-portability]) |
|---|
| 22 |
AM_MAINTAINER_MODE |
|---|
| 23 |
#GOBJECT_INTROSPECTION_CHECK([0.6.7]) |
|---|
| 24 |
|
|---|
| 25 |
AM_PROG_LEX |
|---|
| 26 |
AC_PROG_YACC |
|---|
| 27 |
AC_PROG_CC(gcc cc) |
|---|
| 28 |
AM_PROG_CC_C_O |
|---|
| 29 |
AC_LANG(C) |
|---|
| 30 |
|
|---|
| 31 |
dnl Checks for programs. |
|---|
| 32 |
AM_PROG_LIBTOOL |
|---|
| 33 |
|
|---|
| 34 |
dnl Checks for libraries. |
|---|
| 35 |
AC_MSG_CHECKING([whether to use Libgda4 (libgda3 by default)]) |
|---|
| 36 |
AC_ARG_WITH(libgda4, [ --with-libgda4], gdamodule="libgda-4.0", gdamodule="libgda-3.0") |
|---|
| 37 |
gdamodule="libgda-4.0" |
|---|
| 38 |
AC_MSG_RESULT($gdamodule) |
|---|
| 39 |
|
|---|
| 40 |
_MIDGARD_DBUS_SUPPORT=yes |
|---|
| 41 |
dbus_libs="dbus-1 dbus-glib-1" |
|---|
| 42 |
MIDGARD_DBUS_SUPPORT=1 |
|---|
| 43 |
AC_MSG_CHECKING([whether to compile dbus support (enabled by default)]) |
|---|
| 44 |
AC_ARG_WITH(dbus-support, |
|---|
| 45 |
[ --with-dbus-support compile with dbus support ], |
|---|
| 46 |
_MIDGARD_DBUS_SUPPORT=[$]withval, _MIDGARD_DBUS_SUPPORT="yes") |
|---|
| 47 |
AC_MSG_RESULT($_MIDGARD_DBUS_SUPPORT) |
|---|
| 48 |
if test "$_MIDGARD_DBUS_SUPPORT" == "no"; then |
|---|
| 49 |
#MIDGARD_DBUS_SUPPORT=0 |
|---|
| 50 |
dbus_libs="" |
|---|
| 51 |
fi |
|---|
| 52 |
|
|---|
| 53 |
PKG_CHECK_MODULES(MIDGARD, glib-2.0 gobject-2.0 libxml-2.0 $gdamodule $dbus_libs) |
|---|
| 54 |
if test "$gdamodule" == "libgda-4.0"; then |
|---|
| 55 |
MIDGARD_CFLAGS="${MIDGARD_CFLAGS} -DHAVE_LIBGDA_4" |
|---|
| 56 |
fi |
|---|
| 57 |
|
|---|
| 58 |
DBUS_CONF_DIR="/etc" |
|---|
| 59 |
if test "$_MIDGARD_DBUS_SUPPORT" == "yes"; then |
|---|
| 60 |
#MIDGARD_DBUS_SUPPORT=1 |
|---|
| 61 |
MIDGARD_CFLAGS=" ${MIDGARD_CFLAGS} -DMGD_HAVE_DBUS " |
|---|
| 62 |
DBUS_CONF_DIR=`pkg-config --variable sysconfdir dbus-1` |
|---|
| 63 |
fi |
|---|
| 64 |
AM_CONDITIONAL(MIDGARD_DBUS_SUPPORT, test x$_MIDGARD_DBUS_SUPPORT = xyes) |
|---|
| 65 |
|
|---|
| 66 |
AM_GLIB_GNU_GETTEXT |
|---|
| 67 |
LIBS="$INTLLIBS $LIBS" |
|---|
| 68 |
|
|---|
| 69 |
PATH="${PATH}:${prefix}/bin" |
|---|
| 70 |
|
|---|
| 71 |
dnl Checks for header files. |
|---|
| 72 |
AC_HEADER_STDC |
|---|
| 73 |
|
|---|
| 74 |
dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 75 |
AC_C_CONST |
|---|
| 76 |
|
|---|
| 77 |
dnl Checks for library functions. |
|---|
| 78 |
|
|---|
| 79 |
dnl accomodate Solaris |
|---|
| 80 |
AC_SEARCH_LIBS(gethostbyname, nsl) |
|---|
| 81 |
AC_SEARCH_LIBS(htonl, socket) |
|---|
| 82 |
|
|---|
| 83 |
AC_MSG_CHECKING([if building for some Win32 platform]) |
|---|
| 84 |
case "$host" in |
|---|
| 85 |
*-*-mingw*|*-*-cygwin*) |
|---|
| 86 |
platform_win32=yes |
|---|
| 87 |
;; |
|---|
| 88 |
*) |
|---|
| 89 |
platform_win32=no |
|---|
| 90 |
;; |
|---|
| 91 |
esac |
|---|
| 92 |
AC_MSG_RESULT($platform_win32) |
|---|
| 93 |
AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes) |
|---|
| 94 |
|
|---|
| 95 |
if test "$prefix" = "/usr"; then |
|---|
| 96 |
sysconfdir="/etc/midgard2" |
|---|
| 97 |
elif test "$prefix" = "NONE"; then |
|---|
| 98 |
sysconfdir="/usr/local/etc/midgard2" |
|---|
| 99 |
else |
|---|
| 100 |
sysconfdir="$prefix/etc/midgard2" |
|---|
| 101 |
fi |
|---|
| 102 |
|
|---|
| 103 |
LIBS="$LIBS $MIDGARD_LIBS" |
|---|
| 104 |
|
|---|
| 105 |
AC_SUBST(LIBS) |
|---|
| 106 |
AC_SUBST(VERSION) |
|---|
| 107 |
AC_SUBST(VERSION_STRING) |
|---|
| 108 |
AC_SUBST(LFLAGS) |
|---|
| 109 |
AC_SUBST(MIDGARD_DBUS_SUPPORT) |
|---|
| 110 |
AC_SUBST(LIBGDA_VERSION, $gdamodule) |
|---|
| 111 |
AC_SUBST(MIDGARD_LIBS) |
|---|
| 112 |
AC_SUBST(MIDGARD_CFLAGS) |
|---|
| 113 |
AC_SUBST(DBUS_CONF_DIR) |
|---|
| 114 |
|
|---|
| 115 |
AC_CONFIG_FILES([Makefile Doxyfile src/midgard_config_auto.h midgard2.pc]) |
|---|
| 116 |
AC_OUTPUT |
|---|