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, 6, 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 sets host_* variables
24 dnl initialize automake
25 dnl FIXME: this is deprecated use, we should move PACKAGE and VERSION to
26 dnl AC_INIT, but then we need to parse the version to pass to AS_VERSION
27 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
29 dnl our libraries and install dirs use major.minor as a version
30 GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
31 dnl we override it here for release candidates for a new series
33 AC_SUBST(GST_MAJORMINOR)
35 dnl CURRENT, REVISION, AGE
36 dnl - library source changed -> increment REVISION
37 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
38 dnl - interfaces added -> increment AGE
39 dnl - interfaces removed -> AGE = 0
40 dnl sets GST_LT_LDFLAGS
41 AS_LIBTOOL(GST, 8, 0, 0)
45 dnl *** autotools stuff ****
47 dnl allow for different autotools
48 AS_AUTOTOOLS_ALTERNATE
50 dnl Add parameters for aclocal
51 AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4")
54 dnl the version check needs to stay here because autopoint greps for it
55 AM_GNU_GETTEXT_VERSION([0.11.5])
56 AM_GNU_GETTEXT([external])
57 GST_GETTEXT([gstreamer-$GST_MAJORMINOR])
59 dnl *** check for arguments to configure ***
61 dnl subsystems - can influence other decisions so needs to be high up
62 dnl we need to AM_CONDITIONAL them here for automake 1.6.x compatibility
63 GST_CHECK_SUBSYSTEM_DISABLE(GST_DEBUG,[debugging subsystem])
64 AM_CONDITIONAL(GST_DISABLE_GST_DEBUG, test "x$GST_GST_DISABLE_DEBUG" = "xyes")
65 GST_CHECK_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
66 AM_CONDITIONAL(GST_DISABLE_LOADSAVE, test "x$GST_DISABLE_LOADSAVE" = "xyes")
67 GST_CHECK_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
68 AM_CONDITIONAL(GST_DISABLE_PARSE, test "x$GST_DISABLE_PARSE" = "xyes")
69 GST_CHECK_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
70 AM_CONDITIONAL(GST_DISABLE_TRACE, test "x$GST_DISABLE_TRACE" = "xyes")
71 GST_CHECK_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
72 AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, test "x$GST_DISABLE_ALLOC_TRACE" = "xyes")
73 GST_CHECK_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
74 AM_CONDITIONAL(GST_DISABLE_REGISTRY, test "x$GST_DISABLE_REGISTRY" = "xyes")
75 GST_CHECK_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
76 AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, test "x$GST_DISABLE_ENUMTYPES" = "xyes")
77 GST_CHECK_SUBSYSTEM_DISABLE(INDEX,[index])
78 AM_CONDITIONAL(GST_DISABLE_INDEX, test "x$GST_DISABLE_INDEX" = "xyes")
79 GST_CHECK_SUBSYSTEM_DISABLE(NET,[network distribution])
80 AM_CONDITIONAL(GST_DISABLE_NET, test "x$GST_DISABLE_NET" = "xyes")
81 GST_CHECK_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
82 AM_CONDITIONAL(GST_DISABLE_PLUGIN, test "x$GST_DISABLE_PLUGIN" = "xyes")
83 GST_CHECK_SUBSYSTEM_DISABLE(URI,[uri handlers])
84 AM_CONDITIONAL(GST_DISABLE_URI, test "x$GST_DISABLE_URI" = "xyes")
93 GST_ARG_WITH_PKG_CONFIG_PATH
94 GST_ARG_WITH_PACKAGE_NAME([GStreamer])
95 GST_ARG_WITH_PACKAGE_ORIGIN
97 dnl use a cache dir for storing element registry info.
98 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
100 AC_ARG_WITH(cachedir,
101 AC_HELP_STRING([--with-cachedir],
102 [specify path to use for plugin and command completion registries]),
105 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
106 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
107 *) GST_CACHE_DIR="${withval}" ;;
110 [:]) dnl Default value
112 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
113 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Location of registry])
114 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
116 dnl building of tests
118 AC_HELP_STRING([--disable-tests], [disable building test apps]),
120 case "${enableval}" in
121 yes) BUILD_TESTS=yes ;;
122 no) BUILD_TESTS=no ;;
123 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
126 [BUILD_TESTS=yes]) dnl Default value
127 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
129 dnl tests known to fail
130 AC_ARG_ENABLE(failing-tests,
131 AC_HELP_STRING([--disable-failing-tests],
132 [disable building tests known to fail]),
134 case "${enableval}" in
135 yes) BUILD_FAILING_TESTS=yes ;;
136 no) BUILD_FAILING_TESTS=no ;;
137 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
140 [BUILD_FAILING_TESTS=no]) dnl Default value
141 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
142 if test x$BUILD_FAILING_TESTS = xyes; then
143 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
145 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.])
148 dnl poison destroyed objects
149 AC_ARG_ENABLE(poisoning,
150 AC_HELP_STRING([--enable-poisoning],
151 [enable poisoning of deallocated objects]),
153 case "${enableval}" in
154 yes) USE_POISONING=yes ;;
155 no) USE_POISONING=no ;;
156 *) AC_MSG_ERROR(bad value ${enableval} for --enable-poisoning) ;;
159 [USE_POISONING=no]) dnl Default value
160 if test "x$USE_POISONING" = xyes; then
161 AC_DEFINE(USE_POISONING, 1,
162 [Define if we should poison deallocated memory])
165 dnl *** checks for platform ***
167 dnl * hardware/architecture *
169 dnl common/m4/gst-arch.m4
173 dnl common/m4/gst-arch.m4
174 dnl check for unaligned access
176 dnl create a configure variable for gst/gstconfig.h
177 if test x${as_cv_unaligned_access} = xyes ; then
178 GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 1"
180 GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 0"
182 AC_SUBST(GST_HAVE_UNALIGNED_ACCESS_DEFINE)
186 dnl check for large file support
187 dnl affected plugins must include config.h
190 dnl HAVE_WIN32 currently means "disable POSIXisms".
193 AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
199 dnl *** checks for programs ***
204 dnl find an assembler
207 dnl we use awk in the bison version check
210 dnl we require bison for building the parser
211 dnl FIXME: check if AC_PROG_YACC is suitable here
212 dnl FIXME: make precious
213 AC_PATH_PROG(BISON_PATH, bison, no)
214 if test x$BISON_PATH = xno; then
215 AC_MSG_ERROR(Could not find bison)
218 dnl check bison version
219 AC_MSG_CHECKING([bison version])
221 if $BISON_PATH --version | head -n 1 | $AWK '{ if ($4 < 1.35) exit 1; else exit 0;}';
225 AC_MSG_RESULT([too old.])
226 AC_MSG_ERROR([Your bison version is too old, v1.35 or later is required.])
229 dnl we require flex for building the parser
230 dnl FIXME: check if AC_PROG_LEX is suitable here
231 AC_PATH_PROG(FLEX_PATH, flex, no)
232 if test x$FLEX_PATH = xno; then
233 AC_MSG_ERROR(Could not find flex)
236 dnl Perl is used in building documentation
237 AC_PATH_PROG(PERL_PATH, perl, no)
238 if test x$PERL_PATH = xno; then
239 AC_MSG_ERROR(Could not find perl)
242 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
243 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
245 dnl check for documentation tools
249 dnl *** checks for libraries ***
251 dnl For interactive UNIX (a Sun thing)
252 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
255 dnl *** checks for header files ***
257 dnl check if we have ANSI C header files
260 dnl Check for ucontext.h
261 AC_CHECK_HEADERS([ucontext.h])
262 AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
263 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
264 AC_CHECK_HEADERS([process.h])
266 dnl *** checks for types/defines ***
268 dnl *** checks for structures ***
270 dnl *** checks for compiler characteristics ***
272 dnl make sure we can use "inline" from C code
276 dnl Check for some compiler flags that optimize our code.
277 if test "x$GCC" = xyes; then
278 AS_COMPILER_FLAG(-fno-common, OPT_CFLAGS="$OPT_CFLAGS -fno-common")
281 dnl FIXME: decide what kind of flag this is, maybe it's not an optimization
283 dnl check if we should use -Wa,-mregnames on PowerPC, so we can use
284 dnl symbolic register names in inline asm
285 if test x$HAVE_CPU_PPC = xyes ; then
286 AS_COMPILER_FLAG(["-Wa,-mregnames"],
287 [OPT_CFLAGS="$OPT_CFLAGS -Wa,-mregnames"])
290 dnl *** checks for library functions ***
292 AC_CHECK_FUNCS([sigaction])
294 dnl check for fseeko()
296 dnl check for ftello()
297 AC_CHECK_FUNCS([ftello])
299 AC_CHECK_FUNCS([fgetpos])
300 AC_CHECK_FUNCS([fsetpos])
304 AM_CONDITIONAL(HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")
306 dnl common/m4/gst-mcsc.m4
307 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
309 if test "$ac_cv_check_mcsc" = "yes"; then
310 AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, 1,
311 [defined if we have makecontext ()])
314 dnl Check for a way to display the function name in debug output
317 dnl test for register_printf_function
318 AC_CHECK_FUNC(register_printf_function,
320 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"P\""
321 AC_DEFINE(HAVE_PRINTF_EXTENSION, 1,
322 [Defined if we have register_printf_function ()])
324 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"p\""
326 AC_SUBST(GST_PRINTF_EXTENSION_FORMAT_DEFINE)
328 dnl test if we have dladdr(); we use it for debugging; see gst/gstinfo.c
329 save_cflags="$CFLAGS"
330 CFLAGS="$CFLAGS -D_GNU_SOURCE"
331 AC_CHECK_LIB(dl, dladdr,
332 AC_DEFINE(HAVE_DLADDR, 1,
333 [Defined if we have dladdr ()]))
334 CFLAGS="$save_cflags"
336 dnl *** checks for dependancy libraries ***
340 GST_GLIB_CHECK([2.6])
342 dnl GLib 2.8 has some bug fixes that we like, so make sure our code knows
343 AC_MSG_CHECKING([glib version >= 2.8])
344 if pkg-config --atleast-version=2.8 glib-2.0; then
346 GST_HAVE_GLIB_2_8_DEFINE="#define GST_HAVE_GLIB_2_8 1"
349 GST_HAVE_GLIB_2_8_DEFINE="/* #undef GST_HAVE_GLIB_2_8 */"
351 AC_SUBST(GST_HAVE_GLIB_2_8_DEFINE)
353 dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
354 PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB_REQ)
356 dnl libxml 2, which is/should be optional (FIXME)
357 if test "x$GST_DISABLE_LOADSAVE" = "xyes" && \
358 test "x$GST_DISABLE_REGISTRY" = "xyes"
360 AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
362 dnl check for libxml2 with minimum req version
363 GST_LIBXML2_CHECK(2.4.9)
366 dnl check for "check", unit testing library/header
370 AC_MSG_NOTICE(CHECK_CFLAGS: $CHECK_CFLAGS)
371 AC_MSG_NOTICE(CHECK_LIBS: $CHECK_LIBS)
374 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
376 dnl *** set variables based on configure arguments
378 dnl set license and copyright notice
380 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
381 AC_SUBST(GST_LICENSE)
383 dnl define LIBDIR so we can inform people where we live
384 AS_AC_EXPAND(LIBDIR, $libdir)
385 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
387 dnl set location of plugin directory
390 dnl FIXME: add LIBXML_PKG here
391 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-no-export-2.0, gthread-2.0"
392 AC_SUBST(GST_PKG_DEPS)
394 dnl define an ERROR_CFLAGS Makefile variable
395 GST_SET_ERROR_CFLAGS($GST_CVS)
397 dnl define correct level for debugging messages
398 GST_SET_LEVEL_DEFAULT($GST_CVS)
400 dnl *** finalize CFLAGS, LDFLAGS, LIBS
403 dnl GST_OPTION_CFLAGS: common cflags for profiling, debugging, errors, ...
404 dnl GST_ALL_*: vars shared by all built objects
405 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
406 dnl GST_OBJ_*: additional vars to link to the core library
407 dnl include GST_ALL_*
408 dnl GST_LT_LDFLAGS: library versioning of our libraries
409 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
411 dnl GST_OPTION_CFLAGS
412 if test "x$USE_DEBUG" = xyes; then
415 AC_SUBST(PROFILE_CFLAGS)
417 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
418 AC_SUBST(DEPRECATED_CFLAGS)
420 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
421 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
422 AC_SUBST(GST_OPTION_CFLAGS)
425 dnl vars common to for all internal objects (core libs, elements, applications)
427 dnl - XML needs to be added because xmlPtr is used in core
428 dnl - src and build dirs need to be added because every piece that gets built
429 dnl will need the GStreamer source and generated headers
430 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
431 dnl from LibXML except for in the core library
432 GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir) $GLIB_CFLAGS $XML_CFLAGS \$(GST_OPTION_CFLAGS)"
433 dnl FIXME: check if LTLIBINTL is needed everywhere
434 dnl I presume it is given that it contains the symbols that _() stuff maps to
435 GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL"
436 dnl LDFLAGS really should only contain flags, not libs - they get added before
437 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
438 GST_ALL_LDFLAGS="-no-undefined"
440 AC_SUBST(GST_ALL_CFLAGS)
441 AC_SUBST(GST_ALL_LIBS)
442 AC_SUBST(GST_ALL_LDFLAGS)
445 dnl linker flags shared by all libraries
446 dnl LDFLAGS modifier defining exported symbols from built libraries
447 GST_LIB_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
448 AC_SUBST(GST_LIB_LDFLAGS)
451 dnl default vars for all internal objects built on libgstreamer
452 dnl includes GST_ALL_*
453 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
454 GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la \$(GST_ALL_LIBS)"
455 AC_SUBST(GST_OBJ_CFLAGS)
456 AC_SUBST(GST_OBJ_LIBS)
458 dnl GST_PLUGIN_LDFLAGS
459 dnl LDFLAGS for plugins; includes GST_ALL_LDFLAGS
460 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
461 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
463 dnl ##################################################
464 dnl # deps for examples from manual #
465 dnl ##################################################
467 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
468 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
469 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
479 libs/gst/base/Makefile
480 libs/gst/check/Makefile
481 libs/gst/controller/Makefile
482 libs/gst/dataprotocol/Makefile
483 libs/gst/net/Makefile
485 plugins/indexers/Makefile
486 plugins/elements/Makefile
491 testsuite/caps/Makefile
492 testsuite/debug/Makefile
493 testsuite/dlopen/Makefile
494 testsuite/elements/Makefile
495 testsuite/indexers/Makefile
496 testsuite/parse/Makefile
497 testsuite/plugin/Makefile
498 testsuite/refcounting/Makefile
499 testsuite/states/Makefile
500 testsuite/threads/Makefile
502 examples/controller/Makefile
503 examples/cutter/Makefile
504 examples/helloworld/Makefile
505 examples/launch/Makefile
506 examples/manual/Makefile
507 examples/mixer/Makefile
508 examples/metadata/Makefile
509 examples/pingpong/Makefile
510 examples/plugins/Makefile
511 examples/pwg/Makefile
512 examples/queue/Makefile
513 examples/retag/Makefile
514 examples/thread/Makefile
515 examples/typefind/Makefile
516 examples/xml/Makefile
527 docs/version.entities
528 win32/common/config.h
531 pkgconfig/gstreamer.pc
532 pkgconfig/gstreamer-uninstalled.pc
533 pkgconfig/gstreamer-base.pc
534 pkgconfig/gstreamer-base-uninstalled.pc
535 pkgconfig/gstreamer-check.pc
536 pkgconfig/gstreamer-check-uninstalled.pc
537 pkgconfig/gstreamer-controller.pc
538 pkgconfig/gstreamer-controller-uninstalled.pc
539 pkgconfig/gstreamer-dataprotocol.pc
540 pkgconfig/gstreamer-dataprotocol-uninstalled.pc
541 pkgconfig/gstreamer-net.pc
542 pkgconfig/gstreamer-net-uninstalled.pc