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, 2, 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)
11 dnl our libraries and install dirs use major.minor as a version
12 GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
13 AC_SUBST(GST_MAJORMINOR)
15 dnl CURRENT, REVISION, AGE
16 dnl - library source changed -> increment REVISION
17 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
18 dnl - interfaces added -> increment AGE
19 dnl - interfaces removed -> AGE = 0
20 AS_LIBTOOL(GST, 1, 0, 0)
22 AC_CONFIG_SRCDIR([gst/gst.c])
23 AM_CONFIG_HEADER(config.h)
25 dnl Add parameters for aclocal
26 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
27 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
35 dnl We disable static building for development, for time savings
36 dnl *NOTE*: dnl this line before release, so release does static too
42 dnl ##############################
43 dnl # Do automated configuration #
44 dnl ##############################
49 dnl allow for different autotools
50 AS_AUTOTOOLS_ALTERNATE()
52 dnl modify pkg-config path
53 AC_ARG_WITH(pkg-config-path,
54 AC_HELP_STRING([--with-pkg-config-path],
55 [colon-separated list of pkg-config(1) dirs]),
56 [export PKG_CONFIG_PATH=${withval}])
61 dnl we require bison for building of some of the marshal files
62 dnl FIXME: check if AC_PROG_YACC is suitable here
63 AC_PATH_PROG(BISON_PATH, bison, no)
64 if test x$BISON_PATH = xno; then
65 AC_MSG_ERROR(Could not find bison)
68 dnl we require flex for building the parser
69 dnl FIXME: check if AC_PROG_LEX is suitable here
70 AC_PATH_PROG(FLEX_PATH, flex, no)
71 if test x$FLEX_PATH = xno; then
72 AC_MSG_ERROR(Could not find flex)
76 dnl We should really use AC_SYS_LARGEFILE, but the problem is
77 dnl many of the plugins don't include "config.h". To assure
78 dnl binary compatibility, it is necessary that all gstreamer
79 dnl code be compiled with the same sizeof(off_t), so we use
80 dnl the following crude hack.
84 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
86 dnl this is so we can make GST_CFLAGS for external modules available
87 dnl without mixing in internal (uninstalled) CFLAGS
90 AC_MSG_CHECKING(for large file support)
92 #define _LARGEFILE_SOURCE
93 #define _FILE_OFFSET_BITS 64
94 #include <sys/types.h>
95 int main () { return !(sizeof(off_t) == 8); }
99 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
108 dnl Check for essential libraries first:
109 dnl ====================================
112 dnl Minimum required version of GLib2
113 dnl required for compilation without warnings
118 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
119 HAVE_GLIB2=yes,HAVE_GLIB2=no)
120 GLIB_LIBS=$GLIB2_LIBS
121 GLIB_CFLAGS=$GLIB2_CFLAGS
123 AC_SUBST(GLIB_CFLAGS)
125 if test "x$HAVE_GLIB2" = "xno"; then
126 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
129 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
130 AC_SUBST(GST_PKG_DEPS)
133 dnl Minimum required version of libxml2
135 AC_SUBST(LIBXML2_REQ)
137 dnl check for libxml2
141 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
142 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
143 download the latest version from
144 ftp://people.redhat.com/sopwith/popt/])
146 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
151 #ifndef POPT_TABLEEND
159 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
160 download the latest version from
161 ftp://people.redhat.com/sopwith/popt/])
164 dnl Check for atomic.h
165 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
166 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
167 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
168 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
169 if test x$HAVE_ATOMIC_H = xyes; then
171 #include "asm/atomic.h"
172 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
175 if test x$HAVE_ATOMIC_H = xyes; then
176 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
182 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
186 dnl ######################################################################
187 dnl # Check command line parameters, and set shell variables accordingly #
188 dnl ######################################################################
190 dnl FIXME: simplify all this down using a few m4 macros
192 AC_ARG_ENABLE(libmmx,
193 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
194 [case "${enableval}" in
195 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
197 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
199 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
201 AC_ARG_ENABLE(atomic,
202 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
203 [case "${enableval}" in
204 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
205 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
206 no) USE_ATOMIC_H=no;;
207 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
209 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
211 AC_ARG_ENABLE(plugin-builddir,
212 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
213 [case "${enableval}" in
214 yes) PLUGINS_USE_BUILDDIR=yes ;;
215 no) PLUGINS_USE_BUILDDIR=no ;;
216 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
218 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
222 AC_ARG_ENABLE(profiling,
223 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
224 [case "${enableval}" in
225 yes) USE_PROFILING=yes ;;
226 no) UES_PROFILING=no ;;
227 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
229 [USE_PROFILING=no]) dnl Default value
231 dnl use a cache dir for storing element registry info.
232 dnl default to building registry in the source tree if we are enabling plugin build dir
233 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
236 dnl ${localstatedir} points to PREFIX/var
237 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
239 AC_ARG_WITH(cachedir,
240 AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
241 [case "${withval}" in
242 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
243 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
244 *) GST_CACHE_DIR="${withval}" ;;
246 [:]) dnl Default value
248 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
249 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
252 dnl building of tests
254 AC_HELP_STRING([--disable-tests],[disable building test apps]),
255 [case "${enableval}" in
256 yes) BUILD_TESTS=yes ;;
257 no) BUILD_TESTS=no ;;
258 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
260 [BUILD_TESTS=yes]) dnl Default value
261 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
263 dnl tests known to fail
264 AC_ARG_ENABLE(failing-tests,
265 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
266 [case "${enableval}" in
267 yes) BUILD_FAILING_TESTS=yes ;;
268 no) BUILD_FAILING_TESTS=no ;;
269 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
271 [BUILD_FAILING_TESTS=no]) dnl Default value
272 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
273 if test x$BUILD_FAILING_TESTS = xyes; then
274 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
276 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.])
279 AC_ARG_ENABLE(examples,
280 AC_HELP_STRING([--disable-examples],[disable building examples]),
281 [case "${enableval}" in
282 yes) BUILD_EXAMPLES=yes ;;
283 no) BUILD_EXAMPLES=no ;;
284 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
286 [BUILD_EXAMPLES=yes]) dnl Default value
287 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
289 dnl Next, check for the optional components:
290 dnl ========================================
292 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
293 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
294 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
295 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
296 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
297 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
298 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
299 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
300 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
301 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
302 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
303 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
305 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
307 dnl ################################################
308 dnl # Set defines according to variables set above #
309 dnl ################################################
312 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
313 dnl HAVE_ and it is likely to be easier to stick with the old name
314 if test "x$USE_LIBMMX" = xyes; then
315 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
318 if test "x$USE_ATOMIC_H" = xyes; then
319 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
322 dnl test if we have pthread_attr_setstack; if not use the older calls
323 AC_CHECK_LIB(pthread, pthread_attr_setstack,
324 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
325 [Defined if libpthread has pthread_attr_setstack ()]))
327 dnl test if we have posix_memalign; FreeBSD doesn't
328 AC_CHECK_FUNC(posix_memalign,
329 AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
330 [Defined if we have posix_memalign ()]))
332 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
333 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
336 if test "x$USE_DEBUG" = xyes; then
337 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
340 if test "x$USE_PROFILING" = xyes; then
341 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
342 FOMIT_FRAME_POINTER=""
344 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
348 dnl AC_SUBST(FOMIT_FRAME_POINTER)
351 dnl #############################
352 dnl # Set automake conditionals #
353 dnl #############################
355 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
356 dnl HAVE_ and it is likely to be easier to stick with the old name
357 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
359 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
360 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
362 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
365 dnl ############################
366 dnl # Set up some more defines #
367 dnl ############################
369 dnl Set location of registry dir.
370 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory])
371 AC_SUBST(GST_CACHE_DIR)
373 dnl Set location of plugin directory
374 if test "x${prefix}" = "xNONE"; then
375 PLUGINS_DIR=${ac_default_prefix}/lib/gstreamer-$GST_MAJORMINOR
377 PLUGINS_DIR=${prefix}/lib/gstreamer-$GST_MAJORMINOR
379 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
380 AC_SUBST(PLUGINS_DIR)
382 dnl Set location of uninstalled plugin directory
383 PLUGINS_BUILDDIR=`pwd`
384 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
385 AC_SUBST(PLUGINS_BUILDDIR)
387 dnl since glib and xml are package deps, there's no need to include their cflags
388 dnl in the pkg-config file
391 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
392 GST_PKG_LIBS=$GST_EXT_LIBS
393 AC_SUBST(GST_PKG_CFLAGS)
394 AC_SUBST(GST_PKG_LIBS)
396 dnl finalize _CFLAGS and _LIBS
397 dnl add GLIB and XML if necessary to EXT_*
398 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
399 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
401 dnl Private vars for libgst only
402 LIBGST_LIBS="$GST_LIBS"
403 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
404 AC_SUBST(LIBGST_LIBS)
405 AC_SUBST(LIBGST_CFLAGS)
407 dnl Vars for everyone else
408 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
409 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
411 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
412 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
414 GST_PLUGIN_LDFLAGS='-module -avoid-version'
415 AC_SUBST(GST_PLUGIN_LDFLAGS)
417 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
419 dnl ##################################################
420 dnl # deps for examples from manual #
421 dnl ##################################################
423 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
424 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
425 AC_SUBST(LIBGNOMEUI_CFLAGS)
426 AC_SUBST(LIBGNOMEUI_LIBS)
427 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
429 dnl ##################################################
430 dnl # Prepare informative messages to display at end #
431 dnl ##################################################
435 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
436 infomessages="$infomessages
437 *** Warning: You have configured using the --enable-plugin-builddir option.
439 This option is for development purposes only: binaries built with
440 it should be used with code in the build tree only. To build an
441 installable version, use ./configure without the --enable-plugin-builddir
442 option. Note that the autogen.sh script supplies the plugin builddir
443 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
444 an installable build.
449 dnl #########################
450 dnl # Make the output files #
451 dnl #########################
453 dnl libs/ext/Makefile
459 gst/autoplug/Makefile
461 gst/elements/Makefile
463 gst/schedulers/Makefile
465 gst/registries/Makefile
468 libs/gst/bytestream/Makefile
469 libs/gst/getbits/Makefile
470 libs/gst/putbits/Makefile
471 libs/gst/control/Makefile
474 tests/bufspeed/Makefile
475 tests/memchunk/Makefile
476 tests/muxing/Makefile
477 tests/seeking/Makefile
479 tests/threadstate/Makefile
481 testsuite/bytestream/Makefile
482 testsuite/caps/Makefile
483 testsuite/cleanup/Makefile
484 testsuite/clock/Makefile
485 testsuite/dynparams/Makefile
486 testsuite/elements/Makefile
487 testsuite/plugin/Makefile
488 testsuite/refcounting/Makefile
489 testsuite/threads/Makefile
491 examples/autoplug/Makefile
492 examples/cutter/Makefile
493 examples/helloworld/Makefile
494 examples/helloworld2/Makefile
495 examples/launch/Makefile
496 examples/manual/Makefile
497 examples/mixer/Makefile
498 examples/pingpong/Makefile
499 examples/plugins/Makefile
500 examples/queue/Makefile
501 examples/queue2/Makefile
502 examples/queue3/Makefile
503 examples/queue4/Makefile
504 examples/thread/Makefile
505 examples/typefind/Makefile
506 examples/xml/Makefile
509 docs/devhelp/Makefile
510 docs/devhelp/html2xml.py
513 docs/gst/gstreamer.types
517 docs/plugins/Makefile
518 docs/plugins/gstreamer-plugins.types
522 gstreamer-uninstalled.pc
524 echo "$infomessages", infomessages="$infomessages"