Cairo stuff
[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 =============================Modules=======================================
94 dnl ==== canvas ====
95 AC_ARG_ENABLE(canvas-module,
96                           AC_HELP_STRING([--enable-canvas-module],
97                                                          [enable the canvas Seed module. [default=yes]]),
98                           [want_canvas_module=$enableval],[want_canvas_module="yes"])
99
100 if test x"$want_canvas_module" == x"yes" ; then
101         PKG_CHECK_MODULES(CAIRO, cairo)
102         AC_SUBST(CAIRO_CFLAGS)
103         AC_SUBST(CAIRO_LDFLAGS)
104         PKG_CHECK_MODULES(GDK, gdk-2.0)
105         AC_SUBST(GDK_CFLAGS)
106         AC_SUBST(GDK_LDFLAGS)
107 fi
108
109 AM_CONDITIONAL(BUILD_CANVAS_MODULE, test "x$want_canvas_module" = "xyes")
110 AC_SUBST(BUILD_CANVAS_MODULE)
111
112
113
114 dnl ==== readline ====
115 AC_ARG_ENABLE(readline-module,
116                           AC_HELP_STRING([--enable-readline-module],
117                                                          [enable the readline Seed module. [default=yes]]),
118                           [want_readline_module=$enableval],[want_readline_module="yes"])
119 if test x"$want_readline_module" == x"yes" ; then
120         AC_CHECK_HEADER([readline/readline.h],,AC_MSG_ERROR([the readline library is not installed.]))
121 fi
122
123 AM_CONDITIONAL(BUILD_READLINE_MODULE, test "x$want_readline_module" = "xyes")
124 AC_SUBST(BUILD_READLINE_MODULE)
125
126 dnl ==== multiprocessing ====
127 AC_ARG_ENABLE(multiprocessing-module,
128                           AC_HELP_STRING([--enable-multiprocessing-module],
129                                                          [enable the multiprocessing Seed module. [default=yes]]),
130                           [want_multiprocessing_module=$enableval],
131                           [want_multiprocessing_module="yes"])
132
133 AM_CONDITIONAL(BUILD_MULTIPROCESSING_MODULE, test "x$want_multiprocessing_module" = "xyes")
134 AC_SUBST(BUILD_MULTIPROCESSING_MODULE)
135
136 dnl ==== sqlite ====
137 AC_ARG_ENABLE(sqlite-module,
138                           AC_HELP_STRING([--enable-sqlite-module],
139                                                          [enable the sqlite Seed module. [default=yes]]),
140                           [want_sqlite_module=$enableval],[want_sqlite_module="yes"])
141
142 if test x"$want_sqlite_module" == x"yes" ; then
143         PKG_CHECK_MODULES(SQLITE, sqlite3)
144         AC_SUBST(SQLITE_CFLAGS)
145         AC_SUBST(SQLITE_LDFLAGS)
146 fi
147
148 AM_CONDITIONAL(BUILD_SQLITE_MODULE, test "x$want_sqlite_module" = "xyes")
149 AC_SUBST(BUILD_SQLITE_MODULE)
150
151 dnl ==== Example ====
152 AC_ARG_ENABLE(example-module,
153                           AC_HELP_STRING([--enable-example-module],
154                                                          [enable the example Seed module. [default=yes]]),
155                           [want_example_module=$enableval],[want_example_module="yes"])
156
157 AM_CONDITIONAL(BUILD_EXAMPLE_MODULE, test "x$want_example_module" = "xyes")
158 AC_SUBST(BUILD_EXAMPLE_MODULE)
159
160 dnl ==== dbus? ====
161 AC_ARG_ENABLE(dbus-module,
162                           AC_HELP_STRING([--enable-dbus-module],
163                                                          [enable the dbus Seed module. [default=yes]]),
164                           [want_dbus_module=$enableval],[want_dbus_module="yes"])
165
166
167 AM_CONDITIONAL(BUILD_DBUS_MODULE, test "x$want_dbus_module" = "xyes")
168 AC_SUBST(BUILD_DBUS_MODULE)
169
170 if test x"$want_dbus_module" == x"yes" ; then
171         PKG_CHECK_MODULES(DBUS, dbus-1)
172         AC_SUBST(DBUS_CFLAGS)
173         AC_SUBST(DBUS_LDFLAGS)
174         PKG_CHECK_MODULES(DBUSGLIB, dbus-glib-1)
175         AC_SUBST(DBUSGLIB_CFLAGS)
176         AC_SUBST(DBUSGLIB_LDFLAGS)
177 fi
178
179 dnl ==== os ====
180 AC_ARG_ENABLE(os-module,
181                           AC_HELP_STRING([--enable-os-module],
182                                                          [enable the os Seed module. [default=yes]]),
183                           [want_os_module=$enableval],[want_os_module="yes"])
184
185
186 AM_CONDITIONAL(BUILD_OS_MODULE, test "x$want_os_module" = "xyes")
187 AC_SUBST(BUILD_OS_MODULE)
188
189 dnl ==== libxml ====
190 AC_ARG_ENABLE(libxml-module,
191                           AC_HELP_STRING([--enable-libxml-module],
192                                                          [enable the libxml Seed module. [default=yes]]),
193                           [want_libxml_module=$enableval],[want_libxml_module="yes"])
194
195 if test x"$want_libxml_module" == x"yes" ; then
196    PKG_CHECK_MODULES(LIBXML, libxml-2.0)
197    AC_SUBST(LIBXML_CFLAGS)
198    AC_SUBST(LIBXML_LDFLAGS)
199 fi
200
201 AM_CONDITIONAL(BUILD_LIBXML_MODULE, test "x$want_libxml_module" = "xyes")
202 AC_SUBST(BUILD_LIBXML_MODULE)
203
204 dnl ==== cairo ====
205 AC_ARG_ENABLE(cairo-module,
206                           AC_HELP_STRING([--enable-cairo-module],
207                                                          [enable the cairo Seed module. [default=yes]]),
208                           [want_cairo_module=$enableval],[want_cairo_module="yes"])
209
210 if test x"$want_cairo_module" == x"yes" ; then
211         PKG_CHECK_MODULES(CAIRO, cairo)
212         AC_SUBST(CAIRO_CFLAGS)
213         AC_SUBST(CAIRO_LDFLAGS)
214 fi
215
216 AM_CONDITIONAL(BUILD_CAIRO_MODULE, test "x$want_cairo_module" = "xyes")
217 AC_SUBST(BUILD_CAIRO_MODULE)
218
219
220
221 dnl =========================turtle example====================================
222 AC_ARG_ENABLE(turtle-example,
223                           AC_HELP_STRING([--enable-turtle-example],
224                                                          [enable the turtle graphics example. [default=yes]]),
225                           [want_turtle_example=$enableval],[want_turtle_example="yes"])
226
227 if test x"$want_turtle_example" == x"yes" ; then
228         PKG_CHECK_MODULES(GTK, gtk+-2.0)
229         AC_SUBST(GTK_CFLAGS)
230         AC_SUBST(GTK_LIBS)
231 fi
232
233 AM_CONDITIONAL(BUILD_TURTLE_EXAMPLE, test "x$want_turtle_example" = "xyes")
234 AC_SUBST(BUILD_TURTLE_EXAMPLE)
235
236 dnl =========================Install Examples==================================
237 AC_ARG_ENABLE(examples,
238                           AC_HELP_STRING([--enable-examples],
239                                                          [install JavaScript examples. [default=yes]]),
240                           [enable_examples=$enableval],[enable_examples="yes"])
241 AM_CONDITIONAL(BUILD_SEED_EXAMPLES, test "x$enable_examples" = "xyes")
242 AC_SUBST(BUILD_SEED_EXAMPLES)
243
244 dnl =============================Debug=========================================
245 AC_ARG_ENABLE(debug,
246                           AC_HELP_STRING([--enable-debug],
247                                                          [enable verbose debugging. [default=no]]),
248                           [enable_debug="yes"],[enable_debug="no"])
249
250 if test "x$enable_debug" = "xyes"; then
251         SEED_DEBUG_CFLAGS="-DSEED_ENABLE_DEBUG -g"
252         CFLAGS="-O0"
253 else
254         SEED_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
255 fi
256
257 AC_SUBST(SEED_DEBUG_CFLAGS)
258
259 dnl ===========================Profiling=======================================
260 AC_ARG_ENABLE(profile,
261                           AC_HELP_STRING([--enable-profile],
262                                                          [turn on profiling [default=no]]),
263                           [enable_profile="yes"],[enable_profile="no"])
264
265 AC_ARG_ENABLE(profile-modules,
266                           AC_HELP_STRING([--enable-profile-modules],
267                                                          [turn on profiling for modules [default=no]]),
268                           [enable_profile_modules="yes"],[enable_profile_modules="no"])
269
270 if test "x$enable_profile" = "xyes"; then
271         SEED_PROFILE_CFLAGS="-fprofile-arcs -ftest-coverage"
272         SEED_PROFILE_LIBS="-lgcov"
273         CFLAGS="-O0"
274 fi
275
276 if test "x$enable_profile" = "xno"; then
277         [enable_profile_modules="no"]
278 fi
279
280 AC_SUBST(SEED_PROFILE_CFLAGS)
281 AC_SUBST(SEED_PROFILE_LIBS)
282
283 AM_CONDITIONAL(PROFILE_MODULES, test "x$enable_profile_modules" = "xyes")
284
285 dnl ===========================Darwin Build====================================
286 SEED_OSX_CFLAGS=
287 SEED_OSX_LDFLAGS=
288
289 case "$host_os" in
290         darwin*)
291                 SEED_OSX_CFLAGS="-F/Applications/WebKit.app/Contents/Frameworks/10.5 -framework JavaScriptCore"
292                 SEED_OSX_LDFLAGS="-F/Applications/WebKit.app/Contents/Frameworks/10.5 -framework JavaScriptCore"
293                 ;;
294         *)
295                 PKG_CHECK_MODULES(WEBKIT, webkit-1.0)
296                 AC_SUBST(WEBKIT_CFLAGS)
297                 AC_SUBST(WEBKIT_LDFLAGS)
298         ;;
299
300
301 esac
302 AC_SUBST(SEED_OSX_CFLAGS)
303 AC_SUBST(SEED_OSX_LDFLAGS)
304
305 AC_CHECK_HEADERS(pty.h)
306
307 dnl =============================gtk-doc=======================================
308 GTK_DOC_CHECK(1.9)
309
310 dnl =============================Output========================================
311 SHAVE_INIT([scripts])
312 AC_CONFIG_FILES([
313 seed.pc
314 Makefile
315
316 doc/conventions.html
317 doc/runtime.html
318 doc/tutorial-standalone/tutorial.html
319 doc/modules/canvas.html
320 doc/modules/multiprocessing.html
321 doc/modules/readline.html
322 doc/modules/sqlite.html
323 doc/modules/sandbox.html
324
325 doc/mapping/mapping.html
326
327 scripts/shave
328 scripts/shave-libtool
329
330 libseed/Makefile
331 po/Makefile.in
332 src/Makefile
333 extensions/Makefile
334 tests/Makefile
335 tests/javascript/Makefile
336 tests/javascript/gtypes/Makefile
337 tests/javascript/signals/Makefile
338 tests/javascript/structs/Makefile
339 tests/c/Makefile
340 doc/Makefile
341 doc/modules/Makefile
342 doc/tutorial-standalone/Makefile
343 doc/reference/Makefile
344 doc/mapping/Makefile
345 examples/Makefile
346 examples/clutter-pad/Makefile
347 examples/clutter-pad/examples/Makefile
348 examples/clutter-shader/Makefile
349 examples/clutter-transitions/Makefile
350 examples/glib/Makefile
351 examples/browser/Makefile
352 examples/turtle/Makefile
353 examples/opengl/Makefile
354 examples/twitter/Makefile
355 examples/pong/Makefile
356 examples/same-seed/Makefile
357 examples/dbus/Makefile
358 examples/xml/Makefile
359 modules/Makefile
360 modules/example/Makefile
361 modules/sqlite/Makefile
362 modules/canvas/Makefile
363 modules/readline/Makefile
364 modules/Multiprocessing/Makefile
365 modules/sandbox/Makefile
366 modules/os/Makefile
367 modules/dbus/Makefile
368 modules/dbus/util/Makefile
369 modules/libxml/Makefile
370 modules/cairo/Makefile
371 ])
372 AC_OUTPUT
373
374 echo "
375 Build Configuration:
376    Debug......................$enable_debug
377    Profiling/Coverage.........$enable_profile
378    Profiling for Modules......$enable_profile_modules
379    gtk-doc....................$enable_gtk_doc
380
381 Installation:
382    Prefix.....................$prefix
383    Install examples...........$enable_examples
384
385 Modules:
386    Canvas.....................$want_canvas_module
387    example....................$want_example_module
388    multiprocessing............$want_multiprocessing_module
389    readline...................$want_readline_module
390    SQLite.....................$want_sqlite_module
391    DBus.......................$want_dbus_module
392    libxml.....................$want_libxml_module
393    cairo......................$want_cairo_module
394
395 Examples:
396    Turtle.....................$want_turtle_example
397 "
398
399 if test "x$want_readline_module" != "xyes"; then
400 echo "WARNING: The readline module is not enabled.
401          Without this, the Seed REPL will not work;
402          however, most Seed applications will still run.
403 "
404 fi