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