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