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 AM_GNU_GETTEXT_VERSION(0.11.5)
319 AM_GNU_GETTEXT([external])
321 GETTEXT_PACKAGE=gstreamer-$GST_MAJORMINOR
322 AC_SUBST(GETTEXT_PACKAGE)
323 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE",
324 [gettext package name])
326 dnl define LOCALEDIR in config.h
327 AS_AC_EXPAND(LOCALEDIR, $datadir/locale)
328 AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR",
329 [gettext locale dir])
331 dnl define LIBDIR so we can inform people where we live
332 AS_AC_EXPAND(LIBDIR, $libdir)
333 AC_DEFINE_UNQUOTED([LIBDIR], "$LIBDIR",
336 dnl define an ERROR_CFLAGS Makefile variable
337 GST_SET_ERROR_CFLAGS($GST_CVS)
339 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
340 dnl messages printed when running cvs builds
341 if test "x$GST_CVS" = "xyes"; then
342 AC_DEFINE(GST_LEVEL_DEFAULT, GST_LEVEL_ERROR, [Default errorlevel to use])
345 dnl *** checks for dependency libraries ***
349 dnl Minimum required version of GLib
353 dnl Check for glib2 with sugar on top
354 PKG_CHECK_MODULES(GLIB,
355 glib-2.0 >= $GLIB_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
359 if test "x$HAVE_GLIB" = "xno"; then
360 AC_MSG_ERROR([GStreamer requires GLib >= $GLIB_REQ to compile.])
363 dnl for the poor souls who for example have glib in /usr/local
364 AS_SCRUB_INCLUDE(GLIB_CFLAGS)
366 dnl GLib 2.8 has some bug fixes that we like, so make sure our code knows
367 AC_MSG_CHECKING([glib version >= 2.8])
368 if pkg-config --atleast-version=2.8 glib-2.0; then
370 GST_HAVE_GLIB_2_8_DEFINE="#define GST_HAVE_GLIB_2_8 1"
373 GST_HAVE_GLIB_2_8_DEFINE="/* #undef GST_HAVE_GLIB_2_8 */"
375 AC_SUBST(GST_HAVE_GLIB_2_8_DEFINE)
377 dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
378 PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB_REQ)
380 dnl libxml 2, which is/should be optional (FIXME)
381 if test "x$GST_DISABLE_LOADSAVE" = "xyes" && \
382 test "x$GST_DISABLE_REGISTRY" = "xyes"
384 AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
386 dnl check for libxml2 with minimum req version
387 GST_LIBXML2_CHECK(2.4.9)
390 dnl check for "check", unit testing library/header
394 AC_MSG_NOTICE(CHECK_CFLAGS: $CHECK_CFLAGS)
395 AC_MSG_NOTICE(CHECK_LIBS: $CHECK_LIBS)
398 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
401 dnl Check for some compiler flags that optimize our code.
402 if test "x$GCC" = xyes; then
403 AS_COMPILER_FLAG(-fno-common, OPT_CFLAGS="$OPT_CFLAGS -fno-common")
406 dnl FIXME: decide what kind of flag this is, maybe it's not an optimization
408 dnl check if we should use -Wa,-mregnames on PowerPC, so we can use
409 dnl symbolic register names in inline asm
410 if test x$HAVE_CPU_PPC = xyes ; then
411 AS_COMPILER_FLAG(["-Wa,-mregnames"],
412 [OPT_CFLAGS="$OPT_CFLAGS -Wa,-mregnames"])
415 dnl *** FIXME: name this part
417 dnl set license and copyright notice
418 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
420 dnl Set location of plugin directory
421 AS_AC_EXPAND(PLUGINS_DIR, ${libdir}/gstreamer-$GST_MAJORMINOR)
422 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
423 AC_SUBST(PLUGINS_DIR)
424 AC_MSG_NOTICE([Using $PLUGINS_DIR as the plugin install location])
426 dnl plugin directory configure-time variable for use in Makefile.am
427 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
430 dnl FIXME: add LIBXML_PKG here
431 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
432 AC_SUBST(GST_PKG_DEPS)
434 dnl *** finalize CFLAGS, LDFLAGS, LIBS
437 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
438 dnl GST_ALL_*: flags shared by all built objects
439 dnl GST_OBJ_*: additional flags to link to the core library
440 dnl include GST_ALL_*
441 dnl GST_LT_LDFLAGS: library versioning of our libraries
442 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
444 dnl GST_OPTION_CFLAGS
445 if test "x$USE_DEBUG" = xyes; then
448 AC_SUBST(PROFILE_CFLAGS)
450 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
451 AC_SUBST(DEPRECATED_CFLAGS)
453 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
454 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
455 AC_SUBST(GST_OPTION_CFLAGS)
458 dnl vars common to for all internal objects (core libs, elements, applications)
460 dnl - XML needs to be added because xmlPtr is used in core
461 dnl - src and build dirs need to be added because every piece that gets built
462 dnl will need the GStreamer source and generated headers
463 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
465 GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir) $GLIB_CFLAGS $XML_CFLAGS \$(GST_OPTION_CFLAGS)"
466 dnl FIXME: check if LTLIBINTL is needed everywhere
467 dnl I presume it is given that it contains the symbols that _() stuff maps to
468 GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL"
469 dnl LDFLAGS modifier defining exported symbols from built shared objects
470 EXPORT_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
471 GST_ALL_LDFLAGS="$EXPORT_LDFLAGS -no-undefined"
472 AC_SUBST(GST_ALL_CFLAGS)
473 AC_SUBST(GST_ALL_LIBS)
474 AC_SUBST(GST_ALL_LDFLAGS)
477 dnl default vars for all internal objects built on libgstreamer
478 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
479 GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la \$(GST_ALL_LIBS)"
480 GST_OBJ_LDFLAGS="$GST_LT_LDFLAGS $GST_ALL_LDFLAGS"
481 AC_SUBST(GST_OBJ_CFLAGS)
482 AC_SUBST(GST_OBJ_LIBS)
483 AC_SUBST(GST_OBJ_LDFLAGS)
485 dnl GST_PLUGIN_LDFLAGS
486 dnl LDFLAGS for plugins; include GST_ALL_LDFLAGS
487 GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
488 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
490 dnl ##################################################
491 dnl # deps for examples from manual #
492 dnl ##################################################
494 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
495 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
496 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
498 dnl ##################################################
499 dnl # Prepare informative messages to display at end #
500 dnl ##################################################
504 dnl *** output files ***
506 dnl libs/ext/Makefile
507 dnl nothing there yet !
515 gst/indexers/Makefile
516 gst/elements/Makefile
520 libs/gst/controller/Makefile
521 libs/gst/dataprotocol/Makefile
525 tests/instantiate/Makefile
526 tests/muxing/Makefile
527 tests/seeking/Makefile
529 tests/threadstate/Makefile
531 testsuite/caps/Makefile
532 testsuite/debug/Makefile
533 testsuite/dlopen/Makefile
534 testsuite/elements/Makefile
535 testsuite/indexers/Makefile
536 testsuite/parse/Makefile
537 testsuite/plugin/Makefile
538 testsuite/refcounting/Makefile
539 testsuite/states/Makefile
540 testsuite/threads/Makefile
541 testsuite/trigger/Makefile
543 examples/controller/Makefile
544 examples/cutter/Makefile
545 examples/helloworld/Makefile
546 examples/launch/Makefile
547 examples/manual/Makefile
548 examples/mixer/Makefile
549 examples/metadata/Makefile
550 examples/pingpong/Makefile
551 examples/plugins/Makefile
552 examples/pwg/Makefile
553 examples/queue/Makefile
554 examples/retag/Makefile
555 examples/thread/Makefile
556 examples/typefind/Makefile
557 examples/xml/Makefile
568 docs/version.entities
571 pkgconfig/gstreamer.pc
572 pkgconfig/gstreamer-uninstalled.pc
573 pkgconfig/gstreamer-base.pc
574 pkgconfig/gstreamer-base-uninstalled.pc
575 pkgconfig/gstreamer-check.pc
576 pkgconfig/gstreamer-check-uninstalled.pc
577 pkgconfig/gstreamer-controller.pc
578 pkgconfig/gstreamer-controller-uninstalled.pc
579 pkgconfig/gstreamer-dataprotocol.pc
580 pkgconfig/gstreamer-dataprotocol-uninstalled.pc
583 AC_CONFIG_COMMANDS(echo "$infomessages", infomessages="$infomessages")