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