Post-release version bump.
[gnome.seed] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(seed, 2.29.6.1)
3
4 AM_INIT_AUTOMAKE([1.7 -Wno-portability])
5 AM_MAINTAINER_MODE
6 AC_CONFIG_HEADERS([config.h])
7
8 AC_CONFIG_MACRO_DIR([m4])
9
10 AC_CANONICAL_HOST
11
12 AC_PROG_CC
13 AM_PROG_CC_C_O
14 AC_PROG_LIBTOOL
15 PKG_PROG_PKG_CONFIG
16
17 # Use AM_SILENT_RULES if present
18 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
19
20 changequote(,)dnl
21 ensureflag() {
22   flag="$1"; shift
23   result="$@"
24
25   case " ${result} " in
26   *[\ \ ]${flag}[\ \    ]*) ;;
27   *) result="${flag} ${result}" ;;
28   esac
29
30   echo ${result}
31 }
32
33 changequote([,])dnl
34
35 dnl =====================Internationalization==================================
36 GETTEXT_PACKAGE=seed
37 AC_SUBST(GETTEXT_PACKAGE)
38 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [GETTEXT package name])
39 AM_GLIB_GNU_GETTEXT
40 IT_PROG_INTLTOOL([0.35.0])
41
42 dnl ============================libffi=========================================
43 PKG_CHECK_MODULES(FFI, libffi, have_ffi_pkgconfig=yes, have_ffi_pkgconfig=no)
44
45 if test x"$have_ffi_pkgconfig" = xno ; then
46         AC_MSG_CHECKING(for ffi.h)
47
48         AC_TRY_CPP([#include <ffi.h>], have_ffi_h=yes, have_ffi_h=no)
49         if test x"$have_ffi_h" = x"yes"; then
50                 save_LIBS=$LIBS
51                 if test x"$with_ffi" = x"yes" || test x"$with_ffi" = x"auto"; then
52                         other_LIBS=
53                 else
54                         other_LIBS=$with_ffi
55                 fi
56
57                 AC_SEARCH_LIBS(ffi_call,ffi,,AC_MSG_ERROR([libffi not found]),$other_LIBS)
58                 if test x"$ac_cv_search_ffi_call" = x"none required" ; then
59                         FFI_LDFLAGS=$other_LIBS
60                 else
61                         FFI_LDFLAGS="$ac_cv_search_ffi_call $other_LIBS"
62                 fi
63                 LIBS=$save_LIBS
64         fi
65         if test x"$have_ffi_h" != x"yes" ; then
66                 AC_MSG_ERROR([ffi.h not found])
67         fi
68
69         FFI_CFLAGS=
70
71         AC_MSG_RESULT([$have_ffi_h])
72 fi
73
74 AC_SUBST(FFI_LDFLAGS)
75 AC_SUBST(FFI_CFLAGS)
76
77 dnl ==============================WebKit=======================================
78 save_LIBS=$LIBS
79 LIBS=`pkg-config --libs webkit-1.0`
80 AC_CHECK_LIB(webkit-1.0, JSContextGroupCreate,,
81                          AC_MSG_ERROR([The installed version of WebKit is too old. Seed requires WebKit SVN revision 35442 or greater.]))
82 LIBS=$save_LIBS
83
84 PKG_CHECK_MODULES(WEBKIT, webkit-1.0)
85 AC_SUBST(WEBKIT_CFLAGS)
86 AC_SUBST(WEBKIT_LDFLAGS)
87
88 dnl =========================Introspection=====================================
89 PKG_CHECK_MODULES(GOBJECT_INTROSPECTION, gobject-introspection-1.0 >= 0.6.3)
90 AC_SUBST(GOBJECT_INTROSPECTION_CFLAGS)
91 AC_SUBST(GOBJECT_INTROSPECTION_LDFLAGS)
92
93 dnl ========================GNOME-js common====================================
94 PKG_CHECK_MODULES(GNOME_JS, gnome-js-common)
95 GNOME_JS_DIR=`pkg-config --variable=moduledir gnome-js-common`
96 AC_SUBST(GNOME_JS_DIR)
97
98 dnl =============================Modules=======================================
99 dnl ==== canvas ====
100 AC_ARG_ENABLE(canvas-module,
101                           AC_HELP_STRING([--enable-canvas-module],
102                                                          [enable the canvas Seed module. [default=yes]]),
103                           [want_canvas_module=$enableval],[want_canvas_module="yes"])
104
105 if test x"$want_canvas_module" == x"yes" ; then
106         PKG_CHECK_MODULES(CAIRO, cairo)
107         AC_SUBST(CAIRO_CFLAGS)
108         AC_SUBST(CAIRO_LDFLAGS)
109         PKG_CHECK_MODULES(GDK, gdk-2.0)
110         AC_SUBST(GDK_CFLAGS)
111         AC_SUBST(GDK_LDFLAGS)
112 fi
113
114 AM_CONDITIONAL(BUILD_CANVAS_MODULE, test "x$want_canvas_module" = "xyes")
115 AC_SUBST(BUILD_CANVAS_MODULE)
116
117 dnl ==== readline ====
118 AC_ARG_ENABLE(readline-module,
119                           AC_HELP_STRING([--enable-readline-module],
120                                                          [enable the readline Seed module. [default=yes]]),
121                           [want_readline_module=$enableval],[want_readline_module="yes"])
122 if test x"$want_readline_module" == x"yes" ; then
123         AC_CHECK_HEADER([readline/readline.h],,AC_MSG_ERROR([the readline library is not installed.]))
124 fi
125
126 AM_CONDITIONAL(BUILD_READLINE_MODULE, test "x$want_readline_module" = "xyes")
127 AC_SUBST(BUILD_READLINE_MODULE)
128
129 dnl ==== multiprocessing ====
130 AC_ARG_ENABLE(multiprocessing-module,
131                           AC_HELP_STRING([--enable-multiprocessing-module],
132                                                          [enable the multiprocessing Seed module. [default=yes]]),
133                           [want_multiprocessing_module=$enableval],
134                           [want_multiprocessing_module="yes"])
135
136 AM_CONDITIONAL(BUILD_MULTIPROCESSING_MODULE, test "x$want_multiprocessing_module" = "xyes")
137 AC_SUBST(BUILD_MULTIPROCESSING_MODULE)
138
139 dnl ==== sqlite ====
140 AC_ARG_ENABLE(sqlite-module,
141                           AC_HELP_STRING([--enable-sqlite-module],
142                                                          [enable the sqlite Seed module. [default=yes]]),
143                           [want_sqlite_module=$enableval],[want_sqlite_module="yes"])
144
145 if test x"$want_sqlite_module" == x"yes" ; then
146         PKG_CHECK_MODULES(SQLITE, sqlite3)
147         AC_SUBST(SQLITE_CFLAGS)
148         AC_SUBST(SQLITE_LDFLAGS)
149 fi
150
151 AM_CONDITIONAL(BUILD_SQLITE_MODULE, test "x$want_sqlite_module" = "xyes")
152 AC_SUBST(BUILD_SQLITE_MODULE)
153
154 dnl ==== Example ====
155 AC_ARG_ENABLE(example-module,
156                           AC_HELP_STRING([--enable-example-module],
157                                                          [enable the example Seed module. [default=yes]]),
158                           [want_example_module=$enableval],[want_example_module="yes"])
159
160 AM_CONDITIONAL(BUILD_EXAMPLE_MODULE, test "x$want_example_module" = "xyes")
161 AC_SUBST(BUILD_EXAMPLE_MODULE)
162
163 dnl ==== dbus ====
164 AC_ARG_ENABLE(dbus-module,
165                           AC_HELP_STRING([--enable-dbus-module],
166                                                          [enable the dbus Seed module. [default=yes]]),
167                           [want_dbus_module=$enableval],[want_dbus_module="yes"])
168
169
170 AM_CONDITIONAL(BUILD_DBUS_MODULE, test "x$want_dbus_module" = "xyes")
171 AC_SUBST(BUILD_DBUS_MODULE)
172
173 if test x"$want_dbus_module" == x"yes" ; then
174         PKG_CHECK_MODULES(DBUS, dbus-1)
175         AC_SUBST(DBUS_CFLAGS)
176         AC_SUBST(DBUS_LDFLAGS)
177         PKG_CHECK_MODULES(DBUSGLIB, dbus-glib-1)
178         AC_SUBST(DBUSGLIB_CFLAGS)
179         AC_SUBST(DBUSGLIB_LDFLAGS)
180 fi
181
182
183
184 dnl ==== os ====
185 AC_ARG_ENABLE(os-module,
186                           AC_HELP_STRING([--enable-os-module],
187                                                          [enable the os Seed module. [default=yes]]),
188                           [want_os_module=$enableval],[want_os_module="yes"])
189
190
191 AM_CONDITIONAL(BUILD_OS_MODULE, test "x$want_os_module" = "xyes")
192 AC_SUBST(BUILD_OS_MODULE)
193
194 dnl ==== ffi ====
195 AC_ARG_ENABLE(ffi-module,
196                           AC_HELP_STRING([--enable-ffi-module],
197                                                          [enable the ffi Seed module. [default=yes]]),
198                           [want_ffi_module=$enableval],[want_ffi_module="yes"])
199
200
201 AM_CONDITIONAL(BUILD_FFI_MODULE, test "x$want_ffi_module" = "xyes")
202 AC_SUBST(BUILD_FFI_MODULE)
203
204 dnl ==== libxml ====
205 AC_ARG_ENABLE(libxml-module,
206                           AC_HELP_STRING([--enable-libxml-module],
207                                                          [enable the libxml Seed module. [default=yes]]),
208                           [want_libxml_module=$enableval],[want_libxml_module="yes"])
209
210 if test x"$want_libxml_module" == x"yes" ; then
211    PKG_CHECK_MODULES(LIBXML, libxml-2.0)
212    AC_SUBST(LIBXML_CFLAGS)
213    AC_SUBST(LIBXML_LDFLAGS)
214 fi
215
216 AM_CONDITIONAL(BUILD_LIBXML_MODULE, test "x$want_libxml_module" = "xyes")
217 AC_SUBST(BUILD_LIBXML_MODULE)
218
219 dnl ==== os ====
220 AC_ARG_ENABLE(os-module,
221                           AC_HELP_STRING([--enable-os-module],
222                                                          [enable the os Seed module. [default=yes]]),
223                           [want_os_module=$enableval],[want_os_module="yes"])
224
225
226 AM_CONDITIONAL(BUILD_OS_MODULE, test "x$want_os_module" = "xyes")
227 AC_SUBST(BUILD_OS_MODULE)
228
229 dnl ==== gtkbuilder ====
230 AC_ARG_ENABLE(gtkbuilder-module,
231                           AC_HELP_STRING([--enable-gtkbuilder-module],
232                                                          [enable the gtkbuilder Seed module. [default=yes]]),
233                           [want_gtkbuilder_module=$enableval],[want_gtkbuilder_module="yes"])
234
235 if test x"$want_gtkbuilder_module" == x"yes" ; then
236    PKG_CHECK_MODULES(GTK, gtk+-2.0)
237    AC_SUBST(GTK_CFLAGS)
238    AC_SUBST(GTK_LDFLAGS)
239 fi
240
241 AM_CONDITIONAL(BUILD_GTKBUILDER_MODULE, test "x$want_gtkbuilder_module" = "xyes")
242 AC_SUBST(BUILD_GTKBUILDER_MODULE)
243
244
245 dnl ==== cairo ====
246 AC_ARG_ENABLE(cairo-module,
247                           AC_HELP_STRING([--enable-cairo-module],
248                                                          [enable the cairo Seed module. [default=yes]]),
249                           [want_cairo_module=$enableval],[want_cairo_module="yes"])
250
251 if test x"$want_cairo_module" == x"yes" ; then
252         PKG_CHECK_MODULES(CAIRO, cairo)
253         AC_SUBST(CAIRO_CFLAGS)
254         AC_SUBST(CAIRO_LDFLAGS)
255 fi
256
257 AM_CONDITIONAL(BUILD_CAIRO_MODULE, test "x$want_cairo_module" = "xyes")
258 AC_SUBST(BUILD_CAIRO_MODULE)
259
260
261 dnl ==== gettext ====
262 AC_ARG_ENABLE(gettext-module,
263                           AC_HELP_STRING([--enable-gettext-module],
264                                                          [enable the gettext Seed module. [default=yes]]),
265                           [want_gettext_module=$enableval],[want_gettext_module="yes"])
266
267 AM_CONDITIONAL(BUILD_GETTEXT_MODULE, test "x$want_gettext_module" = "xyes")
268 AC_SUBST(BUILD_GETTEXT_MODULE)
269
270 dnl ==== mpfr ====
271 AC_ARG_ENABLE(mpfr-module,
272                           AC_HELP_STRING([--enable-mpfr-module],
273                                                          [enable the mpfr Seed module. [default=yes]]),
274                           [want_mpfr_module=$enableval],[want_mpfr_module="yes"])
275
276 if test x"$want_mpfr_module" == x"yes" ; then
277         AC_TRY_CPP([#include <mpfr.h>], have_mpfr_h=yes, have_mpfr_h=no)
278         if test x"$have_mpfr_h" = x"yes"; then
279                 save_LIBS=$LIBS
280                 if test x"$with_mpfr" = x"yes" || test x"$with_mpfr" = x"auto"; then
281                         other_LIBS=
282                 else
283                         other_LIBS=$with_mpfr
284                 fi
285
286                 AC_SEARCH_LIBS(mpfr_init2,mpfr,,AC_MSG_ERROR([mpfr not found]),$other_LIBS)
287                 if test x"$ac_cv_search_mpfr_call" = x"none required" ; then
288                         MPFR_LDFLAGS=$other_LIBS
289                 else
290                         MPFR_LDFLAGS="$other_LIBS"
291                 fi
292                 LIBS=$save_LIBS
293         fi
294         if test x"$have_mpfr_h" != x"yes" ; then
295                 AC_MSG_ERROR([mpfr.h not found])
296         fi
297
298         MPFR_CFLAGS=
299 fi
300
301 AM_CONDITIONAL(BUILD_MPFR_MODULE, test "x$want_mpfr_module" = "xyes")
302 AC_SUBST(BUILD_MPFR_MODULE)
303
304 dnl ===========================Profiling=======================================
305 AC_ARG_ENABLE(profile,
306                           AC_HELP_STRING([--enable-profile],
307                                                          [turn on profiling [default=no]]),
308                           [enable_profile="yes"],[enable_profile="no"])
309
310 AC_ARG_ENABLE(profile-modules,
311                           AC_HELP_STRING([--enable-profile-modules],
312                                                          [turn on profiling for modules [default=no]]),
313                           [enable_profile_modules="yes"],[enable_profile_modules="no"])
314
315 if test "x$enable_profile" = "xyes"; then
316         SEED_PROFILE_CFLAGS="-fprofile-arcs -ftest-coverage"
317         SEED_PROFILE_LIBS="-lgcov"
318         [need_debug="yes"]
319 fi
320
321 if test "x$enable_profile" = "xno"; then
322         [enable_profile_modules="no"]
323 fi
324
325 AC_SUBST(SEED_PROFILE_CFLAGS)
326 AC_SUBST(SEED_PROFILE_LIBS)
327
328 AM_CONDITIONAL(PROFILE_MODULES, test "x$enable_profile_modules" = "xyes")
329
330 dnl =============================Debug=========================================
331 AC_ARG_ENABLE(debug,
332                           AC_HELP_STRING([--enable-debug],
333                                                          [enable verbose debugging. [default=no]]),
334                           [enable_debug="yes"],[enable_debug="no"])
335
336 if test "x$enable_debug" = "xyes"; then
337         SEED_DEBUG_CFLAGS="-DSEED_ENABLE_DEBUG -g"
338         CFLAGS="-O0 -Wall"
339 else
340         SEED_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
341         CFLAGS="-Wall"
342         
343         if test "x$need_debug" = "xyes"; then
344                 AC_MSG_ERROR([debug must be enabled in order to enable profiling.])
345         fi
346 fi
347
348 AC_SUBST(SEED_DEBUG_CFLAGS)
349
350 AC_CHECK_HEADERS(pty.h)
351
352 dnl =============================gtk-doc=======================================
353 GTK_DOC_CHECK(1.9)
354
355 dnl =============================Output========================================
356 AC_CONFIG_FILES([
357 seed.pc
358 Makefile
359
360 doc/index.html
361 doc/conventions.html
362 doc/runtime.html
363 doc/tutorial-standalone/tutorial.html
364
365 doc/modules/canvas/canvas.html
366 doc/modules/multiprocessing/multiprocessing.html
367
368 doc/modules/canvas/Makefile
369 doc/modules/multiprocessing/Makefile
370 doc/modules/readline/Makefile
371 doc/modules/gtkbuilder/Makefile
372 doc/modules/sqlite/Makefile
373 doc/modules/sandbox/Makefile
374
375 doc/mapping/mapping.html
376
377 libseed/Makefile
378 po/Makefile.in
379 src/Makefile
380 extensions/Makefile
381 tests/Makefile
382 tests/javascript/Makefile
383 tests/javascript/gtypes/Makefile
384 tests/javascript/signals/Makefile
385 tests/javascript/structs/Makefile
386 tests/c/Makefile
387 doc/Makefile
388 doc/modules/Makefile
389 doc/modules/version.xml
390 doc/tutorial-standalone/Makefile
391 doc/reference/Makefile
392 doc/reference/version.xml
393 doc/mapping/Makefile
394 modules/Makefile
395 modules/example/Makefile
396 modules/sqlite/Makefile
397 modules/canvas/Makefile
398 modules/readline/Makefile
399 modules/multiprocessing/Makefile
400 modules/sandbox/Makefile
401 modules/os/Makefile
402 modules/dbus/Makefile
403 modules/dbus/util/Makefile
404 modules/libxml/Makefile
405 modules/cairo/Makefile
406 modules/gtkbuilder/Makefile
407 modules/gettext/Makefile
408 modules/mpfr/Makefile
409 modules/ffi/Makefile
410
411 libseed/seed-path.h
412 ])
413 AC_OUTPUT
414
415 echo "
416 Build Configuration:
417    Debug......................$enable_debug
418    Profiling/Coverage.........$enable_profile
419    Profiling for Modules......$enable_profile_modules
420    gtk-doc....................$enable_gtk_doc
421
422 Installation:
423    Prefix.....................$prefix
424
425 Modules:
426    Canvas.....................$want_canvas_module
427    example....................$want_example_module
428    multiprocessing............$want_multiprocessing_module
429    readline...................$want_readline_module
430    SQLite.....................$want_sqlite_module
431    DBus.......................$want_dbus_module
432    libxml.....................$want_libxml_module
433    cairo......................$want_cairo_module
434    gtkbuilder.................$want_gtkbuilder_module
435    gettext....................$want_gettext_module
436    mpfr.......................$want_mpfr_module
437    ffi........................$want_ffi_module
438 "
439
440 if test "x$want_readline_module" != "xyes"; then
441 echo "WARNING: The readline module is not enabled.
442          Without this, the Seed REPL will not work;
443          however, most Seed applications will still run.
444 "
445 fi