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")
263 AC_CHECK_HEADERS([process.h])
265 dnl *** checks for library functions ***
267 AC_CHECK_FUNCS([sigaction])
269 dnl check for fseeko()
271 dnl check for ftello()
272 AC_CHECK_FUNCS([ftello])
274 AC_CHECK_FUNCS([fgetpos])
275 AC_CHECK_FUNCS([fsetpos])
279 AM_CONDITIONAL(HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")
281 dnl common/m4/gst-mcsc.m4
282 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
284 if test "$ac_cv_check_mcsc" = "yes"; then
285 AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, 1,
286 [defined if we have makecontext ()])
289 dnl Check for a way to display the function name in debug output
292 dnl test for register_printf_function
293 AC_CHECK_FUNC(register_printf_function,
295 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"P\""
296 AC_DEFINE(HAVE_PRINTF_EXTENSION, 1,
297 [Defined if we have register_printf_function ()])
299 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"p\""
301 AC_SUBST(GST_PRINTF_EXTENSION_FORMAT_DEFINE)
303 dnl test if we have dladdr(); we use it for debugging; see gst/gstinfo.c
304 save_cflags="$CFLAGS"
305 CFLAGS="$CFLAGS -D_GNU_SOURCE"
306 AC_CHECK_LIB(dl, dladdr,
307 AC_DEFINE(HAVE_DLADDR, 1,
308 [Defined if we have dladdr ()]))
309 CFLAGS="$save_cflags"
311 dnl *** checks for compiler characteristics ***
313 dnl make sure we can use "inline" from C code
316 dnl *** TODO: decide where to put ***
319 GST_GETTEXT([gstreamer-$GST_MAJORMINOR])
321 dnl define an ERROR_CFLAGS Makefile variable
322 GST_SET_ERROR_CFLAGS($GST_CVS)
324 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
325 dnl messages printed when running cvs builds
326 if test "x$GST_CVS" = "xyes"; then
327 GST_LEVEL_DEFAULT=GST_LEVEL_ERROR
329 GST_LEVEL_DEFAULT=GST_LEVEL_NONE
331 AC_DEFINE_UNQUOTED(GST_LEVEL_DEFAULT, $GST_LEVEL_DEFAULT,
332 [Default errorlevel to use])
333 AC_SUBST(GST_LEVEL_DEFAULT)
335 dnl *** checks for dependency libraries ***
339 dnl Minimum required version of GLib
343 dnl Check for glib2 with sugar on top
344 PKG_CHECK_MODULES(GLIB,
345 glib-2.0 >= $GLIB_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
349 if test "x$HAVE_GLIB" = "xno"; then
350 AC_MSG_ERROR([GStreamer requires GLib >= $GLIB_REQ to compile.])
353 dnl for the poor souls who for example have glib in /usr/local
354 AS_SCRUB_INCLUDE(GLIB_CFLAGS)
356 dnl GLib 2.8 has some bug fixes that we like, so make sure our code knows
357 AC_MSG_CHECKING([glib version >= 2.8])
358 if pkg-config --atleast-version=2.8 glib-2.0; then
360 GST_HAVE_GLIB_2_8_DEFINE="#define GST_HAVE_GLIB_2_8 1"
363 GST_HAVE_GLIB_2_8_DEFINE="/* #undef GST_HAVE_GLIB_2_8 */"
365 AC_SUBST(GST_HAVE_GLIB_2_8_DEFINE)
367 dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
368 PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB_REQ)
370 dnl libxml 2, which is/should be optional (FIXME)
371 if test "x$GST_DISABLE_LOADSAVE" = "xyes" && \
372 test "x$GST_DISABLE_REGISTRY" = "xyes"
374 AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
376 dnl check for libxml2 with minimum req version
377 GST_LIBXML2_CHECK(2.4.9)
380 dnl check for "check", unit testing library/header
384 AC_MSG_NOTICE(CHECK_CFLAGS: $CHECK_CFLAGS)
385 AC_MSG_NOTICE(CHECK_LIBS: $CHECK_LIBS)
388 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
391 dnl Check for some compiler flags that optimize our code.
392 if test "x$GCC" = xyes; then
393 AS_COMPILER_FLAG(-fno-common, OPT_CFLAGS="$OPT_CFLAGS -fno-common")
396 dnl FIXME: decide what kind of flag this is, maybe it's not an optimization
398 dnl check if we should use -Wa,-mregnames on PowerPC, so we can use
399 dnl symbolic register names in inline asm
400 if test x$HAVE_CPU_PPC = xyes ; then
401 AS_COMPILER_FLAG(["-Wa,-mregnames"],
402 [OPT_CFLAGS="$OPT_CFLAGS -Wa,-mregnames"])
405 dnl *** FIXME: name this part
407 dnl set license and copyright notice
409 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
410 AC_SUBST(GST_LICENSE)
412 dnl define LIBDIR so we can inform people where we live
413 AS_AC_EXPAND(LIBDIR, $libdir)
414 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
416 dnl set location of plugin directory
417 AS_AC_EXPAND(PLUGINS_DIR, ${libdir}/gstreamer-$GST_MAJORMINOR)
418 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
419 AC_SUBST(PLUGINS_DIR)
420 AC_MSG_NOTICE([Using $PLUGINS_DIR as the plugin install location])
422 dnl plugin directory configure-time variable for use in Makefile.am
423 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
426 dnl FIXME: add LIBXML_PKG here
427 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
428 AC_SUBST(GST_PKG_DEPS)
430 dnl *** finalize CFLAGS, LDFLAGS, LIBS
433 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
434 dnl GST_ALL_*: flags shared by all built objects
435 dnl GST_OBJ_*: additional flags to link to the core library
436 dnl include GST_ALL_*
437 dnl GST_LT_LDFLAGS: library versioning of our libraries
438 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
440 dnl GST_OPTION_CFLAGS
441 if test "x$USE_DEBUG" = xyes; then
444 AC_SUBST(PROFILE_CFLAGS)
446 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
447 AC_SUBST(DEPRECATED_CFLAGS)
449 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
450 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
451 AC_SUBST(GST_OPTION_CFLAGS)
454 dnl vars common to for all internal objects (core libs, elements, applications)
456 dnl - XML needs to be added because xmlPtr is used in core
457 dnl - src and build dirs need to be added because every piece that gets built
458 dnl will need the GStreamer source and generated headers
459 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
461 GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir) $GLIB_CFLAGS $XML_CFLAGS \$(GST_OPTION_CFLAGS)"
462 dnl FIXME: check if LTLIBINTL is needed everywhere
463 dnl I presume it is given that it contains the symbols that _() stuff maps to
464 GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL"
465 dnl LDFLAGS modifier defining exported symbols from built shared objects
466 EXPORT_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
467 GST_ALL_LDFLAGS="$EXPORT_LDFLAGS -no-undefined"
468 AC_SUBST(GST_ALL_CFLAGS)
469 AC_SUBST(GST_ALL_LIBS)
470 AC_SUBST(GST_ALL_LDFLAGS)
473 dnl default vars for all internal objects built on libgstreamer
474 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
475 GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la \$(GST_ALL_LIBS)"
476 GST_OBJ_LDFLAGS="$GST_LT_LDFLAGS $GST_ALL_LDFLAGS"
477 AC_SUBST(GST_OBJ_CFLAGS)
478 AC_SUBST(GST_OBJ_LIBS)
479 AC_SUBST(GST_OBJ_LDFLAGS)
481 dnl GST_PLUGIN_LDFLAGS
482 dnl LDFLAGS for plugins; include GST_ALL_LDFLAGS
483 GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
484 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
486 dnl ##################################################
487 dnl # deps for examples from manual #
488 dnl ##################################################
490 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
491 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
492 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
494 dnl ##################################################
495 dnl # Prepare informative messages to display at end #
496 dnl ##################################################
500 dnl *** output files ***
502 dnl libs/ext/Makefile
503 dnl nothing there yet !
511 gst/indexers/Makefile
512 gst/elements/Makefile
516 libs/gst/controller/Makefile
517 libs/gst/dataprotocol/Makefile
521 tests/instantiate/Makefile
522 tests/muxing/Makefile
523 tests/seeking/Makefile
525 tests/threadstate/Makefile
527 testsuite/caps/Makefile
528 testsuite/debug/Makefile
529 testsuite/dlopen/Makefile
530 testsuite/elements/Makefile
531 testsuite/indexers/Makefile
532 testsuite/parse/Makefile
533 testsuite/plugin/Makefile
534 testsuite/refcounting/Makefile
535 testsuite/states/Makefile
536 testsuite/threads/Makefile
537 testsuite/trigger/Makefile
539 examples/controller/Makefile
540 examples/cutter/Makefile
541 examples/helloworld/Makefile
542 examples/launch/Makefile
543 examples/manual/Makefile
544 examples/mixer/Makefile
545 examples/metadata/Makefile
546 examples/pingpong/Makefile
547 examples/plugins/Makefile
548 examples/pwg/Makefile
549 examples/queue/Makefile
550 examples/retag/Makefile
551 examples/thread/Makefile
552 examples/typefind/Makefile
553 examples/xml/Makefile
564 docs/version.entities
565 win32/common/config.h
568 pkgconfig/gstreamer.pc
569 pkgconfig/gstreamer-uninstalled.pc
570 pkgconfig/gstreamer-base.pc
571 pkgconfig/gstreamer-base-uninstalled.pc
572 pkgconfig/gstreamer-check.pc
573 pkgconfig/gstreamer-check-uninstalled.pc
574 pkgconfig/gstreamer-controller.pc
575 pkgconfig/gstreamer-controller-uninstalled.pc
576 pkgconfig/gstreamer-dataprotocol.pc
577 pkgconfig/gstreamer-dataprotocol-uninstalled.pc
580 AC_CONFIG_COMMANDS(echo "$infomessages", infomessages="$infomessages")