3 m4_define(swfdec_major, 0)
4 m4_define(swfdec_minor, 9)
5 m4_define(swfdec_micro, 1)
6 AC_INIT(swfdec,[swfdec_major.swfdec_minor.swfdec_micro])
8 SWFDEC_VERSION_MAJOR=swfdec_major
9 SWFDEC_VERSION_MINOR=swfdec_minor
10 SWFDEC_VERSION_MICRO=swfdec_micro
11 SWFDEC_VERSION=$SWFDEC_VERSION_MAJOR.$SWFDEC_VERSION_MINOR.$SWFDEC_VERSION_MICRO
12 AC_SUBST(SWFDEC_VERSION_MAJOR)
13 AC_SUBST(SWFDEC_VERSION_MINOR)
14 AC_SUBST(SWFDEC_VERSION_MICRO)
15 AC_SUBST(SWFDEC_VERSION)
18 [SWFDEC_DEVEL=$(echo $SWFDEC_VERSION_MICRO | sed 's/[0-9]*[13579]/yes/')]
19 [SWFDEC_SNAPSHOT=$(echo $SWFDEC_VERSION_MINOR | sed 's/[0-9]*[13579]/yes/')]
22 dnl AC_CANONICAL_TARGET([])
24 SWFDEC_MAJORMINOR=$SWFDEC_VERSION_MAJOR.$SWFDEC_VERSION_MINOR
25 AC_SUBST(SWFDEC_MAJORMINOR)
27 AM_CONFIG_HEADER(config.h)
28 AC_CONFIG_MACRO_DIR([m4])
30 dnl decide on error flags
31 dnl if we support them, we set them unconditionally
32 dnl FIXME: I want this but stupid headers don't let me: -Wshadow
33 dnl FIXME: readd -Wlogical-op when http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36513 is solved
34 AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default -Winit-self -Wmissing-include-dirs -Wundef -Waddress -Waggregate-return -Wmissing-format-attribute -Wno-multichar -Wnested-externs")
35 dnl if we're in nano >= 1, add -Werror if supported
36 if test x$SWFDEC_DEVEL = xyes ; then
37 AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-Werror")
38 DEFAULT_DEBUG_LEVEL="SWFDEC_LEVEL_WARNING"
40 DEFAULT_DEBUG_LEVEL="SWFDEC_LEVEL_ERROR"
42 AC_DEFINE_UNQUOTED(SWFDEC_LEVEL_DEFAULT, $DEFAULT_DEBUG_LEVEL, [Default debug level used])
44 dnl Compute the libversion automatically, so there's no need to think about it
45 dnl when bumping versions.
46 dnl Note that the libversions are based on Swfdec's current release mechanism
48 dnl http://lists.freedesktop.org/archives/swfdec/2008-January/001131.html
49 dnl If this ever changes (like when Swfdec gets a stable API), don't forget to
51 if test x"$SWFDEC_SNAPSHOT" = xyes ; then
52 SWFDEC_LIBVERSION="$SWFDEC_VERSION_MICRO:0:0"
54 SWFDEC_LIBVERSION="0:0:0"
56 AC_SUBST(SWFDEC_LIBVERSION)
59 dnl C99 is only required to get definitions for NAN and INFINITY.
60 AS_COMPILER_FLAGS(GLOBAL_CFLAGS, "-std=gnu99")
62 dnl ensures the library is linked against the internal Mozilla
63 dnl if this doesn't work on your platform, I'll take patches :)
64 SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic"
65 AC_SUBST(SYMBOLIC_LDFLAGS)
67 dnl Add parameters for aclocal
68 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
69 #ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS"
79 AC_MSG_CHECKING([for timezone support])
85 localtime (&t)->tm_gmtoff;
89 if test "x$HAVE_TIMEZONE" = "xyes"; then
91 AC_DEFINE(HAVE_TIMEZONE, 1, [Define if we can query the timezone])
97 dnl ##############################
98 dnl # Do automated configuration #
99 dnl ##############################
104 dnl modify pkg-config path
105 AC_ARG_WITH(pkg-config-path,
106 AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
107 [export PKG_CONFIG_PATH=${withval}])
109 dnl Check for essential libraries first:
110 dnl ====================================
113 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_VER gobject-2.0 >= $GLIB_VER gthread-2.0 >= $GLIB_VER,
114 HAVE_GLIB=yes, HAVE_GLIB=no)
115 if test "$HAVE_GLIB" = "no"; then
116 AC_MSG_ERROR([glib-2.0, gobject-2.0 and gthread-2.0 >= $GLIB_VER are required to build swfdec])
119 AC_SUBST(GLIB_CFLAGS)
121 dnl FIXME: detect these executables correctly
122 GLIB_GENMARSHAL=glib-genmarshal
123 AC_SUBST(GLIB_GENMARSHAL)
124 GLIB_MKENUMS=glib-mkenums
125 AC_SUBST(GLIB_MKENUMS)
128 PKG_CHECK_MODULES(PANGO, pangocairo >= $PANGO_VER, HAVE_PANGO=yes, HAVE_PANGO=no)
129 if test "$HAVE_PANGO" = "no"; then
130 AC_MSG_ERROR([pangocairo >= $PANGO_VER is required to build swfdec])
133 AC_SUBST(PANGO_CFLAGS)
136 AS_HELP_STRING([--enable-gtk],
137 [enable build of swfdec-gtk (default=yes)])],
138 enable_gtk=$enableval,
142 dnl GTK: We want this for swfdec-gtk
146 if test "$enable_gtk" = "yes"; then
147 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VER libsoup-2.4, HAVE_GTK=yes)
148 AC_DEFINE(HAVE_GTK, 1, [Define if Gtk is enabled])
150 AC_MSG_NOTICE([Gtk support was not enabled.])
152 AM_CONDITIONAL(WITH_GTK, [test "x$HAVE_GTK" = xyes])
158 [AC_HELP_STRING([--with-audio=@<:@auto/pulse/none@:>@],
159 [audio backend to use])],,
163 if test "$with_audio" = "alsa"; then
164 PKG_CHECK_MODULES(ALSA, alsa >= 1.0, AUDIO_TYPE=alsa)
165 if test "$AUDIO_TYPE" = "alsa"; then
166 AUDIO_CFLAGS=$ALSA_CFLAGS
167 AUDIO_LIBS=$ALSA_LIBS
169 if test "$with_audio" = "alsa"; then
170 AC_MSG_ERROR([no alsa audio support])
172 AC_MSG_WARN([no alsa audio support])
177 dnl Use PA if ALSA wasn't found and we're auto and it's available.
178 dnl Disabled for now until the PA backend works.
179 if test "$with_audio" = "pulse"; then
180 PKG_CHECK_MODULES(PA, libpulse-mainloop-glib, AUDIO_TYPE="pulse")
181 if test "$AUDIO_TYPE" = "pulse"; then
182 AUDIO_CFLAGS=$PA_CFLAGS
185 if test "$with_audio" = "pulse"; then
186 AC_MSG_ERROR([no pulseaudio support])
188 AC_MSG_WARN([no pulseaudio support])
193 dnl If all else fails, fall back to none.
194 if test "$with_audio" = "none"; then
200 if test "x$AUDIO_TYPE" = "x"; then
201 AC_MSG_ERROR([audio backend "$with_audio" could not be used])
203 AC_MSG_NOTICE([audio backend: $AUDIO_TYPE])
206 AC_SUBST(AUDIO_CFLAGS)
210 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= $LIBOIL_VER, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
211 AC_SUBST(LIBOIL_LIBS)
212 AC_SUBST(LIBOIL_CFLAGS)
213 if test "$HAVE_LIBOIL" = "no"; then
214 AC_MSG_ERROR([liboil-0.3 >= $LIBOIL_VER is required to build swfdec])
218 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VER cairo-png >= $CAIRO_VER, HAVE_CAIRO=yes, HAVE_CAIRO=no)
220 AC_SUBST(CAIRO_CFLAGS)
221 if test "$HAVE_CAIRO" = "no"; then
222 AC_MSG_ERROR([cairo and cairo-png = $CAIRO_VER is required to build swfdec])
225 AC_ARG_ENABLE(gstreamer,
226 AS_HELP_STRING([--enable-gstreamer],
227 [enable GStreamer support (default=yes)])],
228 enable_gstreamer=$enableval,
229 enable_gstreamer="yes")
231 if test "$enable_gstreamer" = "yes"; then
233 GST_PB_REQUIRED=0.10.15
234 PKG_CHECK_MODULES(GST, gstreamer-0.10 >= $GST_REQUIRED gstreamer-pbutils-0.10 >= $GST_PB_REQUIRED, HAVE_GST=yes, HAVE_GST=no)
235 if test "x$HAVE_GST" = xyes; then
236 AC_DEFINE(HAVE_GST, 1, [Define if GStreamer is enabled])
238 AC_MSG_ERROR([Couldn't find GStreamer $GST_REQUIRED and gstreamer-pbutils $GST_PB_REQUIRED.])
241 AC_MSG_NOTICE([GStreamer support was not enabled.])
243 AM_CONDITIONAL(HAVE_GST, [test "x$HAVE_GST" = xyes])
246 AC_ARG_ENABLE(vivified,
247 AS_HELP_STRING([--enable-vivified],
248 [enable Vivified Flash debugger (default=no)])],
249 enable_vivi=$enableval,
251 if test "$enable_vivi" = "yes"; then
253 MING_REQUIRED=0.4.0.beta5
254 VIVI_GTK_REQUIRED=2.11.6
255 VIVI_GLIB_REQUIRED=2.14
256 PKG_CHECK_MODULES(VIVI, libming >= $MING_REQUIRED gmodule-export-2.0 gtk+-2.0 >= $VIVI_GTK_REQUIRED glib-2.0 >= $VIVI_GLIB_REQUIRED, HAVE_VIVI=yes, HAVE_VIVI=no)
257 if test "x$HAVE_VIVI" = xyes; then
258 AC_DEFINE(HAVE_VIVI, 1, [Define if Vivified is enabled])
260 AC_MSG_ERROR([Vivified requirements not met. You need libming >= $MING_REQUIRED, glib >= $VIVI_GLIB_REQUIRED and Gtk+ >= $VIVI_GTK_REQUIRED.])
263 AC_MSG_NOTICE([Vivified was not enabled.])
265 AM_CONDITIONAL(HAVE_VIVI, [test "x$HAVE_VIVI" = xyes])
268 AC_SUBST(GLOBAL_CFLAGS)
269 AC_SUBST(GLOBAL_CFLAGS)
271 SWFDEC_CFLAGS="-I\$(top_srcdir) $GLIB_CFLAGS $CAIRO_CFLAGS"
272 SWFDEC_LIBS="\$(top_builddir)/swfdec/libswfdec-$SWFDEC_MAJORMINOR.la $GLIB_LIBS $CAIRO_LIBS -lz -lm"
273 AC_SUBST(SWFDEC_LIBS)
274 AC_SUBST(SWFDEC_CFLAGS)
276 SWFDEC_GTK_CFLAGS="$SWFDEC_CFLAGS $GTK_CFLAGS"
277 SWFDEC_GTK_LIBS="\$(top_builddir)/swfdec-gtk/libswfdec-gtk-$SWFDEC_MAJORMINOR.la $SWFDEC_LIBS $GTK_LIBS"
278 AC_SUBST(SWFDEC_GTK_LIBS)
279 AC_SUBST(SWFDEC_GTK_CFLAGS)
283 if test "x${prefix}" = "xNONE"; then
284 PACKAGE_PREFIX=${ac_default_prefix}
286 PACKAGE_PREFIX=${prefix}
288 AC_DEFINE_UNQUOTED(PACKAGE_PREFIX, "$PACKAGE_PREFIX", [Define the package prefix])
289 AC_SUBST(PACKAGE_PREFIX)
291 dnl #########################
292 dnl # Make the output files #
293 dnl #########################
295 dnl testsuite/autoplug/Makefile
296 dnl testsuite/Makefile
304 swfdec/swfdec_version.h
311 test/gnash/media/Makefile
312 test/gnash/actionscript.all/Makefile
313 test/gnash/misc-mtasc.all/Makefile
314 test/gnash/misc-swfc.all/Makefile
315 test/gnash/misc-swfmill.all/Makefile
319 test/various/Makefile
322 vivified/code/Makefile
323 vivified/code/test/Makefile
324 vivified/code/test/compiler/Makefile
325 vivified/code/test/decompiler/Makefile
326 vivified/core/Makefile
327 vivified/dock/Makefile