back to head
[platform/upstream/gstreamer.git] / configure.ac
index 58ad196..6f0d4bf 100644 (file)
@@ -1,9 +1,9 @@
 AC_INIT
-AC_CANONICAL_TARGET([])
+AC_CANONICAL_TARGET
 
 dnl when going to/from release please set the nano (fourth number) right !
 dnl releases only do Wall, cvs and prerelease does Werror too
-AS_VERSION(gstreamer, GST_VERSION, 0, 8, 0, 1, GST_CVS="no", GST_CVS="yes")
+AS_VERSION(gstreamer, GST_VERSION, 0, 8, 8, 1, GST_CVS="no", GST_CVS="yes")
 
 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
 AM_MAINTAINER_MODE
@@ -24,14 +24,14 @@ dnl - library source changed -> increment REVISION
 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
 dnl - interfaces added -> increment AGE
 dnl - interfaces removed -> AGE = 0
-AS_LIBTOOL(GST, 1, 0, 0)
+AS_LIBTOOL(GST, 5, 0, 4)
 AM_PROG_LIBTOOL
 
 AC_CONFIG_SRCDIR([gst/gst.c])
 AM_CONFIG_HEADER(config.h)
 
 dnl Add parameters for aclocal
-AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4")
+AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4 -I .")
 
 AM_PROG_CC_STDC
 AM_PROG_AS
@@ -51,12 +51,20 @@ AS_AC_EXPAND(LOCALEDIR, $datadir/locale)
 AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR",
                    [gettext locale dir])
 
+dnl define LIBDIR so we can inform people where we live
+AS_AC_EXPAND(LIBDIR, $libdir)
+AC_DEFINE_UNQUOTED([LIBDIR], "$LIBDIR",
+                   [library dir])
 
 dnl decide on error flags
-AS_COMPILER_FLAG(-Wall,GST_ERROR="$GST_ERROR -Wall",GST_ERROR="$GST_ERROR")
-if test "x$GST_CVS" = "xyes"; then
-  AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
-  GST_ERROR="$GST_ERROR"
+dnl if we support -Wall, set it unconditionally
+AS_COMPILER_FLAG(-Wall,
+                 GST_ERROR_CFLAGS="-Wall",
+                 GST_ERROR_CFLAGS="")
+dnl if we're in nano >= 1, add -Werror if supported
+if test "x$GST_CVS" = "xyes"
+then
+  AS_COMPILER_FLAG(-Werror, GST_ERROR_CFLAGS="$GST_ERROR_CFLAGS -Werror")
 fi
 
 dnl We disable static building for development, for time savings
@@ -155,16 +163,6 @@ dnl code be compiled with the same sizeof(off_t), so we use
 dnl the following crude hack.
 dnl
 
-dnl
-dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
-dnl same for libs
-dnl this is so we can make GST_CFLAGS for external modules available
-dnl without mixing in internal (uninstalled) CFLAGS
-dnl
-
-dnl disable deprecated functions internally
-GST_INT_CFLAGS="-DGST_DISABLE_DEPRECATED"
-
 AC_MSG_CHECKING(for large file support)
 AC_TRY_RUN([
 #define _LARGEFILE_SOURCE
@@ -173,16 +171,26 @@ AC_TRY_RUN([
 int main () { return !(sizeof(off_t) == 8); }
 ],
 [
-AC_MSG_RESULT(yes)
-GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+  AC_MSG_RESULT(yes)
+  GST_PKG_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
 ],
 [
-AC_MSG_RESULT(no)
+  AC_MSG_RESULT(no)
 ],
 [
-AC_MSG_RESULT(no)
+  AC_MSG_RESULT(no)
 ])
 
+dnl check for mmap
+AC_FUNC_MMAP()
+if test "$ac_cv_func_mmap_fixed_mapped" = "yes" ; then
+  GST_DISABLE_OMEGA_COTHREADS=no
+else
+  GST_DISABLE_OMEGA_COTHREADS=yes
+fi
+dnl for future --disabling, maybe.  Right now, it depends on HAVE_MMAP
+AM_CONDITIONAL(GST_DISABLE_OMEGA_COTHREADS, test "x$GST_DISABLE_OMEGA_COTHREADS" = "xyes")
+
 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
 AC_CHECK_MCSC()
 if test "$ac_cv_check_mcsc" = "yes"; then
@@ -217,6 +225,27 @@ if test x$enable_gcov = xyes ; then
 fi
 AM_CONDITIONAL(GST_GCOV_ENABLED, test x$enable_gcov = xyes)
 
+dnl Check for some compiler flags that optimize our code.
+if test "x$GCC" = xyes; then
+  AS_COMPILER_FLAG(-fno-common,GST_INT_CFLAGS="$GST_INT_CFLAGS -fno-common",)
+fi
+
+dnl HAVE_WIN32 currently means "disable POSIXisms".
+case "$host" in
+  *-*-mingw*)
+    AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
+    ;;
+  *)
+    ;;
+esac
+
+GST_UNALIGNED_ACCESS()
+if test x${as_cv_unaligned_access} = xyes ; then
+  GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 1"
+else
+  GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 0"
+fi
+AC_SUBST(GST_HAVE_UNALIGNED_ACCESS_DEFINE)
 
 dnl Check for essential libraries first:
 dnl ====================================
@@ -229,6 +258,8 @@ AC_SUBST(GLIB2_REQ)
 
 dnl Check for glib2 with sugar on top
 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,HAVE_GLIB2=yes,HAVE_GLIB2=no)
+dnl for the poor souls who for example have glib in /usr/local
+AS_SCRUB_INCLUDE(GLIB2_CFLAGS)
 GLIB_LIBS=$GLIB2_LIBS
 GLIB_CFLAGS=$GLIB2_CFLAGS
 AC_SUBST(GLIB_LIBS)
@@ -238,9 +269,6 @@ if test "x$HAVE_GLIB2" = "xno"; then
   AC_MSG_ERROR([GStreamer requires GLib $GLIB2_REQ to compile.])
 fi
 
-GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
-AC_SUBST(GST_PKG_DEPS)
-
 dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
 PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB2_REQ)
 AC_SUBST(GLIB_ONLY_CFLAGS)
@@ -291,15 +319,6 @@ dnl ######################################################################
 
 dnl FIXME: simplify all this down using a few m4 macros
 
-AC_ARG_ENABLE(libmmx,
-AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
-[case "${enableval}" in
-  yes) USE_LIBMMX=$HAVE_LIBMMX ;;
-  no)  USE_LIBMMX=no ;;
-  *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
-esac], 
-[USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
-
 AC_ARG_ENABLE(fast-stack-trash,
 AC_HELP_STRING([--enable-fast-stack-trash],[use fast memory allocator (i586 or above)]),
 [case "${enableval}" in
@@ -323,7 +342,7 @@ AC_ARG_ENABLE(profiling,
 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
 [case "${enableval}" in
   yes) USE_PROFILING=yes ;;
-  no)  UES_PROFILING=no ;;
+  no)  USE_PROFILING=no ;;
   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
 esac], 
 [USE_PROFILING=no]) dnl Default value
@@ -411,15 +430,17 @@ esac],
 
 dnl valgrind inclusion
 USE_VALGRIND="$USE_DEBUG"
+VALGRIND_REQ="2.1"
 if test "x$USE_VALGRIND" = xyes; then
-  PKG_CHECK_MODULES(VALGRIND, valgrind, USE_VALGRIND="yes", USE_VALGRIND="no")
+
+  PKG_CHECK_MODULES(VALGRIND, valgrind > $VALGRIND_REQ, USE_VALGRIND="yes", USE_VALGRIND="no")
 fi
 if test "x$USE_VALGRIND" = xyes; then
   AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used])
   AC_MSG_NOTICE(Using extra code paths for valgrind)
 fi
-AC_SUBST (VALGRIND_CFLAGS)
-AC_SUBST (VALGRIND_LIBS)
+AC_SUBST(VALGRIND_CFLAGS)
+AC_SUBST(VALGRIND_LIBS)
 
 dnl ################################################
 dnl # Set defines according to variables set above #
@@ -428,10 +449,6 @@ 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
-if test "x$USE_LIBMMX" = xyes; then
-  AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
-fi
-
 if test "x$USE_FAST_STACK_TRASH" = xyes; then
   AC_DEFINE(USE_FAST_STACK_TRASH, 1, [Define if we should use i586 optimized stack functions])
 fi
@@ -489,6 +506,7 @@ dnl ############################
 
 dnl set license and copyright notice
 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
+
 dnl package name in plugins
 AC_ARG_WITH(package-name,
 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
@@ -497,9 +515,20 @@ AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
   *) GST_PACKAGE="${withval}" ;;
 esac], 
-[GST_PACKAGE="GStreamer"]) dnl Default value
+[
+dnl default value
+if test "x$GST_CVS" = "xyes"
+then
+  dnl nano >= 1
+  GST_PACKAGE="GStreamer CVS/prerelease"
+else
+  GST_PACKAGE="GStreamer source release"
+fi
+]
+)
 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
+
 dnl package origin URL
 AC_ARG_WITH(package-origin,
 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
@@ -508,7 +537,7 @@ AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plu
   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
   *) GST_ORIGIN="${withval}" ;;
 esac], 
-[GST_ORIGIN="http://gstreamer.net/"]) dnl Default value
+[GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
 
@@ -523,36 +552,54 @@ PLUGINS_BUILDDIR=`pwd`
 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
 AC_SUBST(PLUGINS_BUILDDIR)
 
+dnl LDFLAGS modifier defining exported symbols from built objects
+EXPORT_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
+
+dnl GST_PKG_*:    the flags we use that are also used
+dnl               for external applications/.pc file
+dnl GST_LIB_*:    used for the main library
+dnl GST_OBJ_*:    the flags we use for all the objects internal to the core
+dnl GST_PLUGIN_*: additional flags we use for all plugins
+
+dnl finalize _CFLAGS and _LIBS
+dnl flags exported for external applications and use in our pkg-config .pc files
 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
-GST_PKG_LIBS=$GST_EXT_LIBS
+GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
 AC_SUBST(GST_PKG_CFLAGS)
 AC_SUBST(GST_PKG_LIBS)
+AC_SUBST(GST_PKG_DEPS)
 
-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 flags shared for all internal objects (core libs, elements, applications)
+dnl we disable deprecated internally
+dnl XML, GLib, popt, GST_INT, VALGRIND, and the right include for CFLAGS
+dnl no need to add XML, GLib, popt explicitly since libgstreamer pulls them in
+GST_INT_CFLAGS="$GLIB_CFLAGS $XML_CFLAGS $GST_PKG_CFLAGS \
+ $GST_INT_CFLAGS $GST_ERROR_CFLAGS -DGST_DISABLE_DEPRECATED"
 
 dnl Private vars for libgst only
-LIBGST_LIBS="$GST_LIBS"
-LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
-AC_SUBST(LIBGST_LIBS)
-AC_SUBST(LIBGST_CFLAGS)
-
-dnl Vars for everyone else
-GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
-GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
-
-AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
-AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
-
-GST_PLUGIN_LDFLAGS="-module -avoid-version"
+GST_LIB_CFLAGS="$GST_PKG_CFLAGS $GST_INT_CFLAGS \
+  $VALGRIND_CFLAGS -I\$(top_srcdir)"
+GST_LIB_LIBS="$XML_LIBS $GLIB_LIBS -lpopt $GST_PKG_LIBS $LTLIBINTL $VALGRIND_LIBS"
+GST_LIB_LDFLAGS="$GST_LT_LDFLAGS -version-info $GST_LIBVERSION $EXPORT_LDFLAGS"
+AC_SUBST(GST_LIB_CFLAGS)
+AC_SUBST(GST_LIB_LIBS)
+AC_SUBST(GST_LIB_LDFLAGS)
+
+dnl Vars for all internal objects built on libgstreamer
+GST_OBJ_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)"
+GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
+
+AC_SUBST(GST_OBJ_CFLAGS, "$GST_OBJ_CFLAGS")
+AC_SUBST(GST_OBJ_LIBS, "$GST_OBJ_LIBS")
+
+dnl specific additional LDFLAGS for plugins
+GST_PLUGIN_LDFLAGS="-module -avoid-version $EXPORT_LDFLAGS"
 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
 
+plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
+AC_SUBST(plugindir)
 
 dnl ##################################################
 dnl # deps for examples from manual                  #
@@ -606,6 +653,7 @@ libs/Makefile
 libs/gst/Makefile
 libs/gst/bytestream/Makefile
 libs/gst/control/Makefile
+libs/gst/dataprotocol/Makefile
 libs/gst/getbits/Makefile
 po/Makefile.in
 tests/Makefile
@@ -623,13 +671,17 @@ testsuite/caps/Makefile
 testsuite/cleanup/Makefile
 testsuite/clock/Makefile
 testsuite/debug/Makefile
+testsuite/dlopen/Makefile
 testsuite/dynparams/Makefile
 testsuite/elements/Makefile
 testsuite/ghostpads/Makefile
 testsuite/indexers/Makefile
+testsuite/negotiation/Makefile
 testsuite/parse/Makefile
 testsuite/plugin/Makefile
 testsuite/refcounting/Makefile
+testsuite/schedulers/Makefile
+testsuite/states/Makefile
 testsuite/tags/Makefile
 testsuite/threads/Makefile
 examples/Makefile
@@ -670,4 +722,3 @@ pkgconfig/gstreamer-control-uninstalled.pc
 gstreamer.spec,
 echo "$infomessages", infomessages="$infomessages"
 )
-