📄 configure.ac
字号:
AC_PREREQ([2.58])AC_INIT(swfdec,0.5.2)[nano=$(echo $PACKAGE_VERSION | sed 's/[0-9]\.[0-9]\.[0-9][0-9]*\.*//')]if test x"$nano" = x1 ; then SWFDEC_CVS="yes"else SWFDEC_CVS="no"fiAM_INIT_AUTOMAKE(1.6)dnl AC_CANONICAL_TARGET([])AM_MAINTAINER_MODESWFDEC_MAJORMINOR=0.5AC_SUBST(SWFDEC_MAJORMINOR)AM_CONFIG_HEADER(config.h)AC_SUBST(ACLOCAL_AMFLAGS, "-I m4")dnl decide on error flagsdnl if we support them, we set them unconditionallyAS_COMPILER_FLAG(-Wall, GLOBAL_CFLAGS="-Wall", GLOBAL_CFLAGS="")dnl I want this but stupid headers don't let mednl AS_COMPILER_FLAG(-Wshadow, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wshadow")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")dnl if we're in nano >= 1, add -Werror if supportedif test x$SWFDEC_CVS = xyes ; then AS_COMPILER_FLAG(-Werror, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Werror") DEFAULT_DEBUG_LEVEL="SWFDEC_LEVEL_WARNING"else DEFAULT_DEBUG_LEVEL="SWFDEC_LEVEL_ERROR"fiAC_DEFINE_UNQUOTED(SWFDEC_LEVEL_DEFAULT, $DEFAULT_DEBUG_LEVEL, [Default debug level used])SWFDEC_LIBVERSION="2:0:0"AC_SUBST(SWFDEC_LIBVERSION)AM_PROG_LIBTOOLdnl C99 is only required to get definitions for NAN and INFINITY.AS_COMPILER_FLAG(-std=gnu99, GLOBAL_CFLAGS="$GLOBAL_CFLAGS -std=gnu99")dnl ensures the library is linked against the internal Mozilladnl if this doesn't work on your platform, I'll take patches :)SYMBOLIC_LDFLAGS="-Wl,-Bsymbolic"AC_SUBST(SYMBOLIC_LDFLAGS)dnl Add parameters for aclocaldnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)#ACLOCAL_AMFLAGS="-I m4 $ACLOCAL_AMFLAGS"AC_PROG_CCAM_PROG_CC_STDCAM_PROG_CC_C_OAM_PROG_ASAC_HEADER_STDC([])dnl ##############################dnl # Do automated configuration #dnl ##############################dnl Check for tools:dnl ================dnl modify pkg-config pathAC_ARG_WITH(pkg-config-path, AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]), [export PKG_CONFIG_PATH=${withval}])dnl Check for essential libraries first:dnl ====================================GLIB_VER=2.4PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_VER gobject-2.0 >= $GLIB_VER, HAVE_GLIB=yes, HAVE_GLIB=no)if test "$HAVE_GLIB" = "no"; then AC_MSG_ERROR([glib-2.0 >= $GLIB_VER and gobject-2.0 >= $GLIB_VER are required to build swfdec])fiAC_SUBST(GLIB_LIBS)AC_SUBST(GLIB_CFLAGS)AC_SUBST(GLIB_VER)dnl we detect gthread seperately for now, since we don't want to link libswfdec to it (yet)PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= $GLIB_VER, HAVE_GLIB=yes, HAVE_GLIB=no)if test "$HAVE_GTHREAD" = "no"; then AC_MSG_ERROR([gthread-2.0 >= $GLIB_VER is required to build swfdec])fidnl FIXME: detect these executables correctlyGLIB_GENMARSHAL=glib-genmarshalAC_SUBST(GLIB_GENMARSHAL)GLIB_MKENUMS=glib-mkenumsAC_SUBST(GLIB_MKENUMS)PKG_CHECK_MODULES(PANGO, pangocairo, HAVE_PANGO=yes, HAVE_PANGO=no)if test "$HAVE_PANGO" = "no"; then AC_MSG_ERROR([pangocairo is required to build swfdec])fiAC_SUBST(PANGO_LIBS)AC_SUBST(PANGO_CFLAGS)AC_ARG_ENABLE(gtk, AS_HELP_STRING([--enable-gtk], [enable Gtk integration (default=yes)])], enable_gtk=$enableval, enable_gtk="yes")dnl dnl GTK: We want this for swfdec-gtkdnlGTK_VER=2.8.0AC_SUBST(GTK_VER)if test "$enable_gtk" = "yes"; then PKG_CHECK_MODULES(GTK, gtk+-2.0 >= $GTK_VER, HAVE_GTK=yes, HAVE_GTK=no) if test "x$HAVE_GTK" = xyes; then AC_DEFINE(HAVE_GTK, 1, [Define if Gtk is enabled]) else AC_MSG_ERROR([Couldn't find a suitable Gtk version. You need at least version $GTK_VER]) fielse AC_MSG_WARN([*** Gtk support was not enabled. ***])fiAM_CONDITIONAL(WITH_GTK, [test "x$HAVE_GTK" = xyes])dnldnl audio backenddnlAC_ARG_WITH(audio, [AC_HELP_STRING([--with-audio=@<:@auto/alsa/oss/none@:>@], [audio backend to use])],, [with_audio=auto])AUDIO_TYPE=if test "$with_audio" = "auto" -o "$with_audio" = "alsa"; then PKG_CHECK_MODULES(ALSA, alsa >= 1.0, AUDIO_TYPE=alsa) if test "$AUDIO_TYPE" = "alsa"; then with_audio=alsa AUDIO_CFLAGS=$ALSA_CFLAGS AUDIO_LIBS=$ALSA_LIBS else if test "$with_audio" = "alsa"; then AC_MSG_ERROR([no alsa audio support]) else AC_MSG_WARN([no alsa audio support]) fi fifidnl Assume OSS is available if ALSA wasn't found and we're "auto".if test "$with_audio" = "auto" -o "$with_audio" = "oss"; then with_audio="oss" AUDIO_CFLAGS= AUDIO_LIBS= AUDIO_TYPE=ossfiif test "$with_audio" = "auto" -o "$with_audio" = "none"; then AUDIO_CFLAGS= AUDIO_LIBS= AUDIO_TYPE=nonefiif test "x$AUDIO_TYPE" = "x"; then AC_MSG_ERROR([desired audio support could not be used])else AC_MSG_NOTICE([audio backend: $AUDIO_TYPE])fiAC_SUBST(AUDIO_LIBS)AC_SUBST(AUDIO_CFLAGS)AC_SUBST(AUDIO_TYPE)LIBOIL_VER=0.3.1PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= $LIBOIL_VER, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)AC_SUBST(LIBOIL_LIBS)AC_SUBST(LIBOIL_CFLAGS)if test "$HAVE_LIBOIL" = "no"; then AC_MSG_ERROR([liboil-0.3 >= $LIBOIL_VER is required to build swfdec])fiCAIRO_VER=1.2.0PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VER, HAVE_CAIRO=yes, HAVE_CAIRO=no)AC_SUBST(CAIRO_LIBS)AC_SUBST(CAIRO_CFLAGS)if test "$HAVE_CAIRO" = "no"; then AC_MSG_ERROR([cairo >= $CAIRO_VER is required to build swfdec])fiAC_ARG_ENABLE(mad, AS_HELP_STRING([--enable-mad], [enable mad audio (default=yes)])], enable_mad=$enableval, enable_mad="yes")if test "$enable_mad" = "yes"; then AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad", HAVE_MAD="no") AC_SUBST(MAD_LIBS) if test "x$HAVE_MAD" = xyes; then AC_DEFINE(HAVE_MAD, 1, [Define if mad is enabled]) else AC_MSG_ERROR([Couldn't find mad. You might need to install the libmad0-dev package.]) fielse AC_MSG_WARN([*** mad audio support was not enabled. ***])fiAM_CONDITIONAL(HAVE_MAD, [test "x$HAVE_MAD" = xyes])dnl I'd put a required version in here if distros can agree on a waydnl to detect ffmpeg. But as it stands even pkg-config versions are weird.dnl So you'll have to update your ffmpeg checkout if compilation fails.dnl Or you submit a patch that detects ffmpeg reliably on the distros.AC_ARG_ENABLE(ffmpeg, AS_HELP_STRING([--enable-ffmpeg], [enable ffmpeg support (default=yes)])], enable_ffmpeg=$enableval, enable_ffmpeg="yes")if test "$enable_ffmpeg" = "yes"; then PKG_CHECK_MODULES(FFMPEG, libavcodec libswscale, HAVE_FFMPEG=yes, HAVE_FFMPEG=no) AC_SUBST(FFMPEG_CFLAGS) AC_SUBST(FFMPEG_LIBS) if test "x$HAVE_FFMPEG" = xyes; then AC_DEFINE(HAVE_FFMPEG, 1, [Define if ffmpeg is enabled]) else AC_MSG_ERROR([Couldn't find ffmpeg. You might need to install the libavcodec-dev and libswscale-dev packages.]) fielse AC_MSG_WARN([*** ffmpeg support was not enabled. ***])fiAM_CONDITIONAL(HAVE_FFMPEG, [test "x$HAVE_FFMPEG" = xyes])AC_ARG_ENABLE(gstreamer, AS_HELP_STRING([--enable-gstreamer], [enable GStreamer support (default=yes)])], enable_gstreamer=$enableval, enable_gstreamer="yes")if test "$enable_gstreamer" = "yes"; then GST_REQUIRED=0.10.11 PKG_CHECK_MODULES(GST, gstreamer-0.10 >= $GST_REQUIRED, HAVE_GST=yes, HAVE_GST=no) if test "x$HAVE_GST" = xyes; then AC_DEFINE(HAVE_GST, 1, [Define if GStreamer is enabled]) else AC_MSG_ERROR([Couldn't find GStreamer $GST_REQUIRED.]) fielse AC_MSG_WARN([*** GStreamer support was not enabled. ***])fiAM_CONDITIONAL(HAVE_GST, [test "x$HAVE_GST" = xyes])AC_ARG_ENABLE(soup, AS_HELP_STRING([--enable-soup], [enable libaoup HTTP support for swfdec-gtk (default=yes)])], enable_libsoup=$enableval, enable_libsoup="yes")if test "$enable_libsoup" = "yes"; then PKG_CHECK_MODULES(HTTP, libsoup-2.2 >= 2.2.0, HAVE_HTTP=yes, HAVE_HTTP=no) if test "x$HAVE_HTTP" = xyes; then AC_DEFINE(HAVE_HTTP, 1, [Define if libsoup is enabled]) else AC_MSG_ERROR([Couldn't find libsoup-2.2.]) fielse AC_MSG_WARN([*** libsoup HTTP support was not enabled. ***])fiAM_CONDITIONAL(HAVE_HTTP, [test "x$HAVE_HTTP" = xyes])AC_ARG_ENABLE(vivified, AS_HELP_STRING([--enable-vivified], [enable Vivified Flash debugger (default=no)])], enable_vivi=$enableval, enable_vivi="no")if test "$enable_vivi" = "yes"; then MING_REQUIRED=0.4.0.beta5 VIVI_GTK_REQUIRED=2.11.6 PKG_CHECK_MODULES(VIVI, libming >= $MING_REQUIRED gmodule-export-2.0 gtk+-2.0 >= $VIVI_GTK_REQUIRED, HAVE_VIVI=yes, HAVE_VIVI=no) if test "x$HAVE_VIVI" = xyes; then AC_DEFINE(HAVE_VIVI, 1, [Define if Vivified is enabled]) else AC_MSG_ERROR([Vivified requirements not met. You need libming >= $MING_REQUIRED and Gtk+ >= $VIVI_GTK_REQUIRED.]) fielse AC_MSG_WARN([*** Vivified was not enabled. ***])fiAM_CONDITIONAL(HAVE_VIVI, [test "x$HAVE_VIVI" = xyes])AC_SUBST(GLOBAL_CFLAGS)AC_SUBST(GLOBAL_CFLAGS)SWFDEC_CFLAGS="-I\$(top_srcdir) $GLIB_CFLAGS $CAIRO_CFLAGS"SWFDEC_LIBS="\$(top_builddir)/libswfdec/libswfdec-$SWFDEC_MAJORMINOR.la $GLIB_LIBS $CAIRO_LIBS -lz"AC_SUBST(SWFDEC_LIBS)AC_SUBST(SWFDEC_CFLAGS)SWFDEC_GTK_CFLAGS="$SWFDEC_CFLAGS $GTK_CFLAGS"SWFDEC_GTK_LIBS="\$(top_builddir)/libswfdec-gtk/libswfdec-gtk-$SWFDEC_MAJORMINOR.la $SWFDEC_LIBS $GTK_LIBS"AC_SUBST(SWFDEC_GTK_LIBS)AC_SUBST(SWFDEC_GTK_CFLAGS)GTK_DOC_CHECK([1.6])if test "x${prefix}" = "xNONE"; then PACKAGE_PREFIX=${ac_default_prefix}else PACKAGE_PREFIX=${prefix}fiAC_DEFINE_UNQUOTED(PACKAGE_PREFIX, "$PACKAGE_PREFIX", [Define the package prefix])AC_SUBST(PACKAGE_PREFIX)dnl #########################dnl # Make the output files #dnl #########################dnl testsuite/autoplug/Makefilednl testsuite/MakefileAC_CONFIG_FILES(Makefiledoc/Makefilelibswfdec/Makefilelibswfdec/jpeg/Makefilelibswfdec-gtk/Makefileplayer/Makefiletest/Makefiletest/image/Makefiletest/sound/Makefiletest/trace/Makefiletest/various/Makefilevivified/Makefilevivified/core/Makefilevivified/dock/Makefilevivified/ui/Makefileswfdec.pcswfdec-gtk.pcswfdec.spec)AC_OUTPUT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -