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