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