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, 3, 4, 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"
28 dnl We disable static building for development, for time savings
29 dnl *NOTE*: dnl this line before release, so release does static too
35 dnl ##############################
36 dnl # Do automated configuration #
37 dnl ##############################
42 dnl modify pkg-config path
43 AC_ARG_WITH(pkg-config-path,
44 AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
45 [export PKG_CONFIG_PATH=${withval}])
48 AC_PATH_PROG(NASM_PATH, nasm, no)
50 if test x$NASM_PATH = xno; then
51 AC_MSG_WARN(Couldn't find nasm)
53 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
60 dnl we require bison for building of some of the marshal files
61 AC_PATH_PROG(BISON_PATH, bison, no)
62 if test x$BISON_PATH = xno; then
63 AC_MSG_ERROR(Could not find bison)
67 dnl We should really use AC_SYS_LARGEFILE, but the problem is
68 dnl many of the plugins don't include "config.h". To assure
69 dnl binary compatibility, it is necessary that all gstreamer
70 dnl code be compiled with the same sizeof(off_t), so we use
71 dnl the following crude hack.
75 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
77 dnl this is so we can make GST_CFLAGS for external modules available
78 dnl without mixing in internal (uninstalled) CFLAGS
81 AC_MSG_CHECKING(for large file support)
83 #define _LARGEFILE_SOURCE
84 #define _FILE_OFFSET_BITS 64
85 #include <sys/types.h>
86 int main () { return !(sizeof(off_t) == 8); }
90 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
99 dnl Check for essential libraries first:
100 dnl ====================================
103 dnl Minimum required version of GLib2
104 dnl required for compilation without warnings
109 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
110 HAVE_GLIB2=yes,HAVE_GLIB2=no)
111 GLIB_LIBS=$GLIB2_LIBS
112 GLIB_CFLAGS=$GLIB2_CFLAGS
114 AC_SUBST(GLIB_CFLAGS)
116 if test "x$HAVE_GLIB2" = "xno"; then
117 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
120 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
121 AC_SUBST(GST_PKG_DEPS)
124 dnl Minimum required version of libxml2
126 AC_SUBST(LIBXML2_REQ)
128 dnl check for libxml2
129 LIBXML_PKG=', libxml-2.0'
130 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
131 if test "x$HAVE_LIBXML2" = "xyes"; then
132 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
134 AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
140 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
141 AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
142 download the latest version from ftp://people.redhat.com/sopwith/popt/]))
144 dnl Check for atomic.h
145 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
146 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
147 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
148 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
149 if test x$HAVE_ATOMIC_H = xyes; then
151 #include "asm/atomic.h"
152 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
155 if test x$HAVE_ATOMIC_H = xyes; then
156 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
162 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
166 dnl ######################################################################
167 dnl # Check command line parameters, and set shell variables accordingly #
168 dnl ######################################################################
170 dnl FIXME: simplify all this down using a few m4 macros
172 AC_ARG_ENABLE(libmmx,
173 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
174 [case "${enableval}" in
175 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
177 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
179 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
181 AC_ARG_ENABLE(atomic,
182 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
183 [case "${enableval}" in
184 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
185 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
186 no) USE_ATOMIC_H=no;;
187 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
189 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
191 AC_ARG_ENABLE(plugin-builddir,
192 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
193 [case "${enableval}" in
194 yes) PLUGINS_USE_BUILDDIR=yes ;;
195 no) PLUGINS_USE_BUILDDIR=no ;;
196 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
198 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
202 AC_ARG_ENABLE(profiling,
203 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
204 [case "${enableval}" in
205 yes) USE_PROFILING=yes ;;
206 no) UES_PROFILING=no ;;
207 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
209 [USE_PROFILING=no]) dnl Default value
211 dnl default to building registry in the source tree if we are enabling plugin build dir
212 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
215 GST_CONFIG_DIR=${sysconfdir}/gstreamer
217 AC_ARG_WITH(configdir,
218 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
219 [case "${withval}" in
220 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
221 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
222 *) GST_CONFIG_DIR="${withval}" ;;
224 [:]) dnl Default value
226 AS_AC_EXPAND(GST_CONFIG_DIR, $GST_CONFIG_DIR)
227 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
230 dnl building of tests
232 AC_HELP_STRING([--disable-tests][disable building test apps]),
233 [case "${enableval}" in
234 yes) BUILD_TESTS=yes ;;
235 no) BUILD_TESTS=no ;;
236 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
238 [BUILD_TESTS=yes]) dnl Default value
239 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
241 dnl tests known to fail
242 AC_ARG_ENABLE(failing-tests,
243 AC_HELP_STRING([--disable-failing-tests][disable building tests known to fail]),
244 [case "${enableval}" in
245 yes) BUILD_FAILING_TESTS=yes ;;
246 no) BUILD_FAILING_TESTS=no ;;
247 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
249 [BUILD_FAILING_TESTS=yes]) dnl Default value
250 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
252 AC_ARG_ENABLE(examples,
253 AC_HELP_STRING([--disable-examples][disable building examples]),
254 [case "${enableval}" in
255 yes) BUILD_EXAMPLES=yes ;;
256 no) BUILD_EXAMPLES=no ;;
257 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
259 [BUILD_EXAMPLES=yes]) dnl Default value
260 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
262 dnl Next, check for the optional components:
263 dnl ========================================
265 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
266 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
267 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
268 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
269 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
270 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
271 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
272 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
273 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
274 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
275 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
276 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
278 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
280 dnl ################################################
281 dnl # Set defines according to variables set above #
282 dnl ################################################
285 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
286 dnl HAVE_ and it is likely to be easier to stick with the old name
287 if test "x$USE_LIBMMX" = xyes; then
288 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
291 if test "x$USE_ATOMIC_H" = xyes; then
292 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
295 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
296 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
299 dnl if test "x$USE_DEBUG" = xyes; then
300 dnl CFLAGS="$CFLAGS -g"
303 if test "x$USE_PROFILING" = xyes; then
304 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
305 FOMIT_FRAME_POINTER=""
307 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
311 dnl AC_SUBST(FOMIT_FRAME_POINTER)
314 dnl #############################
315 dnl # Set automake conditionals #
316 dnl #############################
318 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
319 dnl HAVE_ and it is likely to be easier to stick with the old name
320 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
322 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
323 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
325 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
326 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
329 dnl ############################
330 dnl # Set up some more defines #
331 dnl ############################
333 dnl Set location of configuration dir.
334 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
335 AC_SUBST(GST_CONFIG_DIR)
337 dnl Set location of plugin directory
338 if test "x${prefix}" = "xNONE"; then
339 PLUGINS_DIR=${ac_default_prefix}/lib/gst
341 PLUGINS_DIR=${prefix}/lib/gst
343 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
344 AC_SUBST(PLUGINS_DIR)
346 dnl Set location of uninstalled plugin directory
347 PLUGINS_BUILDDIR=`pwd`
348 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
349 AC_SUBST(PLUGINS_BUILDDIR)
351 dnl since glib and xml are package deps, there's no need to include their cflags
352 dnl in the pkg-config file
355 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
356 GST_PKG_LIBS=$GST_EXT_LIBS
357 AC_SUBST(GST_PKG_CFLAGS)
358 AC_SUBST(GST_PKG_LIBS)
360 dnl finalize _CFLAGS and _LIBS
361 dnl add GLIB and XML if necessary to EXT_*
362 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
363 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
365 dnl Private vars for libgst only
366 LIBGST_LIBS="$GST_LIBS"
367 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
368 AC_SUBST(LIBGST_LIBS)
369 AC_SUBST(LIBGST_CFLAGS)
371 dnl Vars for everyone else
372 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
373 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
375 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
376 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
378 GST_PLUGIN_LDFLAGS='-module -avoid-version'
379 AC_SUBST(GST_PLUGIN_LDFLAGS)
381 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
383 dnl ##################################################
384 dnl # Prepare informative messages to display at end #
385 dnl ##################################################
389 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
390 infomessages="$infomessages
391 *** Warning: You have configured using the --enable-plugin-builddir option.
393 This option is for development purposes only: binaries built with
394 it should be used with code in the build tree only. To build an
395 installable version, use ./configure without the --enable-plugin-builddir
396 option. Note that the autogen.sh script supplies the plugin builddir
397 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
398 an installable build.
403 dnl #########################
404 dnl # Make the output files #
405 dnl #########################
407 dnl libs/ext/Makefile
413 gst/autoplug/Makefile
414 gst/elements/Makefile
416 gst/schedulers/Makefile
418 gst/registries/Makefile
421 libs/gst/bytestream/Makefile
422 libs/gst/getbits/Makefile
423 libs/gst/putbits/Makefile
424 libs/gst/control/Makefile
427 tests/bufspeed/Makefile
428 tests/memchunk/Makefile
429 tests/muxing/Makefile
432 testsuite/bytestream/Makefile
433 testsuite/caps/Makefile
434 testsuite/cleanup/Makefile
435 testsuite/clock/Makefile
436 testsuite/dynparams/Makefile
437 testsuite/elements/Makefile
438 testsuite/plugin/Makefile
439 testsuite/refcounting/Makefile
440 testsuite/threads/Makefile
442 examples/autoplug/Makefile
443 examples/helloworld/Makefile
444 examples/helloworld2/Makefile
445 examples/launch/Makefile
446 examples/queue/Makefile
447 examples/queue2/Makefile
448 examples/queue3/Makefile
449 examples/queue4/Makefile
450 examples/thread/Makefile
451 examples/mixer/Makefile
452 examples/cutter/Makefile
453 examples/launch/Makefile
454 examples/xml/Makefile
455 examples/plugins/Makefile
456 examples/typefind/Makefile
457 examples/mixer/Makefile
461 docs/gst/gstreamer.types
463 docs/plugins/Makefile
464 docs/plugins/gstreamer-plugins.types
468 docs/devhelp/Makefile
471 gstreamer-uninstalled.pc
473 echo "$infomessages", infomessages="$infomessages"