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