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