no good reason to require glib 1.3.15 so back to 1.3.12 put version checking for...
[platform/upstream/gstreamer.git] / configure.ac
index 3b3c1a9..3e3a3a0 100644 (file)
@@ -1,9 +1,9 @@
-dnl Note: this file is now the main autoconf file
 AC_INIT
 AC_CANONICAL_TARGET([])
 
 dnl when going to/from release please set the nano (fourth number) right !
 AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2, 1)
+AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
 AS_LIBTOOL(GST, 0, 0, 0, yes)
 
 AC_CONFIG_SRCDIR([gst/gst.c])
@@ -11,7 +11,7 @@ AM_CONFIG_HEADER(config.h)
 
 dnl Add parameters for aclocal
 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
-ACLOCAL="cat m4/*.m4 >acinclude.m4;$ACLOCAL $ACLOCAL_FLAGS"
+ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
 
 AM_MAINTAINER_MODE
 
@@ -52,112 +52,8 @@ else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is availabl
   HAVE_NASM="yes"
 fi
 
-dnl check for gtk-doc
-AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]))
-
-if test "x$with_html_dir" = "x" ; then
-  HTML_DIR='${datadir}/gst/html'
-else
-  HTML_DIR=$with_html_dir
-fi
-
-AC_SUBST(HTML_DIR)
-
-AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scangobj, true, false)
-gtk_doc_min_version=0.6
-if $HAVE_GTK_DOC ; then 
-    gtk_doc_version=`gtkdoc-mkdb --version`
-    AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
-    if perl <<EOF ; then
-      exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
-            ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
-EOF
-      AC_MSG_RESULT(yes)
-   else
-      AC_MSG_RESULT(no)
-      HAVE_GTK_DOC=false
-   fi
-fi
-# don't you love undocumented command line options?
-GTK_DOC_SCANOBJ="gtkdoc-scangobj --nogtkinit"
-AC_SUBST(HAVE_GTK_DOC)
-AC_SUBST(GTK_DOC_SCANOBJ)
-
-dnl check for docbook tools
-AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, true, false)
-AC_CHECK_PROG(HAVE_PDFTOPS, pdftops, true, false)
-dnl this does not yet work properly, at least on debian -- wingo
-HAVE_PDFXMLTEX=false
-
-dnl check for image conversion tool
-AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
-
-dnl The following is a hack: if fig2dev doesn't display an error message
-dnl for the desired type, we assume it supports it.
-HAVE_FIG2DEV_PNG=false
-if test "x$HAVE_FIG2DEV" = "xtrue" ; then
-  fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
-  if test "x$fig2dev_quiet" = "x" ; then
-    HAVE_FIG2DEV_PNG=true
-  fi
-fi
-HAVE_FIG2DEV_PDF=false
-if test "x$HAVE_FIG2DEV" = "xtrue" ; then
-  fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
-  if test "x$fig2dev_quiet" = "x" ; then
-    HAVE_FIG2DEV_PDF=true
-  fi
-fi
-
-
-dnl Set up conditionals for (target) architecture:
-dnl ==============================================
-
-dnl Determine CPU
-case "x${target_cpu}" in
-  xi?86 | k?) HAVE_CPU_I386=yes
-              AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
-              dnl FIXME could use some better detection
-              dnl       (ie CPUID)
-              case "x${target_cpu}" in
-                xi386 | xi486) ;;
-                *)             AC_DEFINE(HAVE_RDTSC) ;;
-              esac ;;
-  xpowerpc)   HAVE_CPU_PPC=yes
-              AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
-  xalpha)     HAVE_CPU_ALPHA=yes
-              AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
-  xarm*)      HAVE_CPU_ARM=yes
-              AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
-  xsparc*)    HAVE_CPU_SPARC=yes
-              AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
-  xmips*)     HAVE_CPU_MIPS=yes
-              AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;;
-  xhppa*)     HAVE_CPU_HPPA=yes
-              AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;;
-esac
-
-dnl Determine endianness
-AC_C_BIGENDIAN
-
-dnl Check for MMX-capable compiler
-AC_MSG_CHECKING(for MMX-capable compiler)
-AC_TRY_RUN([
-#include "include/mmx.h"
-
-main()
-{ movq_r2r(mm0, mm1); return 0; }
-],
-[
-HAVE_LIBMMX="yes"
-AC_MSG_RESULT(yes)
-],
-HAVE_LIBMMX="no"
-AC_MSG_RESULT(no)
-,
-HAVE_LIBMMX="no"
-AC_MSG_RESULT(no)
-)
+GST_DOC()
+GST_ARCH()
 
 dnl
 dnl We should really use AC_SYS_LARGEFILE, but the problem is
@@ -195,8 +91,13 @@ AC_MSG_RESULT(no)
 dnl Check for essential libraries first:
 dnl ====================================
 
+dnl === GLib 2 ===
+dnl Minimum required version of GLib2
+GLIB2_REQ="1.3.12"
+AC_SUBST(GLIB2_REQ)
+
 dnl Check for glib2
-PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
+PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
   HAVE_GLIB2=yes,HAVE_GLIB2=no)
 GLIB_LIBS=$GLIB2_LIBS
 GLIB_CFLAGS=$GLIB2_CFLAGS
@@ -210,17 +111,27 @@ fi
 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
 AC_SUBST(GST_PKG_DEPS)
   
+dnl === libxml 2 ===
+dnl Minimum required version of libxml2
+LIBXML2_REQ="2.4.0"
+AC_SUBST(LIBXML2_REQ)
+
+dnl check for libxml2
 LIBXML_PKG=', libxml-2.0'
-PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
+PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
 if test "x$HAVE_LIBXML2" = "xyes"; then
   AC_DEFINE(HAVE_LIBXML2)
 else
-  AC_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
+  AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
 fi
 AC_SUBST(LIBXML_PKG)
 AC_SUBST(XML_LIBS)
 AC_SUBST(XML_CFLAGS)
 
+GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
+  AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
+download the latest version from ftp://people.redhat.com/sopwith/popt/]))
+
 dnl Check for atomic.h
 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
@@ -283,50 +194,7 @@ AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed
 esac], 
 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
 
-AC_ARG_ENABLE(debug,
-AC_HELP_STRING([--disable-debug][disable addition of -g debugging info]),
-[case "${enableval}" in
-  yes) USE_DEBUG=yes ;;
-  no)  USE_DEBUG=no ;;
-  *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
-esac], 
-[USE_DEBUG=yes]) dnl Default value
-
-AC_ARG_ENABLE(DEBUG,
-AC_HELP_STRING([--disable-DEBUG][disables compilation of debugging messages]),
-[case "${enableval}" in
-  yes) ENABLE_DEBUG=yes ;;
-  no)  ENABLE_DEBUG=no ;;
-  *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
-esac], 
-[ENABLE_DEBUG=yes]) dnl Default value
-if test x$ENABLE_DEBUG = xyes; then
-  AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
-fi
-
-AC_ARG_ENABLE(INFO,
-AC_HELP_STRING([--disable-INFO][disables compilation of informational messages]),
-[case "${enableval}" in
-  yes) ENABLE_INFO=yes ;;
-  no)  ENABLE_INFO=no ;;
-  *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
-esac], 
-[ENABLE_INFO=yes]) dnl Default value
-if test x$ENABLE_INFO = xyes; then
-  AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
-fi
-
-AC_ARG_ENABLE(debug-color,
-AC_HELP_STRING([--disable-debug-color][disables color output of DEBUG and INFO output]),
-[case "${enableval}" in
-  yes) ENABLE_DEBUG_COLOR=yes ;;
-  no)  ENABLE_DEBUG_COLOR=no ;;
-  *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
-esac], 
-[ENABLE_DEBUG_COLOR=yes]) dnl Default value
-if test "x$ENABLE_DEBUG_COLOR" = xyes; then
-  AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
-fi
+GST_DEBUGINFO
 
 AC_ARG_ENABLE(profiling,
 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
@@ -352,26 +220,6 @@ AC_HELP_STRING([--with-configdir][specify path to use for plugin and command com
 esac], 
 [:]) dnl Default value
 
-AC_ARG_ENABLE(docs-build,
-AC_HELP_STRING([--enable-docs-build][enable building of documentation]),
-[case "${enableval}" in
-  yes) if $HAVE_GTK_DOC; then BUILD_DOCS=yes; else AC_MSG_ERROR([you don't have gtk-doc, so don't use --docs-build]); fi; ;;
-  no)  BUILD_DOCS=no ;;
-  *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs-build) ;;
-esac], 
-[BUILD_DOCS=no]) dnl Default value
-
-dnl AC_ARG_ENABLE(plugin-docs,
-dnl [  --enable-plugin-docs         enable the building of plugin documentation
-dnl                                (this is currently broken, so off by default)],
-dnl [case "${enableval}" in
-dnl   yes) BUILD_PLUGIN_DOCS=yes ;;
-dnl   no)  BUILD_PLUGIN_DOCS=no ;;
-dnl   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;;
-dnl esac], 
-dnl [BUILD_PLUGIN_DOCS=no]) dnl Default value
-BUILD_PLUGIN_DOCS=no
-
 AC_ARG_ENABLE(tests,
 AC_HELP_STRING([--disable-tests][disable building test apps]),
 [case "${enableval}" in
@@ -448,29 +296,14 @@ dnl #############################
 
 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
 dnl HAVE_ and it is likely to be easier to stick with the old name
-AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
-AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
-AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
-AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
-AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
-AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
-
 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
 
 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
 
 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
-AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
-AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
-AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
-AM_CONDITIONAL(HAVE_PDFXMLTEX,      $HAVE_PDFXMLTEX)
-AM_CONDITIONAL(HAVE_PDFTOPS,        $HAVE_PDFTOPS)
-AM_CONDITIONAL(HAVE_XSLTPROC,       $HAVE_XSLTPROC)
-AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
-AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
 
 
@@ -496,10 +329,8 @@ PLUGINS_BUILDDIR=`pwd`
 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
 AC_SUBST(PLUGINS_BUILDDIR)
 
-dnl finalize _CFLAGS and _LIBS
-dnl add GLIB and XML if necessary to EXT_*
-GST_EXT_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
-GST_EXT_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS"
+dnl since glib and xml are package deps, there's no need to include their cflags
+dnl in the pkg-config file
 
 dnl for pkg-config
 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
@@ -507,20 +338,25 @@ GST_PKG_LIBS=$GST_EXT_LIBS
 AC_SUBST(GST_PKG_CFLAGS)
 AC_SUBST(GST_PKG_LIBS)
 
+dnl finalize _CFLAGS and _LIBS
+dnl add GLIB and XML if necessary to EXT_*
+GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
+GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
+
 dnl Private vars for libgst only
-LIBGST_LIBS="$GST_EXT_LIBS"
-LIBGST_CFLAGS="$GST_EXT_CFLAGS -I\$(top_srcdir)"
+LIBGST_LIBS="$GST_LIBS"
+LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) -Wall"
 AC_SUBST(LIBGST_LIBS)
 AC_SUBST(LIBGST_CFLAGS)
 
 dnl Vars for everyone else
-GST_INT_LIBS="\$(top_builddir)/gst/libgst.la"
-GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include -I\$(top_srcdir) -Wall"
+GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
+GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
 
-AC_SUBST(GST_CFLAGS, "$GST_EXT_CFLAGS $GST_INT_CFLAGS")
-AC_SUBST(GST_LIBS, "$GST_EXT_LIBS $GST_INT_LIBS")
+AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
+AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
 
-dnl AC_CONFIG_SUBDIRS(gst/cothreads)
+AC_CONFIG_SUBDIRS(libs/ext/cothreads)
 
 dnl ##################################################
 dnl # Prepare informative messages to display at end #
@@ -550,7 +386,6 @@ dnl libs/ext/Makefile
 AC_OUTPUT(
 Makefile
 include/Makefile
-m4/Makefile
 gst/Makefile
 gst/gstversion.h
 gst/types/Makefile
@@ -563,6 +398,7 @@ libs/gst/bytestream/Makefile
 libs/gst/getbits/Makefile
 libs/gst/putbits/Makefile
 libs/gst/control/Makefile
+libs/ext/Makefile
 tests/Makefile
 tests/bufspeed/Makefile
 tests/memchunk/Makefile
@@ -574,6 +410,7 @@ testsuite/caps/Makefile
 testsuite/cleanup/Makefile
 testsuite/elements/Makefile
 testsuite/plugin/Makefile
+testsuite/dynparams/Makefile
 examples/Makefile
 examples/autoplug/Makefile
 examples/helloworld/Makefile
@@ -601,6 +438,7 @@ docs/plugins/gstreamer-plugins.types
 docs/manual/Makefile
 docs/fwg/Makefile
 docs/xsl/Makefile
+docs/devhelp/Makefile
 stamp.h
 gstreamer.pc
 gstreamer-uninstalled.pc