Start writing the mapping documentation
[gnome.seed] / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(seed, 0.5)
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 CFLAGS="-O3"
18
19 changequote(,)dnl
20 ensureflag() {
21   flag="$1"; shift
22   result="$@"
23
24   case " ${result} " in
25   *[\ \ ]${flag}[\ \    ]*) ;;
26   *) result="${flag} ${result}" ;;
27   esac
28
29   echo ${result}
30 }
31
32 changequote([,])dnl
33
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(libffi, 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_LIBS=$other_LIBS
60                 else
61                         FFI_LIBS="$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         AC_SUBST(FFI_LIBS)
73         AC_SUBST(FFI_CFLAGS)
74 fi
75
76 dnl =======================WebKit ContextGroup=================================
77 case "$host_os" in
78         darwin*)
79                 ;;
80         *)
81                 save_LIBS=$LIBS
82                 LIBS=`pkg-config --libs webkit-1.0`
83                 AC_CHECK_LIB(webkit-1.0, JSContextGroupCreate,,
84                                          AC_MSG_ERROR([The installed version of WebKit is too old. Seed requires WebKit SVN revision 35442 or greater.]))
85                 LIBS=$save_LIBS
86                 ;;
87 esac
88
89 dnl ==============================readline=====================================
90 AC_MSG_CHECKING(for readline)
91 AC_TRY_CPP([#include <readline/readline.h>],
92                         have_readline_h=yes,
93                         have_readline_h=no)
94 AC_MSG_RESULT([$have_readline_h])
95
96 dnl ==============================cairo========================================
97 AC_MSG_CHECKING(for cairo)
98 AC_TRY_CPP([#include <cairo/cairo.h>], have_cairo_h=yes, have_cairo_h=no)
99 AC_MSG_RESULT([$have_cairo_h])
100
101 dnl ============================sqlite3========================================
102 AC_MSG_CHECKING(for sqlite3)
103 AC_TRY_CPP([#include <sqlite3.h>], have_sqlite3_h=yes, have_sqlite3_h=no)
104 AC_MSG_RESULT([$have_sqlite3_h])
105
106 dnl =============================gtk+-2.0======================================
107 AC_MSG_CHECKING(for gtk+-2.0)
108 PKG_CHECK_EXISTS(gtk+-2.0, have_gtk=yes, have_gtk=no)
109 AC_MSG_RESULT([$have_gtk])
110
111 dnl =============================Modules=======================================
112 AC_ARG_ENABLE(canvas-module,
113                           AC_HELP_STRING([--enable-canvas-module],
114                                                          [enable the canvas Seed module. [default=yes]]),
115                           [want_canvas_module=$enableval],[want_canvas_module="yes"])
116
117 AC_ARG_ENABLE(example-module,
118                           AC_HELP_STRING([--enable-example-module],
119                                                          [enable the example Seed module. [default=yes]]),
120                           [want_example_module=$enableval],[want_example_module="yes"])
121
122 AC_ARG_ENABLE(multiprocessing-module,
123                           AC_HELP_STRING([--enable-multiprocessing-module],
124                                                          [enable the multiprocessing Seed module. [default=yes]]),
125                           [want_multiprocessing_module=$enableval],
126                           [want_multiprocessing_module="yes"])
127
128 AC_ARG_ENABLE(readline-module,
129                           AC_HELP_STRING([--enable-readline-module],
130                                                          [enable the readline Seed module. [default=yes]]),
131                           [want_readline_module=$enableval],[want_readline_module="yes"])
132
133 AC_ARG_ENABLE(sqlite-module,
134                           AC_HELP_STRING([--enable-sqlite-module],
135                                                          [enable the sqlite Seed module. [default=yes]]),
136                           [want_sqlite_module=$enableval],[want_sqlite_module="yes"])
137
138 dnl --- Special Cases ---
139
140 if test x"$have_cairo_h" != x"yes" ; then
141         want_canvas_module="no"
142 fi
143
144 if test x"$have_readline_h" != x"yes" ; then
145         want_readline_module="no"
146 fi
147
148 if test x"$have_sqlite3_h" != x"yes" ; then
149         want_sqlite_module="no"
150 fi
151
152 want_dbus_modules="yes"
153
154 AM_CONDITIONAL(BUILD_CANVAS_MODULE, test "x$want_canvas_module" = "xyes")
155 AM_CONDITIONAL(BUILD_EXAMPLE_MODULE, test "x$want_example_module" = "xyes")
156 AM_CONDITIONAL(BUILD_MULTIPROCESSING_MODULE, test "x$want_multiprocessing_module" = "xyes")
157 AM_CONDITIONAL(BUILD_READLINE_MODULE, test "x$want_readline_module" = "xyes")
158 AM_CONDITIONAL(BUILD_SQLITE_MODULE, test "x$want_sqlite_module" = "xyes")
159
160 AC_SUBST(BUILD_CANVAS_MODULE)
161 AC_SUBST(BUILD_EXAMPLE_MODULE)
162 AC_SUBST(BUILD_MULTIPROCESSING_MODULE)
163 AC_SUBST(BUILD_READLINE_MODULE)
164 AC_SUBST(BUILD_SQLITE_MODULE)
165
166 dnl =========================turtle example====================================
167 AC_ARG_ENABLE(turtle-example,
168                           AC_HELP_STRING([--enable-turtle-example],
169                                                          [enable the turtle graphics example. [default=yes]]),
170                           [want_turtle_example=$enableval],[want_turtle_example="yes"])
171
172 if test x"$have_gtk" != x"yes" ; then
173         want_turtle_example="no"
174 fi
175
176 AM_CONDITIONAL(BUILD_TURTLE_EXAMPLE, test "x$want_turtle_example" = "xyes")
177 AC_SUBST(BUILD_TURTLE_EXAMPLE)
178
179 dnl =========================Install Examples==================================
180 AC_ARG_ENABLE(examples,
181                           AC_HELP_STRING([--enable-examples],
182                                                          [install JavaScript examples. [default=yes]]),
183                           [enable_examples=$enableval],[enable_examples="yes"])
184 AM_CONDITIONAL(BUILD_SEED_EXAMPLES, test "x$enable_examples" = "xyes")
185 AC_SUBST(BUILD_SEED_EXAMPLES)
186
187 dnl =============================Debug=========================================
188 AC_ARG_ENABLE(debug,
189                           AC_HELP_STRING([--enable-debug],
190                                                          [enable verbose debugging. [default=no]]),
191                           [enable_debug="yes"],[enable_debug="no"])
192
193 if test "x$enable_debug" = "xyes"; then
194         SEED_DEBUG_CFLAGS="-DSEED_ENABLE_DEBUG -g"
195         CFLAGS="-O0"
196 else
197         SEED_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
198 fi
199
200 AC_SUBST(SEED_DEBUG_CFLAGS)
201
202 dnl ===========================Profiling=======================================
203 AC_ARG_ENABLE(profile,
204                           AC_HELP_STRING([--enable-profile],
205                                                          [turn on profiling [default=no]]),
206                           [enable_profile="yes"],[enable_profile="no"])
207
208 AC_ARG_ENABLE(profile-modules,
209                           AC_HELP_STRING([--enable-profile-modules],
210                                                          [turn on profiling for modules [default=no]]),
211                           [enable_profile_modules="yes"],[enable_profile_modules="no"])
212
213 if test "x$enable_profile" = "xyes"; then
214         SEED_PROFILE_CFLAGS="-fprofile-arcs -ftest-coverage"
215         SEED_PROFILE_LDFLAGS="-lgcov"
216         CFLAGS="-O0"
217 fi
218
219 if test "x$enable_profile" = "xno"; then
220         [enable_profile_modules="no"]
221 fi
222
223 AC_SUBST(SEED_PROFILE_CFLAGS)
224 AC_SUBST(SEED_PROFILE_LDFLAGS)
225
226 AM_CONDITIONAL(PROFILE_MODULES, test "x$enable_profile_modules" = "xyes")
227
228 dnl ===========================Darwin Build====================================
229 SEED_OSX_CFLAGS=
230 SEED_OSX_LDFLAGS=
231
232 case "$host_os" in
233         darwin*)
234                 SEED_OSX_CFLAGS="-F/Applications/WebKit.app/Contents/Frameworks/10.5 -framework JavaScriptCore"
235                 SEED_OSX_LDFLAGS="-F/Applications/WebKit.app/Contents/Frameworks/10.5 -framework JavaScriptCore"
236                 PKG_CHECK_MODULES(SEED, gobject-introspection-1.0 >= 0.6.3)
237                 PKG_CHECK_MODULES(LIBSEED, gobject-introspection-1.0 >= 0.6.3)
238                 ;;
239         *)
240                 PKG_CHECK_MODULES(SEED, webkit-1.0 gobject-introspection-1.0 >= 0.6.3)
241                 PKG_CHECK_MODULES(LIBSEED, webkit-1.0 gobject-introspection-1.0  >= 0.6.3)
242                 ;;
243 esac
244 AC_SUBST(SEED_OSX_CFLAGS)
245 AC_SUBST(SEED_OSX_LDFLAGS)
246
247 dnl =============================gtk-doc=======================================
248 GTK_DOC_CHECK(1.9)
249
250 dnl =============================Output========================================
251 SHAVE_INIT([scripts])
252 AC_CONFIG_FILES([
253 seed.pc
254 Makefile
255
256 doc/conventions.html
257 doc/runtime.html
258 doc/tutorial-standalone/tutorial.html
259 doc/modules/canvas.html
260 doc/modules/multiprocessing.html
261 doc/modules/readline.html
262 doc/modules/sqlite.html
263
264 doc/mapping/mapping.html
265
266 scripts/shave
267 scripts/shave-libtool
268
269 libseed/Makefile
270 po/Makefile.in
271 src/Makefile
272 extensions/Makefile
273 tests/Makefile
274 tests/javascript/Makefile
275 tests/c/Makefile
276 doc/Makefile
277 doc/modules/Makefile
278 doc/tutorial-standalone/Makefile
279 doc/reference/Makefile
280 doc/mapping/Makefile
281 examples/Makefile
282 examples/clutter-shader/Makefile
283 examples/clutter-transitions/Makefile
284 examples/glib/Makefile
285 examples/browser/Makefile
286 examples/turtle/Makefile
287 examples/opengl/Makefile
288 examples/twitter/Makefile
289 examples/pong/Makefile
290 examples/same-seed/Makefile
291 modules/Makefile
292 modules/example/Makefile
293 modules/sqlite/Makefile
294 modules/canvas/Makefile
295 modules/readline/Makefile
296 modules/Multiprocessing/Makefile
297 modules/os/Makefile
298 ])
299 AC_OUTPUT
300
301 echo "
302 Build Configuration:
303    Debug......................$enable_debug
304    Profiling/Coverage.........$enable_profile
305    Profiling for Modules......$enable_profile_modules
306    gtk-doc....................$enable_gtk_doc
307
308 Installation:
309    Prefix.....................$prefix
310    Install examples...........$enable_examples
311
312 Modules:
313    Canvas.....................$want_canvas_module
314    example....................$want_example_module
315    multiprocessing............$want_multiprocessing_module
316    readline...................$want_readline_module
317    SQLite.....................$want_sqlite_module
318
319 Examples:
320    Turtle.....................$want_turtle_example
321 "
322
323 if test "x$want_readline_module" != "xyes"; then
324 echo "WARNING: The readline module is not enabled.
325          Without this, the Seed REPL will not work;
326          however, most Seed applications will still run.
327 "
328 fi