deactivate and remove dparams (libgstcontrol)
[platform/upstream/gstreamer.git] / configure.ac
1 AC_PREREQ(2.52)
2
3 AC_INIT
4 AC_CANONICAL_TARGET
5
6 dnl when going to/from release please set the nano (fourth number) right !
7 dnl releases only do Wall, cvs and prerelease does Werror too
8 AS_VERSION(gstreamer, GST_VERSION, 0, 9, 1, 1, GST_CVS="no", GST_CVS="yes")
9
10 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
11 AM_MAINTAINER_MODE
12 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
13
14 dnl our libraries and install dirs use major.minor as a version
15 GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
16 dnl we override it here for release candidates for a new series
17 # GST_MAJORMINOR=0.9
18 AC_SUBST(GST_MAJORMINOR)
19
20 AC_PROG_CC
21 dnl For interactive UNIX (a Sun thing)
22 AC_ISC_POSIX
23
24 dnl CURRENT, REVISION, AGE
25 dnl - library source changed -> increment REVISION
26 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
27 dnl - interfaces added -> increment AGE
28 dnl - interfaces removed -> AGE = 0
29 AS_LIBTOOL(GST, 6, 0, 0)
30 AS_LIBTOOL_TAGS([])
31 AM_PROG_LIBTOOL
32
33 AC_CONFIG_SRCDIR([gst/gst.c])
34 AM_CONFIG_HEADER(config.h)
35
36 dnl Add parameters for aclocal
37 AC_SUBST(ACLOCAL_AMFLAGS, "-I common/m4 -I .")
38
39 AM_PROG_CC_STDC
40 AM_PROG_AS
41 AS="${CC}"
42
43 dnl the gettext stuff needed
44 AM_GNU_GETTEXT_VERSION(0.11.5)
45 AM_GNU_GETTEXT([external])
46
47 GETTEXT_PACKAGE=gstreamer-$GST_MAJORMINOR
48 AC_SUBST(GETTEXT_PACKAGE)
49 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE",
50                    [gettext package name])
51
52 dnl define LOCALEDIR in config.h
53 AS_AC_EXPAND(LOCALEDIR, $datadir/locale)
54 AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR",
55                    [gettext locale dir])
56
57 dnl define LIBDIR so we can inform people where we live
58 AS_AC_EXPAND(LIBDIR, $libdir)
59 AC_DEFINE_UNQUOTED([LIBDIR], "$LIBDIR",
60                    [library dir])
61
62 GST_SET_ERROR_CFLAGS($GST_CVS)
63
64 dnl We disable static building for development, for time savings
65 dnl *NOTE*: dnl this line before release, so release does static too
66 dnl AM_DISABLE_STATIC
67
68 AC_HEADER_STDC([])
69 AC_C_INLINE
70
71 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
72 dnl messages printed when running cvs builds
73 if test "x$GST_CVS" = "xyes"; then
74   AC_DEFINE(GST_LEVEL_DEFAULT, GST_LEVEL_ERROR, [Default errorlevel to use])
75 fi
76
77 dnl subsystems - can influence other decisions so needs to be high up
78 dnl we need to do AM_CONDITIONAL them here for automake 1.6.x compatibility
79 GST_CHECK_SUBSYSTEM_DISABLE(GST_DEBUG,[debugging subsystem])
80 AM_CONDITIONAL(GST_DISABLE_GST_DEBUG, test "x$GST_DISABLE_GST_DEBUG" = "xyes")
81 GST_CHECK_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
82 AM_CONDITIONAL(GST_DISABLE_LOADSAVE, test "x$GST_DISABLE_LOADSAVE" = "xyes")
83 GST_CHECK_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
84 AM_CONDITIONAL(GST_DISABLE_PARSE, test "x$GST_DISABLE_PARSE" = "xyes")
85 GST_CHECK_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
86 AM_CONDITIONAL(GST_DISABLE_TRACE, test "x$GST_DISABLE_TRACE" = "xyes")
87 GST_CHECK_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
88 AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, test "x$GST_DISABLE_ALLOC_TRACE" = "xyes")
89 GST_CHECK_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
90 AM_CONDITIONAL(GST_DISABLE_REGISTRY, test "x$GST_DISABLE_REGISTRY" = "xyes")
91 GST_CHECK_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
92 AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, test "x$GST_DISABLE_ENUMTYPES" = "xyes")
93 GST_CHECK_SUBSYSTEM_DISABLE(INDEX,[index])
94 AM_CONDITIONAL(GST_DISABLE_INDEX, test "x$GST_DISABLE_INDEX" = "xyes")
95 GST_CHECK_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
96 AM_CONDITIONAL(GST_DISABLE_PLUGIN, test "x$GST_DISABLE_PLUGIN" = "xyes")
97 GST_CHECK_SUBSYSTEM_DISABLE(URI,[uri handlers])
98 AM_CONDITIONAL(GST_DISABLE_URI, test "x$GST_DISABLE_URI" = "xyes")
99
100 dnl ##############################
101 dnl # Do automated configuration #
102 dnl ##############################
103
104 dnl Check for tools:
105 dnl ================
106
107 dnl allow for different autotools
108 AS_AUTOTOOLS_ALTERNATE()
109
110 dnl modify pkg-config path
111 AC_ARG_WITH(pkg-config-path, 
112    AC_HELP_STRING([--with-pkg-config-path],
113                   [colon-separated list of pkg-config(1) dirs]),
114    [export PKG_CONFIG_PATH=${withval}])
115
116 GST_DOC()
117 GST_ARCH()
118
119 dnl Perl is used in building documentation
120 AC_PATH_PROG(PERL_PATH, perl, no)
121 if test x$PERL_PATH = xno; then
122   AC_MSG_ERROR(Could not find perl)
123 fi
124
125 AC_PROG_AWK
126
127 dnl we require bison for building the parser
128 dnl FIXME: check if AC_PROG_YACC is suitable here
129 AC_PATH_PROG(BISON_PATH, bison, no)
130 if test x$BISON_PATH = xno; then
131   AC_MSG_ERROR(Could not find bison)
132 fi
133
134 dnl check bison version
135 AC_MSG_CHECKING([bison version])
136
137 if $BISON_PATH --version | head -n 1 | $AWK '{ if ($4 < 1.35) exit 1; else exit 0;}'; 
138 then 
139   AC_MSG_RESULT([ok])
140 else 
141   AC_MSG_RESULT([too old.])
142   AC_MSG_ERROR([Your bison version is too old, v1.35 or later is required.])
143 fi
144
145 dnl we require flex for building the parser
146 dnl FIXME: check if AC_PROG_LEX is suitable here
147 AC_PATH_PROG(FLEX_PATH, flex, no)
148 if test x$FLEX_PATH = xno; then
149   AC_MSG_ERROR(Could not find flex)
150 fi
151
152 dnl check for large file support (affected
153 dnl plugins must include config.h for this)
154 AC_SYS_LARGEFILE
155
156 dnl check for mmap
157 AC_FUNC_MMAP()
158
159 dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
160 AC_CHECK_MCSC()
161 if test "$ac_cv_check_mcsc" = "yes"; then
162   AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, $HAVE_MAKECONTEXT,
163                      [defined if we have makecontext ()])
164 fi
165
166 dnl Check for a way to display the function name in debug output
167 GST_CHECK_FUNCTION()
168
169 dnl check if we should use -Wa,-mregnames on PowerPC, so we can use
170 dnl symbolic register names in inline asm
171 if test x$HAVE_CPU_PPC = xyes ; then
172   AS_COMPILER_FLAG(["-Wa,-mregnames"],
173     [GST_INT_CFLAGS="$GST_INT_CFLAGS -Wa,-mregnames"],
174     true)
175 fi
176
177 AC_ARG_ENABLE(gcov,
178   AC_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),
179   enable_gcov=$enableval,enable_gcov=no)
180 if test x$enable_gcov = xyes ; then
181   AS_COMPILER_FLAG(["-fprofile-arcs"],
182     [GST_INT_CFLAGS="$GST_INT_CFLAGS -fprofile-arcs"],
183     true)
184   AS_COMPILER_FLAG(["-ftest-coverage"],
185     [GST_INT_CFLAGS="$GST_INT_CFLAGS -ftest-coverage"],
186     true)
187   GST_INT_CFLAGS=`echo "$GST_INT_CFLAGS" | sed -e 's/-O[0-9]*//g'`
188
189   AC_DEFINE_UNQUOTED(GST_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
190 fi
191 AM_CONDITIONAL(GST_GCOV_ENABLED, test x$enable_gcov = xyes)
192
193 dnl Check for some compiler flags that optimize our code.
194 if test "x$GCC" = xyes; then
195   AS_COMPILER_FLAG(-fno-common,GST_INT_CFLAGS="$GST_INT_CFLAGS -fno-common",)
196 fi
197
198 dnl HAVE_WIN32 currently means "disable POSIXisms".
199 case "$host" in
200   *-*-mingw*)
201     AC_DEFINE_UNQUOTED(HAVE_WIN32, 1, [Defined if compiling for Windows])
202     ;;
203   *)
204     ;;
205 esac
206
207 GST_UNALIGNED_ACCESS()
208 if test x${as_cv_unaligned_access} = xyes ; then
209   GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 1"
210 else
211   GST_HAVE_UNALIGNED_ACCESS_DEFINE="#define GST_HAVE_UNALIGNED_ACCESS 0"
212 fi
213 AC_SUBST(GST_HAVE_UNALIGNED_ACCESS_DEFINE)
214
215 dnl Check for essential libraries first:
216 dnl ====================================
217
218 dnl === GLib 2 ===
219 dnl Minimum required version of GLib2
220 dnl required for compilation without warnings
221 GLIB2_REQ="2.4"
222 AC_SUBST(GLIB2_REQ)
223
224 dnl Check for glib2 with sugar on top
225 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,HAVE_GLIB2=yes,HAVE_GLIB2=no)
226 dnl for the poor souls who for example have glib in /usr/local
227 AS_SCRUB_INCLUDE(GLIB2_CFLAGS)
228 GLIB_LIBS=$GLIB2_LIBS
229 GLIB_CFLAGS=$GLIB2_CFLAGS
230 AC_SUBST(GLIB_LIBS)
231 AC_SUBST(GLIB_CFLAGS)
232
233 if test "x$HAVE_GLIB2" = "xno"; then
234   AC_MSG_ERROR([GStreamer requires GLib $GLIB2_REQ to compile.])
235 fi
236
237 dnl Check for glib2 without extra fat, useful for the unversioned tool frontends
238 PKG_CHECK_MODULES(GLIB_ONLY, glib-2.0 >= $GLIB2_REQ)
239 AC_SUBST(GLIB_ONLY_CFLAGS)
240 AC_SUBST(GLIB_ONLY_LIBS)
241   
242 dnl === libxml 2 ===
243 if test "x$GST_DISABLE_LOADSAVE" = "xyes" && test "x$GST_DISABLE_REGISTRY" = "xyes"
244 then
245   AC_MSG_NOTICE([Registry and load/save are disabled, not checking for libxml2])
246 else
247   dnl check for libxml2 with minimum req version
248   GST_LIBXML2_CHECK(2.4.9)
249 fi
250
251 dnl popt checks
252 dnl FIXME: This test passes on popt 1.6.2, maybe earlier, but popt 1.6.2
253 dnl        causes segfaults on gst_init. Write a working test if possible.
254 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
255   AC_MSG_ERROR([popt 1.6.3 or newer is required to build gstreamer. You can
256                 download the latest version from 
257                 ftp://ftp.rpm.org/pub/rpm/dist/])
258 )
259 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
260 AC_COMPILE_IFELSE([
261 #include <popt.h>
262 int main ()
263 {
264 #ifndef POPT_TABLEEND
265 #error
266 #else
267   return 0;
268 #endif
269 }
270 ],, [
271   dnl it failed
272   AC_MSG_ERROR([popt 1.6.3 or newer is required to build gstreamer. You can
273                 download the latest version from 
274                 ftp://ftp.rpm.org/pub/rpm/dist/])
275 ])
276 AC_SUBST(POPT_CFLAGS)
277 AC_SUBST(POPT_LIBS)
278
279 dnl Check for ucontext.h
280 AC_CHECK_HEADER(ucontext.h, AC_DEFINE(HAVE_UCONTEXT_H, 1, [defined if we have ucontext.h]))
281
282 dnl check for "check", unit testing library/header
283 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
284 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
285
286 dnl ######################################################################
287 dnl # Check command line parameters, and set shell variables accordingly #
288 dnl ######################################################################
289
290 dnl FIXME: simplify all this down using a few m4 macros
291
292 AC_ARG_ENABLE(fast-stack-trash,
293 AC_HELP_STRING([--enable-fast-stack-trash],[use fast memory allocator (i586 or above)]),
294 [case "${enableval}" in
295   yes) USE_FAST_STACK_TRASH=yes;;
296   noset) USE_FAST_STACK_TRASH=no;;
297   no)  USE_FAST_STACK_TRASH=no;;
298   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
299 esac], 
300 [USE_FAST_STACK_TRASH=yes]) dnl Default value
301
302 AC_ARG_ENABLE(plugin-builddir,
303 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
304 [case "${enableval}" in
305   yes) PLUGINS_USE_BUILDDIR=yes ;;
306   no)  PLUGINS_USE_BUILDDIR=no ;;
307   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
308 esac], 
309 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
310
311 AC_ARG_ENABLE(profiling,
312 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
313 [case "${enableval}" in
314   yes) USE_PROFILING=yes ;;
315   no)  USE_PROFILING=no ;;
316   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
317 esac], 
318 [USE_PROFILING=no]) dnl Default value
319
320 dnl use a cache dir for storing element registry info.
321 dnl default to building registry in the source tree if we are enabling plugin build dir
322 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
323   GST_CACHE_DIR=`pwd`
324 else
325   dnl ${localstatedir} points to PREFIX/var
326   GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
327 fi
328 AC_ARG_WITH(cachedir,
329 AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
330 [case "${withval}" in
331   yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
332   no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
333   *) GST_CACHE_DIR="${withval}" ;;
334 esac], 
335 [:]) dnl Default value
336
337 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
338 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Location of registry])
339 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
340
341 dnl building of tests
342 AC_ARG_ENABLE(tests,
343 AC_HELP_STRING([--disable-tests],[disable building test apps]),
344 [case "${enableval}" in
345   yes) BUILD_TESTS=yes ;;
346   no)  BUILD_TESTS=no ;;
347   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
348 esac], 
349 [BUILD_TESTS=yes]) dnl Default value
350 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
351
352 dnl tests known to fail
353 AC_ARG_ENABLE(failing-tests,
354 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
355 [case "${enableval}" in
356   yes) BUILD_FAILING_TESTS=yes ;;
357   no)  BUILD_FAILING_TESTS=no ;;
358   *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
359 esac], 
360 [BUILD_FAILING_TESTS=no]) dnl Default value
361 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
362 if test x$BUILD_FAILING_TESTS = xyes; then
363   AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
364 else
365   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.])
366 fi
367
368 AC_ARG_ENABLE(examples,
369 AC_HELP_STRING([--disable-examples],[disable building examples]),
370 [case "${enableval}" in
371   yes) BUILD_EXAMPLES=yes ;;
372   no)  BUILD_EXAMPLES=no ;;
373   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
374 esac], 
375 [BUILD_EXAMPLES=yes]) dnl Default value
376 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
377
378 dnl poison destroyed objects
379 AC_ARG_ENABLE(poisoning,
380 AC_HELP_STRING([--enable-poisoning],[enable poisoning of deallocated objects]),
381 [case "${enableval}" in
382   yes) USE_POISONING=yes ;;
383   no)  USE_POISONING=no ;;
384   *) AC_MSG_ERROR(bad value ${enableval} for --enable-poisoning) ;;
385 esac], 
386 [USE_POISONING=no]) dnl Default value
387
388 dnl Next, check for the optional components:
389 dnl ========================================
390
391 dnl debugging stuff
392 AC_ARG_ENABLE(debug,
393 AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]),
394 [case "${enableval}" in
395   yes) USE_DEBUG=yes ;;
396   no)  USE_DEBUG=no ;;
397   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
398 esac],
399 [USE_DEBUG=yes]) dnl Default value
400
401 dnl valgrind inclusion
402 AC_ARG_ENABLE(valgrind,
403 AC_HELP_STRING([--disable-valgrind],[disable run-time valgrind detection]),
404 [case "${enableval}" in
405   yes) USE_VALGRIND="$USE_DEBUG" ;;
406   no)  USE_VALGRIND=no ;;
407   *) AC_MSG_ERROR(bad value ${enableval} for --enable-valgrind) ;;
408 esac],
409 [USE_VALGRIND="$USE_DEBUG"]) dnl Default value
410 VALGRIND_REQ="2.1"
411 if test "x$USE_VALGRIND" = xyes; then
412
413   PKG_CHECK_MODULES(VALGRIND, valgrind > $VALGRIND_REQ, USE_VALGRIND="yes", USE_VALGRIND="no")
414 fi
415 if test "x$USE_VALGRIND" = xyes; then
416   AC_DEFINE(HAVE_VALGRIND, 1, [Define if valgrind should be used])
417   AC_MSG_NOTICE(Using extra code paths for valgrind)
418 fi
419 AC_SUBST(VALGRIND_CFLAGS)
420 AC_SUBST(VALGRIND_LIBS)
421
422 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
423 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
424
425 dnl ################################################
426 dnl # Set defines according to variables set above #
427 dnl ################################################
428
429
430 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
431 dnl HAVE_ and it is likely to be easier to stick with the old name
432 if test "x$USE_FAST_STACK_TRASH" = xyes; then
433   AC_DEFINE(USE_FAST_STACK_TRASH, 1, [Define if we should use i586 optimized stack functions])
434 fi
435
436 if test "x$USE_POISONING" = xyes; then
437   AC_DEFINE(USE_POISONING, 1, [Define if we should poison deallocated memory])
438 fi
439
440 dnl test for sigaction()
441 AC_CHECK_FUNC(sigaction,
442    AC_DEFINE(HAVE_SIGACTION, 1,
443              [Defined if we have sigaction ()]))
444
445 dnl test for register_printf_function
446 AC_CHECK_FUNC(register_printf_function,
447   [
448     GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"P\""
449     AC_DEFINE(HAVE_PRINTF_EXTENSION, 1,
450              [Defined if we have register_printf_function ()])
451   ],
452   GST_PRINTF_EXTENSION_FORMAT_DEFINE="#define GST_PTR_FORMAT \"p\""
453 )
454 AC_SUBST(GST_PRINTF_EXTENSION_FORMAT_DEFINE)
455
456 dnl test if we have dladdr(); we use it for debugging
457 save_cflags="$CFLAGS"
458 CFLAGS="$CFLAGS -D_GNU_SOURCE"
459 AC_CHECK_LIB(dl, dladdr,
460    AC_DEFINE(HAVE_DLADDR, 1,
461              [Defined if we have dladdr ()]))
462 CFLAGS="$save_cflags"
463
464 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
465   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
466 fi
467
468 if test "x$USE_DEBUG" = xyes; then
469    GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
470 fi
471
472 dnl #############################
473 dnl # Set automake conditionals #
474 dnl #############################
475
476 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
477 dnl HAVE_ and it is likely to be easier to stick with the old name
478 AM_CONDITIONAL(EXPERIMENTAL,        test "x$EXPERIMENTAL" = "yes")
479 AM_CONDITIONAL(BROKEN,              test "x$BROKEN" = "yes")
480 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
481
482
483 dnl ############################
484 dnl # Set up some more defines #
485 dnl ############################
486
487 dnl set license and copyright notice
488 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
489
490 dnl package name in plugins
491 AC_ARG_WITH(package-name,
492 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
493 [case "${withval}" in
494   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
495   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
496   *) GST_PACKAGE="${withval}" ;;
497 esac], 
498 [
499 dnl default value
500 if test "x$GST_CVS" = "xyes"
501 then
502   dnl nano >= 1
503   GST_PACKAGE="GStreamer CVS/prerelease"
504 else
505   GST_PACKAGE="GStreamer source release"
506 fi
507 ]
508 )
509 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
510 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
511
512 dnl package origin URL
513 AC_ARG_WITH(package-origin,
514 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
515 [case "${withval}" in
516   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
517   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
518   *) GST_ORIGIN="${withval}" ;;
519 esac], 
520 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
521 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
522 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
523
524 dnl Set location of plugin directory
525 AS_AC_EXPAND(PLUGINS_DIR, ${libdir}/gstreamer-$GST_MAJORMINOR)
526 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
527 AC_SUBST(PLUGINS_DIR)
528 AC_MSG_NOTICE([Using $PLUGINS_DIR as the plugin install location])
529
530 dnl Set location of uninstalled plugin directory
531 PLUGINS_BUILDDIR=`pwd`
532 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
533 AC_SUBST(PLUGINS_BUILDDIR)
534
535 dnl LDFLAGS modifier defining exported symbols from built objects
536 EXPORT_LDFLAGS="-export-symbols-regex [_]*\(gst_\|Gst\|GST_\).*"
537
538 dnl GST_PKG_*:    the flags we use that are also used
539 dnl               for external applications/.pc file
540 dnl GST_LIB_*:    used for the main library
541 dnl GST_OBJ_*:    the flags we use for all the objects internal to the core
542 dnl GST_PLUGIN_*: additional flags we use for all plugins
543
544 dnl finalize _CFLAGS and _LIBS
545 dnl flags exported for external applications and use in our pkg-config .pc files
546 dnl since glib and xml are package deps, there's no need to include their cflags
547 dnl in the pkg-config file
548
549 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
550 AC_SUBST(GST_PKG_CFLAGS)
551 AC_SUBST(GST_PKG_LIBS)
552 AC_SUBST(GST_PKG_DEPS)
553
554 dnl flags shared for all internal objects (core libs, elements, applications)
555 dnl we disable deprecated internally
556 dnl XML, GLib, popt, GST_INT, VALGRIND, and the right include for CFLAGS
557 dnl no need to add XML, GLib, popt explicitly since libgstreamer pulls them in
558 GST_INT_CFLAGS="$GLIB_CFLAGS $XML_CFLAGS $GST_PKG_CFLAGS \
559  $GST_INT_CFLAGS \$(ERROR_CFLAGS) -DGST_DISABLE_DEPRECATED"
560
561 dnl Private vars for libgst only
562 GST_LIB_CFLAGS="$GST_PKG_CFLAGS $GST_INT_CFLAGS \
563   $VALGRIND_CFLAGS -I\$(top_srcdir)"
564 GST_LIB_LIBS="$XML_LIBS $GLIB_LIBS -lpopt $GST_PKG_LIBS $LTLIBINTL $VALGRIND_LIBS"
565 GST_LIB_LDFLAGS="$GST_LT_LDFLAGS -version-info $GST_LIBVERSION -no-undefined $EXPORT_LDFLAGS"
566 AC_SUBST(GST_LIB_CFLAGS)
567 AC_SUBST(GST_LIB_LIBS)
568 AC_SUBST(GST_LIB_LDFLAGS)
569
570 dnl Vars for all internal objects built on libgstreamer
571 GST_OBJ_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)"
572 GST_OBJ_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
573
574 AC_SUBST(GST_OBJ_CFLAGS, "$GST_OBJ_CFLAGS")
575 AC_SUBST(GST_OBJ_LIBS, "$GST_OBJ_LIBS")
576
577 dnl specific additional LDFLAGS for plugins
578 GST_PLUGIN_LDFLAGS="-module -avoid-version $EXPORT_LDFLAGS"
579 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
580
581 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
582 AC_SUBST(plugindir)
583
584 dnl ##################################################
585 dnl # deps for examples from manual                  #
586 dnl ##################################################
587
588 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
589                   HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
590 AC_SUBST(LIBGNOMEUI_CFLAGS)
591 AC_SUBST(LIBGNOMEUI_LIBS)
592 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
593
594 dnl ##################################################
595 dnl # Prepare informative messages to display at end #
596 dnl ##################################################
597
598 infomessages=
599
600 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
601   infomessages="$infomessages
602 *** Warning: You have configured using the --enable-plugin-builddir option.
603
604 This option is for development purposes only: binaries built with
605 it should be used with code in the build tree only.  To build an
606 installable version, use ./configure without the --enable-plugin-builddir
607 option.  Note that the autogen.sh script supplies the plugin builddir
608 option automatically -- run ./autogen.sh -- --disable-plugin-builddir to make
609 an installable build.
610
611 "
612 fi
613
614 dnl #########################
615 dnl # Make the output files #
616 dnl #########################
617
618 dnl libs/ext/Makefile
619 dnl nothing there yet !
620 AC_OUTPUT(
621 Makefile
622 include/Makefile
623 gst/Makefile
624 gst/gstconfig.h
625 gst/gstversion.h
626 gst/base/Makefile
627 gst/indexers/Makefile
628 gst/elements/Makefile
629 gst/parse/Makefile
630 gst/registries/Makefile
631 libs/Makefile
632 libs/gst/Makefile
633 libs/gst/dataprotocol/Makefile
634 libs/gst/getbits/Makefile
635 po/Makefile.in
636 check/Makefile
637 tests/Makefile
638 tests/instantiate/Makefile
639 tests/memchunk/Makefile
640 tests/muxing/Makefile
641 tests/seeking/Makefile
642 tests/sched/Makefile
643 tests/threadstate/Makefile
644 testsuite/Makefile
645 testsuite/bytestream/Makefile
646 testsuite/caps/Makefile
647 testsuite/cleanup/Makefile
648 testsuite/debug/Makefile
649 testsuite/dlopen/Makefile
650 testsuite/elements/Makefile
651 testsuite/indexers/Makefile
652 testsuite/negotiation/Makefile
653 testsuite/pad/Makefile
654 testsuite/parse/Makefile
655 testsuite/plugin/Makefile
656 testsuite/refcounting/Makefile
657 testsuite/schedulers/Makefile
658 testsuite/states/Makefile
659 testsuite/threads/Makefile
660 testsuite/trigger/Makefile
661 examples/Makefile
662 examples/cutter/Makefile
663 examples/helloworld/Makefile
664 examples/launch/Makefile
665 examples/manual/Makefile
666 examples/mixer/Makefile
667 examples/pingpong/Makefile
668 examples/plugins/Makefile
669 examples/pwg/Makefile
670 examples/queue/Makefile
671 examples/retag/Makefile
672 examples/thread/Makefile
673 examples/typefind/Makefile
674 examples/xml/Makefile
675 tools/Makefile
676 common/Makefile
677 common/m4/Makefile
678 docs/Makefile
679 docs/faq/Makefile
680 docs/gst/Makefile
681 docs/libs/Makefile
682 docs/manual/Makefile
683 docs/plugins/Makefile
684 docs/plugins/gstreamer-plugins.types
685 docs/pwg/Makefile
686 docs/xsl/Makefile
687 docs/version.entities
688 pkgconfig/Makefile
689 stamp.h
690 pkgconfig/gstreamer.pc
691 pkgconfig/gstreamer-uninstalled.pc
692 pkgconfig/gstreamer-base.pc
693 pkgconfig/gstreamer-base-uninstalled.pc
694 pkgconfig/gstreamer-control.pc
695 pkgconfig/gstreamer-control-uninstalled.pc
696 pkgconfig/gstreamer-dataprotocol.pc
697 pkgconfig/gstreamer-dataprotocol-uninstalled.pc
698 gstreamer.spec,
699 echo "$infomessages", infomessages="$infomessages"
700 )