same changes as in gst-plugins module also, PKG_CHECK_MODULES does the pkg-config...
[platform/upstream/gstreamer.git] / configure.ac
1 dnl Note: this file is now the main autoconf file
2 AC_INIT
3 AC_CONFIG_SRCDIR([gst/gstobject.h])
4
5 AC_CANONICAL_TARGET([])
6
7 AM_CONFIG_HEADER(config.h)
8
9 GST_VERSION_MAJOR=0
10 GST_VERSION_MINOR=3
11 GST_VERSION_MICRO=01
12
13 dnl we use the release tag during CVS development
14 GST_VERSION_RELEASE=`date +%Y%m%d`
15
16 GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GST_VERSION_MICRO
17
18 PACKAGE=gstreamer
19 VERSION=$GST_VERSION
20
21 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
22 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
23 AC_SUBST(PACKAGE)
24 AC_SUBST(VERSION)
25 AC_DEFINE_UNQUOTED(GST_VERSION_RELEASE, "$GST_VERSION_RELEASE")
26 AC_SUBST(GST_VERSION_RELEASE)
27
28 dnl libtool
29 GST_CURRENT=1
30 GST_REVISION=0
31 GST_AGE=0
32 GST_LIBVERSION=$GST_CURRENT:$GST_REVISION:$GST_AGE
33
34 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
35 dnl Add parameters for aclocal
36 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
37 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
38
39 AC_SUBST(GST_VERSION_MAJOR)
40 AC_SUBST(GST_VERSION_MINOR)
41 AC_SUBST(GST_VERSION_MICRO)
42 AC_SUBST(GST_VERSION)
43
44 AC_SUBST(GST_CURRENT)
45 AC_SUBST(GST_REVISION)
46 AC_SUBST(GST_AGE)
47 AC_SUBST(GST_LIBVERSION)
48
49 AM_MAINTAINER_MODE
50
51 AC_PROG_CC
52 AM_PROG_CC_STDC
53 AM_PROG_AS
54 AS="${CC}"
55 AC_PROG_CXX
56 AC_PROG_CXXCPP
57 AC_ISC_POSIX
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 AM_DISABLE_STATIC
62 AC_LIBTOOL_DLOPEN
63 AM_PROG_LIBTOOL
64
65 AC_HEADER_STDC([])
66
67
68 dnl ##############################
69 dnl # Do automated configuration #
70 dnl ##############################
71
72 dnl Check for tools:
73 dnl ================
74
75 dnl modify pkg-config path
76 AC_ARG_WITH(pkg-config-path, 
77    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
78    [export PKG_CONFIG_PATH=${withval}])
79
80 dnl Check for nasm
81 AC_PATH_PROG(NASM_PATH, nasm, no)
82 AC_SUBST(NASM_PATH)
83 if test x$NASM_PATH = xno; then
84   AC_MSG_WARN(Couldn't find nasm)
85   HAVE_NASM="no"
86 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
87   HAVE_NASM="yes"
88 fi
89
90 dnl check for gtk-doc
91 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
92
93 if test "x$with_html_dir" = "x" ; then
94   HTML_DIR='${datadir}/gst/html'
95 else
96   HTML_DIR=$with_html_dir
97 fi
98
99 AC_SUBST(HTML_DIR)
100
101 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, true, false)
102 gtk_doc_min_version=0.6
103 if $HAVE_GTK_DOC ; then 
104     gtk_doc_version=`gtkdoc-mkdb --version`
105     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
106     if perl <<EOF ; then
107       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
108             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
109 EOF
110       AC_MSG_RESULT(yes)
111    else
112       AC_MSG_RESULT(no)
113       HAVE_GTK_DOC=false
114    fi
115 fi
116 GTK_DOC_SCANOBJ=gtkdoc-scanobj
117
118 AC_SUBST(HAVE_GTK_DOC)
119 AC_SUBST(GTK_DOC_SCANOBJ)
120
121 dnl check for docbook tools
122 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, true, false)
123 AC_CHECK_PROG(HAVE_PDFTOPS, pdftops, true, false)
124 dnl this does not yet work properly, at least on debain -- wingo
125 HAVE_PDFXMLTEX=false
126
127 dnl check for image conversion tool
128 AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
129
130 dnl The following is a hack: if fig2dev doesn't display an error message
131 dnl for the desired type, we assume it supports it.
132 HAVE_FIG2DEV_PNG=false
133 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
134   fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
135   if test "x$fig2dev_quiet" = "x" ; then
136     HAVE_FIG2DEV_PNG=true
137   fi
138 fi
139 HAVE_FIG2DEV_PDF=false
140 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
141   fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
142   if test "x$fig2dev_quiet" = "x" ; then
143     HAVE_FIG2DEV_PDF=true
144   fi
145 fi
146
147
148 dnl Set up conditionals for (target) architecture:
149 dnl ==============================================
150
151 dnl Determine CPU
152 case "x${target_cpu}" in
153   xi?86 | k?) HAVE_CPU_I386=yes
154               AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
155               dnl FIXME could use some better detection
156               dnl       (ie CPUID)
157               case "x${target_cpu}" in
158                 xi386 | xi486) ;;
159                 *)             AC_DEFINE(HAVE_RDTSC) ;;
160               esac ;;
161   xpowerpc)   HAVE_CPU_PPC=yes
162               AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
163   xalpha)     HAVE_CPU_ALPHA=yes
164               AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
165   xarm*)      HAVE_CPU_ARM=yes
166               AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
167   xsparc*)    HAVE_CPU_SPARC=yes
168               AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
169   xmips*)     HAVE_CPU_MIPS=yes
170               AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;;
171   xhppa*)     HAVE_CPU_HPPA=yes
172               AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;;
173 esac
174
175 dnl Determine endianness
176 AC_C_BIGENDIAN
177
178 dnl Check for MMX-capable compiler
179 AC_MSG_CHECKING(for MMX-capable compiler)
180 AC_TRY_RUN([
181 #include "include/mmx.h"
182
183 main()
184 { movq_r2r(mm0, mm1); return 0; }
185 ],
186 [
187 HAVE_LIBMMX="yes"
188 AC_MSG_RESULT(yes)
189 ],
190 HAVE_LIBMMX="no"
191 AC_MSG_RESULT(no)
192 ,
193 HAVE_LIBMMX="no"
194 AC_MSG_RESULT(no)
195 )
196
197 dnl
198 dnl We should really use AC_SYS_LARGEFILE, but the problem is
199 dnl many of the plugins don't include "config.h".  To assure
200 dnl binary compatibility, it is necessary that all gstreamer
201 dnl code be compiled with the same sizeof(off_t), so we use
202 dnl the following crude hack.
203 dnl
204
205 AC_MSG_CHECKING(for large file support)
206 AC_TRY_RUN([
207 #define _LARGEFILE_SOURCE
208 #define _FILE_OFFSET_BITS 64
209 #include <sys/types.h>
210 int main () { return !(sizeof(off_t) == 8); }
211 ],
212 [
213 AC_MSG_RESULT(yes)
214 GST_CFLAGS="$GST_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
215 ],
216 [
217 AC_MSG_RESULT(no)
218 ],
219 [
220 AC_MSG_RESULT(no)
221 ])
222
223 dnl Check for essential libraries first:
224 dnl ====================================
225
226 dnl Check for glib2
227 translit(dnm, m, l) AM_CONDITIONAL(USE_GLIB2, true)
228 GST_CHECK_FEATURE(GLIB2, [use of glib-2.0 and GObject], , [
229   PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
230     HAVE_GLIB2=yes,HAVE_GLIB2=no)
231   GLIB_LIBS=$GLIB2_LIBS
232   GLIB_CFLAGS=$GLIB2_CFLAGS
233   AC_SUBST(GLIB_LIBS)
234   AC_SUBST(GLIB_CFLAGS)
235 ], disabled, [
236   AC_DEFINE(USE_GLIB2)
237   GST_CFLAGS="$GST_CFLAGS -DUSE_GLIB2"
238 ])
239 AC_SUBST(USE_GLIB2)
240
241 if test x$USE_GLIB2 = xno; then
242   GST_PKG_DEPS="glib >= 1.2.0, gtk+ >= 1.2.0"
243   
244   dnl Check for glib and gtk
245   AM_PATH_GLIB(1.2.0,,
246               AC_MSG_ERROR(Cannot find glib: Is glib-config in path?),
247               glib gmodule gthread)
248   AM_PATH_GTK(1.2.0,,
249               AC_MSG_ERROR(Cannot find gtk: Is gtk-config in path?))
250   HAVE_GTK=yes
251
252   GLIB_LIBS="$GLIB_LIBS $GTK_LIBS"
253   GLIB_CFLAGS="$GLIB_CFLAGS $GTK_CFLAGS"
254 else
255   GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
256   
257   PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK=yes, HAVE_GTK=no)
258
259   GTK_CFLAGS=$GTK2_CFLAGS
260   GTK_LIBS=$GTK2_LIBS
261   
262   if $HAVE_GTK_DOC; then  
263     AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scangobj, true, false)
264     if $HAVE_GTK_DOC; then
265       GTK_DOC_SCANOBJ=gtkdoc-scangobj
266     fi;
267   fi
268
269   dnl FIXME: check for  gnome2 - this conditional is currently
270   dnl always false.
271   AM_CONDITIONAL(USE_GNOME2, test "x$USE_GNOME2" = "xyes")
272   AC_SUBST(USE_GNOME2)
273 fi
274
275 AC_SUBST(GST_PKG_DEPS)
276 AC_SUBST(GTK_LIBS)
277 AC_SUBST(GTK_CFLAGS)
278
279 dnl Check for libxml
280 if test x$USE_GLIB2 = xno; then
281   LIBXML_PKG=', libxml >= 1.8.1'
282   AC_PATH_PROG(XML_CONFIG, xml-config, no)
283   if test x$XML_CONFIG = xno; then
284     AC_MSG_ERROR(Couldn't find $LIBXML_PKG)
285   fi
286   XML_LIBS="`xml-config --libs`"
287   XML_CFLAGS="`xml-config --cflags`"
288   AC_CHECK_LIB(xml, xmlDocGetRootElement, :,
289     [ AC_MSG_ERROR(Need version 1.8.1 or better of libxml) ],
290     $XML_LIBS)
291 else
292   LIBXML_PKG=', libxml-2.0'
293   PKG_CHECK_MODULES(XML, $LIBXML_PKG, XML_CONFIG=yes, XML_CONFIG=no)
294   AC_PATH_PROG(XML_CONFIG, xml-config, no)
295   AC_DEFINE(HAVE_LIBXML2)
296   GST_CFLAGS="$GST_CFLAGS -DHAVE_LIBXML2"
297 fi
298 AC_SUBST(LIBXML_PKG)
299 AC_SUBST(XML_LIBS)
300 AC_SUBST(XML_CFLAGS)
301
302 if test x$USE_GLIB2 = xyes; then
303   dnl we don't support gnome/gtk with glib2.0 yet
304   GNOME_LIBS=
305   GNOME_CFLAGS=
306   HAVE_GNOME=no
307   AC_MSG_WARN(gnome disabled for glib2.0)
308 else
309   dnl Check for libgnome
310   GST_CHECK_CONFIGPROG(GNOME, gnome-config, gnome gnomeui)
311 fi
312 AC_SUBST(GNOME_LIBS)
313 AC_SUBST(GNOME_CFLAGS)
314 AC_SUBST(HAVE_GNOME)
315
316 dnl Check for libglade with gnome support; no libglade for glib2.0
317 HAVE_LIBGLADE_GNOME="no"
318 if test x$USE_GLIB2 = xyes; then
319   AC_MSG_WARN(libglade disabled for glib2.0)
320   PKG_CHECK_MODULES(LIBGLADE_GNOME, libglade-2.0 libgnomeui-2.0, HAVE_LIBGLADE_GNOME=yes, HAVE_LIBGLADE_GNOME=no)
321   if test x$HAVE_LIBGLADE_GNOME = xno; then
322     AC_MSG_WARN(Couldn't find libglade-2.0 - Can't build gstplay)
323     LIBGLADE_GNOME_LIBS=
324     LIBGLADE_GNOME_CFLAGS=
325   fi;
326 else
327   AM_PATH_LIBGLADE(HAVE_LIBGLADE_GNOME="yes", HAVE_LIBGLADE_GNOME="no", gnome)
328   if test x$HAVE_LIBGLADE_GNOME = xno; then
329     AC_MSG_WARN(Couldn't find libglade-config - Can't build gstplay)
330   else
331     LIBGLADE_GNOME_LIBS=$LIBGLADE_LIBS
332     LIBGLADE_GNOME_CFLAGS=$LIBGLADE_CFLAGS
333         AC_TRY_LINK([#include <glade/glade.h>],[glade_gnome_init();],
334                 HAVE_LIBGLADE_GNOME="yes"
335                 AC_MSG_WARN(
336         [Couldn't find gnome libraries for libglade - Can't build gstmediaplay and gsteditor])
337                )
338   fi
339 fi
340 AC_SUBST(HAVE_LIBGLADE_GNOME)
341 AC_SUBST(LIBGLADE_GNOME_LIBS)
342 AC_SUBST(LIBGLADE_GNOME_CFLAGS)
343
344 dnl Check for atomic.h
345 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
346 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
347 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
348 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
349 if test x$HAVE_ATOMIC_H = xyes; then
350   AC_TRY_RUN([
351 #include "asm/atomic.h"
352 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
353   ],, [
354     # Not successful
355     if test x$HAVE_ATOMIC_H = xyes; then
356       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
357     fi
358     HAVE_ATOMIC_H=no
359   ], [
360     # Cross compiling
361     AC_MSG_RESULT(yes)
362     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
363   ])
364 fi
365
366
367 dnl ######################################################################
368 dnl # Check command line parameters, and set shell variables accordingly #
369 dnl ######################################################################
370
371 AC_ARG_ENABLE(libmmx,
372 [  --enable-libmmx              use libmmx, if available],
373 [case "${enableval}" in
374   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
375   no)  USE_LIBMMX=no ;;
376   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
377 esac], 
378 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
379
380 AC_ARG_ENABLE(atomic,
381 [  --enable-atomic              use atomic reference counting header],
382 [case "${enableval}" in
383   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
384   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
385   no)  USE_ATOMIC_H=no;;
386   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
387 esac], 
388 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
389
390 AC_ARG_ENABLE(plugin-builddir,
391 [  --enable-plugin-builddir     allow tests/demos to use non-installed plugins ],
392 [case "${enableval}" in
393   yes) PLUGINS_USE_BUILDDIR=yes ;;
394   no)  PLUGINS_USE_BUILDDIR=no ;;
395   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
396 esac], 
397 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
398
399 AC_ARG_ENABLE(debug,
400 [  --enable-debug               compile with -g debugging info],
401 [case "${enableval}" in
402   yes) USE_DEBUG=yes ;;
403   no)  USE_DEBUG=no ;;
404   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
405 esac], 
406 [USE_DEBUG=no]) dnl Default value
407
408 AC_ARG_ENABLE(DEBUG,
409 [  --enable-DEBUG               compiles in a large number of debugging messages],
410 [case "${enableval}" in
411   yes) ENABLE_DEBUG=yes ;;
412   no)  ENABLE_DEBUG=no ;;
413   *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
414 esac], 
415 [ENABLE_DEBUG=no]) dnl Default value
416 if test x$ENABLE_DEBUG = xyes; then
417   AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
418 fi
419
420 AC_ARG_ENABLE(INFO,
421 [  --disable-INFO               disables compilation of informational messages],
422 [case "${enableval}" in
423   yes) ENABLE_INFO=yes ;;
424   no)  ENABLE_INFO=no ;;
425   *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
426 esac], 
427 [ENABLE_INFO=yes]) dnl Default value
428 if test x$ENABLE_INFO = xyes; then
429   AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
430 fi
431
432 AC_ARG_ENABLE(debug-color,
433 [  --disable-debug-color        disables color output of DEBUG and INFO output],
434 [case "${enableval}" in
435   yes) ENABLE_DEBUG_COLOR=yes ;;
436   no)  ENABLE_DEBUG_COLOR=no ;;
437   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
438 esac], 
439 [ENABLE_DEBUG_COLOR=yes]) dnl Default value
440 if test "x$ENABLE_DEBUG_COLOR" = xyes; then
441   AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
442 fi
443
444 AC_ARG_ENABLE(profiling,
445 [  --enable-profiling           adds -pg to compiler commandline, for profiling],
446 [case "${enableval}" in
447   yes) USE_PROFILING=yes ;;
448   no)  UES_PROFILING=no ;;
449   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
450 esac], 
451 [USE_PROFILING=no]) dnl Default value
452
453 dnl default to building registry in the source tree if we are enabling plugin build dir
454 if test "x$PLUGINS_USE_BUILDDIR"="xyes"; then
455   GST_CONFIG_DIR=`pwd`
456 else
457   GST_CONFIG_DIR=/etc/gstreamer
458 fi
459 AC_ARG_WITH(configdir,
460 [  --with-configdir             specify path to use for configdir],
461 [case "${withval}" in
462   yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
463   no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
464   *) GST_CONFIG_DIR="${withval}" ;;
465 esac], 
466 [:]) dnl Default value
467
468 dnl Default value
469 GST_WIN32_LIBDIR="/usr/lib/win32"
470 AC_ARG_WITH(win32_libdir,
471 [  --with-win32-libdir          specify location for win32 DLLs],
472 [case "${withval}" in
473   yes) AC_MSG_ERROR(bad value ${withval} for --with-win32-libdir) ;;
474   no) AC_MSG_ERROR(bad value ${withval} for --with-win32-libdir) ;;
475   *) GST_WIN32_LIBDIR="${withval}" ;;
476 esac],
477 [:]) dnl Default value
478
479 AC_ARG_ENABLE(docs-build,
480 [  --enable-docs-build          enable building of documentation],
481 [case "${enableval}" in
482   yes) if $HAVE_GTK_DOC; then BUILD_DOCS=yes; else AC_MSG_ERROR([you don't have gtk-doc, so don't use --docs-build]); fi; ;;
483   no)  BUILD_DOCS=no ;;
484   *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs-build) ;;
485 esac], 
486 [BUILD_DOCS=no]) dnl Default value
487
488 AC_ARG_ENABLE(plugin-docs,
489 [  --enable-plugin-docs         enable the building of plugin documentation
490                                (this is currently broken, so off by default)],
491 [case "${enableval}" in
492   yes) BUILD_PLUGIN_DOCS=yes ;;
493   no)  BUILD_PLUGIN_DOCS=no ;;
494   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;;
495 esac], 
496 [BUILD_PLUGIN_DOCS=no]) dnl Default value
497
498 AC_ARG_ENABLE(tests,
499 [  --disable-tests              disable building test apps],
500 [case "${enableval}" in
501   yes) BUILD_TESTS=yes ;;
502   no)  BUILD_TESTS=no ;;
503   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
504 esac], 
505 [BUILD_TESTS=yes]) dnl Default value
506
507 AC_ARG_ENABLE(examples,
508 [  --disable-examples           disable building examples],
509 [case "${enableval}" in
510   yes) BUILD_EXAMPLES=yes ;;
511   no)  BUILD_EXAMPLES=no ;;
512   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
513 esac], 
514 [BUILD_EXAMPLES=yes]) dnl Default value
515
516 dnl Next, check for the optional components:
517 dnl ========================================
518
519
520 AC_DEFUN(GST_SUBSYSTEM_DISABLE,
521 [dnl
522 dnl Add a subsystem --disable flag and all the necessary symbols and substitions
523 dnl
524 AC_ARG_ENABLE(translit([$1], A-Z, a-z), 
525 [  ]builtin(format, --disable-%-17s  disable %s, translit([$1], A-Z, a-z), $2),
526 [ case "${enableval}" in
527     yes) GST_DISABLE_[$1]=no ;;
528     no) GST_DISABLE_[$1]=yes ;;
529     *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;;
530   esac],
531 [GST_DISABLE_[$1]=no]) dnl Default value
532 if test x$GST_DISABLE_[$1] = xyes; then
533   AC_DEFINE(GST_DISABLE_[$1], 1, [Disable $2])
534   GST_DISABLE_[$1]_DEFINE=-DGST_DISABLE_[$1]
535 fi
536 AM_CONDITIONAL(GST_DISABLE_[$1], test x$GST_DISABLE_[$1] = xyes)
537 AC_SUBST(GST_DISABLE_[$1]_DEFINE)
538 GST_SUBSYSTEM_DISABLE_DEFINES="$GST_SUBSYTEM_DISABLE_DEFINES $GST_DISABLE_[$1]_DEFINE"
539 ])
540
541 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
542 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
543 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
544 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
545 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
546 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
547 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
548 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
549 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
550 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
551 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
552 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
553
554 GST_CFLAGS="$GST_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
555
556 dnl for pkg-config
557 GST_PKG_CFLAGS=$GST_CFLAGS
558 AC_SUBST(GST_PKG_CFLAGS)
559
560 dnl ################################################
561 dnl # Set defines according to variables set above #
562 dnl ################################################
563
564
565 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
566 dnl HAVE_ and it is likely to be easier to stick with the old name
567 if test "x$USE_LIBGHTTP" = xyes; then
568   AC_DEFINE(HAVE_LIBGHTTP, 1, [Define if ghttp library is available])
569 fi
570
571 if test "x$USE_LIBMMX" = xyes; then
572   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
573 fi
574
575 if test "x$USE_ATOMIC_H" = xyes; then
576   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
577 fi
578
579 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
580   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
581 fi
582
583 dnl if test "x$USE_DEBUG" = xyes; then
584 dnl   CFLAGS="$CFLAGS -g"
585 dnl fi
586
587 if test "x$USE_PROFILING" = xyes; then
588 dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
589   FOMIT_FRAME_POINTER=""
590 else
591   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
592 fi
593
594 dnl
595 dnl AC_SUBST(FOMIT_FRAME_POINTER)
596 dnl
597
598 if test "x$HAVE_LIBXV" = xyes; then
599   AC_DEFINE(HAVE_LIBXV)
600 fi
601
602 dnl #############################
603 dnl # Set automake conditionals #
604 dnl #############################
605
606 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
607 dnl HAVE_ and it is likely to be easier to stick with the old name
608 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
609 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
610 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
611 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
612 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
613 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
614
615 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
616
617 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
618 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
619
620 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
621 AM_CONDITIONAL(HAVE_LIBGLADE_GNOME, test "x$HAVE_LIBGLADE_GNOME" = "xyes")
622 AM_CONDITIONAL(HAVE_GNOME,          test "x$HAVE_GNOME" = "xyes")
623 AM_CONDITIONAL(HAVE_LIBXV,          test "x$HAVE_LIBXV" = "xyes")
624 AM_CONDITIONAL(HAVE_GTK,            test "x$HAVE_GTK" = "xyes")
625 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
626 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
627 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
628 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
629 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
630 AM_CONDITIONAL(HAVE_PDFXMLTEX,      $HAVE_PDFXMLTEX)
631 AM_CONDITIONAL(HAVE_PDFTOPS,        $HAVE_PDFTOPS)
632 AM_CONDITIONAL(HAVE_XSLTPROC,       $HAVE_XSLTPROC)
633 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
634 AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
635 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
636
637
638 dnl ############################
639 dnl # Set up some more defines #
640 dnl ############################
641
642 dnl Set location of configuration dir.
643 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
644 AC_SUBST(GST_CONFIG_DIR)
645
646 dnl Set location of windows dll dir.
647 AC_DEFINE_UNQUOTED(GST_WIN32_LIBDIR,"$GST_WIN32_LIBDIR")
648 AC_SUBST(GST_WIN32_LIBDIR)
649
650 dnl Set location of plugin directory
651 if test "x${prefix}" = "xNONE"; then
652   PLUGINS_DIR=${ac_default_prefix}/lib/gst
653 else
654   PLUGINS_DIR=${prefix}/lib/gst
655 fi
656 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
657 AC_SUBST(PLUGINS_DIR)
658
659 dnl Set location of uninstalled plugin directory
660 PLUGINS_BUILDDIR=`pwd`
661 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
662 AC_SUBST(PLUGINS_BUILDDIR)
663
664 dnl Private vars for libgst only
665 LIBGST_LIBS="$GST_LIBS $XML_LIBS $GLIB_LIBS"
666 LIBGST_CFLAGS="$GST_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
667 AC_SUBST(LIBGST_LIBS)
668 AC_SUBST(LIBGST_CFLAGS)
669
670 dnl Vars for everyone else
671 GST_LIBS="\$(top_builddir)/gst/libgst.la $LIBGST_LIBS"
672 GST_CFLAGS="-I\$(top_srcdir) -I\$(top_srcdir)/libs -I\$(top_srcdir)/include $LIBGST_CFLAGS"
673 AC_SUBST(GST_LIBS)
674 AC_SUBST(GST_CFLAGS)
675
676 dnl ##################################################
677 dnl # Prepare informative messages to display at end #
678 dnl ##################################################
679
680 infomessages=
681
682 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
683   infomessages="$infomessages
684 *** Warning: You have configured using the --enable-plugin-builddir option.
685
686 This option is for development purposes only: binaries built with
687 it should be used with code in the build tree only.  To build an
688 installable version, use ./configure without the --enable-plugin-builddir
689 option.  Note that the autogen.sh script supplies the plugin builddir
690 option automatically - it cannot be used to configure installable builds.
691
692 "
693 fi
694
695 dnl #########################
696 dnl # Make the output files #
697 dnl #########################
698
699 dnl until ffmpeg is handled by configure plugins/ffmpeg/Makefile
700 dnl components/bonobo-gstmediaplay/Makefile
701 dnl someone should fix this test/misc/Makefile
702 dnl wtay fix this: testsuite/threads/Makefile
703 dnl testsuite/refcounting/Makefile
704 AC_OUTPUT(
705 Makefile
706 include/Makefile
707 gst/Makefile
708 gst/gstversion.h
709 gst/types/Makefile
710 gst/elements/Makefile
711 gst/autoplug/Makefile
712 gst/schedulers/Makefile
713 libs/Makefile
714 libs/gst/Makefile
715 libs/gst/bytestream/Makefile
716 libs/gst/getbits/Makefile
717 libs/gst/putbits/Makefile
718 libs/gst/control/Makefile
719 gstplay/Makefile
720 test/Makefile
721 test/xml/Makefile
722 test/bindings/Makefile
723 test/memchunk/Makefile
724 test/events/Makefile
725 tests/Makefile
726 tests/sched/Makefile
727 tests/eos/Makefile
728 tests/muxing/Makefile
729 testsuite/Makefile
730 testsuite/bytestream/Makefile
731 testsuite/capsnego/Makefile
732 testsuite/plugin/Makefile
733 testsuite/cleanup/Makefile
734 tests/nego/Makefile
735 examples/Makefile
736 examples/autoplug/Makefile
737 examples/helloworld/Makefile
738 examples/helloworld2/Makefile
739 examples/launch/Makefile
740 examples/queue/Makefile
741 examples/queue2/Makefile
742 examples/queue3/Makefile
743 examples/queue4/Makefile
744 examples/thread/Makefile
745 examples/mixer/Makefile
746 examples/cutter/Makefile
747 examples/launch/Makefile
748 examples/xml/Makefile
749 examples/plugins/Makefile
750 examples/typefind/Makefile
751 examples/mixer/Makefile
752 editor/Makefile
753 editor/pixmaps/Makefile
754 tools/Makefile
755 docs/Makefile
756 docs/gst/Makefile
757 docs/gst/gstreamer.types
758 docs/libs/Makefile
759 docs/plugins/Makefile
760 docs/plugins/gstreamer-plugins.types
761 docs/manual/Makefile
762 docs/fwg/Makefile
763 stamp.h
764 gstreamer.pc
765 gstreamer-uninstalled.pc
766 gstreamer.spec,
767 echo "$infomessages", infomessages="$infomessages"
768 )