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"
27 dnl We disable static building for development, for time savings
28 dnl *NOTE*: dnl this line before release, so release does static too
34 dnl ##############################
35 dnl # Do automated configuration #
36 dnl ##############################
41 dnl allow for different autotools
42 AS_AUTOTOOLS_ALTERNATE()
44 dnl modify pkg-config path
45 AC_ARG_WITH(pkg-config-path,
46 AC_HELP_STRING([--with-pkg-config-path],
47 [colon-separated list of pkg-config(1) dirs]),
48 [export PKG_CONFIG_PATH=${withval}])
51 AC_PATH_PROG(NASM_PATH, nasm, no)
53 if test x$NASM_PATH = xno; then
54 AC_MSG_WARN(Couldn't find nasm)
56 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
63 dnl we require bison for building of some of the marshal files
64 AC_PATH_PROG(BISON_PATH, bison, no)
65 if test x$BISON_PATH = xno; then
66 AC_MSG_ERROR(Could not find bison)
70 dnl We should really use AC_SYS_LARGEFILE, but the problem is
71 dnl many of the plugins don't include "config.h". To assure
72 dnl binary compatibility, it is necessary that all gstreamer
73 dnl code be compiled with the same sizeof(off_t), so we use
74 dnl the following crude hack.
78 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
80 dnl this is so we can make GST_CFLAGS for external modules available
81 dnl without mixing in internal (uninstalled) CFLAGS
84 AC_MSG_CHECKING(for large file support)
86 #define _LARGEFILE_SOURCE
87 #define _FILE_OFFSET_BITS 64
88 #include <sys/types.h>
89 int main () { return !(sizeof(off_t) == 8); }
93 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
102 dnl Check for essential libraries first:
103 dnl ====================================
106 dnl Minimum required version of GLib2
107 dnl required for compilation without warnings
112 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
113 HAVE_GLIB2=yes,HAVE_GLIB2=no)
114 GLIB_LIBS=$GLIB2_LIBS
115 GLIB_CFLAGS=$GLIB2_CFLAGS
117 AC_SUBST(GLIB_CFLAGS)
119 if test "x$HAVE_GLIB2" = "xno"; then
120 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
123 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
124 AC_SUBST(GST_PKG_DEPS)
127 dnl Minimum required version of libxml2
129 AC_SUBST(LIBXML2_REQ)
131 dnl check for libxml2
132 LIBXML_PKG=', libxml-2.0'
133 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
134 if test "x$HAVE_LIBXML2" = "xyes"; then
135 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
137 AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
143 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
144 AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
145 download the latest version from ftp://people.redhat.com/sopwith/popt/]))
147 dnl Check for atomic.h
148 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
149 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
150 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
151 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
152 if test x$HAVE_ATOMIC_H = xyes; then
154 #include "asm/atomic.h"
155 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
158 if test x$HAVE_ATOMIC_H = xyes; then
159 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
165 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
169 dnl ######################################################################
170 dnl # Check command line parameters, and set shell variables accordingly #
171 dnl ######################################################################
173 dnl FIXME: simplify all this down using a few m4 macros
175 AC_ARG_ENABLE(libmmx,
176 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
177 [case "${enableval}" in
178 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
180 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
182 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
184 AC_ARG_ENABLE(atomic,
185 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
186 [case "${enableval}" in
187 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
188 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
189 no) USE_ATOMIC_H=no;;
190 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
192 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
194 AC_ARG_ENABLE(plugin-builddir,
195 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
196 [case "${enableval}" in
197 yes) PLUGINS_USE_BUILDDIR=yes ;;
198 no) PLUGINS_USE_BUILDDIR=no ;;
199 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
201 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
205 AC_ARG_ENABLE(profiling,
206 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
207 [case "${enableval}" in
208 yes) USE_PROFILING=yes ;;
209 no) UES_PROFILING=no ;;
210 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
212 [USE_PROFILING=no]) dnl Default value
214 dnl default to building registry in the source tree if we are enabling plugin build dir
215 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
218 GST_CONFIG_DIR=${sysconfdir}/gstreamer
220 AC_ARG_WITH(configdir,
221 AC_HELP_STRING([--with-configdir],[specify path to use for plugin and command completion registries]),
222 [case "${withval}" in
223 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
224 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
225 *) GST_CONFIG_DIR="${withval}" ;;
227 [:]) dnl Default value
229 AS_AC_EXPAND(GST_CONFIG_DIR, $GST_CONFIG_DIR)
230 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
233 dnl building of tests
235 AC_HELP_STRING([--disable-tests],[disable building test apps]),
236 [case "${enableval}" in
237 yes) BUILD_TESTS=yes ;;
238 no) BUILD_TESTS=no ;;
239 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
241 [BUILD_TESTS=yes]) dnl Default value
242 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
244 dnl tests known to fail
245 AC_ARG_ENABLE(failing-tests,
246 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
247 [case "${enableval}" in
248 yes) BUILD_FAILING_TESTS=yes ;;
249 no) BUILD_FAILING_TESTS=no ;;
250 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
252 [BUILD_FAILING_TESTS=no]) dnl Default value
253 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
254 if test x$BUILD_FAILING_TESTS = xyes; then
255 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
257 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.])
260 AC_ARG_ENABLE(examples,
261 AC_HELP_STRING([--disable-examples],[disable building examples]),
262 [case "${enableval}" in
263 yes) BUILD_EXAMPLES=yes ;;
264 no) BUILD_EXAMPLES=no ;;
265 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
267 [BUILD_EXAMPLES=yes]) dnl Default value
268 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
270 dnl Next, check for the optional components:
271 dnl ========================================
273 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
274 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
275 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
276 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
277 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
278 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
279 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
280 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
281 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
282 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
283 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
284 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
286 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
288 dnl ################################################
289 dnl # Set defines according to variables set above #
290 dnl ################################################
293 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
294 dnl HAVE_ and it is likely to be easier to stick with the old name
295 if test "x$USE_LIBMMX" = xyes; then
296 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
299 if test "x$USE_ATOMIC_H" = xyes; then
300 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
303 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
304 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
307 if test "x$USE_DEBUG" = xyes; then
308 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
311 if test "x$USE_PROFILING" = xyes; then
312 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
313 FOMIT_FRAME_POINTER=""
315 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
319 dnl AC_SUBST(FOMIT_FRAME_POINTER)
322 dnl #############################
323 dnl # Set automake conditionals #
324 dnl #############################
326 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
327 dnl HAVE_ and it is likely to be easier to stick with the old name
328 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
330 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
331 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
333 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
334 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
337 dnl ############################
338 dnl # Set up some more defines #
339 dnl ############################
341 dnl Set location of configuration dir.
342 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
343 AC_SUBST(GST_CONFIG_DIR)
345 dnl Set location of plugin directory
346 if test "x${prefix}" = "xNONE"; then
347 PLUGINS_DIR=${ac_default_prefix}/lib/gst
349 PLUGINS_DIR=${prefix}/lib/gst
351 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
352 AC_SUBST(PLUGINS_DIR)
354 dnl Set location of uninstalled plugin directory
355 PLUGINS_BUILDDIR=`pwd`
356 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
357 AC_SUBST(PLUGINS_BUILDDIR)
359 dnl since glib and xml are package deps, there's no need to include their cflags
360 dnl in the pkg-config file
363 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
364 GST_PKG_LIBS=$GST_EXT_LIBS
365 AC_SUBST(GST_PKG_CFLAGS)
366 AC_SUBST(GST_PKG_LIBS)
368 dnl finalize _CFLAGS and _LIBS
369 dnl add GLIB and XML if necessary to EXT_*
370 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
371 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
373 dnl Private vars for libgst only
374 LIBGST_LIBS="$GST_LIBS"
375 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
376 AC_SUBST(LIBGST_LIBS)
377 AC_SUBST(LIBGST_CFLAGS)
379 dnl Vars for everyone else
380 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
381 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
383 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
384 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
386 GST_PLUGIN_LDFLAGS='-module -avoid-version'
387 AC_SUBST(GST_PLUGIN_LDFLAGS)
389 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
391 dnl ##################################################
392 dnl # Prepare informative messages to display at end #
393 dnl ##################################################
397 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
398 infomessages="$infomessages
399 *** Warning: You have configured using the --enable-plugin-builddir option.
401 This option is for development purposes only: binaries built with
402 it should be used with code in the build tree only. To build an
403 installable version, use ./configure without the --enable-plugin-builddir
404 option. Note that the autogen.sh script supplies the plugin builddir
405 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
406 an installable build.
411 dnl #########################
412 dnl # Make the output files #
413 dnl #########################
415 dnl libs/ext/Makefile
421 gst/autoplug/Makefile
422 gst/elements/Makefile
424 gst/schedulers/Makefile
426 gst/registries/Makefile
429 libs/gst/bytestream/Makefile
430 libs/gst/getbits/Makefile
431 libs/gst/putbits/Makefile
432 libs/gst/control/Makefile
435 tests/bufspeed/Makefile
436 tests/memchunk/Makefile
437 tests/muxing/Makefile
439 tests/threadstate/Makefile
441 testsuite/bytestream/Makefile
442 testsuite/caps/Makefile
443 testsuite/cleanup/Makefile
444 testsuite/clock/Makefile
445 testsuite/dynparams/Makefile
446 testsuite/elements/Makefile
447 testsuite/plugin/Makefile
448 testsuite/refcounting/Makefile
449 testsuite/threads/Makefile
451 examples/autoplug/Makefile
452 examples/helloworld/Makefile
453 examples/helloworld2/Makefile
454 examples/launch/Makefile
455 examples/queue/Makefile
456 examples/queue2/Makefile
457 examples/queue3/Makefile
458 examples/queue4/Makefile
459 examples/thread/Makefile
460 examples/mixer/Makefile
461 examples/cutter/Makefile
462 examples/launch/Makefile
463 examples/xml/Makefile
464 examples/plugins/Makefile
465 examples/typefind/Makefile
466 examples/mixer/Makefile
470 docs/gst/gstreamer.types
472 docs/plugins/Makefile
473 docs/plugins/gstreamer-plugins.types
477 docs/devhelp/Makefile
480 gstreamer-uninstalled.pc
482 echo "$infomessages", infomessages="$infomessages"