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