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 -Wswitch-enum -Wswitch-default, 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 -Wswitch-enum -Wswitch-default")
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 gthread-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, gobject-2.0 and gthread-2.0 >= $GLIB_VER are required to build swfdec])
84 dnl FIXME: detect these executables correctly
85 GLIB_GENMARSHAL=glib-genmarshal
86 AC_SUBST(GLIB_GENMARSHAL)
87 GLIB_MKENUMS=glib-mkenums
88 AC_SUBST(GLIB_MKENUMS)
90 PKG_CHECK_MODULES(PANGO, pangocairo, HAVE_PANGO=yes, HAVE_PANGO=no)
91 if test "$HAVE_PANGO" = "no"; then
92 AC_MSG_ERROR([pangocairo is required to build swfdec])
95 AC_SUBST(PANGO_CFLAGS)
98 AS_HELP_STRING([--enable-gtk],
99 [enable Gtk integration (default=yes)])],
100 enable_gtk=$enableval,
104 dnl GTK: We want this for swfdec-gtk
108 if test "$enable_gtk" = "yes"; then
109 PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VER, HAVE_GTK=yes, HAVE_GTK=no)
110 if test "x$HAVE_GTK" = xyes; then
111 AC_DEFINE(HAVE_GTK, 1, [Define if Gtk is enabled])
113 AC_MSG_ERROR([Couldn't find a suitable Gtk version. You need at least version $GTK_VER])
116 AC_MSG_NOTICE([Gtk support was not enabled.])
118 AM_CONDITIONAL(WITH_GTK, [test "x$HAVE_GTK" = xyes])
124 [AC_HELP_STRING([--with-audio=@<:@auto/alsa/oss/none@:>@],
125 [audio backend to use])],,
129 if test "$with_audio" = "auto" -o "$with_audio" = "alsa"; then
130 PKG_CHECK_MODULES(ALSA, alsa >= 1.0, AUDIO_TYPE=alsa)
131 if test "$AUDIO_TYPE" = "alsa"; then
133 AUDIO_CFLAGS=$ALSA_CFLAGS
134 AUDIO_LIBS=$ALSA_LIBS
136 if test "$with_audio" = "alsa"; then
137 AC_MSG_ERROR([no alsa audio support])
139 AC_MSG_WARN([no alsa audio support])
144 dnl Use PA if ALSA wasn't found and we're auto and it's available.
145 dnl Disabled for now until the PA backend works.
146 if test "$with_audio" = "auto" -o "$with_audio" = "pa"; then
147 PKG_CHECK_MODULES(PA, libpulse-mainloop-glib, AUDIO_TYPE=pa)
148 if test "$AUDIO_TYPE" = "pa"; then
150 AUDIO_CFLAGS=$PA_CFLAGS
153 if test "$with_audio" = "pa"; then
154 AC_MSG_ERROR([no pulseaudio support])
156 AC_MSG_WARN([no pulseaudio support])
161 dnl Assume OSS is available if ALSA wasn't found and we're "auto".
162 if test "$with_audio" = "auto" -o "$with_audio" = "oss"; then
169 dnl If all else fails, fall back to none.
170 if test "$with_audio" = "auto" -o "$with_audio" = "none"; then
176 if test "x$AUDIO_TYPE" = "x"; then
177 AC_MSG_ERROR([desired audio support could not be used])
179 AC_MSG_NOTICE([audio backend: $AUDIO_TYPE])
182 AC_SUBST(AUDIO_CFLAGS)
186 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= $LIBOIL_VER, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
187 AC_SUBST(LIBOIL_LIBS)
188 AC_SUBST(LIBOIL_CFLAGS)
189 if test "$HAVE_LIBOIL" = "no"; then
190 AC_MSG_ERROR([liboil-0.3 >= $LIBOIL_VER is required to build swfdec])
194 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VER, HAVE_CAIRO=yes, HAVE_CAIRO=no)
196 AC_SUBST(CAIRO_CFLAGS)
197 if test "$HAVE_CAIRO" = "no"; then
198 AC_MSG_ERROR([cairo >= $CAIRO_VER is required to build swfdec])
202 AS_HELP_STRING([--enable-mad],
203 [enable mad audio (default=no)])],
204 enable_mad=$enableval,
207 if test "$enable_mad" = "yes"; then
208 AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad", HAVE_MAD="no")
210 if test "x$HAVE_MAD" = xyes; then
211 AC_DEFINE(HAVE_MAD, 1, [Define if mad is enabled])
213 AC_MSG_ERROR([Couldn't find mad. You might need to install the libmad0-dev package.])
216 AC_MSG_NOTICE([mad audio support was not enabled.])
218 AM_CONDITIONAL(HAVE_MAD, [test "x$HAVE_MAD" = xyes])
220 dnl I'd put a required version in here if distros can agree on a way
221 dnl to detect ffmpeg. But as it stands even pkg-config versions are weird.
222 dnl So you'll have to update your ffmpeg checkout if compilation fails.
223 dnl Or you submit a patch that detects ffmpeg reliably on the distros.
224 AC_ARG_ENABLE(ffmpeg,
225 AS_HELP_STRING([--enable-ffmpeg],
226 [enable ffmpeg support (default=no)])],
227 enable_ffmpeg=$enableval,
230 if test "$enable_ffmpeg" = "yes"; then
231 PKG_CHECK_MODULES(FFMPEG, libavcodec libswscale, HAVE_FFMPEG=yes, HAVE_FFMPEG=no)
232 AC_SUBST(FFMPEG_CFLAGS)
233 AC_SUBST(FFMPEG_LIBS)
234 if test "x$HAVE_FFMPEG" = xyes; then
235 AC_DEFINE(HAVE_FFMPEG, 1, [Define if ffmpeg is enabled])
237 AC_MSG_ERROR([Couldn't find ffmpeg. You might need to install the libavcodec-dev and libswscale-dev packages.])
240 AC_MSG_NOTICE([ffmpeg support was not enabled.])
242 AM_CONDITIONAL(HAVE_FFMPEG, [test "x$HAVE_FFMPEG" = xyes])
243 AC_ARG_ENABLE(gstreamer,
244 AS_HELP_STRING([--enable-gstreamer],
245 [enable GStreamer support (default=yes)])],
246 enable_gstreamer=$enableval,
247 enable_gstreamer="yes")
249 if test "$enable_gstreamer" = "yes"; then
251 PKG_CHECK_MODULES(GST, gstreamer-0.10 >= $GST_REQUIRED, HAVE_GST=yes, HAVE_GST=no)
252 if test "x$HAVE_GST" = xyes; then
253 AC_DEFINE(HAVE_GST, 1, [Define if GStreamer is enabled])
255 AC_MSG_ERROR([Couldn't find GStreamer $GST_REQUIRED.])
258 AC_MSG_NOTICE([GStreamer support was not enabled.])
260 AM_CONDITIONAL(HAVE_GST, [test "x$HAVE_GST" = xyes])
264 AS_HELP_STRING([--enable-soup],
265 [enable libsoup HTTP support for swfdec-gtk (default=yes)])],
266 enable_libsoup=$enableval,
267 enable_libsoup="yes")
269 if test "$enable_libsoup" = "yes"; then
270 PKG_CHECK_MODULES(HTTP, libsoup-2.2 >= 2.2.0, HAVE_HTTP=yes, HAVE_HTTP=no)
271 if test "x$HAVE_HTTP" = xyes; then
272 AC_DEFINE(HAVE_HTTP, 1, [Define if libsoup is enabled])
274 AC_MSG_ERROR([Couldn't find libsoup-2.2.])
277 AC_MSG_NOTICE([libsoup HTTP support was not enabled.])
279 AM_CONDITIONAL(HAVE_HTTP, [test "x$HAVE_HTTP" = xyes])
281 AC_ARG_ENABLE(vivified,
282 AS_HELP_STRING([--enable-vivified],
283 [enable Vivified Flash debugger (default=no)])],
284 enable_vivi=$enableval,
286 if test "$enable_vivi" = "yes"; then
287 MING_REQUIRED=0.4.0.beta5
288 VIVI_GTK_REQUIRED=2.11.6
289 PKG_CHECK_MODULES(VIVI, libming >= $MING_REQUIRED gmodule-export-2.0 gtk+-2.0 >= $VIVI_GTK_REQUIRED, HAVE_VIVI=yes, HAVE_VIVI=no)
290 if test "x$HAVE_VIVI" = xyes; then
291 AC_DEFINE(HAVE_VIVI, 1, [Define if Vivified is enabled])
293 AC_MSG_ERROR([Vivified requirements not met. You need libming >= $MING_REQUIRED and Gtk+ >= $VIVI_GTK_REQUIRED.])
296 AC_MSG_NOTICE([Vivified was not enabled.])
298 AM_CONDITIONAL(HAVE_VIVI, [test "x$HAVE_VIVI" = xyes])
301 AC_SUBST(GLOBAL_CFLAGS)
302 AC_SUBST(GLOBAL_CFLAGS)
304 SWFDEC_CFLAGS="-I\$(top_srcdir) $GLIB_CFLAGS $CAIRO_CFLAGS"
305 SWFDEC_LIBS="\$(top_builddir)/libswfdec/libswfdec-$SWFDEC_MAJORMINOR.la $GLIB_LIBS $CAIRO_LIBS -lz"
306 AC_SUBST(SWFDEC_LIBS)
307 AC_SUBST(SWFDEC_CFLAGS)
309 SWFDEC_GTK_CFLAGS="$SWFDEC_CFLAGS $GTK_CFLAGS"
310 SWFDEC_GTK_LIBS="\$(top_builddir)/libswfdec-gtk/libswfdec-gtk-$SWFDEC_MAJORMINOR.la $SWFDEC_LIBS $GTK_LIBS"
311 AC_SUBST(SWFDEC_GTK_LIBS)
312 AC_SUBST(SWFDEC_GTK_CFLAGS)
316 if test "x${prefix}" = "xNONE"; then
317 PACKAGE_PREFIX=${ac_default_prefix}
319 PACKAGE_PREFIX=${prefix}
321 AC_DEFINE_UNQUOTED(PACKAGE_PREFIX, "$PACKAGE_PREFIX", [Define the package prefix])
322 AC_SUBST(PACKAGE_PREFIX)
324 dnl #########################
325 dnl # Make the output files #
326 dnl #########################
328 dnl testsuite/autoplug/Makefile
329 dnl testsuite/Makefile
334 data/icons/16x16/Makefile
335 data/icons/22x22/Makefile
336 data/icons/24x24/Makefile
337 data/icons/32x32/Makefile
338 data/icons/48x48/Makefile
339 data/icons/scalable/Makefile
344 libswfdec/jpeg/Makefile
345 libswfdec-gtk/Makefile
351 test/various/Makefile
353 vivified/core/Makefile
354 vivified/dock/Makefile