Add option --enable-gcov to build GStreamer with -fprofile-arcs and -ftest-coverage...
[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, 3, 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, 5, 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 AC_ARG_ENABLE(gcov,
165   [--enable-gcov         compile with coverage profiling instrumentation (gcc only)],
166   enable_gcov=$enableval,enable_gcov=no)
167 if test x$enable_gcov = xyes ; then
168   AS_COMPILER_FLAG(["-fprofile-arcs"],
169     [GST_INT_CFLAGS="$GST_INT_CFLAGS -fprofile-arcs"],
170     true)
171   AS_COMPILER_FLAG(["-ftest-coverage"],
172     [GST_INT_CFLAGS="$GST_INT_CFLAGS -ftest-coverage"],
173     true)
174   GST_INT_CFLAGS=`echo "$GST_INT_CFLAGS" | sed -e 's/-O[0-9]*//g'`
175
176   AC_DEFINE_UNQUOTED(GST_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
177 fi
178 AM_CONDITIONAL(GST_GCOV_ENABLED, test x$enable_gcov = xyes)
179
180
181 dnl Check for essential libraries first:
182 dnl ====================================
183
184 dnl === GLib 2 ===
185 dnl Minimum required version of GLib2
186 dnl required for compilation without warnings
187 GLIB2_REQ="2.2"
188 AC_SUBST(GLIB2_REQ)
189
190 dnl Check for glib2
191 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,HAVE_GLIB2=yes,HAVE_GLIB2=no)
192 GLIB_LIBS=$GLIB2_LIBS
193 GLIB_CFLAGS=$GLIB2_CFLAGS
194 AC_SUBST(GLIB_LIBS)
195 AC_SUBST(GLIB_CFLAGS)
196
197 if test "x$HAVE_GLIB2" = "xno"; then
198   AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
199 fi
200
201 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
202 AC_SUBST(GST_PKG_DEPS)
203   
204 dnl === libxml 2 ===
205 dnl Minimum required version of libxml2
206 LIBXML2_REQ="2.4.9"
207 AC_SUBST(LIBXML2_REQ)
208
209 dnl check for libxml2
210 GST_LIBXML2_CHECK()
211
212 dnl popt checks
213 dnl FIXME: This test passes on popt 1.6.2, maybe earlier, but popt 1.6.2
214 dnl        causes segfaults on gst_init. Write a working test if possible.
215 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
216   AC_MSG_ERROR([popt 1.6.3 or newer is required to build gstreamer. You can
217                 download the latest version from 
218                 ftp://ftp.rpm.org/pub/rpm/dist/])
219 )
220 AC_MSG_NOTICE(Checking for POPT_TABLEEND)
221 AC_COMPILE_IFELSE([
222 #include <popt.h>
223 int main ()
224 {
225 #ifndef POPT_TABLEEND
226 #error
227 #else
228   return 0;
229 #endif
230 }
231 ],, [
232   dnl it failed
233   AC_MSG_ERROR([popt 1.6.3 or newer is required to build gstreamer. You can
234                 download the latest version from 
235                 ftp://ftp.rpm.org/pub/rpm/dist/])
236 ])
237
238 dnl Check for atomic.h
239 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
240 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
241 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
242 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
243 if test x$HAVE_ATOMIC_H = xyes; then
244   AC_LINK_IFELSE([
245 #include "asm/atomic.h"
246 main() {atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
247   ],, [
248     # Not successful
249     if test x$HAVE_ATOMIC_H = xyes; then
250       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
251     fi
252     HAVE_ATOMIC_H=no
253   ])
254 fi
255
256 dnl Check for ucontext.h
257 AC_CHECK_HEADER(ucontext.h, AC_DEFINE(HAVE_UCONTEXT_H, 1, [defined if we have ucontext.h]))
258
259 dnl ######################################################################
260 dnl # Check command line parameters, and set shell variables accordingly #
261 dnl ######################################################################
262
263 dnl FIXME: simplify all this down using a few m4 macros
264
265 AC_ARG_ENABLE(libmmx,
266 AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
267 [case "${enableval}" in
268   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
269   no)  USE_LIBMMX=no ;;
270   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
271 esac], 
272 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
273
274 AC_ARG_ENABLE(atomic,
275 AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
276 [case "${enableval}" in
277   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
278   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
279   no)  USE_ATOMIC_H=no;;
280   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
281 esac], 
282 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
283
284 AC_ARG_ENABLE(fast-stack-trash,
285 AC_HELP_STRING([--enable-fast-stack-trash],[use fast memory allocator (i586 or above)]),
286 [case "${enableval}" in
287   yes) USE_FAST_STACK_TRASH=yes;;
288   noset) USE_FAST_STACK_TRASH=no;;
289   no)  USE_FAST_STACK_TRASH=no;;
290   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
291 esac], 
292 [USE_FAST_STACK_TRASH=yes]) dnl Default value
293
294 AC_ARG_ENABLE(plugin-builddir,
295 AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
296 [case "${enableval}" in
297   yes) PLUGINS_USE_BUILDDIR=yes ;;
298   no)  PLUGINS_USE_BUILDDIR=no ;;
299   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
300 esac], 
301 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
302
303 AC_ARG_ENABLE(profiling,
304 AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
305 [case "${enableval}" in
306   yes) USE_PROFILING=yes ;;
307   no)  UES_PROFILING=no ;;
308   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
309 esac], 
310 [USE_PROFILING=no]) dnl Default value
311
312 dnl use a cache dir for storing element registry info.
313 dnl default to building registry in the source tree if we are enabling plugin build dir
314 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
315   GST_CACHE_DIR=`pwd`
316 else
317   dnl ${localstatedir} points to PREFIX/var
318   GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
319 fi
320 AC_ARG_WITH(cachedir,
321 AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
322 [case "${withval}" in
323   yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
324   no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
325   *) GST_CACHE_DIR="${withval}" ;;
326 esac], 
327 [:]) dnl Default value
328
329 AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
330 AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Location of registry])
331 AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
332
333 dnl building of tests
334 AC_ARG_ENABLE(tests,
335 AC_HELP_STRING([--disable-tests],[disable building test apps]),
336 [case "${enableval}" in
337   yes) BUILD_TESTS=yes ;;
338   no)  BUILD_TESTS=no ;;
339   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
340 esac], 
341 [BUILD_TESTS=yes]) dnl Default value
342 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
343
344 dnl tests known to fail
345 AC_ARG_ENABLE(failing-tests,
346 AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
347 [case "${enableval}" in
348   yes) BUILD_FAILING_TESTS=yes ;;
349   no)  BUILD_FAILING_TESTS=no ;;
350   *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
351 esac], 
352 [BUILD_FAILING_TESTS=no]) dnl Default value
353 AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
354 if test x$BUILD_FAILING_TESTS = xyes; then
355   AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
356 else
357   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.])
358 fi
359
360 AC_ARG_ENABLE(examples,
361 AC_HELP_STRING([--disable-examples],[disable building examples]),
362 [case "${enableval}" in
363   yes) BUILD_EXAMPLES=yes ;;
364   no)  BUILD_EXAMPLES=no ;;
365   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
366 esac], 
367 [BUILD_EXAMPLES=yes]) dnl Default value
368 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
369
370 dnl poison destroyed objects
371 AC_ARG_ENABLE(poisoning,
372 AC_HELP_STRING([--enable-poisoning],[enable poisoning of deallocated objects]),
373 [case "${enableval}" in
374   yes) USE_POISONING=yes ;;
375   no)  USE_POISONING=no ;;
376   *) AC_MSG_ERROR(bad value ${enableval} for --enable-poisoning) ;;
377 esac], 
378 [USE_POISONING=no]) dnl Default value
379
380 dnl Next, check for the optional components:
381 dnl ========================================
382
383 dnl debugging stuff
384 AC_ARG_ENABLE(debug,
385 AC_HELP_STRING([--disable-debug],[disable addition of -g debugging info]),
386 [case "${enableval}" in
387   yes) USE_DEBUG=yes ;;
388   no)  USE_DEBUG=no ;;
389   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
390 esac],
391 [USE_DEBUG=yes]) dnl Default value
392 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_GST_DEBUG, true)
393 GST_SUBSYSTEM_DISABLE(GST_DEBUG,[debugging subsystem])
394
395 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
396 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
397 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
398 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
399 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
400 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
401 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_ALLOC_TRACE, true)
402 GST_SUBSYSTEM_DISABLE(ALLOC_TRACE,[allocation tracing])
403
404 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
405 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
406 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_ENUMTYPES, true)
407 GST_SUBSYSTEM_DISABLE(ENUMTYPES,[enum types])
408 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_INDEX, true)
409 GST_SUBSYSTEM_DISABLE(INDEX,[index])
410 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PLUGIN, true)
411 GST_SUBSYSTEM_DISABLE(PLUGIN,[plugin])
412 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_URI, true)
413 GST_SUBSYSTEM_DISABLE(URI,[uri handlers])
414
415 dnl ################################################
416 dnl # Set defines according to variables set above #
417 dnl ################################################
418
419
420 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
421 dnl HAVE_ and it is likely to be easier to stick with the old name
422 if test "x$USE_LIBMMX" = xyes; then
423   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
424 fi
425
426 if test "x$USE_ATOMIC_H" = xyes; then
427   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
428 fi
429
430 if test "x$USE_FAST_STACK_TRASH" = xyes; then
431   AC_DEFINE(USE_FAST_STACK_TRASH, 1, [Define if we should use i586 optimized stack functions])
432 fi
433
434 if test "x$USE_POISONING" = xyes; then
435   AC_DEFINE(USE_POISONING, 1, [Define if we should poison deallocated memory])
436 fi
437
438 dnl test if we have pthread_attr_setstack; if not use the older calls
439 AC_CHECK_LIB(pthread, pthread_attr_setstack, 
440    AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1, 
441              [Defined if libpthread has pthread_attr_setstack ()]))
442
443 dnl test if we have posix_memalign; FreeBSD doesn't
444 AC_CHECK_FUNC(posix_memalign,
445    AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
446              [Defined if we have posix_memalign ()]))
447
448 dnl test for sigaction()
449 AC_CHECK_FUNC(sigaction,
450    AC_DEFINE(HAVE_SIGACTION, 1,
451              [Defined if we have sigaction ()]))
452
453 dnl test if we have dladdr(); we use it for debugging
454 save_cflags="$CFLAGS"
455 CFLAGS="$CFLAGS -D_GNU_SOURCE"
456 AC_CHECK_LIB(dl, dladdr,
457    AC_DEFINE(HAVE_DLADDR, 1,
458              [Defined if we have dladdr ()]))
459 CFLAGS="$save_cflags"
460
461 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
462   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
463 fi
464
465 if test "x$USE_DEBUG" = xyes; then
466    GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
467 fi
468
469 dnl #############################
470 dnl # Set automake conditionals #
471 dnl #############################
472
473 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
474 dnl HAVE_ and it is likely to be easier to stick with the old name
475 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
476
477 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
478 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
479
480 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
481
482
483 dnl ############################
484 dnl # Set up some more defines #
485 dnl ############################
486
487 dnl set license and copyright notice
488 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
489 dnl package name in plugins
490 AC_ARG_WITH(package-name,
491 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
492 [case "${withval}" in
493   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
494   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
495   *) GST_PACKAGE="${withval}" ;;
496 esac], 
497 [GST_PACKAGE="GStreamer"]) dnl Default value
498 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
499 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
500 dnl package origin URL
501 AC_ARG_WITH(package-origin,
502 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
503 [case "${withval}" in
504   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
505   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
506   *) GST_ORIGIN="${withval}" ;;
507 esac], 
508 [GST_ORIGIN="http://gstreamer.net"]) dnl Default value
509 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
510 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
511
512 dnl Set location of plugin directory
513 if test "x${prefix}" = "xNONE"; then
514   PLUGINS_DIR=${ac_default_prefix}/lib/gstreamer-$GST_MAJORMINOR
515 else
516   PLUGINS_DIR=${prefix}/lib/gstreamer-$GST_MAJORMINOR
517 fi
518 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
519 AC_SUBST(PLUGINS_DIR)
520
521 dnl Set location of uninstalled plugin directory
522 PLUGINS_BUILDDIR=`pwd`
523 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
524 AC_SUBST(PLUGINS_BUILDDIR)
525
526 dnl since glib and xml are package deps, there's no need to include their cflags
527 dnl in the pkg-config file
528
529 dnl for pkg-config
530 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
531 GST_PKG_LIBS=$GST_EXT_LIBS
532 AC_SUBST(GST_PKG_CFLAGS)
533 AC_SUBST(GST_PKG_LIBS)
534
535 dnl finalize _CFLAGS and _LIBS
536 dnl add GLIB and XML if necessary to EXT_*
537 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
538 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
539
540 dnl Private vars for libgst only
541 LIBGST_LIBS="$GST_LIBS"
542 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
543 AC_SUBST(LIBGST_LIBS)
544 AC_SUBST(LIBGST_CFLAGS)
545
546 dnl Vars for everyone else
547 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
548 GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
549
550 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
551 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
552
553 GST_PLUGIN_LDFLAGS="-module -avoid-version"
554 AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
555
556
557 dnl ##################################################
558 dnl # deps for examples from manual                  #
559 dnl ##################################################
560
561 PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
562                   HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
563 AC_SUBST(LIBGNOMEUI_CFLAGS)
564 AC_SUBST(LIBGNOMEUI_LIBS)
565 AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
566
567 dnl ##################################################
568 dnl # Prepare informative messages to display at end #
569 dnl ##################################################
570
571 infomessages=
572
573 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
574   infomessages="$infomessages
575 *** Warning: You have configured using the --enable-plugin-builddir option.
576
577 This option is for development purposes only: binaries built with
578 it should be used with code in the build tree only.  To build an
579 installable version, use ./configure without the --enable-plugin-builddir
580 option.  Note that the autogen.sh script supplies the plugin builddir
581 option automatically -- run ./autogen.sh -- --disable-plugin-builddir to make
582 an installable build.
583
584 "
585 fi
586
587 dnl #########################
588 dnl # Make the output files #
589 dnl #########################
590
591 dnl libs/ext/Makefile
592 dnl nothing there yet !
593 AC_OUTPUT(
594 Makefile
595 include/Makefile
596 gst/Makefile
597 gst/gstconfig.h
598 gst/gstversion.h
599 gst/autoplug/Makefile
600 gst/indexers/Makefile
601 gst/elements/Makefile
602 gst/parse/Makefile
603 gst/schedulers/Makefile
604 gst/registries/Makefile
605 libs/Makefile
606 libs/gst/Makefile
607 libs/gst/bytestream/Makefile
608 libs/gst/control/Makefile
609 libs/gst/getbits/Makefile
610 po/Makefile.in
611 tests/Makefile
612 tests/bufspeed/Makefile
613 tests/instantiate/Makefile
614 tests/memchunk/Makefile
615 tests/muxing/Makefile
616 tests/seeking/Makefile
617 tests/sched/Makefile
618 tests/threadstate/Makefile
619 testsuite/Makefile
620 testsuite/bins/Makefile
621 testsuite/bytestream/Makefile
622 testsuite/caps/Makefile
623 testsuite/cleanup/Makefile
624 testsuite/clock/Makefile
625 testsuite/debug/Makefile
626 testsuite/dynparams/Makefile
627 testsuite/elements/Makefile
628 testsuite/indexers/Makefile
629 testsuite/parse/Makefile
630 testsuite/plugin/Makefile
631 testsuite/refcounting/Makefile
632 testsuite/tags/Makefile
633 testsuite/threads/Makefile
634 examples/Makefile
635 examples/cutter/Makefile
636 examples/helloworld/Makefile
637 examples/launch/Makefile
638 examples/manual/Makefile
639 examples/mixer/Makefile
640 examples/pingpong/Makefile
641 examples/plugins/Makefile
642 examples/queue/Makefile
643 examples/queue2/Makefile
644 examples/queue3/Makefile
645 examples/queue4/Makefile
646 examples/retag/Makefile
647 examples/thread/Makefile
648 examples/typefind/Makefile
649 examples/xml/Makefile
650 tools/Makefile
651 docs/Makefile
652 docs/faq/Makefile
653 docs/gst/Makefile
654 docs/libs/Makefile
655 docs/manual/Makefile
656 docs/plugins/Makefile
657 docs/plugins/gstreamer-plugins.types
658 docs/pwg/Makefile
659 docs/xsl/Makefile
660 docs/version.entities
661 pkgconfig/Makefile
662 stamp.h
663 pkgconfig/gstreamer.pc
664 pkgconfig/gstreamer-uninstalled.pc
665 pkgconfig/gstreamer-control.pc
666 pkgconfig/gstreamer-control-uninstalled.pc
667 gstreamer.spec,
668 echo "$infomessages", infomessages="$infomessages"
669 )
670