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