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 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 AS_LIBTOOL(GST, 7, 0, 0)
44 dnl *** autotools stuff ****
46 dnl allow for different autotools
47 AS_AUTOTOOLS_ALTERNATE
49 dnl Add parameters for aclocal
50 AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4")
53 dnl the version check needs to stay here because autopoint greps for it
54 AM_GNU_GETTEXT_VERSION([0.11.5])
55 AM_GNU_GETTEXT([external])
56 GST_GETTEXT([gstreamer-$GST_MAJORMINOR])
58 dnl *** check for arguments to configure ***
60 dnl subsystems - can influence other decisions so needs to be high up
61 dnl we need to AM_CONDITIONAL them here for automake 1.6.x compatibility
62 GST_CHECK_SUBSYSTEM_DISABLE(GST_DEBUG,[debugging subsystem])
63 AM_CONDITIONAL(GST_DISABLE_GST_DEBUG, test "x$GST_GST_DISABLE_DEBUG" = "xyes")
64 GST_CHECK_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
65 AM_CONDITIONAL(GST_DISABLE_LOADSAVE, test "x$GST_DISABLE_LOADSAVE" = "xyes")
66 GST_CHECK_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
67 AM_CONDITIONAL(GST_DISABLE_PARSE, test "x$GST_DISABLE_PARSE" = "xyes")
68 GST_CHECK_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
69 AM_CONDITIONAL(GST_DISABLE_TRACE, test "x$GST_DISABLE_TRACE" = "xyes")
70 GST_CHECK_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
71 AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, test "x$GST_DISABLE_ALLOC_TRACE" = "xyes")
72 GST_CHECK_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
73 AM_CONDITIONAL(GST_DISABLE_REGISTRY, test "x$GST_DISABLE_REGISTRY" = "xyes")
74 GST_CHECK_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
75 AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, test "x$GST_DISABLE_ENUMTYPES" = "xyes")
76 GST_CHECK_SUBSYSTEM_DISABLE(INDEX,[index])
77 AM_CONDITIONAL(GST_DISABLE_INDEX, test "x$GST_DISABLE_INDEX" = "xyes")
78 GST_CHECK_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
79 AM_CONDITIONAL(GST_DISABLE_PLUGIN, test "x$GST_DISABLE_PLUGIN" = "xyes")
80 GST_CHECK_SUBSYSTEM_DISABLE(URI,[uri handlers])
81 AM_CONDITIONAL(GST_DISABLE_URI, test "x$GST_DISABLE_URI" = "xyes")
90 GST_ARG_WITH_PKG_CONFIG_PATH
91 GST_ARG_WITH_PACKAGE_NAME([GStreamer])
92 GST_ARG_WITH_PACKAGE_ORIGIN
94 dnl use a cache dir for storing element registry info.
95 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
98 AC_HELP_STRING([--with-cachedir],
99 [specify path to use for plugin and command completion registries]),
102 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
103 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
104 *) GST_CACHE_DIR="${withval}" ;;
107 [:]) dnl Default value
109 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
110 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Location of registry])
111 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
113 dnl building of tests
115 AC_HELP_STRING([--disable-tests], [disable building test apps]),
117 case "${enableval}" in
118 yes) BUILD_TESTS=yes ;;
119 no) BUILD_TESTS=no ;;
120 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
123 [BUILD_TESTS=yes]) dnl Default value
124 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
126 dnl tests known to fail
127 AC_ARG_ENABLE(failing-tests,
128 AC_HELP_STRING([--disable-failing-tests],
129 [disable building tests known to fail]),
131 case "${enableval}" in
132 yes) BUILD_FAILING_TESTS=yes ;;
133 no) BUILD_FAILING_TESTS=no ;;
134 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
137 [BUILD_FAILING_TESTS=no]) dnl Default value
138 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
139 if test x$BUILD_FAILING_TESTS = xyes; then
140 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
142 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.])
145 dnl poison destroyed objects
146 AC_ARG_ENABLE(poisoning,
147 AC_HELP_STRING([--enable-poisoning],
148 [enable poisoning of deallocated objects]),
150 case "${enableval}" in
151 yes) USE_POISONING=yes ;;
152 no) USE_POISONING=no ;;
153 *) AC_MSG_ERROR(bad value ${enableval} for --enable-poisoning) ;;
156 [USE_POISONING=no]) dnl Default value
157 if test "x$USE_POISONING" = xyes; then
158 AC_DEFINE(USE_POISONING, 1,
159 [Define if we should poison deallocated memory])
162 dnl *** checks for platform ***
164 dnl * hardware/architecture *
166 dnl common/m4/gst-arch.m4
170 dnl common/m4/gst-arch.m4
171 dnl check for unaligned access
173 dnl create a configure variable for gst/gstconfig.h
174 if test x${as_cv_unaligned_access} = xyes ; then
175 GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 1"
177 GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 0"
179 AC_SUBST(GST_HAVE_UNALIGNED_ACCESS_DEFINE)
183 dnl check for large file support
184 dnl affected plugins must include config.h
187 dnl HAVE_WIN32 currently means "disable POSIXisms".
190 AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
196 dnl *** checks for programs ***
201 dnl find an assembler
204 dnl we use awk in the bison version check
207 dnl we require bison for building the parser
208 dnl FIXME: check if AC_PROG_YACC is suitable here
209 dnl FIXME: make precious
210 AC_PATH_PROG(BISON_PATH, bison, no)
211 if test x$BISON_PATH = xno; then
212 AC_MSG_ERROR(Could not find bison)
215 dnl check bison version
216 AC_MSG_CHECKING([bison version])
218 if $BISON_PATH --version | head -n 1 | $AWK '{ if ($4 < 1.35) exit 1; else exit 0;}';
222 AC_MSG_RESULT([too old.])
223 AC_MSG_ERROR([Your bison version is too old, v1.35 or later is required.])
226 dnl we require flex for building the parser
227 dnl FIXME: check if AC_PROG_LEX is suitable here
228 AC_PATH_PROG(FLEX_PATH, flex, no)
229 if test x$FLEX_PATH = xno; then
230 AC_MSG_ERROR(Could not find flex)
233 dnl Perl is used in building documentation
234 AC_PATH_PROG(PERL_PATH, perl, no)
235 if test x$PERL_PATH = xno; then
236 AC_MSG_ERROR(Could not find perl)
239 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
240 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
242 dnl check for documentation tools
246 dnl *** checks for libraries ***
248 dnl For interactive UNIX (a Sun thing)
249 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
252 dnl *** checks for header files ***
254 dnl check if we have ANSI C header files
257 dnl Check for ucontext.h
258 AC_CHECK_HEADERS([ucontext.h])
259 AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
260 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
261 AC_CHECK_HEADERS([process.h])
263 dnl *** checks for types/defines ***
265 dnl *** checks for structures ***
267 dnl *** checks for compiler characteristics ***
269 dnl make sure we can use "inline" from C code
273 dnl Check for some compiler flags that optimize our code.
274 if test "x$GCC" = xyes; then
275 AS_COMPILER_FLAG(-fno-common, OPT_CFLAGS="$OPT_CFLAGS -fno-common")
278 dnl FIXME: decide what kind of flag this is, maybe it's not an optimization
280 dnl check if we should use -Wa,-mregnames on PowerPC, so we can use
281 dnl symbolic register names in inline asm
282 if test x$HAVE_CPU_PPC = xyes ; then
283 AS_COMPILER_FLAG(["-Wa,-mregnames"],
284 [OPT_CFLAGS="$OPT_CFLAGS -Wa,-mregnames"])
287 dnl *** checks for library functions ***
289 AC_CHECK_FUNCS([sigaction])
291 dnl check for fseeko()
293 dnl check for ftello()
294 AC_CHECK_FUNCS([ftello])
296 AC_CHECK_FUNCS([fgetpos])
297 AC_CHECK_FUNCS([fsetpos])
301 AM_CONDITIONAL(HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")
303 dnl common/m4/gst-mcsc.m4
304 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
306 if test "$ac_cv_check_mcsc" = "yes"; then
307 AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, 1,
308 [defined if we have makecontext ()])
311 dnl Check for a way to display the function name in debug output
314 dnl test for register_printf_function
315 AC_CHECK_FUNC(register_printf_function,
317 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"P\""
318 AC_DEFINE(HAVE_PRINTF_EXTENSION, 1,
319 [Defined if we have register_printf_function ()])
321 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"p\""
323 AC_SUBST(GST_PRINTF_EXTENSION_FORMAT_DEFINE)
325 dnl test if we have dladdr(); we use it for debugging; see gst/gstinfo.c
326 save_cflags="$CFLAGS"
327 CFLAGS="$CFLAGS -D_GNU_SOURCE"
328 AC_CHECK_LIB(dl, dladdr,
329 AC_DEFINE(HAVE_DLADDR, 1,
330 [Defined if we have dladdr ()]))
331 CFLAGS="$save_cflags"
333 dnl *** checks for dependancy libraries ***
337 GST_GLIB_CHECK([2.6])
339 dnl GLib 2.8 has some bug fixes that we like, so make sure our code knows
340 AC_MSG_CHECKING([glib version >= 2.8])
341 if pkg-config --atleast-version=2.8 glib-2.0; then
343 GST_HAVE_GLIB_2_8_DEFINE="#define GST_HAVE_GLIB_2_8 1"
346 GST_HAVE_GLIB_2_8_DEFINE="/* #undef GST_HAVE_GLIB_2_8 */"
348 AC_SUBST(GST_HAVE_GLIB_2_8_DEFINE)
350 dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
351 PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB_REQ)
353 dnl libxml 2, which is/should be optional (FIXME)
354 if test "x$GST_DISABLE_LOADSAVE" = "xyes" && \
355 test "x$GST_DISABLE_REGISTRY" = "xyes"
357 AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
359 dnl check for libxml2 with minimum req version
360 GST_LIBXML2_CHECK(2.4.9)
363 dnl check for "check", unit testing library/header
367 AC_MSG_NOTICE(CHECK_CFLAGS: $CHECK_CFLAGS)
368 AC_MSG_NOTICE(CHECK_LIBS: $CHECK_LIBS)
371 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
373 dnl *** set variables based on configure arguments
375 dnl set license and copyright notice
377 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
378 AC_SUBST(GST_LICENSE)
380 dnl define LIBDIR so we can inform people where we live
381 AS_AC_EXPAND(LIBDIR, $libdir)
382 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
384 dnl set location of plugin directory
387 dnl FIXME: add LIBXML_PKG here
388 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
389 AC_SUBST(GST_PKG_DEPS)
391 dnl define an ERROR_CFLAGS Makefile variable
392 GST_SET_ERROR_CFLAGS($GST_CVS)
394 dnl define correct level for debugging messages
395 GST_SET_LEVEL_DEFAULT($GST_CVS)
397 dnl *** finalize CFLAGS, LDFLAGS, LIBS
400 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
401 dnl GST_ALL_*: flags shared by all built objects
402 dnl GST_OBJ_*: additional flags to link to the core library
403 dnl include GST_ALL_*
404 dnl GST_LT_LDFLAGS: library versioning of our libraries
405 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
407 dnl GST_OPTION_CFLAGS
408 if test "x$USE_DEBUG" = xyes; then
411 AC_SUBST(PROFILE_CFLAGS)
413 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
414 AC_SUBST(DEPRECATED_CFLAGS)
416 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
417 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
418 AC_SUBST(GST_OPTION_CFLAGS)
421 dnl vars common to for all internal objects (core libs, elements, applications)
423 dnl - XML needs to be added because xmlPtr is used in core
424 dnl - src and build dirs need to be added because every piece that gets built
425 dnl will need the GStreamer source and generated headers
426 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
428 GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir) $GLIB_CFLAGS $XML_CFLAGS \$(GST_OPTION_CFLAGS)"
429 dnl FIXME: check if LTLIBINTL is needed everywhere
430 dnl I presume it is given that it contains the symbols that _() stuff maps to
431 GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL"
432 dnl LDFLAGS modifier defining exported symbols from built shared objects
433 EXPORT_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
434 GST_ALL_LDFLAGS="$EXPORT_LDFLAGS -no-undefined"
435 AC_SUBST(GST_ALL_CFLAGS)
436 AC_SUBST(GST_ALL_LIBS)
437 AC_SUBST(GST_ALL_LDFLAGS)
440 dnl default vars for all internal objects built on libgstreamer
441 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
442 GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la \$(GST_ALL_LIBS)"
443 GST_OBJ_LDFLAGS="$GST_LT_LDFLAGS $GST_ALL_LDFLAGS"
444 AC_SUBST(GST_OBJ_CFLAGS)
445 AC_SUBST(GST_OBJ_LIBS)
446 AC_SUBST(GST_OBJ_LDFLAGS)
448 dnl GST_PLUGIN_LDFLAGS
449 dnl LDFLAGS for plugins; include GST_ALL_LDFLAGS
450 GST_PLUGIN_LDFLAGS="-module -avoid-version $GST_ALL_LDFLAGS"
451 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
453 dnl ##################################################
454 dnl # deps for examples from manual #
455 dnl ##################################################
457 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
458 HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
459 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
461 dnl ##################################################
462 dnl # Prepare informative messages to display at end #
463 dnl ##################################################
467 dnl *** output files ***
469 dnl libs/ext/Makefile
470 dnl nothing there yet !
478 gst/indexers/Makefile
479 gst/elements/Makefile
483 libs/gst/controller/Makefile
484 libs/gst/dataprotocol/Makefile
488 tests/instantiate/Makefile
489 tests/muxing/Makefile
490 tests/seeking/Makefile
492 tests/threadstate/Makefile
494 testsuite/caps/Makefile
495 testsuite/debug/Makefile
496 testsuite/dlopen/Makefile
497 testsuite/elements/Makefile
498 testsuite/indexers/Makefile
499 testsuite/parse/Makefile
500 testsuite/plugin/Makefile
501 testsuite/refcounting/Makefile
502 testsuite/states/Makefile
503 testsuite/threads/Makefile
504 testsuite/trigger/Makefile
506 examples/controller/Makefile
507 examples/cutter/Makefile
508 examples/helloworld/Makefile
509 examples/launch/Makefile
510 examples/manual/Makefile
511 examples/mixer/Makefile
512 examples/metadata/Makefile
513 examples/pingpong/Makefile
514 examples/plugins/Makefile
515 examples/pwg/Makefile
516 examples/queue/Makefile
517 examples/retag/Makefile
518 examples/thread/Makefile
519 examples/typefind/Makefile
520 examples/xml/Makefile
531 docs/version.entities
532 win32/common/config.h
535 pkgconfig/gstreamer.pc
536 pkgconfig/gstreamer-uninstalled.pc
537 pkgconfig/gstreamer-base.pc
538 pkgconfig/gstreamer-base-uninstalled.pc
539 pkgconfig/gstreamer-check.pc
540 pkgconfig/gstreamer-check-uninstalled.pc
541 pkgconfig/gstreamer-controller.pc
542 pkgconfig/gstreamer-controller-uninstalled.pc
543 pkgconfig/gstreamer-dataprotocol.pc
544 pkgconfig/gstreamer-dataprotocol-uninstalled.pc
547 AC_CONFIG_COMMANDS(echo "$infomessages", infomessages="$infomessages")