2 AC_INIT(swfdec,0.5.3.1)
4 [nano=$(echo $PACKAGE_VERSION | sed 's/[0-9]\.[0-9]\.[0-9][0-9]*\.*//')]
5 if test x"$nano" = x1 ; then
12 dnl AC_CANONICAL_TARGET([])
16 AC_SUBST(SWFDEC_MAJORMINOR)
18 AM_CONFIG_HEADER(config.h)
19 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")
21 dnl decide on error flags
22 dnl if we support them, we set them unconditionally
23 AS_COMPILER_FLAG(-Wall, GLOBAL_CFLAGS="-Wall", GLOBAL_CFLAGS="")
24 dnl I want this but stupid headers don't let me
25 dnl AS_COMPILER_FLAG(-Wshadow, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wshadow")
26 AS_COMPILER_FLAG(-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, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -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")
27 dnl if we're in nano >= 1, add -Werror if supported
28 if test x$SWFDEC_CVS = xyes ; then
29 AS_COMPILER_FLAG(-Werror, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Werror")
30 DEFAULT_DEBUG_LEVEL="SWFDEC_LEVEL_WARNING"
32 DEFAULT_DEBUG_LEVEL="SWFDEC_LEVEL_ERROR"
34 AC_DEFINE_UNQUOTED(SWFDEC_LEVEL_DEFAULT, $DEFAULT_DEBUG_LEVEL, [Default debug level used])
36 SWFDEC_LIBVERSION="3:0:0"
37 AC_SUBST(SWFDEC_LIBVERSION)
40 dnl C99 is only required to get definitions for NAN and INFINITY.
41 AS_COMPILER_FLAG(-std=gnu99, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -std=gnu99")
43 dnl ensures the library is linked against the internal Mozilla
44 dnl if this doesn't work on your platform, I'll take patches :)
45 SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic"
46 AC_SUBST(SYMBOLIC_LDFLAGS)
48 dnl Add parameters for aclocal
49 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
50 #ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS"
60 dnl ##############################
61 dnl # Do automated configuration #
62 dnl ##############################
67 dnl modify pkg-config path
68 AC_ARG_WITH(pkg-config-path,
69 AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
70 [export PKG_CONFIG_PATH=${withval}])
72 dnl Check for essential libraries first:
73 dnl ====================================
76 PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_VER gobject-2.0 >= $GLIB_VER,
77 HAVE_GLIB=yes, HAVE_GLIB=no)
78 if test "$HAVE_GLIB" = "no"; then
79 AC_MSG_ERROR([glib-2.0 >= $GLIB_VER and gobject-2.0 >= $GLIB_VER are required to build swfdec])
84 dnl we detect gthread seperately for now, since we don't want to link libswfdec to it (yet)
85 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= $GLIB_VER,
86 HAVE_GLIB=yes, HAVE_GLIB=no)
87 if test "$HAVE_GTHREAD" = "no"; then
88 AC_MSG_ERROR([gthread-2.0 >= $GLIB_VER is required to build swfdec])
90 dnl FIXME: detect these executables correctly
91 GLIB_GENMARSHAL=glib-genmarshal
92 AC_SUBST(GLIB_GENMARSHAL)
93 GLIB_MKENUMS=glib-mkenums
94 AC_SUBST(GLIB_MKENUMS)
96 PKG_CHECK_MODULES(PANGO, pangocairo, HAVE_PANGO=yes, HAVE_PANGO=no)
97 if test "$HAVE_PANGO" = "no"; then
98 AC_MSG_ERROR([pangocairo is required to build swfdec])
101 AC_SUBST(PANGO_CFLAGS)
104 AS_HELP_STRING([--enable-gtk],
105 [enable Gtk integration (default=yes)])],
106 enable_gtk=$enableval,
110 dnl GTK: We want this for swfdec-gtk
114 if test "$enable_gtk" = "yes"; then
115 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VER, HAVE_GTK=yes, HAVE_GTK=no)
116 if test "x$HAVE_GTK" = xyes; then
117 AC_DEFINE(HAVE_GTK, 1, [Define if Gtk is enabled])
119 AC_MSG_ERROR([Couldn't find a suitable Gtk version. You need at least version $GTK_VER])
122 AC_MSG_NOTICE([Gtk support was not enabled.])
124 AM_CONDITIONAL(WITH_GTK, [test "x$HAVE_GTK" = xyes])
130 [AC_HELP_STRING([--with-audio=@<:@auto/alsa/oss/none@:>@],
131 [audio backend to use])],,
135 if test "$with_audio" = "auto" -o "$with_audio" = "alsa"; then
136 PKG_CHECK_MODULES(ALSA, alsa >= 1.0, AUDIO_TYPE=alsa)
137 if test "$AUDIO_TYPE" = "alsa"; then
139 AUDIO_CFLAGS=$ALSA_CFLAGS
140 AUDIO_LIBS=$ALSA_LIBS
142 if test "$with_audio" = "alsa"; then
143 AC_MSG_ERROR([no alsa audio support])
145 AC_MSG_WARN([no alsa audio support])
150 dnl Assume OSS is available if ALSA wasn't found and we're "auto".
151 if test "$with_audio" = "auto" -o "$with_audio" = "oss"; then
158 if test "$with_audio" = "auto" -o "$with_audio" = "none"; then
164 if test "x$AUDIO_TYPE" = "x"; then
165 AC_MSG_ERROR([desired audio support could not be used])
167 AC_MSG_NOTICE([audio backend: $AUDIO_TYPE])
170 AC_SUBST(AUDIO_CFLAGS)
174 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= $LIBOIL_VER, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
175 AC_SUBST(LIBOIL_LIBS)
176 AC_SUBST(LIBOIL_CFLAGS)
177 if test "$HAVE_LIBOIL" = "no"; then
178 AC_MSG_ERROR([liboil-0.3 >= $LIBOIL_VER is required to build swfdec])
182 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VER, HAVE_CAIRO=yes, HAVE_CAIRO=no)
184 AC_SUBST(CAIRO_CFLAGS)
185 if test "$HAVE_CAIRO" = "no"; then
186 AC_MSG_ERROR([cairo >= $CAIRO_VER is required to build swfdec])
190 AS_HELP_STRING([--enable-mad],
191 [enable mad audio (default=yes)])],
192 enable_mad=$enableval,
195 if test "$enable_mad" = "yes"; then
196 AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad", HAVE_MAD="no")
198 if test "x$HAVE_MAD" = xyes; then
199 AC_DEFINE(HAVE_MAD, 1, [Define if mad is enabled])
201 AC_MSG_ERROR([Couldn't find mad. You might need to install the libmad0-dev package.])
204 AC_MSG_NOTICE([mad audio support was not enabled.])
206 AM_CONDITIONAL(HAVE_MAD, [test "x$HAVE_MAD" = xyes])
208 dnl I'd put a required version in here if distros can agree on a way
209 dnl to detect ffmpeg. But as it stands even pkg-config versions are weird.
210 dnl So you'll have to update your ffmpeg checkout if compilation fails.
211 dnl Or you submit a patch that detects ffmpeg reliably on the distros.
212 AC_ARG_ENABLE(ffmpeg,
213 AS_HELP_STRING([--enable-ffmpeg],
214 [enable ffmpeg support (default=yes)])],
215 enable_ffmpeg=$enableval,
218 if test "$enable_ffmpeg" = "yes"; then
219 PKG_CHECK_MODULES(FFMPEG, libavcodec libswscale, HAVE_FFMPEG=yes, HAVE_FFMPEG=no)
220 AC_SUBST(FFMPEG_CFLAGS)
221 AC_SUBST(FFMPEG_LIBS)
222 if test "x$HAVE_FFMPEG" = xyes; then
223 AC_DEFINE(HAVE_FFMPEG, 1, [Define if ffmpeg is enabled])
225 AC_MSG_ERROR([Couldn't find ffmpeg. You might need to install the libavcodec-dev and libswscale-dev packages.])
228 AC_MSG_NOTICE([ffmpeg support was not enabled.])
230 AM_CONDITIONAL(HAVE_FFMPEG, [test "x$HAVE_FFMPEG" = xyes])
231 AC_ARG_ENABLE(gstreamer,
232 AS_HELP_STRING([--enable-gstreamer],
233 [enable GStreamer support (default=yes)])],
234 enable_gstreamer=$enableval,
235 enable_gstreamer="yes")
237 if test "$enable_gstreamer" = "yes"; then
239 PKG_CHECK_MODULES(GST, gstreamer-0.10 >= $GST_REQUIRED, HAVE_GST=yes, HAVE_GST=no)
240 if test "x$HAVE_GST" = xyes; then
241 AC_DEFINE(HAVE_GST, 1, [Define if GStreamer is enabled])
243 AC_MSG_ERROR([Couldn't find GStreamer $GST_REQUIRED.])
246 AC_MSG_NOTICE([GStreamer support was not enabled.])
248 AM_CONDITIONAL(HAVE_GST, [test "x$HAVE_GST" = xyes])
252 AS_HELP_STRING([--enable-soup],
253 [enable libsoup HTTP support for swfdec-gtk (default=yes)])],
254 enable_libsoup=$enableval,
255 enable_libsoup="yes")
257 if test "$enable_libsoup" = "yes"; then
258 PKG_CHECK_MODULES(HTTP, libsoup-2.2 >= 2.2.0, HAVE_HTTP=yes, HAVE_HTTP=no)
259 if test "x$HAVE_HTTP" = xyes; then
260 AC_DEFINE(HAVE_HTTP, 1, [Define if libsoup is enabled])
262 AC_MSG_ERROR([Couldn't find libsoup-2.2.])
265 AC_MSG_NOTICE([libsoup HTTP support was not enabled.])
267 AM_CONDITIONAL(HAVE_HTTP, [test "x$HAVE_HTTP" = xyes])
269 AC_ARG_ENABLE(vivified,
270 AS_HELP_STRING([--enable-vivified],
271 [enable Vivified Flash debugger (default=no)])],
272 enable_vivi=$enableval,
274 if test "$enable_vivi" = "yes"; then
275 MING_REQUIRED=0.4.0.beta5
276 VIVI_GTK_REQUIRED=2.11.6
277 PKG_CHECK_MODULES(VIVI, libming >= $MING_REQUIRED gmodule-export-2.0 gtk+-2.0 >= $VIVI_GTK_REQUIRED, HAVE_VIVI=yes, HAVE_VIVI=no)
278 if test "x$HAVE_VIVI" = xyes; then
279 AC_DEFINE(HAVE_VIVI, 1, [Define if Vivified is enabled])
281 AC_MSG_ERROR([Vivified requirements not met. You need libming >= $MING_REQUIRED and Gtk+ >= $VIVI_GTK_REQUIRED.])
284 AC_MSG_NOTICE([Vivified was not enabled.])
286 AM_CONDITIONAL(HAVE_VIVI, [test "x$HAVE_VIVI" = xyes])
289 AC_SUBST(GLOBAL_CFLAGS)
290 AC_SUBST(GLOBAL_CFLAGS)
292 SWFDEC_CFLAGS="-I\$(top_srcdir) $GLIB_CFLAGS $CAIRO_CFLAGS"
293 SWFDEC_LIBS="\$(top_builddir)/libswfdec/libswfdec-$SWFDEC_MAJORMINOR.la $GLIB_LIBS $CAIRO_LIBS -lz"
294 AC_SUBST(SWFDEC_LIBS)
295 AC_SUBST(SWFDEC_CFLAGS)
297 SWFDEC_GTK_CFLAGS="$SWFDEC_CFLAGS $GTK_CFLAGS"
298 SWFDEC_GTK_LIBS="\$(top_builddir)/libswfdec-gtk/libswfdec-gtk-$SWFDEC_MAJORMINOR.la $SWFDEC_LIBS $GTK_LIBS"
299 AC_SUBST(SWFDEC_GTK_LIBS)
300 AC_SUBST(SWFDEC_GTK_CFLAGS)
304 if test "x${prefix}" = "xNONE"; then
305 PACKAGE_PREFIX=${ac_default_prefix}
307 PACKAGE_PREFIX=${prefix}
309 AC_DEFINE_UNQUOTED(PACKAGE_PREFIX, "$PACKAGE_PREFIX", [Define the package prefix])
310 AC_SUBST(PACKAGE_PREFIX)
312 dnl #########################
313 dnl # Make the output files #
314 dnl #########################
316 dnl testsuite/autoplug/Makefile
317 dnl testsuite/Makefile
322 data/icons/16x16/Makefile
323 data/icons/22x22/Makefile
324 data/icons/24x24/Makefile
325 data/icons/32x32/Makefile
326 data/icons/48x48/Makefile
327 data/icons/scalable/Makefile
332 libswfdec/jpeg/Makefile
333 libswfdec-gtk/Makefile
339 test/various/Makefile
341 vivified/core/Makefile
342 vivified/dock/Makefile