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, 7, 6, 0, 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
dnl our libraries and install dirs use major.minor as a version
GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
-dnl we override it for the release candidate
-GST_MAJORMINOR=0.8
+dnl we override it here for release candidates
+#GST_MAJORMINOR=0.8
AC_SUBST(GST_MAJORMINOR)
AC_PROG_CC
dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
dnl - interfaces added -> increment AGE
dnl - interfaces removed -> AGE = 0
-AS_LIBTOOL(GST, 0, 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
AM_GNU_GETTEXT_VERSION(0.11.5)
AM_GNU_GETTEXT([external])
-GETTEXT_PACKAGE=gstreamer-$GST_VERSION_MAJOR.$GST_VERSION_MINOR
+GETTEXT_PACKAGE=gstreamer-$GST_MAJORMINOR
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE",
[gettext package name])
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
AC_MSG_ERROR(Could not find perl)
fi
+AC_PROG_AWK
+
dnl we require bison for building the parser
dnl FIXME: check if AC_PROG_YACC is suitable here
AC_PATH_PROG(BISON_PATH, bison, no)
AC_MSG_ERROR(Could not find bison)
fi
+dnl check bison version
+AC_MSG_CHECKING([bison version])
+
+if $BISON_PATH --version | head -n 1 | $AWK '{ if ($4 < 1.35) exit 1; else exit 0;}';
+then
+ AC_MSG_RESULT([ok])
+else
+ AC_MSG_RESULT([too old.])
+ AC_MSG_ERROR([Your bison version is too old, v1.35 or later is required.])
+fi
+
dnl we require flex for building the parser
dnl FIXME: check if AC_PROG_LEX is suitable here
AC_PATH_PROG(FLEX_PATH, flex, no)
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
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
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 ====================================
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)
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)
])
AC_SUBST(POPT_LIBS)
-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)
-AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
-dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
-if test x$HAVE_ATOMIC_H = xyes; then
- AC_LINK_IFELSE([
-#include "asm/atomic.h"
-main() {atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
- ],, [
- # Not successful
- if test x$HAVE_ATOMIC_H = xyes; then
- AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
- fi
- HAVE_ATOMIC_H=no
- ])
-fi
-
dnl Check for ucontext.h
AC_CHECK_HEADER(ucontext.h, AC_DEFINE(HAVE_UCONTEXT_H, 1, [defined if we have ucontext.h]))
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(atomic,
-AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
-[case "${enableval}" in
- yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
- noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
- no) USE_ATOMIC_H=no;;
- *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
-esac],
-[USE_ATOMIC_H=$HAVE_ATOMIC_H]) 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
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
esac],
[USE_DEBUG=yes]) dnl Default value
+dnl valgrind inclusion
+USE_VALGRIND="$USE_DEBUG"
+VALGRIND_REQ="2.1"
+if test "x$USE_VALGRIND" = xyes; then
+
+ 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)
+
dnl ################################################
dnl # Set defines according to variables set above #
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_ATOMIC_H" = xyes; then
- AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file 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
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_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
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]),
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]),
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])
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 #
libs/gst/Makefile
libs/gst/bytestream/Makefile
libs/gst/control/Makefile
+libs/gst/dataprotocol/Makefile
libs/gst/getbits/Makefile
po/Makefile.in
tests/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
examples/typefind/Makefile
examples/xml/Makefile
tools/Makefile
+common/Makefile
+common/m4/Makefile
docs/Makefile
docs/faq/Makefile
docs/gst/Makefile
gstreamer.spec,
echo "$infomessages", infomessages="$infomessages"
)
-