libseed: Fix include of Seed.js in non-standard prefix
[gnome.seed] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(seed, 0.7)
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 changequote(,)dnl
18 ensureflag() {
19   flag="$1"; shift
20   result="$@"
21
22   case " ${result} " in
23   *[\ \ ]${flag}[\ \    ]*) ;;
24   *) result="${flag} ${result}" ;;
25   esac
26
27   echo ${result}
28 }
29
30 changequote([,])dnl
31
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 ContextGroup=================================
76 case "$host_os" in
77         darwin*)
78                 ;;
79         *)
80                 save_LIBS=$LIBS
81                 LIBS=`pkg-config --libs webkit-1.0`
82                 AC_CHECK_LIB(webkit-1.0, JSContextGroupCreate,,
83                                          AC_MSG_ERROR([The installed version of WebKit is too old. Seed requires WebKit SVN revision 35442 or greater.]))
84                 LIBS=$save_LIBS
85                 ;;
86 esac
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 m4_define([gnome-js-dir], [`pkg-config --variable=moduledir gnome-js-common`])
96
97 dnl =============================Modules=======================================
98 dnl ==== canvas ====
99 AC_ARG_ENABLE(canvas-module,
100                           AC_HELP_STRING([--enable-canvas-module],
101                                                          [enable the canvas Seed module. [default=yes]]),
102                           [want_canvas_module=$enableval],[want_canvas_module="yes"])
103
104 if test x"$want_canvas_module" == x"yes" ; then
105         PKG_CHECK_MODULES(CAIRO, cairo)
106         AC_SUBST(CAIRO_CFLAGS)
107         AC_SUBST(CAIRO_LDFLAGS)
108         PKG_CHECK_MODULES(GDK, gdk-2.0)
109         AC_SUBST(GDK_CFLAGS)
110         AC_SUBST(GDK_LDFLAGS)
111 fi
112
113 AM_CONDITIONAL(BUILD_CANVAS_MODULE, test "x$want_canvas_module" = "xyes")
114 AC_SUBST(BUILD_CANVAS_MODULE)
115
116
117
118 dnl ==== readline ====
119 AC_ARG_ENABLE(readline-module,
120                           AC_HELP_STRING([--enable-readline-module],
121                                                          [enable the readline Seed module. [default=yes]]),
122                           [want_readline_module=$enableval],[want_readline_module="yes"])
123 if test x"$want_readline_module" == x"yes" ; then
124         AC_CHECK_HEADER([readline/readline.h],,AC_MSG_ERROR([the readline library is not installed.]))
125 fi
126
127 AM_CONDITIONAL(BUILD_READLINE_MODULE, test "x$want_readline_module" = "xyes")
128 AC_SUBST(BUILD_READLINE_MODULE)
129
130 dnl ==== multiprocessing ====
131 AC_ARG_ENABLE(multiprocessing-module,
132                           AC_HELP_STRING([--enable-multiprocessing-module],
133                                                          [enable the multiprocessing Seed module. [default=yes]]),
134                           [want_multiprocessing_module=$enableval],
135                           [want_multiprocessing_module="yes"])
136
137 AM_CONDITIONAL(BUILD_MULTIPROCESSING_MODULE, test "x$want_multiprocessing_module" = "xyes")
138 AC_SUBST(BUILD_MULTIPROCESSING_MODULE)
139
140 dnl ==== sqlite ====
141 AC_ARG_ENABLE(sqlite-module,
142                           AC_HELP_STRING([--enable-sqlite-module],
143                                                          [enable the sqlite Seed module. [default=yes]]),
144                           [want_sqlite_module=$enableval],[want_sqlite_module="yes"])
145
146 if test x"$want_sqlite_module" == x"yes" ; then
147         PKG_CHECK_MODULES(SQLITE, sqlite3)
148         AC_SUBST(SQLITE_CFLAGS)
149         AC_SUBST(SQLITE_LDFLAGS)
150 fi
151
152 AM_CONDITIONAL(BUILD_SQLITE_MODULE, test "x$want_sqlite_module" = "xyes")
153 AC_SUBST(BUILD_SQLITE_MODULE)
154
155 dnl ==== Example ====
156 AC_ARG_ENABLE(example-module,
157                           AC_HELP_STRING([--enable-example-module],
158                                                          [enable the example Seed module. [default=yes]]),
159                           [want_example_module=$enableval],[want_example_module="yes"])
160
161 AM_CONDITIONAL(BUILD_EXAMPLE_MODULE, test "x$want_example_module" = "xyes")
162 AC_SUBST(BUILD_EXAMPLE_MODULE)
163
164 dnl ==== dbus? ====
165 AC_ARG_ENABLE(dbus-module,
166                           AC_HELP_STRING([--enable-dbus-module],
167                                                          [enable the dbus Seed module. [default=yes]]),
168                           [want_dbus_module=$enableval],[want_dbus_module="yes"])
169
170
171 AM_CONDITIONAL(BUILD_DBUS_MODULE, test "x$want_dbus_module" = "xyes")
172 AC_SUBST(BUILD_DBUS_MODULE)
173
174 if test x"$want_dbus_module" == x"yes" ; then
175         PKG_CHECK_MODULES(DBUS, dbus-1)
176         AC_SUBST(DBUS_CFLAGS)
177         AC_SUBST(DBUS_LDFLAGS)
178         PKG_CHECK_MODULES(DBUSGLIB, dbus-glib-1)
179         AC_SUBST(DBUSGLIB_CFLAGS)
180         AC_SUBST(DBUSGLIB_LDFLAGS)
181 fi
182
183 dnl ==== os ====
184 AC_ARG_ENABLE(os-module,
185                           AC_HELP_STRING([--enable-os-module],
186                                                          [enable the os Seed module. [default=yes]]),
187                           [want_os_module=$enableval],[want_os_module="yes"])
188
189
190 AM_CONDITIONAL(BUILD_OS_MODULE, test "x$want_os_module" = "xyes")
191 AC_SUBST(BUILD_OS_MODULE)
192
193 dnl ==== os ====
194 AC_ARG_ENABLE(os-module,
195                           AC_HELP_STRING([--enable-os-module],
196                                                          [enable the os Seed module. [default=yes]]),
197                           [want_os_module=$enableval],[want_os_module="yes"])
198
199
200 AM_CONDITIONAL(BUILD_OS_MODULE, test "x$want_os_module" = "xyes")
201 AC_SUBST(BUILD_OS_MODULE)
202
203 dnl ==== libxml ====
204 AC_ARG_ENABLE(libxml-module,
205                           AC_HELP_STRING([--enable-libxml-module],
206                                                          [enable the libxml Seed module. [default=yes]]),
207                           [want_libxml_module=$enableval],[want_libxml_module="yes"])
208
209 if test x"$want_libxml_module" == x"yes" ; then
210    PKG_CHECK_MODULES(LIBXML, libxml-2.0)
211    AC_SUBST(LIBXML_CFLAGS)
212    AC_SUBST(LIBXML_LDFLAGS)
213 fi
214
215 AM_CONDITIONAL(BUILD_LIBXML_MODULE, test "x$want_libxml_module" = "xyes")
216 AC_SUBST(BUILD_LIBXML_MODULE)
217
218 dnl ==== os ====
219 AC_ARG_ENABLE(os-module,
220                           AC_HELP_STRING([--enable-os-module],
221                                                          [enable the os Seed module. [default=yes]]),
222                           [want_os_module=$enableval],[want_os_module="yes"])
223
224
225 AM_CONDITIONAL(BUILD_OS_MODULE, test "x$want_os_module" = "xyes")
226 AC_SUBST(BUILD_OS_MODULE)
227
228 dnl ==== gtkbuilder ====
229 AC_ARG_ENABLE(gtkbuilder-module,
230                           AC_HELP_STRING([--enable-gtkbuilder-module],
231                                                          [enable the gtkbuilder Seed module. [default=yes]]),
232                           [want_gtkbuilder_module=$enableval],[want_gtkbuilder_module="yes"])
233
234 if test x"$want_gtkbuilder_module" == x"yes" ; then
235    PKG_CHECK_MODULES(GTK, gtk+-2.0)
236    AC_SUBST(GTK_CFLAGS)
237    AC_SUBST(GTK_LDFLAGS)
238 fi
239
240 AM_CONDITIONAL(BUILD_GTKBUILDER_MODULE, test "x$want_gtkbuilder_module" = "xyes")
241 AC_SUBST(BUILD_GTKBUILDER_MODULE)
242
243
244 dnl ==== cairo ====
245 AC_ARG_ENABLE(cairo-module,
246                           AC_HELP_STRING([--enable-cairo-module],
247                                                          [enable the cairo Seed module. [default=yes]]),
248                           [want_cairo_module=$enableval],[want_cairo_module="yes"])
249
250 if test x"$want_cairo_module" == x"yes" ; then
251         PKG_CHECK_MODULES(CAIRO, cairo)
252         AC_SUBST(CAIRO_CFLAGS)
253         AC_SUBST(CAIRO_LDFLAGS)
254 fi
255
256 AM_CONDITIONAL(BUILD_CAIRO_MODULE, test "x$want_cairo_module" = "xyes")
257 AC_SUBST(BUILD_CAIRO_MODULE)
258
259
260
261 dnl =========================turtle example====================================
262 AC_ARG_ENABLE(turtle-example,
263                           AC_HELP_STRING([--enable-turtle-example],
264                                                          [enable the turtle graphics example. [default=yes]]),
265                           [want_turtle_example=$enableval],[want_turtle_example="yes"])
266
267 if test x"$want_turtle_example" == x"yes" ; then
268         PKG_CHECK_MODULES(GTK, gtk+-2.0)
269         AC_SUBST(GTK_CFLAGS)
270         AC_SUBST(GTK_LIBS)
271 fi
272
273 AM_CONDITIONAL(BUILD_TURTLE_EXAMPLE, test "x$want_turtle_example" = "xyes")
274 AC_SUBST(BUILD_TURTLE_EXAMPLE)
275
276 dnl =========================Install Examples==================================
277 AC_ARG_ENABLE(examples,
278                           AC_HELP_STRING([--enable-examples],
279                                                          [install JavaScript examples. [default=yes]]),
280                           [enable_examples=$enableval],[enable_examples="yes"])
281 AM_CONDITIONAL(BUILD_SEED_EXAMPLES, test "x$enable_examples" = "xyes")
282 AC_SUBST(BUILD_SEED_EXAMPLES)
283
284 dnl =============================Debug=========================================
285 AC_ARG_ENABLE(debug,
286                           AC_HELP_STRING([--enable-debug],
287                                                          [enable verbose debugging. [default=no]]),
288                           [enable_debug="yes"],[enable_debug="no"])
289
290 if test "x$enable_debug" = "xyes"; then
291         SEED_DEBUG_CFLAGS="-DSEED_ENABLE_DEBUG -g"
292         CFLAGS="-O0"
293 else
294         SEED_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
295 fi
296
297 AC_SUBST(SEED_DEBUG_CFLAGS)
298
299 dnl ===========================Profiling=======================================
300 AC_ARG_ENABLE(profile,
301                           AC_HELP_STRING([--enable-profile],
302                                                          [turn on profiling [default=no]]),
303                           [enable_profile="yes"],[enable_profile="no"])
304
305 AC_ARG_ENABLE(profile-modules,
306                           AC_HELP_STRING([--enable-profile-modules],
307                                                          [turn on profiling for modules [default=no]]),
308                           [enable_profile_modules="yes"],[enable_profile_modules="no"])
309
310 if test "x$enable_profile" = "xyes"; then
311         SEED_PROFILE_CFLAGS="-fprofile-arcs -ftest-coverage"
312         SEED_PROFILE_LIBS="-lgcov"
313         CFLAGS="-O0"
314 fi
315
316 if test "x$enable_profile" = "xno"; then
317         [enable_profile_modules="no"]
318 fi
319
320 AC_SUBST(SEED_PROFILE_CFLAGS)
321 AC_SUBST(SEED_PROFILE_LIBS)
322
323 AM_CONDITIONAL(PROFILE_MODULES, test "x$enable_profile_modules" = "xyes")
324
325 dnl ===========================Darwin Build====================================
326 SEED_OSX_CFLAGS=
327 SEED_OSX_LDFLAGS=
328
329 case "$host_os" in
330         darwin*)
331                 SEED_OSX_CFLAGS="-F/Applications/WebKit.app/Contents/Frameworks/10.5 -framework JavaScriptCore"
332                 SEED_OSX_LDFLAGS="-F/Applications/WebKit.app/Contents/Frameworks/10.5 -framework JavaScriptCore"
333                 ;;
334         *)
335                 PKG_CHECK_MODULES(WEBKIT, webkit-1.0)
336                 AC_SUBST(WEBKIT_CFLAGS)
337                 AC_SUBST(WEBKIT_LDFLAGS)
338         ;;
339
340
341 esac
342 AC_SUBST(SEED_OSX_CFLAGS)
343 AC_SUBST(SEED_OSX_LDFLAGS)
344
345 AC_CHECK_HEADERS(pty.h)
346
347 dnl =============================gtk-doc=======================================
348 GTK_DOC_CHECK(1.9)
349
350 dnl =============================Output========================================
351 SHAVE_INIT([scripts])
352 AC_CONFIG_FILES([
353 seed.pc
354 Makefile
355
356 doc/conventions.html
357 doc/runtime.html
358 doc/tutorial-standalone/tutorial.html
359
360 doc/modules/canvas/canvas.html
361 doc/modules/multiprocessing/multiprocessing.html
362
363 doc/modules/canvas/Makefile
364 doc/modules/multiprocessing/Makefile
365 doc/modules/readline/Makefile
366 doc/modules/gtkbuilder/Makefile
367 doc/modules/sqlite/Makefile
368 doc/modules/sandbox/Makefile
369
370 doc/mapping/mapping.html
371
372 scripts/shave
373 scripts/shave-libtool
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/tutorial-standalone/Makefile
388 doc/reference/Makefile
389 doc/mapping/Makefile
390 examples/Makefile
391 examples/clutter-pad/Makefile
392 examples/clutter-pad/examples/Makefile
393 examples/clutter-shader/Makefile
394 examples/clutter-transitions/Makefile
395 examples/glib/Makefile
396 examples/browser/Makefile
397 examples/turtle/Makefile
398 examples/opengl/Makefile
399 examples/twitter/Makefile
400 examples/pong/Makefile
401 examples/same-seed/Makefile
402 examples/dbus/Makefile
403 examples/xml/Makefile
404 modules/Makefile
405 modules/example/Makefile
406 modules/sqlite/Makefile
407 modules/canvas/Makefile
408 modules/readline/Makefile
409 modules/Multiprocessing/Makefile
410 modules/sandbox/Makefile
411 modules/os/Makefile
412 modules/dbus/Makefile
413 modules/dbus/util/Makefile
414 modules/libxml/Makefile
415 modules/cairo/Makefile
416 modules/gtkbuilder/Makefile
417
418 libseed/seed-path.h
419 ])
420 AC_OUTPUT
421
422 echo "
423 Build Configuration:
424    Debug......................$enable_debug
425    Profiling/Coverage.........$enable_profile
426    Profiling for Modules......$enable_profile_modules
427    gtk-doc....................$enable_gtk_doc
428
429 Installation:
430    Prefix.....................$prefix
431    Install examples...........$enable_examples
432
433 Modules:
434    Canvas.....................$want_canvas_module
435    example....................$want_example_module
436    multiprocessing............$want_multiprocessing_module
437    readline...................$want_readline_module
438    SQLite.....................$want_sqlite_module
439    DBus.......................$want_dbus_module
440    libxml.....................$want_libxml_module
441    cairo......................$want_cairo_module
442    gtkbuilder.................$want_gtkbuilder_module
443
444 Examples:
445    Turtle.....................$want_turtle_example
446 "
447
448 if test "x$want_readline_module" != "xyes"; then
449 echo "WARNING: The readline module is not enabled.
450          Without this, the Seed REPL will not work;
451          however, most Seed applications will still run.
452 "
453 fi