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