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