-
Notifications
You must be signed in to change notification settings - Fork 6
/
configure.in
123 lines (103 loc) · 3.17 KB
/
configure.in
1
2
3
4
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
dnl $Id$
dnl
dnl Process this file with autoconf to produce a configure script.
dnl
dnl The Midgard version number is changed from here. First edit
dnl this file, then write a ChangeLog entry about the new version,
dnl and finally commit the source tree and give it a tag.
dnl
dnl If the version contains user visible changes then you should
dnl have updated the NEWS file. Remember also to test the release
dnl before committing.
dnl
AC_INIT([midgard2-core],[12.09])
AC_PREREQ(2.50)
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR(src/midgard.c)
dnl Automake is needed for the build system.
dnl
AM_INIT_AUTOMAKE([-Wno-portability -Wall])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
AM_MAINTAINER_MODE
GOBJECT_INTROSPECTION_CHECK([0.6.5])
AC_PROG_CC(gcc cc)
AC_LANG(C)
dnl Checks for programs.
AM_PROG_LIBTOOL
dnl Checks libgda
gdamodule="libgda-4.0"
GDA_GIR_INCLUDE="Gda-4.0"
GDA_GIR_PACKAGE="libgda-4.0"
AC_MSG_CHECKING([whether to use Libgda5 (libgda4 by default)])
AC_ARG_WITH(libgda5, [ --with-libgda5], gdamodule="libgda-5.0", gdamodule="libgda-4.0")
AC_MSG_RESULT($gdamodule)
if test "$gdamodule" == "libgda-5.0"; then
GDA_GIR_INCLUDE="Gda-5.0"
GDA_GIR_PACKAGE="libgda-5.0"
fi
_MIDGARD_DBUS_SUPPORT=yes
dbus_libs="dbus-1 dbus-glib-1"
MIDGARD_DBUS_SUPPORT=1
AC_MSG_CHECKING([whether to compile dbus support (enabled by default)])
AC_ARG_WITH(dbus-support,
[ --with-dbus-support compile with dbus support ],
_MIDGARD_DBUS_SUPPORT=[$]withval, _MIDGARD_DBUS_SUPPORT="yes")
AC_MSG_RESULT($_MIDGARD_DBUS_SUPPORT)
if test "$_MIDGARD_DBUS_SUPPORT" == "no"; then
#MIDGARD_DBUS_SUPPORT=0
dbus_libs=""
fi
PKG_CHECK_MODULES(MIDGARD, glib-2.0 gobject-2.0 libxml-2.0 $gdamodule $dbus_libs)
if test "$gdamodule" == "libgda-4.0"; then
MIDGARD_CFLAGS="${MIDGARD_CFLAGS} -DHAVE_LIBGDA_4"
fi
DBUS_CONF_DIR="/etc"
if test "$_MIDGARD_DBUS_SUPPORT" == "yes"; then
#MIDGARD_DBUS_SUPPORT=1
MIDGARD_CFLAGS=" ${MIDGARD_CFLAGS} -DMGD_HAVE_DBUS "
DBUS_CONF_DIR=`pkg-config --variable sysconfdir dbus-1`
fi
AM_CONDITIONAL(MIDGARD_DBUS_SUPPORT, test x$_MIDGARD_DBUS_SUPPORT = xyes)
LIBS="$INTLLIBS $LIBS"
PATH="${PATH}:${prefix}/bin"
dnl Checks for header files.
AC_HEADER_STDC
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
dnl Checks for library functions.
dnl accomodate Solaris
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(htonl, socket)
AC_MSG_CHECKING([if building for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
;;
*)
platform_win32=no
;;
esac
AC_MSG_RESULT($platform_win32)
AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_win32 = xyes)
if test "$prefix" = "/usr"; then
sysconfdir="/etc/midgard2"
elif test "$prefix" = "NONE"; then
sysconfdir="/usr/local/etc/midgard2"
else
sysconfdir="$prefix/etc/midgard2"
fi
LIBS="$LIBS $MIDGARD_LIBS"
AC_SUBST(LIBS)
AC_SUBST(VERSION)
AC_SUBST(VERSION_STRING)
AC_SUBST(LFLAGS)
AC_SUBST(MIDGARD_DBUS_SUPPORT)
AC_SUBST(GDA_GIR_INCLUDE)
AC_SUBST(GDA_GIR_PACKAGE)
AC_SUBST(LIBGDA_VERSION, $gdamodule)
AC_SUBST(MIDGARD_LIBS)
AC_SUBST(MIDGARD_CFLAGS)
AC_SUBST(DBUS_CONF_DIR)
AC_CONFIG_FILES([Makefile Doxyfile src/midgard_config_auto.h midgard2.pc])
AC_OUTPUT