2 # Process this file with autoconf to produce a configure script.
3 m4_define([champlain_major_version], [0])
4 m4_define([champlain_minor_version], [5])
5 m4_define([champlain_micro_version], [0])
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
12 AC_INIT([libchamplain],
14 pierre-luc@pierlux.com)
15 AC_CONFIG_SRCDIR([champlain/champlain.h])
16 AC_CONFIG_HEADER([config.h])
17 AC_CONFIG_MACRO_DIR([m4])
23 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
25 # Checks for programs.
28 AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
30 # Checks for libraries.
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
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)
46 AC_SUBST(LIBRARY_VERSION)
50 PKG_CHECK_MODULES(DEPS,
64 # -----------------------------------------------------------
65 # Check for libsoup, use libsoup-gnome if available
66 # -----------------------------------------------------------
67 PKG_CHECK_MODULES(SOUP, libsoup-gnome-2.4 >= 2.26, [
69 AC_DEFINE(HAVE_LIBSOUP_GNOME,1,[libsoup gnome integration])
70 ], have_soup_gnome="no")
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")
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.])
84 # -----------------------------------------------------------
86 # -----------------------------------------------------------
89 AC_HELP_STRING([--disable-debug],[compile without debug code]),
90 enable_debug=$enableval, enable_debug=yes )
92 if test x$enable_debug = xyes; then
93 AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code])
96 # -----------------------------------------------------------
98 # -----------------------------------------------------------
101 AC_HELP_STRING([--disable-gtk],[Don't compile Gtk+ embedded view]),
102 enable_gtk=$enableval, enable_gtk=yes )
104 if test x$enable_gtk = xyes; then
105 AC_SUBST(GTK_DEPS_CFLAGS)
106 AC_SUBST(GTK_DEPS_LIBS)
107 PKG_CHECK_MODULES(GTK_DEPS,
109 clutter-gtk-0.10 >= 0.10
113 AC_CONFIG_FILES([champlain-gtk/Makefile
114 docs/reference-gtk/Makefile
115 docs/reference-gtk/version.xml
117 champlain-gtk-uninstalled.pc])
119 AC_DEFINE(ENABLE_GTK, [], [Enable Gtk+ view code])
122 AM_CONDITIONAL(ENABLE_GTK, test "x$enable_gtk" = "xyes")
124 # -----------------------------------------------------------
125 # Enable managed (default to "no")
126 # -----------------------------------------------------------
127 AC_ARG_ENABLE(managed,
128 AC_HELP_STRING([--enable-managed],[Build champlain-sharp (and champlain-gtk-sharp)]),
129 enable_managed=$enableval, enable_managed=no )
131 if test x$enable_managed = xyes; then
132 AC_PATH_PROG(MCS, gmcs)
135 AC_PATH_PROG(GACUTIL, gacutil)
138 PKG_CHECK_MODULES(GAPI, gapi-2.0 >= 2.12.0)
139 AC_PATH_PROG(GAPI_PARSER, gapi2-parser)
140 AC_SUBST(GAPI_PARSER)
142 AC_PATH_PROG(GAPI_CODEGEN, gapi2-codegen)
143 AC_SUBST(GAPI_CODEGEN)
145 AC_PATH_PROG(GAPI_FIXUP, gapi2-fixup)
148 PKG_CHECK_MODULES(GTKSHARP, gtk-sharp-2.0 > 2.12.0)
149 AC_SUBST(GTKSHARP_LIBS)
151 PKG_CHECK_MODULES(CLUTTERSHARP, clutter-sharp >= 0.8.0)
152 AC_SUBST(CLUTTER_SHARP_LIBS)
154 PKG_CHECK_MODULES(CLUTTER_GTK_SHARP, clutter-gtk-sharp >= 0.8.0)
155 AC_SUBST(CLUTTER_GTK_SHARP_LIBS)
157 CHAMPLAIN_APIVERSION=0.3
158 CHAMPLAIN_GTK_APIVERSION=0.3
159 AC_SUBST(CHAMPLAIN_APIVERSION)
160 AC_SUBST(CHAMPLAIN_GTK_APIVERSION)
163 AM_CONDITIONAL(ENABLE_MANAGED, test "x$enable_managed" = "xyes")
165 # -----------------------------------------------------------
166 # Enable Python bindings
167 # -----------------------------------------------------------
169 AC_ARG_ENABLE(python,
170 AC_HELP_STRING([--enable-python],[Build python bindings]),
171 enable_python=$enableval, enable_python=no )
173 if test x$enable_python = xyes; then
174 PKG_CHECK_MODULES(PYTHON_BINDING,
185 ], have_python="yes", have_python="no")
187 if test "x$have_python" = "xyes" ; then
188 AC_CHECK_PROGS([PYGOBJECTCODEGEN], [pygobject-codegen-2.0 pygtk-codegen-2.0])
189 AM_CHECK_PYTHON_HEADERS(,have_python="no")
193 if test "x$enable_python" = "xyes" -a "x$have_python" != "xyes"; then
194 AC_MSG_ERROR([Couldn't find python. Check config.log])
197 AM_CONDITIONAL(ENABLE_PYTHON, test "x$enable_python" = "xyes")
198 GOBJECT_INTROSPECTION_CHECK([0.6.3])
200 # -----------------------------------------------------------
201 AC_CONFIG_FILES([Makefile
203 champlain/champlain-version.h
206 docs/reference/Makefile
207 docs/reference/version.xml
209 champlain-uninstalled.pc
210 bindings/perl/Champlain/Makefile
211 bindings/python/Makefile
212 bindings/python/champlain/Makefile
213 bindings/python/champlain-gtk/Makefile
214 bindings/python/demos/Makefile
215 bindings/managed/Makefile
216 bindings/managed/champlain/Makefile
217 bindings/managed/champlain/AssemblyInfo.cs
218 bindings/managed/champlain/champlain-sharp.pc
219 bindings/managed/champlain/champlain-sharp.dll.config
220 bindings/managed/champlain-gtk/Makefile
221 bindings/managed/champlain-gtk/AssemblyInfo.cs
222 bindings/managed/champlain-gtk/champlain-gtk-sharp.pc
223 bindings/managed/champlain-gtk/champlain-gtk-sharp.dll.config
224 bindings/managed/samples/Makefile
229 echo " libchamplain $VERSION"
231 echo " Prefix: ${prefix}"
232 echo " Compiler flags: ${CPPFLAGS}"
233 echo " Documentation: ${enable_gtk_doc}"
234 echo " Debug: ${enable_debug}"
235 echo " libsoup-gnome: ${have_soup_gnome}"
236 echo " Gtk+ View: ${enable_gtk}"
239 echo " champlain-sharp: ${enable_managed}"
240 echo " Python bindings: ${enable_python}"
241 echo " gobject-introspection: ${enable_introspection}"