conversion to xml manuals
[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=0
12 dnl we use the release tag during CVS development
13 GST_VERSION_RELEASE=`date +%Y%m%d`
14 GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GST_VERSION_MICRO
15
16 PACKAGE=gstreamer
17 VERSION=$GST_VERSION
18
19 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
20 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
21 AC_SUBST(PACKAGE)
22 AC_SUBST(VERSION)
23 AC_DEFINE_UNQUOTED(GST_VERSION_RELEASE, "$GST_VERSION_RELEASE")
24 AC_SUBST(GST_VERSION_RELEASE)
25
26 dnl libtool
27 GST_CURRENT=1
28 GST_REVISION=0
29 GST_AGE=0
30 GST_LIBVERSION=$GST_CURRENT:$GST_REVISION:$GST_AGE
31
32 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
33 dnl Add parameters for aclocal
34 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
35 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
36
37 AC_SUBST(GST_VERSION_MAJOR)
38 AC_SUBST(GST_VERSION_MINOR)
39 AC_SUBST(GST_VERSION_MICRO)
40 AC_SUBST(GST_VERSION)
41
42 AC_SUBST(GST_CURRENT)
43 AC_SUBST(GST_REVISION)
44 AC_SUBST(GST_AGE)
45 AC_SUBST(GST_LIBVERSION)
46
47 AM_MAINTAINER_MODE
48
49 AC_PROG_CC
50 AM_PROG_CC_STDC
51 dnl you need automake 1.5 for AM_PROG_AS to work !
52 AM_PROG_AS
53 AS="${CC}"
54 AC_PROG_CXX
55 AC_PROG_CXXCPP
56 AC_ISC_POSIX
57
58 dnl We disable static building for development, for time savings
59 dnl *NOTE*: dnl this line before release, so release does static too
60 AM_DISABLE_STATIC
61 AC_LIBTOOL_DLOPEN
62 AM_PROG_LIBTOOL
63
64 AC_HEADER_STDC([])
65
66 dnl This is used for the -config script...
67 builddir=`pwd`
68 AC_SUBST(builddir)
69
70 dnl ##############################
71 dnl # Do automated configuration #
72 dnl ##############################
73
74 dnl Check for tools:
75 dnl ================
76
77 dnl Check for nasm
78 AC_PATH_PROG(NASM_PATH, nasm, no)
79 AC_SUBST(NASM_PATH)
80 if test x$NASM_PATH = xno; then
81   AC_MSG_WARN(Couldn't find nasm)
82   HAVE_NASM="no"
83 else
84   AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
85   HAVE_NASM="yes"
86 fi
87
88 dnl fix pkg-config's broken default search path
89 if test -z "$PKG_CONFIG_PATH"; then
90   PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
91 fi
92 export PKG_CONFIG_PATH
93
94 dnl Check for pkgconfig
95 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, true, false)
96
97 dnl check for gtk-doc
98 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
99
100 if test "x$with_html_dir" = "x" ; then
101   HTML_DIR='${datadir}/gst/html'
102 else
103   HTML_DIR=$with_html_dir
104 fi
105
106 AC_SUBST(HTML_DIR)
107
108 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, true, false)
109 gtk_doc_min_version=0.6
110 if $HAVE_GTK_DOC ; then 
111     gtk_doc_version=`gtkdoc-mkdb --version`
112     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
113     if perl <<EOF ; then
114       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
115             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
116 EOF
117       AC_MSG_RESULT(yes)
118    else
119       AC_MSG_RESULT(no)
120       HAVE_GTK_DOC=false
121    fi
122 fi
123 GTK_DOC_SCANOBJ=gtkdoc-scanobj
124
125 AC_SUBST(HAVE_GTK_DOC)
126 AC_SUBST(GTK_DOC_SCANOBJ)
127
128 dnl check for docbook tools
129 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, true, false)
130 AC_CHECK_PROG(HAVE_PDFTOPS, pdftops, true, false)
131 dnl this does not yet work properly, at least on debain -- wingo
132 HAVE_PDFXMLTEX=false
133
134 dnl check for image conversion tool
135 AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
136
137 dnl The following is a hack: if fig2dev doesn't display an error message
138 dnl for the desired type, we assume it supports it.
139 HAVE_FIG2DEV_PNG=false
140 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
141   fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
142   if test "x$fig2dev_quiet" = "x" ; then
143     HAVE_FIG2DEV_PNG=true
144   fi
145 fi
146 HAVE_FIG2DEV_PDF=false
147 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
148   fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
149   if test "x$fig2dev_quiet" = "x" ; then
150     HAVE_FIG2DEV_PDF=true
151   fi
152 fi
153
154
155 dnl Set up conditionals for (target) architecture:
156 dnl ==============================================
157
158 dnl Determine CPU
159 case "x${target_cpu}" in
160   xi?86 | k?) HAVE_CPU_I386=yes
161               AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
162               dnl FIXME could use some better detection
163               dnl       (ie CPUID)
164               case "x${target_cpu}" in
165                 xi386 | xi486) ;;
166                 *)             AC_DEFINE(HAVE_RDTSC) ;;
167               esac ;;
168   xpowerpc)   HAVE_CPU_PPC=yes
169               AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
170   xalpha)     HAVE_CPU_ALPHA=yes
171               AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
172   xarm*)      HAVE_CPU_ARM=yes
173               AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
174   xsparc*)    HAVE_CPU_SPARC=yes
175               AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
176   xmips*)     HAVE_CPU_MIPS=yes
177               AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;;
178   xhppa*)     HAVE_CPU_HPPA=yes
179               AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;;
180 esac
181
182 dnl Determine endianness
183 AC_C_BIGENDIAN
184
185 dnl Check for MMX-capable compiler
186 AC_MSG_CHECKING(for MMX-capable compiler)
187 AC_TRY_RUN([
188 #include "include/mmx.h"
189
190 main()
191 { movq_r2r(mm0, mm1); return 0; }
192 ],
193 [
194 HAVE_LIBMMX="yes"
195 AC_MSG_RESULT(yes)
196 ],
197 HAVE_LIBMMX="no"
198 AC_MSG_RESULT(no)
199 ,
200 HAVE_LIBMMX="no"
201 AC_MSG_RESULT(no)
202 )
203
204 dnl
205 dnl We should really use AC_SYS_LARGEFILE, but the problem is
206 dnl many of the plugins don't include "config.h".  To assure
207 dnl binary compatibility, it is necessary that all gstreamer
208 dnl code be compiled with the same sizeof(off_t), so we use
209 dnl the following crude hack.
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_CFLAGS="$GST_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_CFLAGS="$GST_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_FLAGS=$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 if test x$USE_GLIB2 = xno; then
287   LIBXML_PKG='libxml >= 1.8.1'
288 else
289   LIBXML_PKG='libxml-2.0'
290   AC_DEFINE(HAVE_LIBXML2)
291 fi
292 AC_SUBST(LIBXML_PKG)
293
294 dnl Check for libxml
295 dnl Thomas tries to convert this to pkg-config
296 PKG_CHECK_MODULES(XML, $LIBXML_PKG, XML_CONFIG=yes, XML_CONFIG=no)
297 dnl AC_PATH_PROG(XML_CONFIG, xml-config, no)
298 if test x$XML_CONFIG = xno; then
299   AC_MSG_ERROR(Couldn't find $LIBXML_PKG)
300 fi
301 AC_SUBST(XML_LIBS)
302 AC_SUBST(XML_CFLAGS)
303
304
305 dnl ==========================================================================
306 dnl ========================= Macro definitions ==============================
307 dnl ==========================================================================
308
309 dnl These macros should be moved out to separate files (acinclude.m4?), but
310 dnl can't currently be because of the SUBSTFOR magic.
311
312 dnl Perform a check for existence of ARTS
313 dnl Richard Boulton <richard-alsa@tartarus.org>
314 dnl Last modification: 26/06/2001
315 dnl GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION,
316 dnl                   DEPENDENT-PLUGINS, TEST-FOR-FEATURE)
317 dnl
318 dnl This check was written for GStreamer: it should be renamed and checked
319 dnl for portability if you decide to use it elsewhere.
320 dnl
321 AC_DEFUN(GST_CHECK_ARTS,
322 [
323 dnl Set the flags
324 ARTS_LIBS="-L/usr/local/lib -L/usr/lib -lmcop -lartsflow -lartsflow_idl"
325 ARTS_CFLAGS="-I/usr/local/include/arts -I/usr/include/kde/arts -I/usr/include/arts"
326 ARTS_MCOPFLAGS=$ARTS_CFLAGS
327 dnl There's no arts-config script, so we make a guess based on the artsc-config
328 AC_PATH_PROG(ARTSC_CONFIG, artsc-config, no)
329 if test x$ARTSC_CONFIG = xyes; then
330   ARTS_ARTSC_CFLAGS=`artsc-config --cflags | sed 's/artsc/arts/g'`
331   ARTS_CFLAGS="$ARTS_CFLAGS $ARTS_ARTSC_CFLAGS"
332   ARTS_MCOPFLAGS="$ARTS_MCOPFLAGS $ARTS_ARTSC_CFLAGS"
333 fi
334 AC_SUBST(ARTS_LIBS)
335 AC_SUBST(ARTS_CFLAGS)
336 AC_SUBST(ARTS_MCOPFLAGS)
337
338 dnl Now check if it exists
339 AC_LANG_PUSH(C++)
340 HAVE_ARTS=yes
341 dnl FIXME: Can't get this test to pass, so commented it out.  Rely on header check.
342 dnl AC_CHECK_LIB(artsflow, convert_stereo_2float_i16le, :, HAVE_ARTS=no, $LIBS)
343
344 dnl AC_CHECK_HEADER uses CPPFLAGS, but not CFLAGS.
345 dnl FIXME: ensure only suitable flags result from artsc-config --cflags
346 AC_CHECK_HEADER(artsflow.h, :, HAVE_ARTS=no)
347
348 AC_LANG_POP(C++)
349 dnl Check for the idl generator
350 AC_CHECK_PROG(HAVE_MCOPIDL, mcopidl, yes, no)
351 if test x$HAVE_MCOPIDL = xno; then
352   HAVE_ARTS=no
353 fi
354 ])
355
356 dnl ==========================================================================
357 dnl ========================= End macro definitions ==========================
358 dnl ==========================================================================
359
360
361 dnl Next, check for the optional libraries:
362 dnl =======================================
363
364
365 dnl ***** ESound *****
366 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBESD, true)
367 GST_CHECK_FEATURE(LIBESD, [esound plugins], esdsrc esdsink, [
368   AM_PATH_ESD(0.2.12, HAVE_LIBESD=yes, HAVE_LIBESD=no)
369 ])
370
371 dnl Check for artsc
372 translit(dnm, m, l) AM_CONDITIONAL(USE_ARTSC, true)
373 GST_CHECK_FEATURE(ARTSC, [artsd plugins], artsdsink, [GST_CHECK_ARTSC()])
374
375 dnl Check for arts
376 dnl FIXME: thomasvs: I don't understand this, have replaced the check
377 dnl translit(dnm, m, l) AM_CONDITIONAL(USE_ARTS, true)
378 dnl GST_CHECK_FEATURE(ARTS, [arts plugins], arts, [GST_CHECK_ARTS()])
379
380 dnl Check for alsa
381 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
382 GST_CHECK_FEATURE(ALSA, [alsa plugins], gstalsa, [
383   AM_PATH_ALSA(0.9.0, HAVE_ALSA=yes, HAVE_ALSA=no)
384 ])
385 if test x$HAVE_ALSA = xno; then
386   unset USE_ALSA
387   ALSA_CFLAGS=
388   ALSA_LIBS=
389 fi
390
391 dnl Check for libaudiofile
392 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBAUDIOFILE, true)
393 GST_CHECK_FEATURE(LIBAUDIOFILE, [use gdk pixbuf], afsink afsrc, [
394 translit(dnm, m, l) AC_SUBST(LIBAUDIOFILE_LIBS)
395 translit(dnm, m, l) AC_SUBST(LIBAUDIOFILE_CFLAGS)
396 GST_CHECK_CONFIGPROG(LIBAUDIOFILE, audiofile-config)
397 ])
398
399 dnl Check for libgdk-pixbuf
400 dnl FIXME: not sure that this is still used anywhere.
401 translit(dnm, m, l) AM_CONDITIONAL(USE_GDK_PIXBUF, true)
402 GST_CHECK_FEATURE(GDK_PIXBUF, [use gdk pixbuf], , [
403 translit(dnm, m, l) AC_SUBST(GDK_PIXBUF_LIBS)
404 translit(dnm, m, l) AC_SUBST(GDK_PIXBUF_CFLAGS)
405 GST_CHECK_CONFIGPROG(GDK_PIXBUF, gdk-pixbuf-config)
406 ])
407
408 if test x$USE_GLIB2 = xyes; then
409   dnl we don't support gnome/gtk with glib2.0 yet
410   GNOME_LIBS=
411   GNOME_CFLAGS=
412   HAVE_GNOME=no
413   AC_MSG_WARN(gnome disabled for glib2.0)
414 else
415   dnl Check for libgnome
416 translit(dnm, m, l) AC_SUBST(GNOME_LIBS)
417 translit(dnm, m, l) AC_SUBST(GNOME_CFLAGS)
418 GST_CHECK_CONFIGPROG(GNOME, gnome-config, gnome gnomeui)
419 fi
420 AC_SUBST(HAVE_GNOME)
421
422 dnl Check for libghttp
423 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBGHTTP, true)
424 GST_CHECK_FEATURE(LIBGHTTP, [libghttp plugins], gsthttpsrc, [
425   dnl FIXME: need to check for header
426   GHTTP_LIBS=
427   GST_HTTPSRC_GET_TYPE=
428   if test x$USE_GLIB2 = xyes; then
429     AC_MSG_WARN(ghttp disabled for glib2.0)
430   else
431     AC_CHECK_LIB(ghttp, ghttp_request_new,
432       [GHTTP_LIBS="-lghttp"
433        GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
434        HAVE_LIBGHTTP=yes
435       ], :, $LIBS)
436   fi
437   AC_SUBST(GHTTP_LIBS)
438   AC_SUBST(GST_HTTPSRC_GET_TYPE)
439 ])
440
441 dnl thomas : adding an arts check taken from xine with it's own .m4
442 AM_PATH_ARTS(, HAVE_ARTS=yes, HAVE_ARTS=no)
443
444 dnl also define ARTS_MCOPFLAGS
445 ARTS_MCOPFLAGS="$ARTS_CFLAGS"
446 AC_SUBST(ARTS_MCOPFLAGS)   
447
448 dnl Check for xmms
449 AM_PATH_XMMS(0.9.4, HAVE_XMMS=yes, HAVE_XMMS=no)
450
451 dnl Check for libglade
452 HAVE_LIBGLADE_GNOME="no"
453 if test x$USE_GLIB2 = xyes; then
454   PKG_CHECK_MODULES(LIBGLADE_GNOME, libglade-2.0 libgnomeui-2.0, HAVE_LIBGLADE_GNOME=yes, HAVE_LIBGLADE_GNOME=no)
455   if test x$HAVE_LIBGLADE_GNOME = xno; then
456     AC_MSG_WARN(Couldn't find libglade-2.0 - Can't build gstplay)
457     LIBGLADE_GNOME_LIBS=
458     LIBGLADE_GNOME_CFLAGS=
459   fi;
460 else
461   AM_PATH_LIBGLADE(HAVE_LIBGLADE_GNOME="yes", HAVE_LIBGLADE_GNOME="no", gnome)
462   if test x$HAVE_LIBGLADE_GNOME = xno; then
463     AC_MSG_WARN(Couldn't find libglade-config - Can't build gstplay)
464   else
465     LIBGLADE_GNOME_LIBS=$LIBGLADE_LIBS
466     LIBGLADE_GNOME_CFLAGS=$LIBGLADE_CFLAGS
467         AC_TRY_LINK([#include <glade/glade.h>],[glade_gnome_init();],
468                 HAVE_LIBGLADE_GNOME="yes"
469                 AC_MSG_WARN(
470         [Couldn't find gnome libraries for libglade - Can't build gstmediaplay and gsteditor])
471                )
472   fi
473 fi
474 AC_SUBST(HAVE_LIBGLADE_GNOME)
475 AC_SUBST(LIBGLADE_GNOME_LIBS)
476 AC_SUBST(LIBGLADE_GNOME_CFLAGS)
477
478 dnl Check for Gnome VFS
479 HAVE_GNOME_VFS="no"
480 if test x$USE_GLIB2 = xyes; then
481   PKG_CHECK_MODULES(VFS, gnome-vfs-2.0, HAVE_GNOME_VFS=yes, HAVE_GNOME_VFS=no)
482
483   if test x$HAVE_GNOME_VFS = xno; then
484     AC_MSG_WARN(Couldn't find gnome-vfs-2.0 - Gnome-VFS support disabled)
485   fi;
486 else
487   AC_MSG_CHECKING(for Gnome VFS)
488   if gnome-config --libs vfs > /dev/null 2>&1; then
489         HAVE_GNOME_VFS="yes"
490         AC_MSG_RESULT(found)
491         VFS_LIBS="`gnome-config --libs vfs`"
492         VFS_CFLAGS="`gnome-config --cflags vfs`"
493   else
494         AC_MSG_WARN(Did not find Gnome-VFS installed)
495         VFS_LIBS=
496         VFS_CFLAGS=
497   fi
498 fi
499 AC_SUBST(VFS_LIBS)
500 AC_SUBST(VFS_CFLAGS)
501
502 dnl Check for Avifile
503 HAVE_AVIFILE="no"
504 AC_MSG_CHECKING(for Avifile)
505 if avifile-config --libs > /dev/null 2>&1; then
506         HAVE_AVIFILE="yes"
507         AC_MSG_RESULT(found)
508 else
509         AC_MSG_WARN(Did not find Avifile installed)
510 fi
511 AVIFILE_LIBS="`avifile-config --libs`"
512 AVIFILE_CFLAGS="`avifile-config --cflags`"
513 AC_SUBST(AVIFILE_LIBS)
514 AC_SUBST(AVIFILE_CFLAGS)
515 dnl HAVE_AVIFILE is needed in a Makefile.am
516
517 AC_SUBST(HAVE_AVIFILE)
518 dnl Check for atomic.h
519 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
520 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
521 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
522 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
523 if test x$HAVE_ATOMIC_H = xyes; then
524   AC_TRY_RUN([
525 #include "asm/atomic.h"
526 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
527   ],, [
528     # Not successful
529     if test x$HAVE_ATOMIC_H = xyes; then
530       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
531     fi
532     HAVE_ATOMIC_H=no
533   ], [
534     # Cross compiling
535     AC_MSG_RESULT(yes)
536     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
537   ])
538 fi
539
540
541 dnl Check for X11 extensions
542 AC_PATH_XTRA
543 if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
544   AC_MSG_ERROR(can not find X11)
545 fi
546 AC_SUBST(X_CFLAGS)
547 AC_SUBST(X_PRE_LIBS)
548 AC_SUBST(X_EXTRA_LIBS)
549 AC_SUBST(X_LIBS)
550
551
552 dnl Check for the Xv library
553 xvsave_LIBS=${LIBS}
554 AC_CHECK_LIB(Xv, XvQueryExtension,
555   HAVE_LIBXV=yes,
556   HAVE_LIBXV=no,
557   $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS
558 )
559 LIBS=${xvsave_LIBS}
560 AC_CHECK_HEADER(X11/extensions/Xv.h, :, HAVE_LIBXV=no)
561 AC_CHECK_HEADER(X11/extensions/Xvlib.h, :, HAVE_LIBXV=no)
562
563 dnl Check for OSS audio
564 AC_CHECK_HEADER(sys/soundcard.h, HAVE_OSS=yes, HAVE_OSS=no)
565
566 dnl Check for xaudio
567 AC_CHECK_HEADER(xaudio/decoder.h,
568   AC_DEFINE(HAVE_XAUDIO, 1, [Define if xaudio is available])
569   HAVE_XAUDIO="yes",
570   AC_MSG_WARN(
571 ***** NOTE: These plugins won't be built: gstxa
572 )
573   HAVE_XAUDIO="no",
574 )
575
576 dnl Check for libmad
577 AC_MSG_CHECKING(MAD library)
578 AC_CHECK_LIB(mad, mad_decoder_finish,
579   HAVE_LIBMAD=yes
580   AC_DEFINE(HAVE_LIBMAD, 1, [Define if libmad is available]),
581   AC_MSG_WARN(
582 ***** NOTE: These plugins won't be built: mad
583 )
584   HAVE_LIBMAD=no,
585 )
586
587 dnl Check for libmikmod
588 AC_MSG_CHECKING(Mikmod library)
589 AC_CHECK_LIB(mikmod, MikMod_Init,
590   HAVE_LIBMIKMOD=yes
591   AC_DEFINE(HAVE_LIBMIKMOD, 1, [Define if libmikmod is available]),
592   AC_MSG_WARN(
593 ***** NOTE: These plugins won't be built: mikmod
594 )
595   HAVE_LIBMIKMOD=no,
596 )
597
598
599 dnl Check for libvorbis
600 AC_MSG_CHECKING(Vorbis library)
601 AC_CHECK_LIB(vorbis, ogg_sync_init,
602   HAVE_VORBIS=yes
603   AC_DEFINE(HAVE_VORBIS, 1, [Define if vorbis library is available]),
604   AC_MSG_WARN(
605 ***** NOTE: These plugins won't be built: vorbisdec vorbisenc
606 )
607   HAVE_VORBIS=no,
608 )
609
610 dnl Check for libjpeg
611 AC_MSG_CHECKING(libjpeg library)
612 AC_CHECK_LIB(jpeg, jpeg_set_defaults,
613   HAVE_LIBJPEG=yes
614   AC_DEFINE(HAVE_LIBJPEG, 1, [Define if libjpeg is available]),
615   AC_MSG_WARN(
616 ***** NOTE: These plugins won't be built: jpegdec jpegenc
617 )
618   HAVE_LIBJPEG=no,
619 )
620
621 dnl Check for libHermes
622 AC_MSG_CHECKING(Hermes library)
623 AC_CHECK_LIB(Hermes, Hermes_ConverterInstance,
624   HAVE_LIBHERMES=yes
625   AC_DEFINE(HAVE_LIBHERMES, 1, [Define if Hermes library is available]),
626   AC_MSG_WARN(
627 ***** NOTE: These plugins won't be built: colorspace
628 )
629   HAVE_LIBHERMES=no,
630 )
631 AC_CHECK_HEADER(Hermes/Hermes.h, :, HAVE_LIBHERMES=no)
632
633 dnl Check for libgsm
634 AC_MSG_CHECKING(GSM library)
635 AC_CHECK_LIB(gsm, gsm_create, HAVE_LIBGSM=yes, HAVE_LIBGSM=no,)
636 GSM_CFLAGS=
637 GSM_LIBS=-lgsm
638 AC_CHECK_HEADER(gsm.h, :, 
639   GSM_CFLAGS="$GSM_CFLAGS -DGSM_HEADER_IN_SUBDIR"
640   AC_CHECK_HEADER(gsm/gsm.h, :, HAVE_LIBGSM=no)
641 )
642 AC_SUBST(GSM_CFLAGS)
643 AC_SUBST(GSM_LIBS)
644
645 if test "x$HAVE_LIBGSM" = "xyes"; then
646   AC_DEFINE(HAVE_LIBGSM, 1, [Define if GSM library is available])
647 else
648   AC_MSG_WARN(
649 ***** NOTE: These plugins won't be built: gsmdec, gsmenc
650 )
651 fi
652
653 dnl Check for cdparanoia
654 AC_MSG_CHECKING(CDparanoia library)
655 HAVE_CDPARANOIA=yes
656 AC_CHECK_LIB(cdda_interface, cdda_open, : , HAVE_CDPARANOIA=no, )
657 AC_CHECK_HEADER(cdda_interface.h, :, HAVE_CDPARANOIA=no)
658 AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
659 AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
660
661 dnl Check for liblame
662 dnl checking the version doesn't work yet
663 dnl HAVE_LIBLAME gets set by AM_PATH_LIBLAME, but for clarity we do it again
664 AM_PATH_LIBLAME(:, HAVE_LIBLAME=yes, HAVE_LIBLAME=no)
665
666 dnl Check for libshout
667 AC_MSG_CHECKING(Shout library)
668 AC_CHECK_LIB(shout, shout_init_connection, HAVE_LIBSHOUT=yes, HAVE_LIBSHOUT=no, )
669 AC_CHECK_HEADER(shout/shout.h, :, HAVE_LIBSHOUT=no)
670
671 dnl Check for mpeg2dec
672 AC_MSG_CHECKING(mpeg2dec library)
673 AC_CHECK_LIB(mpeg2, mpeg2_init, HAVE_MPEG2DEC=yes, HAVE_MPEG2DEC=no, )
674 AC_CHECK_HEADER(mpeg2dec/mpeg2.h, :, HAVE_MPEG2DEC=no)
675
676 dnl Check for a52dec
677 AC_MSG_CHECKING(a52dec library)
678 AC_CHECK_LIB(a52, a52_init, HAVE_A52DEC=yes, HAVE_A52DEC=no, -lm)
679 AC_CHECK_HEADER(a52dec/a52.h, :, HAVE_A52DEC=no)
680
681 dnl Check for sidplay
682 AC_PATH_LIBSIDPLAY
683
684 dnl Check for librtp
685 AC_MSG_CHECKING(rtp library)
686 AC_CHECK_LIB(rtp, rtp_packet_new_take_data, HAVE_LIBRTP=yes, HAVE_LIBRTP=no, $GLIB_LIBS $GLIB_CFLAGS)
687 dnl FIXME header check needs to use GLIB_CFLAGS in order to succeed for rtp
688 dnl AC_CHECK_HEADERS(rtp/rtp.h, HAVE_LIBRTP=yes, HAVE_LIBRTP=no)
689 dnl AC_CHECK_HEADERS(rtp/rtp-packet.h, :, HAVE_LIBRTP=no)
690 dnl AC_CHECK_HEADERS(rtp/rtcp-packet.h, :, HAVE_LIBRTP=no)
691 dnl AC_CHECK_HEADERS(rtp/rtp-audio.h, :, HAVE_LIBRTP=no)
692
693 dnl Check for FLAC
694 dnl thomas : checking for compile with main instead of actual function,
695 dnl since that made autoconf break (for version 2.13)
696 AC_MSG_CHECKING(FLAC library)
697 AC_CHECK_LIB(FLAC, main, HAVE_FLACLIB=yes, HAVE_FLACLIB=no, -lm)
698 AC_CHECK_HEADER(FLAC/all.h, :, HAVE_FLACLIB=no)
699
700 dnl Check for libraw1394
701 AC_MSG_CHECKING(raw1394 library)
702 AC_CHECK_LIB(raw1394, raw1394_get_handle, HAVE_RAW1394=yes, HAVE_RAW1394=no, )
703 AC_CHECK_HEADER(libraw1394/raw1394.h, :, HAVE_RAW1394=no)
704
705 dnl Check for libdv
706 AC_MSG_CHECKING(libdv)
707 AC_CHECK_LIB(dv, dv_init, HAVE_LIBDV=yes, HAVE_LIBDV=no, -lm $GLIB_LIBS $GLIB_CFLAGS)
708 libdvcheck_save_CPPFLAGS="$CPPFLAGS"
709 CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
710 AC_CHECK_HEADER(libdv/dv.h, :, HAVE_LIBDV=no)
711 CPPFLAGS="$libdvcheck_save_CPPFLAGS"
712
713 dnl Check for aalib
714 AC_MSG_CHECKING(aalib)
715 AC_CHECK_LIB(aa, aa_init, HAVE_LIBAA=yes, HAVE_LIBAA=no, )
716 AC_CHECK_HEADER(aalib.h, :, HAVE_LIBAA=no)
717
718 dnl Check for quicktime
719 AC_MSG_CHECKING(openquicktime)
720 AC_CHECK_LIB(openquicktime, quicktime_init, HAVE_LIBOPENQUICKTIME=yes, HAVE_LIBOPENQUICKTIME=no, )
721 AC_CHECK_HEADER(openquicktime/openquicktime.h, :, HAVE_LIBOPENQUICKTIME=no)
722
723 dnl Check for libdvdread
724 AC_MSG_CHECKING(libdvdread)
725 AC_CHECK_LIB(dvdread, DVDOpen, HAVE_LIBDVDREAD=yes, HAVE_LIBDVDREAD=no, )
726 AC_CHECK_HEADER(dvdread/dvd_reader.h, :, HAVE_LIBDVDREAD=no)
727
728 dnl Check for SDL library
729 dnl this bit is taken from vlc's configure.in and modified accordingly
730
731 AM_PATH_SDL(1.1.0, HAVE_LIBSDL=yes, HAVE_LIBSDL=no)
732
733 if test "x$HAVE_LIBSDL" = "xno"; then
734   AC_MSG_WARN(
735 ***** NOTE: These plugins won't be built: sdlvideosink
736 )
737 fi
738
739 dnl Check for linux/cdrom.h
740 AC_CHECK_HEADER(linux/cdrom.h,
741   HAVE_LINUX_CDROM=yes, HAVE_LINUX_CDROM=no
742 )
743
744 dnl Check for linux/videodev.h
745 AC_CHECK_HEADER(linux/videodev.h,
746   HAVE_LINUX_VIDEODEV=yes, HAVE_LINUX_VIDEODEV=no
747 )
748
749
750 dnl ######################################################################
751 dnl # Check command line parameters, and set shell variables accordingly #
752 dnl ######################################################################
753
754 AC_ARG_ENABLE(libmmx,
755 [  --enable-libmmx              use libmmx, if available],
756 [case "${enableval}" in
757   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
758   no)  USE_LIBMMX=no ;;
759   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
760 esac], 
761 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
762
763 AC_ARG_ENABLE(atomic,
764 [  --enable-atomic              use atomic reference counting header],
765 [case "${enableval}" in
766   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
767   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
768   no)  USE_ATOMIC_H=no;;
769   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
770 esac], 
771 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
772
773 AC_ARG_ENABLE(plugin-builddir,
774 [  --enable-plugin-builddir     allow tests/demos to use non-installed plugins ],
775 [case "${enableval}" in
776   yes) PLUGINS_USE_BUILDDIR=yes ;;
777   no)  PLUGINS_USE_BUILDDIR=no ;;
778   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
779 esac], 
780 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
781
782 AC_ARG_ENABLE(debug,
783 [  --enable-debug               compile with -g debugging info],
784 [case "${enableval}" in
785   yes) USE_DEBUG=yes ;;
786   no)  USE_DEBUG=no ;;
787   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
788 esac], 
789 [USE_DEBUG=no]) dnl Default value
790
791 AC_ARG_ENABLE(DEBUG,
792 [  --enable-DEBUG               compiles in a large number of debugging messages],
793 [case "${enableval}" in
794   yes) ENABLE_DEBUG=yes ;;
795   no)  ENABLE_DEBUG=no ;;
796   *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
797 esac], 
798 [ENABLE_DEBUG=no]) dnl Default value
799 if test x$ENABLE_DEBUG = xyes; then
800   AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
801 fi
802
803 AC_ARG_ENABLE(INFO,
804 [  --disable-INFO               disables compilation of informational messages],
805 [case "${enableval}" in
806   yes) ENABLE_INFO=yes ;;
807   no)  ENABLE_INFO=no ;;
808   *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
809 esac], 
810 [ENABLE_INFO=yes]) dnl Default value
811 if test x$ENABLE_INFO = xyes; then
812   AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
813 fi
814
815 AC_ARG_ENABLE(debug-color,
816 [  --disable-debug-color        disables color output of DEBUG and INFO output],
817 [case "${enableval}" in
818   yes) ENABLE_DEBUG_COLOR=yes ;;
819   no)  ENABLE_DEBUG_COLOR=no ;;
820   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
821 esac], 
822 [ENABLE_DEBUG_COLOR=yes]) dnl Default value
823 if test "x$ENABLE_DEBUG_COLOR" = xyes; then
824   AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
825 fi
826
827 AC_ARG_ENABLE(profiling,
828 [  --enable-profiling           adds -pg to compiler commandline, for profiling],
829 [case "${enableval}" in
830   yes) USE_PROFILING=yes ;;
831   no)  UES_PROFILING=no ;;
832   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
833 esac], 
834 [USE_PROFILING=no]) dnl Default value
835
836 dnl default to building registry in the source tree if we are enabling plugin build dir
837 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
838   GST_CONFIG_DIR=$builddir
839 else
840   GST_CONFIG_DIR=/etc/gstreamer
841 fi
842 AC_ARG_WITH(configdir,
843 [  --with-configdir             specify path to use for configdir],
844 [case "${withval}" in
845   yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
846   no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
847   *) GST_CONFIG_DIR="${withval}" ;;
848 esac], 
849 [:]) dnl Default value
850
851 dnl Default value
852 GST_WIN32_LIBDIR="/usr/lib/win32"
853 AC_ARG_WITH(win32_libdir,
854 [  --with-win32-libdir          specify location for win32 DLLs],
855 [case "${withval}" in
856   yes) AC_MSG_ERROR(bad value ${withval} for --with-win32-libdir) ;;
857   no) AC_MSG_ERROR(bad value ${withval} for --with-win32-libdir) ;;
858   *) GST_WIN32_LIBDIR="${withval}" ;;
859 esac],
860 [:]) dnl Default value
861
862 AC_ARG_ENABLE(docs-build,
863 [  --enable-docs-build          enable building of documentation],
864 [case "${enableval}" in
865   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; ;;
866   no)  BUILD_DOCS=no ;;
867   *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs-build) ;;
868 esac], 
869 [BUILD_DOCS=no]) dnl Default value
870
871 AC_ARG_ENABLE(plugin-docs,
872 [  --enable-plugin-docs         enable the building of plugin documentation
873                                (this is currently broken, so off by default)],
874 [case "${enableval}" in
875   yes) BUILD_PLUGIN_DOCS=yes ;;
876   no)  BUILD_PLUGIN_DOCS=no ;;
877   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;;
878 esac], 
879 [BUILD_PLUGIN_DOCS=no]) dnl Default value
880
881 AC_ARG_ENABLE(tests,
882 [  --disable-tests              disable building test apps],
883 [case "${enableval}" in
884   yes) BUILD_TESTS=yes ;;
885   no)  BUILD_TESTS=no ;;
886   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
887 esac], 
888 [BUILD_TESTS=yes]) dnl Default value
889
890 AC_ARG_ENABLE(examples,
891 [  --disable-examples           disable building examples],
892 [case "${enableval}" in
893   yes) BUILD_EXAMPLES=yes ;;
894   no)  BUILD_EXAMPLES=no ;;
895   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
896 esac], 
897 [BUILD_EXAMPLES=yes]) dnl Default value
898
899 dnl Next, check for the optional components:
900 dnl ========================================
901
902
903 AC_DEFUN(GST_SUBSYSTEM_DISABLE,
904 [dnl
905 dnl Add a subsystem --disable flag and all the necessary symbols and substitions
906 dnl
907 AC_ARG_ENABLE(translit([$1], A-Z, a-z), 
908 [  ]builtin(format, --disable-%-17s  disable %s, translit([$1], A-Z, a-z), $2),
909 [ case "${enableval}" in
910     yes) GST_DISABLE_[$1]=no ;;
911     no) GST_DISABLE_[$1]=yes ;;
912     *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;;
913   esac],
914 [GST_DISABLE_[$1]=no]) dnl Default value
915 if test x$GST_DISABLE_[$1] = xyes; then
916   AC_DEFINE(GST_DISABLE_[$1], 1, [Disable $2])
917   GST_DISABLE_[$1]_DEFINE=-DGST_DISABLE_[$1]
918 fi
919 AM_CONDITIONAL(GST_DISABLE_[$1], test x$GST_DISABLE_[$1] = xyes)
920 AC_SUBST(GST_DISABLE_[$1]_DEFINE)
921 GST_SUBSYSTEM_DISABLE_DEFINES="$GST_SUBSYTEM_DISABLE_DEFINES $GST_DISABLE_[$1]_DEFINE"
922 ])
923
924 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
925 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
926 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
927 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
928 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
929 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
930 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
931 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
932 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
933 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
934 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
935 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
936
937 GST_CFLAGS="$GST_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
938
939
940 dnl ################################################
941 dnl # Set defines according to variables set above #
942 dnl ################################################
943
944
945 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
946 dnl HAVE_ and it is likely to be easier to stick with the old name
947 if test "x$USE_LIBGHTTP" = xyes; then
948   AC_DEFINE(HAVE_LIBGHTTP, 1, [Define if ghttp library is available])
949 fi
950
951 if test "x$USE_LIBMMX" = xyes; then
952   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
953 fi
954
955 if test "x$USE_ATOMIC_H" = xyes; then
956   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
957 fi
958
959 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
960   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
961 fi
962
963 dnl if test "x$USE_DEBUG" = xyes; then
964 dnl   CFLAGS="$CFLAGS -g"
965 dnl fi
966
967 if test "x$USE_PROFILING" = xyes; then
968 dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
969   FOMIT_FRAME_POINTER=""
970 else
971   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
972 fi
973
974 dnl
975 dnl AC_SUBST(FOMIT_FRAME_POINTER)
976 dnl
977
978 if test "x$HAVE_LIBXV" = xyes; then
979   AC_DEFINE(HAVE_LIBXV)
980 fi
981
982 if test "x$HAVE_OSS" = xyes; then
983   AC_DEFINE(HAVE_OSS)
984 fi
985
986 if test "x$HAVE_XAUDIO" = xyes; then
987   AC_DEFINE(HAVE_XAUDIO)
988 fi
989
990 if test "x$HAVE_LIBMAD" = xyes; then
991   AC_DEFINE(HAVE_LIBMAD)
992 fi
993
994 if test "x$HAVE_LIBMIKMOD" = xyes; then
995   AC_DEFINE(HAVE_LIBMIKMOD)
996 fi
997
998 if test "x$HAVE_VORBIS" = xyes; then
999   AC_DEFINE(HAVE_VORBIS)
1000 fi
1001
1002 if test "x$HAVE_LIBJPEG" = xyes; then
1003   AC_DEFINE(HAVE_LIBJPEG)
1004 fi
1005
1006 if test "x$HAVE_LIBSDL" = xyes; then
1007   AC_DEFINE(HAVE_LIBSDL)
1008 fi
1009
1010 if test "x$HAVE_LIBHERMES" = "xyes"; then
1011   AC_DEFINE(HAVE_LIBHERMES)
1012 fi
1013
1014 if test "x$HAVE_LIBDVDREAD" = xyes; then
1015   AC_DEFINE(HAVE_LIBDVDREAD)
1016 fi
1017
1018 if test "x$HAVE_LINUX_CDROM" = xyes; then
1019   AC_DEFINE(HAVE_LINUX_CDROM)
1020 fi
1021
1022 if test "x$HAVE_LINUX_VIDEODEV" = xyes; then
1023   AC_DEFINE(HAVE_LINUX_VIDEODEV)
1024 fi
1025
1026 if test "x$HAVE_MPEG2DEC" = xyes; then
1027   AC_DEFINE(HAVE_MPEG2DEC)
1028 fi
1029
1030 if test "x$HAVE_A52DEC" = xyes; then
1031   AC_DEFINE(HAVE_A52DEC)
1032 fi
1033
1034 if test "x$HAVE_FLACLIB" = xyes; then
1035   AC_DEFINE(HAVE_FLACLIB)
1036 fi
1037
1038 if test "x$HAVE_LIBGSM" = xyes; then
1039   AC_DEFINE(HAVE_LIBGSM)
1040 fi
1041
1042 dnl #############################
1043 dnl # Set automake conditionals #
1044 dnl #############################
1045
1046 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
1047 dnl HAVE_ and it is likely to be easier to stick with the old name
1048 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
1049 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
1050 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
1051 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
1052 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
1053 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
1054 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
1055 AM_CONDITIONAL(HAVE_OSS,            test "x$HAVE_OSS" = "xyes")
1056 AM_CONDITIONAL(HAVE_XAUDIO,         test "x$HAVE_XAUDIO" = "xyes")
1057 AM_CONDITIONAL(HAVE_LIBMAD,         test "x$HAVE_LIBMAD" = "xyes")
1058 AM_CONDITIONAL(HAVE_LIBMIKMOD,      test "x$HAVE_LIBMIKMOD" = "xyes")
1059 AM_CONDITIONAL(HAVE_LINUX_CDROM,    test "x$HAVE_LINUX_CDROM" = "xyes")
1060 AM_CONDITIONAL(HAVE_LINUX_VIDEODEV, test "x$HAVE_LINUX_VIDEODEV" = "xyes")
1061 AM_CONDITIONAL(HAVE_LIBDVDREAD,     test "x$HAVE_LIBDVDREAD" = "xyes")
1062 AM_CONDITIONAL(HAVE_VORBIS,         test "x$HAVE_VORBIS" = "xyes")
1063 AM_CONDITIONAL(HAVE_LIBJPEG,        test "x$HAVE_LIBJPEG" = "xyes")
1064 AM_CONDITIONAL(HAVE_LIBSDL,         test "x$HAVE_LIBSDL" = "xyes")
1065 AM_CONDITIONAL(HAVE_LIBHERMES,      test "x$HAVE_LIBHERMES" = "xyes")
1066 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
1067 AM_CONDITIONAL(HAVE_LIBGLADE_GNOME, test "x$HAVE_LIBGLADE_GNOME" = "xyes")
1068 AM_CONDITIONAL(HAVE_GNOME,          test "x$HAVE_GNOME" = "xyes")
1069 AM_CONDITIONAL(HAVE_LIBXV,          test "x$HAVE_LIBXV" = "xyes")
1070 AM_CONDITIONAL(HAVE_GTK,            test "x$HAVE_GTK" = "xyes")
1071 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
1072 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
1073 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
1074 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
1075 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
1076 AM_CONDITIONAL(HAVE_PDFXMLTEX,      $HAVE_PDFXMLTEX)
1077 AM_CONDITIONAL(HAVE_PDFTOPS,        $HAVE_PDFTOPS)
1078 AM_CONDITIONAL(HAVE_XSLTPROC,       $HAVE_XSLTPROC)
1079 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
1080 AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
1081 AM_CONDITIONAL(HAVE_CDPARANOIA,     test "x$HAVE_CDPARANOIA" = "xyes")
1082 AM_CONDITIONAL(HAVE_LIBLAME,        test "x$HAVE_LIBLAME" = "xyes")
1083 AM_CONDITIONAL(HAVE_LIBSHOUT,       test "x$HAVE_LIBSHOUT" = "xyes")
1084 AM_CONDITIONAL(HAVE_MPEG2DEC,       test "x$HAVE_MPEG2DEC" = "xyes")
1085 AM_CONDITIONAL(HAVE_A52DEC,         test "x$HAVE_A52DEC" = "xyes")
1086 dnl thomas : the next line gives errors, this is how it is in CVS
1087 dnl AM_CONDITIONAL(HAVE_FLAC,               test "x$HAVE_FLAC" = "xyes")
1088 dnl thomas : the next line gives errors as well, I commented it
1089 dnl AM_CONDITIONAL(HAVE_LAC,                test "x$HAVE_FAC" = "xyes")
1090 dnl thomas: the next line doesn't give errors
1091 AM_CONDITIONAL(HAVE_FLACLIB,        test "x$HAVE_FLACLIB" = "xyes")
1092 AM_CONDITIONAL(HAVE_LIBRTP,         test "x$HAVE_LIBRTP" = "xyes")
1093 AM_CONDITIONAL(HAVE_ARTS,           test "x$HAVE_ARTS" = "xyes")
1094 AM_CONDITIONAL(HAVE_XMMS,           test "x$HAVE_XMMS" = "xyes")
1095 AM_CONDITIONAL(HAVE_RAW1394,        test "x$HAVE_RAW1394" = "xyes")
1096 AM_CONDITIONAL(HAVE_LIBDV,          test "x$HAVE_LIBDV" = "xyes")
1097 AM_CONDITIONAL(HAVE_LIBAA,          test "x$HAVE_LIBAA" = "xyes")
1098 AM_CONDITIONAL(HAVE_GNOME_VFS,      test "x$HAVE_GNOME_VFS" = "xyes")
1099 AM_CONDITIONAL(HAVE_AVIFILE,        test "x$HAVE_AVIFILE" = "xyes")
1100 AM_CONDITIONAL(HAVE_LIBOPENQUICKTIME, test "x$HAVE_LIBOPENQUICKTIME" = "xyes")
1101 AM_CONDITIONAL(HAVE_LIBGSM,         test "x$HAVE_LIBGSM" = "xyes")
1102 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
1103 AM_CONDITIONAL(HAVE_SIDPLAY,        test "x$have_sidplay" = "xyes")
1104
1105
1106 dnl ############################
1107 dnl # Set up some more defines #
1108 dnl ############################
1109
1110 dnl Set location of configuration dir.
1111 dnl AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
1112 AC_SUBST(GST_CONFIG_DIR)
1113
1114 dnl Set location of windows dll dir.
1115 AC_DEFINE_UNQUOTED(GST_WIN32_LIBDIR,"$GST_WIN32_LIBDIR")
1116 AC_SUBST(GST_WIN32_LIBDIR)
1117
1118 dnl Set location of plugin directory
1119 if test "x${prefix}" = "xNONE"; then
1120   PLUGINS_DIR=${ac_default_prefix}/lib/gst
1121 else
1122   PLUGINS_DIR=${prefix}/lib/gst
1123 fi
1124 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
1125 AC_SUBST(PLUGINS_DIR)
1126
1127 dnl Set location of uninstalled plugin directory
1128 PLUGINS_BUILDDIR=${builddir}
1129 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
1130 AC_SUBST(PLUGINS_BUILDDIR)
1131
1132 dnl Vars for everyone else
1133 GST_LIBS="\$(top_builddir)/gst/libgst.la"
1134 GST_CFLAGS="-I\$(top_srcdir) -I\$(top_srcdir)/include"
1135 AC_SUBST(GST_LIBS)
1136 AC_SUBST(GST_CFLAGS)
1137
1138 dnl Private vars for libgst only
1139 LIBGST_CFLAGS="$GST_CFLAGS"
1140 AC_SUBST(LIBGST_LIBS)
1141 AC_SUBST(LIBGST_CFLAGS)
1142
1143 AC_SUBST(GST_CFLAGS)
1144
1145 dnl #############################
1146 dnl # Configure the subpackages #
1147 dnl #############################
1148
1149 dnl AC_CONFIG_SUBDIRS(gist)
1150 dnl AC_CONFIG_SUBDIRS(plugins/mp3decode/xing/libxing)
1151
1152 dnl ##################################################
1153 dnl # Prepare informative messages to display at end #
1154 dnl ##################################################
1155
1156 infomessages=
1157
1158 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
1159   infomessages="$infomessages
1160 *** Warning: You have configured using the --enable-plugin-builddir option.
1161
1162 This option is for development purposes only: binaries built with
1163 it should be used with code in the build tree only.  To build an
1164 installable version, use ./configure without the --enable-plugin-builddir
1165 option.  Note that the autogen.sh script supplies the plugin builddir
1166 option automatically - it cannot be used to configure installable builds.
1167
1168 "
1169 fi
1170
1171 dnl #########################
1172 dnl # Make the output files #
1173 dnl #########################
1174
1175 dnl until ffmpeg is handled by configure plugins/ffmpeg/Makefile
1176 dnl components/bonobo-gstmediaplay/Makefile
1177 dnl FIXME someone should fix this test/misc/Makefile
1178 dnl FIXME wtay fix this: testsuite/threads/Makefile
1179 dnl FIXME testsuite/refcounting/Makefile
1180
1181 AC_OUTPUT(
1182 Makefile
1183 include/Makefile
1184 gst/Makefile
1185 gst/gstversion.h
1186 gst/types/Makefile
1187 gst/elements/Makefile
1188 gst/autoplug/Makefile
1189 gst/schedulers/Makefile
1190 libs/Makefile
1191 libs/riff/Makefile
1192 libs/getbits/Makefile
1193 libs/putbits/Makefile
1194 libs/idct/Makefile
1195 libs/audio/Makefile
1196 libs/bytestream/Makefile
1197 libs/control/Makefile
1198 libs/resample/Makefile
1199 plugins/Makefile
1200 plugins/a52dec/Makefile
1201 plugins/aasink/Makefile
1202 plugins/alsa/Makefile
1203 plugins/au/Makefile
1204 plugins/audiofile/Makefile
1205 plugins/audioscale/Makefile
1206 plugins/avi/Makefile
1207 plugins/avi/wincodec/Makefile
1208 plugins/avi/winaudio/Makefile
1209 plugins/flx/Makefile
1210 plugins/festival/Makefile
1211 plugins/flac/Makefile
1212 plugins/jpeg/Makefile
1213 plugins/mp3decode/Makefile
1214 plugins/mp3decode/types/Makefile
1215 plugins/mp3decode/xa/Makefile
1216 plugins/mp3decode/mpg123/Makefile
1217 plugins/mp3decode/mad/Makefile
1218 plugins/mp3decode/parse/Makefile
1219 plugins/mp3encode/Makefile
1220 plugins/mp3encode/lame/Makefile
1221 plugins/mikmod/Makefile
1222 plugins/mpeg2/Makefile
1223 plugins/mpeg2/parse/Makefile
1224 plugins/mpeg2/ac3parse/Makefile
1225 plugins/mpeg2/ac3dec/Makefile
1226 plugins/mpeg2/video/Makefile
1227 plugins/mpeg2/mpeg2enc/Makefile
1228 plugins/mpeg2/mpeg2dec/Makefile
1229 plugins/mpeg2/subtitles/Makefile
1230 plugins/mpeg2/videoparse/Makefile
1231 plugins/mpeg2/mpegtypes/Makefile
1232 plugins/mpeg1/Makefile
1233 plugins/mpeg1/mpegtypes/Makefile
1234 plugins/mpeg1/mpegaudio/Makefile
1235 plugins/mpeg1/system_encode/Makefile
1236 plugins/mpeg1/mpeg1encoder/Makefile
1237 plugins/mpeg1video/Makefile
1238 plugins/mpeg1video/parse/Makefile
1239 plugins/oss/Makefile
1240 plugins/rtp/Makefile
1241 plugins/mulaw/Makefile
1242 plugins/alaw/Makefile
1243 plugins/filters/Makefile
1244 plugins/filters/smooth/Makefile
1245 plugins/filters/median/Makefile
1246 plugins/filters/ladspa/Makefile
1247 plugins/filters/stereo2mono/Makefile
1248 plugins/filters/mono2stereo/Makefile
1249 plugins/filters/intfloatconvert/Makefile
1250 plugins/filters/passthrough/Makefile
1251 plugins/filters/adder/Makefile
1252 plugins/filters/colorspace/Makefile
1253 plugins/filters/volenv/Makefile
1254 plugins/filters/level/Makefile
1255 plugins/filters/lav/Makefile
1256 plugins/filters/cutter/Makefile
1257 plugins/filters/deinterlace/Makefile
1258 plugins/filters/volume/Makefile
1259 plugins/filters/speed/Makefile
1260 plugins/filters/playondemand/Makefile
1261 plugins/gnomevfs/Makefile
1262 plugins/icecast/Makefile
1263 plugins/icecast/icecastsend/Makefile
1264 plugins/effects/Makefile
1265 plugins/effects/stereo/Makefile
1266 plugins/effects/volume/Makefile
1267 plugins/udp/Makefile
1268 plugins/visualization/Makefile
1269 plugins/visualization/spectrum/Makefile
1270 plugins/visualization/vumeter/Makefile
1271 plugins/visualization/synaesthesia/Makefile
1272 plugins/visualization/smoothwave/Makefile
1273 plugins/visualization/chart/Makefile
1274 plugins/videoscale/Makefile
1275 plugins/xvideosink/Makefile
1276 plugins/wav/Makefile
1277 plugins/dvdsrc/Makefile
1278 plugins/vcdsrc/Makefile
1279 plugins/rtjpeg/Makefile
1280 plugins/SID/Makefile
1281 plugins/vorbis/Makefile
1282 plugins/capture/Makefile
1283 plugins/capture/v4l/Makefile
1284 plugins/capture/qcam/Makefile
1285 plugins/cdparanoia/Makefile
1286 plugins/esd/Makefile
1287 plugins/esd/esdsink/Makefile
1288 plugins/artsd/Makefile
1289 plugins/quicktime/Makefile
1290 plugins/xmms/Makefile
1291 plugins/arts/Makefile
1292 plugins/gsm/Makefile
1293 plugins/1394/Makefile
1294 plugins/sdlsink/Makefile
1295 plugins/dv/Makefile
1296 plugins/synthesis/Makefile
1297 plugins/synthesis/sinesrc/Makefile
1298 plugins/silence/Makefile
1299 gstplay/Makefile
1300 test/Makefile
1301 test/xml/Makefile
1302 test/bindings/Makefile
1303 test/memchunk/Makefile
1304 test/events/Makefile
1305 tests/Makefile
1306 tests/sched/Makefile
1307 tests/eos/Makefile
1308 tests/muxing/Makefile
1309 testsuite/Makefile
1310 testsuite/bytestream/Makefile
1311 testsuite/capsnego/Makefile
1312 testsuite/plugin/Makefile
1313 tests/nego/Makefile
1314 examples/Makefile
1315 examples/autoplug/Makefile
1316 examples/helloworld/Makefile
1317 examples/helloworld2/Makefile
1318 examples/launch/Makefile
1319 examples/queue/Makefile
1320 examples/queue2/Makefile
1321 examples/queue3/Makefile
1322 examples/queue4/Makefile
1323 examples/thread/Makefile
1324 examples/mixer/Makefile
1325 examples/cutter/Makefile
1326 examples/launch/Makefile
1327 examples/xml/Makefile
1328 examples/plugins/Makefile
1329 examples/typefind/Makefile
1330 examples/mixer/Makefile
1331 editor/Makefile
1332 editor/pixmaps/Makefile
1333 tools/Makefile
1334 docs/Makefile
1335 docs/gst/Makefile
1336 docs/gst/gstreamer.types
1337 docs/libs/Makefile
1338 docs/plugins/Makefile
1339 docs/plugins/gstreamer-plugins.types
1340 docs/manual/Makefile
1341 docs/fwg/Makefile
1342 debian/Makefile
1343 stamp.h
1344 gstreamer-config
1345 gstreamer.pc
1346 gstreamer-uninstalled.pc
1347 gstreamer.spec,
1348 chmod +x gstreamer-config
1349 echo "$infomessages", infomessages="$infomessages"
1350 )