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