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")
8 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
9 AS_LIBTOOL(GST, 0, 0, 0, yes)
11 AC_CONFIG_SRCDIR([gst/gst.c])
12 AM_CONFIG_HEADER(config.h)
14 dnl Add parameters for aclocal
15 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
16 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
26 dnl We disable static building for development, for time savings
27 dnl *NOTE*: dnl this line before release, so release does static too
33 dnl ##############################
34 dnl # Do automated configuration #
35 dnl ##############################
40 dnl allow for different autotools
41 AS_AUTOTOOLS_ALTERNATE()
43 dnl modify pkg-config path
44 AC_ARG_WITH(pkg-config-path,
45 AC_HELP_STRING([--with-pkg-config-path],
46 [colon-separated list of pkg-config(1) dirs]),
47 [export PKG_CONFIG_PATH=${withval}])
50 AC_PATH_PROG(NASM_PATH, nasm, no)
52 if test x$NASM_PATH = xno; then
53 AC_MSG_WARN(Couldn't find nasm)
55 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
62 dnl we require bison for building of some of the marshal files
63 AC_PATH_PROG(BISON_PATH, bison, no)
64 if test x$BISON_PATH = xno; then
65 AC_MSG_ERROR(Could not find bison)
69 dnl We should really use AC_SYS_LARGEFILE, but the problem is
70 dnl many of the plugins don't include "config.h". To assure
71 dnl binary compatibility, it is necessary that all gstreamer
72 dnl code be compiled with the same sizeof(off_t), so we use
73 dnl the following crude hack.
77 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
79 dnl this is so we can make GST_CFLAGS for external modules available
80 dnl without mixing in internal (uninstalled) CFLAGS
83 AC_MSG_CHECKING(for large file support)
85 #define _LARGEFILE_SOURCE
86 #define _FILE_OFFSET_BITS 64
87 #include <sys/types.h>
88 int main () { return !(sizeof(off_t) == 8); }
92 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
101 dnl Check for essential libraries first:
102 dnl ====================================
105 dnl Minimum required version of GLib2
106 dnl required for compilation without warnings
111 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
112 HAVE_GLIB2=yes,HAVE_GLIB2=no)
113 GLIB_LIBS=$GLIB2_LIBS
114 GLIB_CFLAGS=$GLIB2_CFLAGS
116 AC_SUBST(GLIB_CFLAGS)
118 if test "x$HAVE_GLIB2" = "xno"; then
119 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
122 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
123 AC_SUBST(GST_PKG_DEPS)
126 dnl Minimum required version of libxml2
128 AC_SUBST(LIBXML2_REQ)
130 dnl check for libxml2
131 LIBXML_PKG=', libxml-2.0'
132 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
133 if test "x$HAVE_LIBXML2" = "xyes"; then
134 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
136 AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
142 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
143 AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
144 download the latest version from ftp://people.redhat.com/sopwith/popt/]))
146 dnl Check for atomic.h
147 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
148 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
149 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
150 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
151 if test x$HAVE_ATOMIC_H = xyes; then
153 #include "asm/atomic.h"
154 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
157 if test x$HAVE_ATOMIC_H = xyes; then
158 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
164 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
168 dnl ######################################################################
169 dnl # Check command line parameters, and set shell variables accordingly #
170 dnl ######################################################################
172 dnl FIXME: simplify all this down using a few m4 macros
174 AC_ARG_ENABLE(libmmx,
175 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
176 [case "${enableval}" in
177 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
179 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
181 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
183 AC_ARG_ENABLE(atomic,
184 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
185 [case "${enableval}" in
186 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
187 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
188 no) USE_ATOMIC_H=no;;
189 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
191 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
193 AC_ARG_ENABLE(plugin-builddir,
194 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
195 [case "${enableval}" in
196 yes) PLUGINS_USE_BUILDDIR=yes ;;
197 no) PLUGINS_USE_BUILDDIR=no ;;
198 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
200 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
204 AC_ARG_ENABLE(profiling,
205 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
206 [case "${enableval}" in
207 yes) USE_PROFILING=yes ;;
208 no) UES_PROFILING=no ;;
209 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
211 [USE_PROFILING=no]) dnl Default value
213 dnl default to building registry in the source tree if we are enabling plugin build dir
214 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
217 GST_CONFIG_DIR=${sysconfdir}/gstreamer
219 AC_ARG_WITH(configdir,
220 AC_HELP_STRING([--with-configdir],[specify path to use for plugin and command completion registries]),
221 [case "${withval}" in
222 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
223 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
224 *) GST_CONFIG_DIR="${withval}" ;;
226 [:]) dnl Default value
228 AS_AC_EXPAND(GST_CONFIG_DIR, $GST_CONFIG_DIR)
229 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
232 dnl building of tests
234 AC_HELP_STRING([--disable-tests],[disable building test apps]),
235 [case "${enableval}" in
236 yes) BUILD_TESTS=yes ;;
237 no) BUILD_TESTS=no ;;
238 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
240 [BUILD_TESTS=yes]) dnl Default value
241 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
243 dnl tests known to fail
244 AC_ARG_ENABLE(failing-tests,
245 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
246 [case "${enableval}" in
247 yes) BUILD_FAILING_TESTS=yes ;;
248 no) BUILD_FAILING_TESTS=no ;;
249 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
251 [BUILD_FAILING_TESTS=no]) dnl Default value
252 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
253 if test x$BUILD_FAILING_TESTS = xyes; then
254 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
256 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.])
259 AC_ARG_ENABLE(examples,
260 AC_HELP_STRING([--disable-examples],[disable building examples]),
261 [case "${enableval}" in
262 yes) BUILD_EXAMPLES=yes ;;
263 no) BUILD_EXAMPLES=no ;;
264 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
266 [BUILD_EXAMPLES=yes]) dnl Default value
267 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
269 dnl Next, check for the optional components:
270 dnl ========================================
272 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
273 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
274 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
275 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
276 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
277 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
278 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
279 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
280 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
281 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
282 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
283 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
285 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
287 dnl ################################################
288 dnl # Set defines according to variables set above #
289 dnl ################################################
292 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
293 dnl HAVE_ and it is likely to be easier to stick with the old name
294 if test "x$USE_LIBMMX" = xyes; then
295 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
298 if test "x$USE_ATOMIC_H" = xyes; then
299 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
302 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
303 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
306 if test "x$USE_DEBUG" = xyes; then
307 GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
310 if test "x$USE_PROFILING" = xyes; then
311 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
312 FOMIT_FRAME_POINTER=""
314 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
318 dnl AC_SUBST(FOMIT_FRAME_POINTER)
321 dnl #############################
322 dnl # Set automake conditionals #
323 dnl #############################
325 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
326 dnl HAVE_ and it is likely to be easier to stick with the old name
327 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
329 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
330 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
332 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
333 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
336 dnl ############################
337 dnl # Set up some more defines #
338 dnl ############################
340 dnl Set location of configuration dir.
341 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
342 AC_SUBST(GST_CONFIG_DIR)
344 dnl Set location of plugin directory
345 if test "x${prefix}" = "xNONE"; then
346 PLUGINS_DIR=${ac_default_prefix}/lib/gst
348 PLUGINS_DIR=${prefix}/lib/gst
350 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
351 AC_SUBST(PLUGINS_DIR)
353 dnl Set location of uninstalled plugin directory
354 PLUGINS_BUILDDIR=`pwd`
355 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
356 AC_SUBST(PLUGINS_BUILDDIR)
358 dnl since glib and xml are package deps, there's no need to include their cflags
359 dnl in the pkg-config file
362 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
363 GST_PKG_LIBS=$GST_EXT_LIBS
364 AC_SUBST(GST_PKG_CFLAGS)
365 AC_SUBST(GST_PKG_LIBS)
367 dnl finalize _CFLAGS and _LIBS
368 dnl add GLIB and XML if necessary to EXT_*
369 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
370 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
372 dnl Private vars for libgst only
373 LIBGST_LIBS="$GST_LIBS"
374 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
375 AC_SUBST(LIBGST_LIBS)
376 AC_SUBST(LIBGST_CFLAGS)
378 dnl Vars for everyone else
379 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
380 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
382 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
383 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
385 GST_PLUGIN_LDFLAGS='-module -avoid-version'
386 AC_SUBST(GST_PLUGIN_LDFLAGS)
388 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
390 dnl ##################################################
391 dnl # Prepare informative messages to display at end #
392 dnl ##################################################
396 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
397 infomessages="$infomessages
398 *** Warning: You have configured using the --enable-plugin-builddir option.
400 This option is for development purposes only: binaries built with
401 it should be used with code in the build tree only. To build an
402 installable version, use ./configure without the --enable-plugin-builddir
403 option. Note that the autogen.sh script supplies the plugin builddir
404 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
405 an installable build.
410 dnl #########################
411 dnl # Make the output files #
412 dnl #########################
414 dnl libs/ext/Makefile
420 gst/autoplug/Makefile
421 gst/elements/Makefile
423 gst/schedulers/Makefile
425 gst/registries/Makefile
428 libs/gst/bytestream/Makefile
429 libs/gst/getbits/Makefile
430 libs/gst/putbits/Makefile
431 libs/gst/control/Makefile
434 tests/bufspeed/Makefile
435 tests/memchunk/Makefile
436 tests/muxing/Makefile
438 tests/threadstate/Makefile
440 testsuite/bytestream/Makefile
441 testsuite/caps/Makefile
442 testsuite/cleanup/Makefile
443 testsuite/clock/Makefile
444 testsuite/dynparams/Makefile
445 testsuite/elements/Makefile
446 testsuite/plugin/Makefile
447 testsuite/refcounting/Makefile
448 testsuite/threads/Makefile
450 examples/autoplug/Makefile
451 examples/helloworld/Makefile
452 examples/helloworld2/Makefile
453 examples/launch/Makefile
454 examples/queue/Makefile
455 examples/queue2/Makefile
456 examples/queue3/Makefile
457 examples/queue4/Makefile
458 examples/thread/Makefile
459 examples/mixer/Makefile
460 examples/cutter/Makefile
461 examples/launch/Makefile
462 examples/xml/Makefile
463 examples/plugins/Makefile
464 examples/typefind/Makefile
465 examples/mixer/Makefile
469 docs/gst/gstreamer.types
471 docs/plugins/Makefile
472 docs/plugins/gstreamer-plugins.types
476 docs/devhelp/Makefile
479 gstreamer-uninstalled.pc
481 echo "$infomessages", infomessages="$infomessages"