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