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