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