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