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