1
#                                               -*- Autoconf -*-
2
# Process this file with autoconf to produce a configure script.
3
m4_define([champlain_major_version], [0])
4
m4_define([champlain_minor_version], [4])
5
m4_define([champlain_micro_version], [4])
6
m4_define([champlain_version],
7
          [champlain_major_version.champlain_minor_version.champlain_micro_version])
8
m4_define([api_version],
9
          [champlain_major_version.champlain_minor_version])
10
# if the API changes, set to 0
11
AC_PREREQ(2.61)
12
AC_INIT([libchamplain],
13
        [champlain_version],
14
        pierre-luc@pierlux.com)
15
AC_CONFIG_SRCDIR([champlain/champlain.h])
16
AC_CONFIG_HEADER([config.h])
17
AC_CONFIG_MACRO_DIR([m4])
18
19
AM_INIT_AUTOMAKE
20
AC_LIBTOOL_DLOPEN
21
AM_PROG_LIBTOOL
22
23
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
24
25
# Checks for programs.
26
AC_PROG_CC
27
AM_PROG_CC_C_O
28
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
29
30
# Checks for libraries.
31
LIBRARY_VERSION=3:1:3
32
# API_VERSION is used to generate pc files only
33
API_VERSION=api_version
34
CHAMPLAIN_MAJOR_VERSION=champlain_major_version
35
CHAMPLAIN_MINOR_VERSION=champlain_minor_version
36
CHAMPLAIN_MICRO_VERSION=champlain_micro_version
37
CHAMPLAIN_VERSION=champlain_version
38
CHAMPLAIN_MAJORMINOR=champlain_api_version
39
AC_SUBST(API_VERSION)
40
AC_SUBST(CHAMPLAIN_MAJOR_VERSION)
41
AC_SUBST(CHAMPLAIN_MINOR_VERSION)
42
AC_SUBST(CHAMPLAIN_MICRO_VERSION)
43
AC_SUBST(CHAMPLAIN_VERSION)
44
AC_SUBST(CHAMPLAIN_MAJORMINOR)
45
46
AC_SUBST(LIBRARY_VERSION)
47
AC_SUBST(DEPS_CFLAGS)
48
AC_SUBST(DEPS_LIBS)
49
50
PKG_CHECK_MODULES(DEPS,
51
  [   glib-2.0 >= 2.16,
52
      gobject-2.0 >= 2.10,
53
      gdk-2.0 >= 2.10,
54
      clutter-1.0 >= 1.0
55
      cairo >= 1.4,
56
      gio-2.0 >= 2.16,
57
      sqlite3 >= 3.0
58
  ]
59
)
60
# check for gtk-doc
61
GTK_DOC_CHECK(1.9)
62
IDT_COMPILE_WARNINGS
63
64
# -----------------------------------------------------------
65
# Check for libsoup, use libsoup-gnome if available
66
# -----------------------------------------------------------
67
PKG_CHECK_MODULES(SOUP, libsoup-gnome-2.4 >= 2.26, [
68
    have_soup_gnome="yes"
69
    AC_DEFINE(HAVE_LIBSOUP_GNOME,1,[libsoup gnome integration])
70
    ], have_soup_gnome="no")
71
72
if test "x$have_soup_gnome" = "xno"; then
73
  PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.4.1,
74
     have_soup="yes", have_soup="no")
75
fi
76
77
if test "x$have_soup" = "xno" && test "x$have_soup_gnome" = "xno"; then
78
   AC_MSG_ERROR([Couldn't find libsoup or libsoup-gnome.])
79
fi
80
81
AC_SUBST(SOUP_CFLAGS)
82
AC_SUBST(SOUP_LIBS)
83
84
# -----------------------------------------------------------
85
# Enable debug
86
# -----------------------------------------------------------
87
88
AC_ARG_ENABLE(debug,
89
  AC_HELP_STRING([--disable-debug],[compile without debug code]),
90
    enable_debug=$enableval, enable_debug=yes )
91
92
if test x$enable_debug = xyes; then
93
  AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
94
fi
95
96
# -----------------------------------------------------------
97
# Enable Maemo optimizations
98
# -----------------------------------------------------------
99
100
AC_ARG_ENABLE(maemo,
101
  AC_HELP_STRING([--enable-maemo],[compile with maemo optimizations]),
102
    [enable_maemo=yes])
103
104
if test x$enable_maemo = xyes; then
105
  AC_DEFINE(USE_MAEMO, [], [Enable Maemo Optimizations])
106
fi
107
108
# -----------------------------------------------------------
109
# Enable gtk
110
# -----------------------------------------------------------
111
112
AC_ARG_ENABLE(gtk,
113
  AC_HELP_STRING([--disable-gtk],[Don't compile Gtk+ embedded view]),
114
    enable_gtk=$enableval, enable_gtk=yes )
115
116
if test x$enable_gtk = xyes; then
117
  AC_SUBST(GTK_DEPS_CFLAGS)
118
  AC_SUBST(GTK_DEPS_LIBS)
119
  PKG_CHECK_MODULES(GTK_DEPS,
120
    [   gtk+-2.0 >= 2.12
121
        clutter-gtk-0.10 >= 0.10
122
    ]
123
  )
124
125
  AC_CONFIG_FILES([champlain-gtk/Makefile
126
                   docs/reference-gtk/Makefile
127
                   docs/reference-gtk/version.xml
128
                   champlain-gtk.pc
129
                   champlain-gtk-uninstalled.pc])
130
131
  AC_DEFINE(ENABLE_GTK, [], [Enable Gtk+ view code])
132
fi
133
134
AM_CONDITIONAL(ENABLE_GTK, test "x$enable_gtk" = "xyes")
135
136
# -----------------------------------------------------------
137
# Enable managed (default to "no")
138
# -----------------------------------------------------------
139
AC_ARG_ENABLE(managed,
140
  AC_HELP_STRING([--enable-managed],[Build champlain-sharp (and champlain-gtk-sharp)]),
141
    enable_managed=$enableval, enable_managed=no )
142
143
if test x$enable_managed = xyes; then
144
  AC_PATH_PROG(MCS, gmcs)
145
  AC_SUBST(MCS)
146
147
  AC_PATH_PROG(GACUTIL, gacutil)
148
  AC_SUBST(GACUTIL)
149
150
  PKG_CHECK_MODULES(GAPI, gapi-2.0 >= 2.12.0)
151
  AC_PATH_PROG(GAPI_PARSER, gapi2-parser)
152
  AC_SUBST(GAPI_PARSER)
153
154
  AC_PATH_PROG(GAPI_CODEGEN, gapi2-codegen)
155
  AC_SUBST(GAPI_CODEGEN)
156
157
  AC_PATH_PROG(GAPI_FIXUP, gapi2-fixup)
158
  AC_SUBST(GAPI_FIXUP)
159
160
  PKG_CHECK_MODULES(GTKSHARP, gtk-sharp-2.0 > 2.12.0)
161
  AC_SUBST(GTKSHARP_LIBS)
162
163
  PKG_CHECK_MODULES(CLUTTERSHARP, clutter-sharp >= 0.8.0)
164
  AC_SUBST(CLUTTER_SHARP_LIBS)
165
166
  PKG_CHECK_MODULES(CLUTTER_GTK_SHARP, clutter-gtk-sharp >= 0.8.0)
167
  AC_SUBST(CLUTTER_GTK_SHARP_LIBS)
168
169
  CHAMPLAIN_APIVERSION=0.3
170
  CHAMPLAIN_GTK_APIVERSION=0.3
171
  AC_SUBST(CHAMPLAIN_APIVERSION)
172
  AC_SUBST(CHAMPLAIN_GTK_APIVERSION)
173
fi
174
175
AM_CONDITIONAL(ENABLE_MANAGED, test "x$enable_managed" = "xyes")
176
177
# -----------------------------------------------------------
178
# Enable Python bindings
179
# -----------------------------------------------------------
180
181
AC_ARG_ENABLE(python,
182
  AC_HELP_STRING([--enable-python],[Build python bindings]),
183
    enable_python=$enableval, enable_python=no )
184
185
if test x$enable_python = xyes; then
186
  PKG_CHECK_MODULES(PYTHON_BINDING,
187
   [
188
      pygtk-2.0,
189
      pygobject-2.0,
190
      glib-2.0,
191
      gobject-2.0,
192
      clutter-1.0,
193
      pyclutter-1.0,
194
      pyclutter-gtk-0.9,
195
      gconf-2.0,
196
      gtk+-2.0
197
   ], have_python="yes", have_python="no")
198
199
  if test "x$have_python" = "xyes" ; then
200
    AC_CHECK_PROGS([PYGOBJECTCODEGEN], [pygobject-codegen-2.0 pygtk-codegen-2.0])
201
    AM_CHECK_PYTHON_HEADERS(,have_python="no")
202
  fi
203
fi
204
205
if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
206
   AC_MSG_ERROR([Couldn't find python. Check config.log])
207
fi
208
209
AM_CONDITIONAL(ENABLE_PYTHON, test "x$enable_python" = "xyes")
210
GOBJECT_INTROSPECTION_CHECK([0.6.3])
211
212
# -----------------------------------------------------------
213
AC_CONFIG_FILES([Makefile
214
                 champlain/Makefile
215
                 champlain/champlain-version.h
216
                 demos/Makefile
217
                 tidy/Makefile
218
                 docs/reference/Makefile
219
                 docs/reference/version.xml
220
                 champlain.pc
221
                 champlain-uninstalled.pc
222
                 bindings/perl/Champlain/Makefile
223
                 bindings/python/Makefile
224
                 bindings/python/champlain/Makefile
225
                 bindings/python/champlain-gtk/Makefile
226
                 bindings/python/demos/Makefile
227
                 bindings/managed/Makefile
228
                 bindings/managed/champlain/Makefile
229
                 bindings/managed/champlain/AssemblyInfo.cs
230
                 bindings/managed/champlain/champlain-sharp.pc
231
                 bindings/managed/champlain/champlain-sharp.dll.config
232
                 bindings/managed/champlain-gtk/Makefile
233
                 bindings/managed/champlain-gtk/AssemblyInfo.cs
234
                 bindings/managed/champlain-gtk/champlain-gtk-sharp.pc
235
                 bindings/managed/champlain-gtk/champlain-gtk-sharp.dll.config
236
                 bindings/managed/samples/Makefile
237
                 bindings/Makefile])
238
AC_OUTPUT
239
240
echo ""
241
echo " libchamplain $VERSION"
242
echo ""
243
echo "          Prefix: ${prefix}"
244
echo "  Compiler flags: ${CPPFLAGS}"
245
echo "   Documentation: ${enable_gtk_doc}"
246
echo "           Debug: ${enable_debug}"
247
echo "   libsoup-gnome: ${have_soup_gnome}"
248
echo "       Gtk+ View: ${enable_gtk}"
249
echo ""
250
echo "Bindings:"
251
echo "       champlain-sharp: ${enable_managed}"
252
echo "       Python bindings: ${enable_python}"
253
echo " gobject-introspection: ${enable_introspection}"
254
echo ""