3 dnl initialize autoconf
4 dnl we don't specify PACKAGE and VERSION because AS_VERSION puts it together
7 dnl when going to/from release please set the nano (fourth number) right !
8 dnl releases only do Wall, cvs and prerelease does Werror too
9 AS_VERSION(gstreamer, GST_VERSION, 0, 9, 3, 1,
10 GST_CVS="no", GST_CVS="yes")
12 dnl can autoconf find the source ?
13 AC_CONFIG_SRCDIR([gst/gst.c])
15 dnl define the output header for config
16 AM_CONFIG_HEADER([config.h])
18 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
21 dnl initialize automake
22 dnl FIXME: this is deprecated use, we should move PACKAGE and VERSION to
23 dnl AC_INIT, but then we need to parse the version to pass to AS_VERSION
24 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
26 dnl our libraries and install dirs use major.minor as a version
27 GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
28 dnl we override it here for release candidates for a new series
30 AC_SUBST(GST_MAJORMINOR)
32 dnl CURRENT, REVISION, AGE
33 dnl - library source changed -> increment REVISION
34 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
35 dnl - interfaces added -> increment AGE
36 dnl - interfaces removed -> AGE = 0
37 AS_LIBTOOL(GST, 7, 0, 0)
41 dnl *** autotools stuff ****
43 dnl allow for different autotools
44 AS_AUTOTOOLS_ALTERNATE
46 dnl Add parameters for aclocal
47 AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4")
49 dnl *** check for arguments to configure ***
51 dnl subsystems - can influence other decisions so needs to be high up
52 dnl we need to AM_CONDITIONAL them here for automake 1.6.x compatibility
53 GST_CHECK_SUBSYSTEM_DISABLE(GST_DEBUG,[debugging subsystem])
54 AM_CONDITIONAL(GST_DISABLE_GST_DEBUG, test "x$GST_GST_DISABLE_DEBUG" = "xyes")
55 GST_CHECK_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
56 AM_CONDITIONAL(GST_DISABLE_LOADSAVE, test "x$GST_DISABLE_LOADSAVE" = "xyes")
57 GST_CHECK_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
58 AM_CONDITIONAL(GST_DISABLE_PARSE, test "x$GST_DISABLE_PARSE" = "xyes")
59 GST_CHECK_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
60 AM_CONDITIONAL(GST_DISABLE_TRACE, test "x$GST_DISABLE_TRACE" = "xyes")
61 GST_CHECK_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
62 AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, test "x$GST_DISABLE_ALLOC_TRACE" = "xyes")
63 GST_CHECK_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
64 AM_CONDITIONAL(GST_DISABLE_REGISTRY, test "x$GST_DISABLE_REGISTRY" = "xyes")
65 GST_CHECK_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
66 AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, test "x$GST_DISABLE_ENUMTYPES" = "xyes")
67 GST_CHECK_SUBSYSTEM_DISABLE(INDEX,[index])
68 AM_CONDITIONAL(GST_DISABLE_INDEX, test "x$GST_DISABLE_INDEX" = "xyes")
69 GST_CHECK_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
70 AM_CONDITIONAL(GST_DISABLE_PLUGIN, test "x$GST_DISABLE_PLUGIN" = "xyes")
71 GST_CHECK_SUBSYSTEM_DISABLE(URI,[uri handlers])
72 AM_CONDITIONAL(GST_DISABLE_URI, test "x$GST_DISABLE_URI" = "xyes")
79 GST_ARG_WITH_PKG_CONFIG_PATH
80 GST_ARG_WITH_PACKAGE_NAME([GStreamer])
81 GST_ARG_WITH_PACKAGE_ORIGIN
83 dnl use a cache dir for storing element registry info.
84 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
87 AC_HELP_STRING([--with-cachedir],
88 [specify path to use for plugin and command completion registries]),
91 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
92 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
93 *) GST_CACHE_DIR="${withval}" ;;
96 [:]) dnl Default value
98 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
99 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Location of registry])
100 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
102 dnl building of tests
104 AC_HELP_STRING([--disable-tests], [disable building test apps]),
106 case "${enableval}" in
107 yes) BUILD_TESTS=yes ;;
108 no) BUILD_TESTS=no ;;
109 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
112 [BUILD_TESTS=yes]) dnl Default value
113 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
115 dnl tests known to fail
116 AC_ARG_ENABLE(failing-tests,
117 AC_HELP_STRING([--disable-failing-tests],
118 [disable building tests known to fail]),
120 case "${enableval}" in
121 yes) BUILD_FAILING_TESTS=yes ;;
122 no) BUILD_FAILING_TESTS=no ;;
123 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
126 [BUILD_FAILING_TESTS=no]) dnl Default value
127 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
128 if test x$BUILD_FAILING_TESTS = xyes; then
129 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
131 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.])
134 AC_ARG_ENABLE(examples,
135 AC_HELP_STRING([--disable-examples], [disable building examples]),
137 case "${enableval}" in
138 yes) BUILD_EXAMPLES=yes ;;
139 no) BUILD_EXAMPLES=no ;;
140 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
143 [BUILD_EXAMPLES=yes]) dnl Default value
144 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
146 dnl poison destroyed objects
147 AC_ARG_ENABLE(poisoning,
148 AC_HELP_STRING([--enable-poisoning],
149 [enable poisoning of deallocated objects]),
151 case "${enableval}" in
152 yes) USE_POISONING=yes ;;
153 no) USE_POISONING=no ;;
154 *) AC_MSG_ERROR(bad value ${enableval} for --enable-poisoning) ;;
157 [USE_POISONING=no]) dnl Default value
158 if test "x$USE_POISONING" = xyes; then
159 AC_DEFINE(USE_POISONING, 1,
160 [Define if we should poison deallocated memory])
163 dnl *** platform checks ***
165 dnl * hardware/architecture *
167 dnl common/m4/gst-arch.m4
171 dnl common/m4/gst-arch.m4
172 dnl check for unaligned access
174 dnl create a configure variable for gst/gstconfig.h
175 if test x${as_cv_unaligned_access} = xyes ; then
176 GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 1"
178 GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 0"
180 AC_SUBST(GST_HAVE_UNALIGNED_ACCESS_DEFINE)
185 dnl check for large file support
186 dnl affected plugins must include config.h
189 dnl HAVE_WIN32 currently means "disable POSIXisms".
192 AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
198 dnl *** checks for programs ***
203 dnl find an assembler
206 dnl we use awk in the bison version check
209 dnl we require bison for building the parser
210 dnl FIXME: check if AC_PROG_YACC is suitable here
211 dnl FIXME: make precious
212 AC_PATH_PROG(BISON_PATH, bison, no)
213 if test x$BISON_PATH = xno; then
214 AC_MSG_ERROR(Could not find bison)
217 dnl check bison version
218 AC_MSG_CHECKING([bison version])
220 if $BISON_PATH --version | head -n 1 | $AWK '{ if ($4 < 1.35) exit 1; else exit 0;}';
224 AC_MSG_RESULT([too old.])
225 AC_MSG_ERROR([Your bison version is too old, v1.35 or later is required.])
228 dnl we require flex for building the parser
229 dnl FIXME: check if AC_PROG_LEX is suitable here
230 AC_PATH_PROG(FLEX_PATH, flex, no)
231 if test x$FLEX_PATH = xno; then
232 AC_MSG_ERROR(Could not find flex)
235 dnl Perl is used in building documentation
236 AC_PATH_PROG(PERL_PATH, perl, no)
237 if test x$PERL_PATH = xno; then
238 AC_MSG_ERROR(Could not find perl)
241 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
242 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
244 dnl check for documentation tools
248 dnl *** checks for libraries ***
250 dnl For interactive UNIX (a Sun thing)
251 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
254 dnl *** checks for header files ***
256 dnl check if we have ANSI C header files
259 dnl Check for ucontext.h
260 AC_CHECK_HEADERS([ucontext.h])
261 AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
262 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
264 dnl *** checks for library functions ***
266 AC_CHECK_FUNCS([sigaction])
268 dnl check for fseeko()
270 dnl check for ftello()
271 AC_CHECK_FUNCS([ftello])
273 AC_CHECK_FUNCS([fgetpos])
274 AC_CHECK_FUNCS([fsetpos])
278 AM_CONDITIONAL(HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")
280 dnl common/m4/gst-mcsc.m4
281 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
283 if test "$ac_cv_check_mcsc" = "yes"; then
284 AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, 1,
285 [defined if we have makecontext ()])
288 dnl Check for a way to display the function name in debug output
291 dnl test for register_printf_function
292 AC_CHECK_FUNC(register_printf_function,
294 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"P\""
295 AC_DEFINE(HAVE_PRINTF_EXTENSION, 1,
296 [Defined if we have register_printf_function ()])
298 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"p\""
300 AC_SUBST(GST_PRINTF_EXTENSION_FORMAT_DEFINE)
302 dnl test if we have dladdr(); we use it for debugging; see gst/gstinfo.c
303 save_cflags="$CFLAGS"
304 CFLAGS="$CFLAGS -D_GNU_SOURCE"
305 AC_CHECK_LIB(dl, dladdr,
306 AC_DEFINE(HAVE_DLADDR, 1,
307 [Defined if we have dladdr ()]))
308 CFLAGS="$save_cflags"
310 dnl *** checks for compiler characteristics ***
312 dnl make sure we can use "inline" from C code
315 dnl *** TODO: decide where to put ***
318 GST_GETTEXT([gstreamer-$GST_MAJORMINOR])
320 dnl define an ERROR_CFLAGS Makefile variable
321 GST_SET_ERROR_CFLAGS($GST_CVS)
323 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
324 dnl messages printed when running cvs builds
325 if test "x$GST_CVS" = "xyes"; then
326 GST_LEVEL_DEFAULT=GST_LEVEL_ERROR
328 GST_LEVEL_DEFAULT=GST_LEVEL_NONE
330 AC_DEFINE_UNQUOTED(GST_LEVEL_DEFAULT, $GST_LEVEL_DEFAULT,
331 [Default errorlevel to use])
332 AC_SUBST(GST_LEVEL_DEFAULT)
334 dnl *** checks for dependency libraries ***
338 dnl Minimum required version of GLib
342 dnl Check for glib2 with sugar on top
343 PKG_CHECK_MODULES(GLIB,
344 glib-2.0 >= $GLIB_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
348 if test "x$HAVE_GLIB" = "xno"; then
349 AC_MSG_ERROR([GStreamer requires GLib >= $GLIB_REQ to compile.])
352 dnl for the poor souls who for example have glib in /usr/local
353 AS_SCRUB_INCLUDE(GLIB_CFLAGS)
355 dnl GLib 2.8 has some bug fixes that we like, so make sure our code knows
356 AC_MSG_CHECKING([glib version >= 2.8])
357 if pkg-config --atleast-version=2.8 glib-2.0; then
359 GST_HAVE_GLIB_2_8_DEFINE="#define GST_HAVE_GLIB_2_8 1"
362 GST_HAVE_GLIB_2_8_DEFINE="/* #undef GST_HAVE_GLIB_2_8 */"
364 AC_SUBST(GST_HAVE_GLIB_2_8_DEFINE)
366 dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
367 PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB_REQ)
369 dnl libxml 2, which is/should be optional (FIXME)
370 if test "x$GST_DISABLE_LOADSAVE" = "xyes" && \
371 test "x$GST_DISABLE_REGISTRY" = "xyes"
373 AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
375 dnl check for libxml2 with minimum req version
376 GST_LIBXML2_CHECK(2.4.9)
379 dnl check for "check", unit testing library/header
383 AC_MSG_NOTICE(CHECK_CFLAGS: $CHECK_CFLAGS)
384 AC_MSG_NOTICE(CHECK_LIBS: $CHECK_LIBS)
387 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
390 dnl Check for some compiler flags that optimize our code.
391 if test "x$GCC" = xyes; then
392 AS_COMPILER_FLAG(-fno-common, OPT_CFLAGS="$OPT_CFLAGS -fno-common")
395 dnl FIXME: decide what kind of flag this is, maybe it's not an optimization
397 dnl check if we should use -Wa,-mregnames on PowerPC, so we can use
398 dnl symbolic register names in inline asm
399 if test x$HAVE_CPU_PPC = xyes ; then
400 AS_COMPILER_FLAG(["-Wa,-mregnames"],
401 [OPT_CFLAGS="$OPT_CFLAGS -Wa,-mregnames"])
404 dnl *** FIXME: name this part
406 dnl set license and copyright notice
408 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
409 AC_SUBST(GST_LICENSE)
411 dnl define LIBDIR so we can inform people where we live
412 AS_AC_EXPAND(LIBDIR, $libdir)
413 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
415 dnl set location of plugin directory
416 AS_AC_EXPAND(PLUGINS_DIR, ${libdir}/gstreamer-$GST_MAJORMINOR)
417 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
418 AC_SUBST(PLUGINS_DIR)
419 AC_MSG_NOTICE([Using $PLUGINS_DIR as the plugin install location])
421 dnl plugin directory configure-time variable for use in Makefile.am
422 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
425 dnl FIXME: add LIBXML_PKG here
426 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
427 AC_SUBST(GST_PKG_DEPS)
429 dnl *** finalize CFLAGS, LDFLAGS, LIBS
432 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
433 dnl GST_ALL_*: flags shared by all built objects
434 dnl GST_OBJ_*: additional flags to link to the core library
435 dnl include GST_ALL_*
436 dnl GST_LT_LDFLAGS: library versioning of our libraries
437 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
439 dnl GST_OPTION_CFLAGS
440 if test "x$USE_DEBUG" = xyes; then
443 AC_SUBST(PROFILE_CFLAGS)
445 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
446 AC_SUBST(DEPRECATED_CFLAGS)
448 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
449 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
450 AC_SUBST(GST_OPTION_CFLAGS)
453 dnl vars common to for all internal objects (core libs, elements, applications)
455 dnl - XML needs to be added because xmlPtr is used in core
456 dnl - src and build dirs need to be added because every piece that gets built
457 dnl will need the GStreamer source and generated headers
458 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
460 GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir) $GLIB_CFLAGS $XML_CFLAGS \$(GST_OPTION_CFLAGS)"
461 dnl FIXME: check if LTLIBINTL is needed everywhere
462 dnl I presume it is given that it contains the symbols that _() stuff maps to
463 GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL"
464 dnl LDFLAGS modifier defining exported symbols from built shared objects
465 EXPORT_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
466 GST_ALL_LDFLAGS="$EXPORT_LDFLAGS -no-undefined"
467 AC_SUBST(GST_ALL_CFLAGS)
468 AC_SUBST(GST_ALL_LIBS)
469 AC_SUBST(GST_ALL_LDFLAGS)
472 dnl default vars for all internal objects built on libgstreamer
473 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
474 GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la \$(GST_ALL_LIBS)"
475 GST_OBJ_LDFLAGS="$GST_LT_LDFLAGS $GST_ALL_LDFLAGS"
476 AC_SUBST(GST_OBJ_CFLAGS)
477 AC_SUBST(GST_OBJ_LIBS)
478 AC_SUBST(GST_OBJ_LDFLAGS)
480 dnl GST_PLUGIN_LDFLAGS
481 dnl LDFLAGS for plugins; include GST_ALL_LDFLAGS
482 GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
483 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
485 dnl ##################################################
486 dnl # deps for examples from manual #
487 dnl ##################################################
489 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
490 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
491 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
493 dnl ##################################################
494 dnl # Prepare informative messages to display at end #
495 dnl ##################################################
499 dnl *** output files ***
501 dnl libs/ext/Makefile
502 dnl nothing there yet !
510 gst/indexers/Makefile
511 gst/elements/Makefile
515 libs/gst/controller/Makefile
516 libs/gst/dataprotocol/Makefile
520 tests/instantiate/Makefile
521 tests/muxing/Makefile
522 tests/seeking/Makefile
524 tests/threadstate/Makefile
526 testsuite/caps/Makefile
527 testsuite/debug/Makefile
528 testsuite/dlopen/Makefile
529 testsuite/elements/Makefile
530 testsuite/indexers/Makefile
531 testsuite/parse/Makefile
532 testsuite/plugin/Makefile
533 testsuite/refcounting/Makefile
534 testsuite/states/Makefile
535 testsuite/threads/Makefile
536 testsuite/trigger/Makefile
538 examples/controller/Makefile
539 examples/cutter/Makefile
540 examples/helloworld/Makefile
541 examples/launch/Makefile
542 examples/manual/Makefile
543 examples/mixer/Makefile
544 examples/metadata/Makefile
545 examples/pingpong/Makefile
546 examples/plugins/Makefile
547 examples/pwg/Makefile
548 examples/queue/Makefile
549 examples/retag/Makefile
550 examples/thread/Makefile
551 examples/typefind/Makefile
552 examples/xml/Makefile
563 docs/version.entities
564 win32/common/config.h
567 pkgconfig/gstreamer.pc
568 pkgconfig/gstreamer-uninstalled.pc
569 pkgconfig/gstreamer-base.pc
570 pkgconfig/gstreamer-base-uninstalled.pc
571 pkgconfig/gstreamer-check.pc
572 pkgconfig/gstreamer-check-uninstalled.pc
573 pkgconfig/gstreamer-controller.pc
574 pkgconfig/gstreamer-controller-uninstalled.pc
575 pkgconfig/gstreamer-dataprotocol.pc
576 pkgconfig/gstreamer-dataprotocol-uninstalled.pc
579 AC_CONFIG_COMMANDS(echo "$infomessages", infomessages="$infomessages")