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)
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}])
51 dnl we require bison for building of some of the marshal files
52 dnl FIXME: check if AC_PROG_YACC is suitable here
53 AC_PATH_PROG(BISON_PATH, bison, no)
54 if test x$BISON_PATH = xno; then
55 AC_MSG_ERROR(Could not find bison)
58 dnl we require flex for building the parser
59 dnl FIXME: check if AC_PROG_LEX is suitable here
60 AC_PATH_PROG(FLEX_PATH, flex, no)
61 if test x$FLEX_PATH = xno; then
62 AC_MSG_ERROR(Could not find flex)
66 dnl We should really use AC_SYS_LARGEFILE, but the problem is
67 dnl many of the plugins don't include "config.h". To assure
68 dnl binary compatibility, it is necessary that all gstreamer
69 dnl code be compiled with the same sizeof(off_t), so we use
70 dnl the following crude hack.
74 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
76 dnl this is so we can make GST_CFLAGS for external modules available
77 dnl without mixing in internal (uninstalled) CFLAGS
80 AC_MSG_CHECKING(for large file support)
82 #define _LARGEFILE_SOURCE
83 #define _FILE_OFFSET_BITS 64
84 #include <sys/types.h>
85 int main () { return !(sizeof(off_t) == 8); }
89 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
98 dnl Check for essential libraries first:
99 dnl ====================================
102 dnl Minimum required version of GLib2
103 dnl required for compilation without warnings
108 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
109 HAVE_GLIB2=yes,HAVE_GLIB2=no)
110 GLIB_LIBS=$GLIB2_LIBS
111 GLIB_CFLAGS=$GLIB2_CFLAGS
113 AC_SUBST(GLIB_CFLAGS)
115 if test "x$HAVE_GLIB2" = "xno"; then
116 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
119 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
120 AC_SUBST(GST_PKG_DEPS)
123 dnl Minimum required version of libxml2
125 AC_SUBST(LIBXML2_REQ)
127 dnl check for libxml2
131 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
132 AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
133 download the latest version from
134 ftp://people.redhat.com/sopwith/popt/])
136 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
141 #ifndef POPT_TABLEEND
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/])
154 dnl Check for atomic.h
155 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
156 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
157 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
158 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
159 if test x$HAVE_ATOMIC_H = xyes; then
161 #include "asm/atomic.h"
162 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
165 if test x$HAVE_ATOMIC_H = xyes; then
166 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
172 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
176 dnl ######################################################################
177 dnl # Check command line parameters, and set shell variables accordingly #
178 dnl ######################################################################
180 dnl FIXME: simplify all this down using a few m4 macros
182 AC_ARG_ENABLE(libmmx,
183 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
184 [case "${enableval}" in
185 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
187 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
189 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
191 AC_ARG_ENABLE(atomic,
192 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
193 [case "${enableval}" in
194 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
195 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
196 no) USE_ATOMIC_H=no;;
197 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
199 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
201 AC_ARG_ENABLE(plugin-builddir,
202 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
203 [case "${enableval}" in
204 yes) PLUGINS_USE_BUILDDIR=yes ;;
205 no) PLUGINS_USE_BUILDDIR=no ;;
206 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
208 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
212 AC_ARG_ENABLE(profiling,
213 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
214 [case "${enableval}" in
215 yes) USE_PROFILING=yes ;;
216 no) UES_PROFILING=no ;;
217 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
219 [USE_PROFILING=no]) dnl Default value
221 dnl default to building registry in the source tree if we are enabling plugin build dir
222 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
225 GST_CONFIG_DIR=${sysconfdir}/gstreamer
227 AC_ARG_WITH(configdir,
228 AC_HELP_STRING([--with-configdir],[specify path to use for plugin and command completion registries]),
229 [case "${withval}" in
230 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
231 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
232 *) GST_CONFIG_DIR="${withval}" ;;
234 [:]) dnl Default value
236 AS_AC_EXPAND(GST_CONFIG_DIR, $GST_CONFIG_DIR)
237 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
240 dnl building of tests
242 AC_HELP_STRING([--disable-tests],[disable building test apps]),
243 [case "${enableval}" in
244 yes) BUILD_TESTS=yes ;;
245 no) BUILD_TESTS=no ;;
246 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
248 [BUILD_TESTS=yes]) dnl Default value
249 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
251 dnl tests known to fail
252 AC_ARG_ENABLE(failing-tests,
253 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
254 [case "${enableval}" in
255 yes) BUILD_FAILING_TESTS=yes ;;
256 no) BUILD_FAILING_TESTS=no ;;
257 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
259 [BUILD_FAILING_TESTS=no]) dnl Default value
260 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
261 if test x$BUILD_FAILING_TESTS = xyes; then
262 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
264 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.])
267 AC_ARG_ENABLE(examples,
268 AC_HELP_STRING([--disable-examples],[disable building examples]),
269 [case "${enableval}" in
270 yes) BUILD_EXAMPLES=yes ;;
271 no) BUILD_EXAMPLES=no ;;
272 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
274 [BUILD_EXAMPLES=yes]) dnl Default value
275 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
277 dnl Next, check for the optional components:
278 dnl ========================================
280 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
281 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
282 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
283 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
284 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
285 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
286 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
287 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
288 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
289 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
290 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
291 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
293 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
295 dnl ################################################
296 dnl # Set defines according to variables set above #
297 dnl ################################################
300 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
301 dnl HAVE_ and it is likely to be easier to stick with the old name
302 if test "x$USE_LIBMMX" = xyes; then
303 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
306 if test "x$USE_ATOMIC_H" = xyes; then
307 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
310 dnl test if we have pthread_attr_setstack; if not use the older calls
311 AC_CHECK_LIB(pthread, pthread_attr_setstack,
312 AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
313 [Defined if libpthread has pthread_attr_setstack ()]))
315 dnl test if we have posix_memalign; FreeBSD doesn't
316 AC_CHECK_FUNC(posix_memalign,
317 AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
318 [Defined if we have posix_memalign ()]))
320 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
321 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
324 if test "x$USE_DEBUG" = xyes; then
325 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
328 if test "x$USE_PROFILING" = xyes; then
329 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
330 FOMIT_FRAME_POINTER=""
332 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
336 dnl AC_SUBST(FOMIT_FRAME_POINTER)
339 dnl #############################
340 dnl # Set automake conditionals #
341 dnl #############################
343 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
344 dnl HAVE_ and it is likely to be easier to stick with the old name
345 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
347 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
348 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
350 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
353 dnl ############################
354 dnl # Set up some more defines #
355 dnl ############################
357 dnl Set location of configuration dir.
358 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
359 AC_SUBST(GST_CONFIG_DIR)
361 dnl Set location of plugin directory
362 if test "x${prefix}" = "xNONE"; then
363 PLUGINS_DIR=${ac_default_prefix}/lib/gst
365 PLUGINS_DIR=${prefix}/lib/gst
367 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
368 AC_SUBST(PLUGINS_DIR)
370 dnl Set location of uninstalled plugin directory
371 PLUGINS_BUILDDIR=`pwd`
372 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
373 AC_SUBST(PLUGINS_BUILDDIR)
375 dnl since glib and xml are package deps, there's no need to include their cflags
376 dnl in the pkg-config file
379 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
380 GST_PKG_LIBS=$GST_EXT_LIBS
381 AC_SUBST(GST_PKG_CFLAGS)
382 AC_SUBST(GST_PKG_LIBS)
384 dnl finalize _CFLAGS and _LIBS
385 dnl add GLIB and XML if necessary to EXT_*
386 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
387 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
389 dnl Private vars for libgst only
390 LIBGST_LIBS="$GST_LIBS"
391 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
392 AC_SUBST(LIBGST_LIBS)
393 AC_SUBST(LIBGST_CFLAGS)
395 dnl Vars for everyone else
396 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
397 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
399 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
400 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
402 GST_PLUGIN_LDFLAGS='-module -avoid-version'
403 AC_SUBST(GST_PLUGIN_LDFLAGS)
405 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
407 dnl ##################################################
408 dnl # deps for examples from manual #
409 dnl ##################################################
411 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
412 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
413 AC_SUBST(LIBGNOMEUI_CFLAGS)
414 AC_SUBST(LIBGNOMEUI_LIBS)
415 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
417 dnl ##################################################
418 dnl # Prepare informative messages to display at end #
419 dnl ##################################################
423 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
424 infomessages="$infomessages
425 *** Warning: You have configured using the --enable-plugin-builddir option.
427 This option is for development purposes only: binaries built with
428 it should be used with code in the build tree only. To build an
429 installable version, use ./configure without the --enable-plugin-builddir
430 option. Note that the autogen.sh script supplies the plugin builddir
431 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
432 an installable build.
437 dnl #########################
438 dnl # Make the output files #
439 dnl #########################
441 dnl libs/ext/Makefile
447 gst/autoplug/Makefile
448 gst/elements/Makefile
450 gst/schedulers/Makefile
452 gst/registries/Makefile
455 libs/gst/bytestream/Makefile
456 libs/gst/getbits/Makefile
457 libs/gst/putbits/Makefile
458 libs/gst/control/Makefile
461 tests/bufspeed/Makefile
462 tests/memchunk/Makefile
463 tests/muxing/Makefile
464 tests/seeking/Makefile
466 tests/threadstate/Makefile
468 testsuite/bytestream/Makefile
469 testsuite/caps/Makefile
470 testsuite/cleanup/Makefile
471 testsuite/clock/Makefile
472 testsuite/dynparams/Makefile
473 testsuite/elements/Makefile
474 testsuite/plugin/Makefile
475 testsuite/refcounting/Makefile
476 testsuite/threads/Makefile
478 examples/autoplug/Makefile
479 examples/cutter/Makefile
480 examples/helloworld/Makefile
481 examples/helloworld2/Makefile
482 examples/launch/Makefile
483 examples/manual/Makefile
484 examples/mixer/Makefile
485 examples/pingpong/Makefile
486 examples/plugins/Makefile
487 examples/queue/Makefile
488 examples/queue2/Makefile
489 examples/queue3/Makefile
490 examples/queue4/Makefile
491 examples/thread/Makefile
492 examples/typefind/Makefile
493 examples/xml/Makefile
496 docs/devhelp/Makefile
497 docs/devhelp/html2xml.py
500 docs/gst/gstreamer.types
504 docs/plugins/Makefile
505 docs/plugins/gstreamer-plugins.types
509 gstreamer-uninstalled.pc
511 echo "$infomessages", infomessages="$infomessages"