2 AC_CANONICAL_TARGET([])
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, cvs and prerelease does Werror too
6 AS_VERSION(gstreamer, GST_VERSION, 0, 4, 0, 1, GST_ERROR="-Wall", GST_ERROR="-Wall -Werror")
7 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
9 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
10 AS_LIBTOOL(GST, 0, 0, 0, yes)
12 AC_CONFIG_SRCDIR([gst/gst.c])
13 AM_CONFIG_HEADER(config.h)
15 dnl Add parameters for aclocal
16 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
17 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
25 dnl We disable static building for development, for time savings
26 dnl *NOTE*: dnl this line before release, so release does static too
32 dnl ##############################
33 dnl # Do automated configuration #
34 dnl ##############################
39 dnl allow for different autotools
40 AS_AUTOTOOLS_ALTERNATE()
42 dnl modify pkg-config path
43 AC_ARG_WITH(pkg-config-path,
44 AC_HELP_STRING([--with-pkg-config-path],
45 [colon-separated list of pkg-config(1) dirs]),
46 [export PKG_CONFIG_PATH=${withval}])
49 AC_PATH_PROG(NASM_PATH, nasm, no)
51 if test x$NASM_PATH = xno; then
52 AC_MSG_WARN(Couldn't find nasm)
54 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
61 dnl we require bison for building of some of the marshal files
62 AC_PATH_PROG(BISON_PATH, bison, no)
63 if test x$BISON_PATH = xno; then
64 AC_MSG_ERROR(Could not find bison)
67 dnl we require flex for building the parser
68 AC_PATH_PROG(FLEX_PATH, flex, no)
69 if test x$FLEX_PATH = xno; then
70 AC_MSG_ERROR(Could not find flex)
74 dnl We should really use AC_SYS_LARGEFILE, but the problem is
75 dnl many of the plugins don't include "config.h". To assure
76 dnl binary compatibility, it is necessary that all gstreamer
77 dnl code be compiled with the same sizeof(off_t), so we use
78 dnl the following crude hack.
82 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
84 dnl this is so we can make GST_CFLAGS for external modules available
85 dnl without mixing in internal (uninstalled) CFLAGS
88 AC_MSG_CHECKING(for large file support)
90 #define _LARGEFILE_SOURCE
91 #define _FILE_OFFSET_BITS 64
92 #include <sys/types.h>
93 int main () { return !(sizeof(off_t) == 8); }
97 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
106 dnl Check for essential libraries first:
107 dnl ====================================
110 dnl Minimum required version of GLib2
111 dnl required for compilation without warnings
116 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
117 HAVE_GLIB2=yes,HAVE_GLIB2=no)
118 GLIB_LIBS=$GLIB2_LIBS
119 GLIB_CFLAGS=$GLIB2_CFLAGS
121 AC_SUBST(GLIB_CFLAGS)
123 if test "x$HAVE_GLIB2" = "xno"; then
124 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
127 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
128 AC_SUBST(GST_PKG_DEPS)
131 dnl Minimum required version of libxml2
133 AC_SUBST(LIBXML2_REQ)
135 dnl check for libxml2
136 LIBXML_PKG=', libxml-2.0'
137 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
138 if test "x$HAVE_LIBXML2" = "xyes"; then
139 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
141 AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
148 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
149 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
150 download the latest version from
151 ftp://people.redhat.com/sopwith/popt/])
153 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
158 #ifndef POPT_TABLEEND
166 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
167 download the latest version from
168 ftp://people.redhat.com/sopwith/popt/])
171 dnl Check for atomic.h
172 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
173 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
174 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
175 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
176 if test x$HAVE_ATOMIC_H = xyes; then
178 #include "asm/atomic.h"
179 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
182 if test x$HAVE_ATOMIC_H = xyes; then
183 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
189 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
193 dnl ######################################################################
194 dnl # Check command line parameters, and set shell variables accordingly #
195 dnl ######################################################################
197 dnl FIXME: simplify all this down using a few m4 macros
199 AC_ARG_ENABLE(libmmx,
200 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
201 [case "${enableval}" in
202 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
204 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
206 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
208 AC_ARG_ENABLE(atomic,
209 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
210 [case "${enableval}" in
211 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
212 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
213 no) USE_ATOMIC_H=no;;
214 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
216 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
218 AC_ARG_ENABLE(plugin-builddir,
219 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
220 [case "${enableval}" in
221 yes) PLUGINS_USE_BUILDDIR=yes ;;
222 no) PLUGINS_USE_BUILDDIR=no ;;
223 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
225 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
229 AC_ARG_ENABLE(profiling,
230 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
231 [case "${enableval}" in
232 yes) USE_PROFILING=yes ;;
233 no) UES_PROFILING=no ;;
234 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
236 [USE_PROFILING=no]) dnl Default value
238 dnl default to building registry in the source tree if we are enabling plugin build dir
239 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
242 GST_CONFIG_DIR=${sysconfdir}/gstreamer
244 AC_ARG_WITH(configdir,
245 AC_HELP_STRING([--with-configdir],[specify path to use for plugin and command completion registries]),
246 [case "${withval}" in
247 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
248 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
249 *) GST_CONFIG_DIR="${withval}" ;;
251 [:]) dnl Default value
253 AS_AC_EXPAND(GST_CONFIG_DIR, $GST_CONFIG_DIR)
254 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
257 dnl building of tests
259 AC_HELP_STRING([--disable-tests],[disable building test apps]),
260 [case "${enableval}" in
261 yes) BUILD_TESTS=yes ;;
262 no) BUILD_TESTS=no ;;
263 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
265 [BUILD_TESTS=yes]) dnl Default value
266 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
268 dnl tests known to fail
269 AC_ARG_ENABLE(failing-tests,
270 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
271 [case "${enableval}" in
272 yes) BUILD_FAILING_TESTS=yes ;;
273 no) BUILD_FAILING_TESTS=no ;;
274 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
276 [BUILD_FAILING_TESTS=no]) dnl Default value
277 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
278 if test x$BUILD_FAILING_TESTS = xyes; then
279 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
281 AC_MSG_WARN([Sissy ! By asking to not build the tests known to fail, you hereby waive your right to customer support. If you do not agree with this EULA, please press Ctrl-C before the next line is printed. By allowing the next line to be printed, you expressly acknowledge your acceptance of this EULA.])
284 AC_ARG_ENABLE(examples,
285 AC_HELP_STRING([--disable-examples],[disable building examples]),
286 [case "${enableval}" in
287 yes) BUILD_EXAMPLES=yes ;;
288 no) BUILD_EXAMPLES=no ;;
289 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
291 [BUILD_EXAMPLES=yes]) dnl Default value
292 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
294 dnl Next, check for the optional components:
295 dnl ========================================
297 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
298 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
299 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
300 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
301 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
302 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
303 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
304 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
305 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
306 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
307 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
308 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
310 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
312 dnl ################################################
313 dnl # Set defines according to variables set above #
314 dnl ################################################
317 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
318 dnl HAVE_ and it is likely to be easier to stick with the old name
319 if test "x$USE_LIBMMX" = xyes; then
320 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
323 if test "x$USE_ATOMIC_H" = xyes; then
324 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
327 dnl test if we have pthread_attr_setstack; if not use the older calls
328 AC_CHECK_LIB(pthread, pthread_attr_setstack,
329 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
330 [Defined if libpthread has pthread_attr_setstack ()]))
332 dnl test if we have posix_memalign; FreeBSD doesn't
333 AC_CHECK_FUNC(posix_memalign,
334 AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
335 [Defined if we have posix_memalign ()]))
337 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
338 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
341 if test "x$USE_DEBUG" = xyes; then
342 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
345 if test "x$USE_PROFILING" = xyes; then
346 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
347 FOMIT_FRAME_POINTER=""
349 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
353 dnl AC_SUBST(FOMIT_FRAME_POINTER)
356 dnl #############################
357 dnl # Set automake conditionals #
358 dnl #############################
360 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
361 dnl HAVE_ and it is likely to be easier to stick with the old name
362 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
364 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
365 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
367 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
368 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
371 dnl ############################
372 dnl # Set up some more defines #
373 dnl ############################
375 dnl Set location of configuration dir.
376 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
377 AC_SUBST(GST_CONFIG_DIR)
379 dnl Set location of plugin directory
380 if test "x${prefix}" = "xNONE"; then
381 PLUGINS_DIR=${ac_default_prefix}/lib/gst
383 PLUGINS_DIR=${prefix}/lib/gst
385 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
386 AC_SUBST(PLUGINS_DIR)
388 dnl Set location of uninstalled plugin directory
389 PLUGINS_BUILDDIR=`pwd`
390 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
391 AC_SUBST(PLUGINS_BUILDDIR)
393 dnl since glib and xml are package deps, there's no need to include their cflags
394 dnl in the pkg-config file
397 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
398 GST_PKG_LIBS=$GST_EXT_LIBS
399 AC_SUBST(GST_PKG_CFLAGS)
400 AC_SUBST(GST_PKG_LIBS)
402 dnl finalize _CFLAGS and _LIBS
403 dnl add GLIB and XML if necessary to EXT_*
404 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
405 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
407 dnl Private vars for libgst only
408 LIBGST_LIBS="$GST_LIBS"
409 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
410 AC_SUBST(LIBGST_LIBS)
411 AC_SUBST(LIBGST_CFLAGS)
413 dnl Vars for everyone else
414 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
415 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
417 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
418 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
420 GST_PLUGIN_LDFLAGS='-module -avoid-version'
421 AC_SUBST(GST_PLUGIN_LDFLAGS)
423 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
425 dnl ##################################################
426 dnl # Prepare informative messages to display at end #
427 dnl ##################################################
431 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
432 infomessages="$infomessages
433 *** Warning: You have configured using the --enable-plugin-builddir option.
435 This option is for development purposes only: binaries built with
436 it should be used with code in the build tree only. To build an
437 installable version, use ./configure without the --enable-plugin-builddir
438 option. Note that the autogen.sh script supplies the plugin builddir
439 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
440 an installable build.
445 dnl #########################
446 dnl # Make the output files #
447 dnl #########################
449 dnl libs/ext/Makefile
455 gst/autoplug/Makefile
456 gst/elements/Makefile
458 gst/schedulers/Makefile
460 gst/registries/Makefile
463 libs/gst/bytestream/Makefile
464 libs/gst/getbits/Makefile
465 libs/gst/putbits/Makefile
466 libs/gst/control/Makefile
469 tests/bufspeed/Makefile
470 tests/memchunk/Makefile
471 tests/muxing/Makefile
472 tests/seeking/Makefile
474 tests/threadstate/Makefile
476 testsuite/bytestream/Makefile
477 testsuite/caps/Makefile
478 testsuite/cleanup/Makefile
479 testsuite/clock/Makefile
480 testsuite/dynparams/Makefile
481 testsuite/elements/Makefile
482 testsuite/plugin/Makefile
483 testsuite/refcounting/Makefile
484 testsuite/threads/Makefile
486 examples/autoplug/Makefile
487 examples/helloworld/Makefile
488 examples/helloworld2/Makefile
489 examples/launch/Makefile
490 examples/queue/Makefile
491 examples/queue2/Makefile
492 examples/queue3/Makefile
493 examples/queue4/Makefile
494 examples/thread/Makefile
495 examples/mixer/Makefile
496 examples/cutter/Makefile
497 examples/launch/Makefile
498 examples/xml/Makefile
499 examples/plugins/Makefile
500 examples/typefind/Makefile
501 examples/mixer/Makefile
502 examples/pingpong/Makefile
506 docs/gst/gstreamer.types
508 docs/plugins/Makefile
509 docs/plugins/gstreamer-plugins.types
513 docs/devhelp/Makefile
516 gstreamer-uninstalled.pc
518 echo "$infomessages", infomessages="$infomessages"