3 dnl initialize autoconf
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, cvs and prerelease does Werror too
6 AC_INIT(GStreamer, 0.10.5,
7 http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
10 dnl initialize automake
13 dnl define PACKAGE_VERSION_* variables
16 dnl check if this is a release version
17 AS_NANO(GST_CVS="no", GST_CVS="yes")
19 dnl can autoconf find the source ?
20 AC_CONFIG_SRCDIR([gst/gst.c])
22 dnl define the output header for config
23 AM_CONFIG_HEADER([config.h])
25 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28 dnl sets host_* variables
31 dnl our libraries and install dirs use major.minor as a version
32 GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
33 dnl we override it here for release candidates for a new series
35 AC_SUBST(GST_MAJORMINOR)
37 dnl CURRENT, REVISION, AGE
38 dnl - library source changed -> increment REVISION
39 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
40 dnl - interfaces added -> increment AGE
41 dnl - interfaces removed -> AGE = 0
42 dnl sets GST_LT_LDFLAGS
43 AS_LIBTOOL(GST, 6, 0, 6)
45 dnl FIXME: this macro doesn't actually work;
46 dnl the generated libtool script has no support for the listed tags.
47 dnl So this needs to be fixed first if we want to use this
52 dnl *** autotools stuff ****
54 dnl allow for different autotools
55 AS_AUTOTOOLS_ALTERNATE
57 dnl Add parameters for aclocal
58 AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4")
61 dnl the version check needs to stay here because autopoint greps for it
62 AM_GNU_GETTEXT_VERSION([0.11.5])
63 AM_GNU_GETTEXT([external])
64 GST_GETTEXT([gstreamer-$GST_MAJORMINOR])
66 dnl *** check for arguments to configure ***
68 dnl subsystems - can influence other decisions so needs to be high up
69 dnl we need to AM_CONDITIONAL them here for automake 1.6.x compatibility
70 GST_CHECK_SUBSYSTEM_DISABLE(GST_DEBUG,[debugging subsystem])
71 AM_CONDITIONAL(GST_DISABLE_GST_DEBUG, test "x$GST_GST_DISABLE_DEBUG" = "xyes")
72 GST_CHECK_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
73 AM_CONDITIONAL(GST_DISABLE_LOADSAVE, test "x$GST_DISABLE_LOADSAVE" = "xyes")
74 dnl define a substitution to use in docs/gst/gstreamer.types
75 if test "x$GST_DISABLE_LOADSAVE" = "xyes"
77 GST_LOADSAVE_DOC_TYPES="%"
79 GST_LOADSAVE_DOC_TYPES=
81 AC_SUBST(GST_LOADSAVE_DOC_TYPES)
82 GST_CHECK_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
83 AM_CONDITIONAL(GST_DISABLE_PARSE, test "x$GST_DISABLE_PARSE" = "xyes")
84 if test "x$GST_DISABLE_PARSE" = xyes; then
85 AC_DEFINE(GST_DISABLE_PARSE, 1,
86 [Define if pipeline parsing code is disabled])
88 GST_CHECK_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
89 AM_CONDITIONAL(GST_DISABLE_TRACE, test "x$GST_DISABLE_TRACE" = "xyes")
90 GST_CHECK_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
91 AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, test "x$GST_DISABLE_ALLOC_TRACE" = "xyes")
92 GST_CHECK_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
93 AM_CONDITIONAL(GST_DISABLE_REGISTRY, test "x$GST_DISABLE_REGISTRY" = "xyes")
94 dnl define a substitution to use in docs/gst/gstreamer.types
95 if test "x$GST_DISABLE_REGISTRY" = "xyes"
97 GST_REGISTRY_DOC_TYPES="%"
99 GST_REGISTRY_DOC_TYPES=
101 AC_SUBST(GST_REGISTRY_DOC_TYPES)
102 GST_CHECK_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
103 AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, test "x$GST_DISABLE_ENUMTYPES" = "xyes")
104 GST_CHECK_SUBSYSTEM_DISABLE(INDEX,[index])
105 AM_CONDITIONAL(GST_DISABLE_INDEX, test "x$GST_DISABLE_INDEX" = "xyes")
106 GST_CHECK_SUBSYSTEM_DISABLE(NET,[network distribution])
107 AM_CONDITIONAL(GST_DISABLE_NET, test "x$GST_DISABLE_NET" = "xyes")
108 GST_CHECK_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
109 AM_CONDITIONAL(GST_DISABLE_PLUGIN, test "x$GST_DISABLE_PLUGIN" = "xyes")
110 GST_CHECK_SUBSYSTEM_DISABLE(URI,[uri handlers])
111 AM_CONDITIONAL(GST_DISABLE_URI, test "x$GST_DISABLE_URI" = "xyes")
120 GST_ARG_WITH_PKG_CONFIG_PATH
121 GST_ARG_WITH_PACKAGE_NAME
122 GST_ARG_WITH_PACKAGE_ORIGIN
124 dnl use a cache dir for storing element registry info.
125 GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
127 AC_ARG_WITH(cachedir,
128 AC_HELP_STRING([--with-cachedir],
129 [specify path to use for plugin and command completion registries]),
132 yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
133 no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
134 *) GST_CACHE_DIR="${withval}" ;;
137 [:]) dnl Default value
139 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
140 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Location of registry])
141 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
143 dnl building of tests
145 AC_HELP_STRING([--disable-tests], [disable building test apps]),
147 case "${enableval}" in
148 yes) BUILD_TESTS=yes ;;
149 no) BUILD_TESTS=no ;;
150 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
153 [BUILD_TESTS=yes]) dnl Default value
154 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
156 dnl tests known to fail
157 AC_ARG_ENABLE(failing-tests,
158 AC_HELP_STRING([--disable-failing-tests],
159 [disable building tests known to fail]),
161 case "${enableval}" in
162 yes) BUILD_FAILING_TESTS=yes ;;
163 no) BUILD_FAILING_TESTS=no ;;
164 *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
167 [BUILD_FAILING_TESTS=no]) dnl Default value
168 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
169 if test x$BUILD_FAILING_TESTS = xyes; then
170 AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
172 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.])
175 dnl poison destroyed objects
176 AC_ARG_ENABLE(poisoning,
177 AC_HELP_STRING([--enable-poisoning],
178 [enable poisoning of deallocated objects]),
180 case "${enableval}" in
181 yes) USE_POISONING=yes ;;
182 no) USE_POISONING=no ;;
183 *) AC_MSG_ERROR(bad value ${enableval} for --enable-poisoning) ;;
186 [USE_POISONING=no]) dnl Default value
187 if test "x$USE_POISONING" = xyes; then
188 AC_DEFINE(USE_POISONING, 1,
189 [Define if we should poison deallocated memory])
192 dnl *** checks for platform ***
194 dnl * hardware/architecture *
196 dnl common/m4/gst-arch.m4
199 dnl substitution for win32/common/config.h
203 dnl common/m4/gst-arch.m4
204 dnl check for unaligned access
206 dnl create a configure variable for gst/gstconfig.h
207 if test x${as_cv_unaligned_access} = xyes ; then
208 GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 1"
210 GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 0"
212 AC_SUBST(GST_HAVE_UNALIGNED_ACCESS_DEFINE)
216 dnl check for large file support
217 dnl affected plugins must include config.h
220 dnl HAVE_WIN32 currently means "disable POSIXisms".
223 AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
229 dnl *** checks for programs ***
234 dnl find an assembler
237 dnl we use awk in the bison version check
240 dnl we require bison for building the parser
241 dnl FIXME: check if AC_PROG_YACC is suitable here
242 dnl FIXME: make precious
243 AC_PATH_PROG(BISON_PATH, bison, no)
244 if test x$BISON_PATH = xno; then
245 AC_MSG_ERROR(Could not find bison)
248 dnl check bison version
249 AC_MSG_CHECKING([bison version])
251 if $BISON_PATH --version | head -n 1 | $AWK '{ if ($4 < 1.35) exit 1; else exit 0;}';
255 AC_MSG_RESULT([too old.])
256 AC_MSG_ERROR([Your bison version is too old, v1.35 or later is required.])
259 dnl we require flex for building the parser
260 dnl FIXME: check if AC_PROG_LEX is suitable here
261 AC_PATH_PROG(FLEX_PATH, flex, no)
262 if test x$FLEX_PATH = xno; then
263 AC_MSG_ERROR(Could not find flex)
266 dnl Perl is used in building documentation
267 AC_PATH_PROG(PERL_PATH, perl, no)
268 if test x$PERL_PATH = xno; then
269 AC_MSG_ERROR(Could not find perl)
272 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
273 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
275 dnl check for documentation tools
278 AS_PATH_PYTHON([2.1])
280 dnl *** checks for libraries ***
282 dnl For interactive UNIX (a Sun thing)
283 dnl FIXME: this adds -lcposix to LIBS, but I doubt we use LIBS
286 dnl *** checks for header files ***
288 dnl check if we have ANSI C header files
291 dnl Check for ucontext.h
292 AC_CHECK_HEADERS([ucontext.h])
293 AC_CHECK_HEADERS([sys/socket.h], HAVE_SYS_SOCKET_H=yes)
294 AM_CONDITIONAL(HAVE_SYS_SOCKET_H, test "x$HAVE_SYS_SOCKET_H" = "xyes")
295 AC_CHECK_HEADERS([process.h])
297 dnl *** checks for types/defines ***
299 dnl *** checks for structures ***
301 dnl *** checks for compiler characteristics ***
303 dnl make sure we can use "inline" from C code
307 dnl Check for some compiler flags that optimize our code.
308 if test "x$GCC" = xyes; then
309 AS_COMPILER_FLAG(-fno-common, OPT_CFLAGS="$OPT_CFLAGS -fno-common")
312 dnl FIXME: decide what kind of flag this is, maybe it's not an optimization
314 dnl check if we should use -Wa,-mregnames on PowerPC, so we can use
315 dnl symbolic register names in inline asm
316 if test x$HAVE_CPU_PPC = xyes ; then
317 AS_COMPILER_FLAG(["-Wa,-mregnames"],
318 [OPT_CFLAGS="$OPT_CFLAGS -Wa,-mregnames"])
321 dnl *** checks for library functions ***
323 AC_CHECK_FUNCS([sigaction])
325 dnl check for fseeko()
327 dnl check for ftello()
328 AC_CHECK_FUNCS([ftello])
330 AC_CHECK_FUNCS([fgetpos])
331 AC_CHECK_FUNCS([fsetpos])
335 AM_CONDITIONAL(HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" = "xyes")
337 dnl Check for a way to display the function name in debug output
340 dnl test for register_printf_function
341 AC_CHECK_FUNC(register_printf_function,
343 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"P\""
344 AC_DEFINE(HAVE_PRINTF_EXTENSION, 1,
345 [Defined if we have register_printf_function ()])
347 GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"p\""
349 AC_SUBST(GST_PRINTF_EXTENSION_FORMAT_DEFINE)
351 dnl test if we have dladdr(); we use it for debugging; see gst/gstinfo.c
352 save_cflags="$CFLAGS"
353 CFLAGS="$CFLAGS -D_GNU_SOURCE"
354 AC_CHECK_LIB(dl, dladdr,
355 AC_DEFINE(HAVE_DLADDR, 1,
356 [Defined if we have dladdr ()]))
357 CFLAGS="$save_cflags"
359 dnl *** checks for dependancy libraries ***
363 GST_GLIB_CHECK([2.6])
365 dnl GLib 2.8 has some bug fixes that we like, so make sure our code knows
366 AC_MSG_CHECKING([glib version >= 2.8])
367 if pkg-config --atleast-version=2.8 glib-2.0; then
369 GST_HAVE_GLIB_2_8_DEFINE="#define GST_HAVE_GLIB_2_8 1"
372 GST_HAVE_GLIB_2_8_DEFINE="/* #undef GST_HAVE_GLIB_2_8 */"
374 AC_SUBST(GST_HAVE_GLIB_2_8_DEFINE)
376 dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
377 PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB_REQ)
379 dnl libxml 2, which is/should be optional (FIXME)
380 if test "x$GST_DISABLE_LOADSAVE" = "xyes" && \
381 test "x$GST_DISABLE_REGISTRY" = "xyes"
383 AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
385 dnl check for libxml2 with minimum req version
386 GST_LIBXML2_CHECK(2.4.9)
389 dnl check for "check", unit testing library/header
393 AC_MSG_NOTICE(CHECK_CFLAGS: $CHECK_CFLAGS)
394 AC_MSG_NOTICE(CHECK_LIBS: $CHECK_LIBS)
397 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
399 dnl *** set variables based on configure arguments
401 dnl set license and copyright notice
403 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
404 AC_SUBST(GST_LICENSE)
406 dnl define LIBDIR so we can inform people where we live
407 AS_AC_EXPAND(LIBDIR, $libdir)
408 AC_DEFINE_UNQUOTED(LIBDIR, "$LIBDIR", [library dir])
410 dnl set location of plugin directory
413 dnl FIXME: add LIBXML_PKG here
414 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
415 AC_SUBST(GST_PKG_DEPS)
417 dnl define an ERROR_CFLAGS Makefile variable
418 GST_SET_ERROR_CFLAGS($GST_CVS)
420 dnl define correct level for debugging messages
421 GST_SET_LEVEL_DEFAULT($GST_CVS)
423 dnl *** finalize CFLAGS, LDFLAGS, LIBS
426 dnl GST_OPTION_CFLAGS: common cflags for profiling, debugging, errors, ...
427 dnl GST_ALL_*: vars shared by all built objects
428 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
429 dnl GST_OBJ_*: additional vars to link to the core library
430 dnl include GST_ALL_*
431 dnl GST_LT_LDFLAGS: library versioning of our libraries
432 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
434 dnl GST_OPTION_CFLAGS
435 if test "x$USE_DEBUG" = xyes; then
438 AC_SUBST(PROFILE_CFLAGS)
440 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
441 AC_SUBST(DEPRECATED_CFLAGS)
443 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
444 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
445 AC_SUBST(GST_OPTION_CFLAGS)
448 dnl vars common to for all internal objects (core libs, elements, applications)
450 dnl - XML needs to be added because xmlPtr is used in core
451 dnl - src and build dirs need to be added because every piece that gets built
452 dnl will need the GStreamer source and generated headers
453 dnl LIBS: XML doesn't need to be added because we don't explicitly use symbols
454 dnl from LibXML except for in the core library
455 GST_ALL_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir) -I\$(top_builddir) $GLIB_CFLAGS $XML_CFLAGS \$(GST_OPTION_CFLAGS)"
456 dnl FIXME: check if LTLIBINTL is needed everywhere
457 dnl I presume it is given that it contains the symbols that _() stuff maps to
458 GST_ALL_LIBS="$GLIB_LIBS $LTLIBINTL"
459 dnl LDFLAGS really should only contain flags, not libs - they get added before
460 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
461 GST_ALL_LDFLAGS="-no-undefined"
463 AC_SUBST(GST_ALL_CFLAGS)
464 AC_SUBST(GST_ALL_LIBS)
465 AC_SUBST(GST_ALL_LDFLAGS)
468 dnl linker flags shared by all libraries
469 dnl LDFLAGS modifier defining exported symbols from built libraries
470 GST_LIB_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
471 AC_SUBST(GST_LIB_LDFLAGS)
474 dnl default vars for all internal objects built on libgstreamer
475 dnl includes GST_ALL_*
476 GST_OBJ_CFLAGS="\$(GST_ALL_CFLAGS)"
477 GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la \$(GST_ALL_LIBS)"
478 AC_SUBST(GST_OBJ_CFLAGS)
479 AC_SUBST(GST_OBJ_LIBS)
481 dnl GST_PLUGIN_LDFLAGS
482 dnl LDFLAGS for plugins; includes GST_ALL_LDFLAGS
483 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
484 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
494 libs/gst/base/Makefile
495 libs/gst/check/Makefile
496 libs/gst/controller/Makefile
497 libs/gst/dataprotocol/Makefile
498 libs/gst/net/Makefile
500 plugins/indexers/Makefile
501 plugins/elements/Makefile
504 tests/benchmarks/Makefile
507 tests/examples/Makefile
508 tests/examples/controller/Makefile
509 tests/examples/helloworld/Makefile
510 tests/examples/launch/Makefile
511 tests/examples/metadata/Makefile
512 tests/examples/queue/Makefile
513 tests/examples/typefind/Makefile
514 tests/examples/xml/Makefile
522 docs/gst/gstreamer.types
524 docs/plugins/Makefile
529 docs/version.entities
530 win32/common/config.h
533 pkgconfig/gstreamer.pc
534 pkgconfig/gstreamer-uninstalled.pc
535 pkgconfig/gstreamer-base.pc
536 pkgconfig/gstreamer-base-uninstalled.pc
537 pkgconfig/gstreamer-check.pc
538 pkgconfig/gstreamer-check-uninstalled.pc
539 pkgconfig/gstreamer-controller.pc
540 pkgconfig/gstreamer-controller-uninstalled.pc
541 pkgconfig/gstreamer-dataprotocol.pc
542 pkgconfig/gstreamer-dataprotocol-uninstalled.pc
543 pkgconfig/gstreamer-net.pc
544 pkgconfig/gstreamer-net-uninstalled.pc