Put GST_CFLAGS before other CFLAGS, to ensure that the correct headers get used if...
[platform/upstream/gstreamer.git] / configure.base
1 dnl Note: this file is generated from configure.base by autogen.sh
2 SUBSTFOR configure.ac:AC_INIT
3 SUBSTFOR configure.ac:AC_CONFIG_SRCDIR([gst/gstobject.h])
4 SUBSTFOR configure.in:AC_INIT(gst/gstobject.h)
5
6 SUBSTFOR configure.ac:AC_CANONICAL_TARGET([])
7 SUBSTFOR configure.in:AC_CANONICAL_SYSTEM
8
9 AM_CONFIG_HEADER(config.h)
10
11 GST_VERSION_MAJOR=0
12 GST_VERSION_MINOR=2
13 GST_VERSION_MICRO=1
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
24 dnl libtool
25 GST_CURRENT=0
26 GST_REVISION=0
27 GST_AGE=0
28 GST_LIBVERSION=$GST_CURRENT:$GST_REVISION:$GST_AGE
29
30 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
31 dnl Add parameters for aclocal
32 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
33 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
34
35 AC_SUBST(GST_VERSION_MAJOR)
36 AC_SUBST(GST_VERSION_MINOR)
37 AC_SUBST(GST_VERSION_MICRO)
38 AC_SUBST(GST_VERSION)
39
40 AC_SUBST(GST_CURRENT)
41 AC_SUBST(GST_REVISION)
42 AC_SUBST(GST_AGE)
43 AC_SUBST(GST_LIBVERSION)
44
45
46 AM_MAINTAINER_MODE
47
48 AC_PROG_CC
49 AC_PROG_CXX
50 AC_PROG_CXXCPP
51 AC_ISC_POSIX
52 SUBSTFOR configure.ac:AC_HEADER_STDC([])
53 SUBSTFOR configure.in:AC_STDC_HEADERS
54 AC_ARG_PROGRAM
55
56 dnl We disable static building for development, for time savings
57 dnl *NOTE*: dnl this line before release, so release does static too
58 AM_DISABLE_STATIC
59 AC_LIBTOOL_DLOPEN
60 AM_PROG_LIBTOOL
61
62 CFLAGS=""
63
64 dnl This is used for the -config script...
65 builddir=`pwd`
66 AC_SUBST(builddir)
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 check for gtkdoc
87 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, true, false)
88 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scanobj, :, false)
89 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scan, :, false)
90 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mktmpl, :, false)
91 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, :, false)
92 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkhtml, :, false)
93 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-fixxref, :, false)
94
95 dnl check for docbook tools
96 AC_CHECK_PROG(HAVE_DB2HTML, db2html, true, false)
97 AC_CHECK_PROG(HAVE_DB2PS, db2ps, true, false)
98 AC_CHECK_PROG(HAVE_PS2PDF, ps2pdf, true, false)
99
100 dnl check for image conversion tool
101 AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
102
103 dnl The following is a hack: if fig2dev doesn't display an error message
104 dnl for the desired type, we assume it supports it.
105 HAVE_FIG2DEV_PNG=false
106 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
107   fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
108   if test "x$fig2dev_quiet" = "x" ; then
109     HAVE_FIG2DEV_PNG=true
110   fi
111 fi
112 HAVE_FIG2DEV_EPS=false
113 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
114   fig2dev_quiet=`fig2dev -L eps </dev/null 2>&1 >/dev/null`
115   if test "x$fig2dev_quiet" = "x" ; then
116     HAVE_FIG2DEV_EPS=true
117   fi
118 fi
119
120
121 dnl Set up conditionals for (target) architecture:
122 dnl ==============================================
123
124 dnl Determine CPU
125 case "x${target_cpu}" in
126   xi?86 | k?) HAVE_CPU_I386=yes
127               AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
128               dnl FIXME could use some better detection
129               dnl       (ie CPUID)
130               case "x${target_cpu}" in
131                 xi386 | xi486) ;;
132                 *)             AC_DEFINE(HAVE_RDTSC) ;;
133               esac ;;
134   xpowerpc)   HAVE_CPU_PPC=yes
135               AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
136   xalpha)     HAVE_CPU_ALPHA=yes
137               AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
138   xarm*)      HAVE_CPU_ARM=yes
139               AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
140   xsparc*)    HAVE_CPU_SPARC=yes
141               AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
142 esac
143
144 dnl Determine endianness
145 AC_C_BIGENDIAN
146
147 dnl Check for MMX-capable compiler
148 AC_MSG_CHECKING(for MMX-capable compiler)
149 AC_TRY_RUN([
150 #include "include/mmx.h"
151
152 main()
153 { movq_r2r(mm0, mm1); return 0; }
154 ],
155 [
156 HAVE_LIBMMX="yes"
157 AC_MSG_RESULT(yes)
158 ],
159 HAVE_LIBMMX="no"
160 AC_MSG_RESULT(no)
161 ,
162 HAVE_LIBMMX="no"
163 AC_MSG_RESULT(no)
164 )
165
166
167
168 dnl Check for essential libraries first:
169 dnl ====================================
170
171 dnl Check for glib2
172 GST_CHECK_FEATURE(GLIB2, [use of glib-2.0 and GObject], , [
173   PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
174     HAVE_GLIB2=yes,HAVE_GLIB2=no)
175   AC_SUBST(GLIB2_LIBS)
176   AC_SUBST(GLIB2_CFLAGS)
177 ], disabled, [
178   CORE_LIBS="$CORE_LIBS $GLIB2_LIBS"
179   CORE_CFLAGS="$CORE_CFLAGS $GLIB2_CFLAGS"
180
181   AC_DEFINE(USE_GLIB2)
182   GST_DEFINE_CFLAGS="$GST_DEFINE_CFLAGS -DUSE_GLIB2"
183 ])
184 AC_SUBST(USE_GLIB2)
185
186 dnl FIXME: check for gtk2 and gnome2 - these conditionals are currently
187 dnl always false.
188 AM_CONDITIONAL(USE_GTK2, test "x$USE_GTK2" = "xyes")
189 AC_SUBST(USE_GTK2)
190 AM_CONDITIONAL(USE_GNOME2, test "x$USE_GNOME2" = "xyes")
191 AC_SUBST(USE_GNOME2)
192
193 if test x$USE_GLIB2 = xno; then
194   dnl Check for glib and gtk
195   AM_PATH_GLIB(1.2.0,,
196               AC_MSG_ERROR(Cannot find glib: Is glib-config in path?),
197               glib gmodule gthread)
198   AM_PATH_GTK(1.2.0,,
199               AC_MSG_ERROR(Cannot find gtk: Is gtk-config in path?))
200
201   CORE_LIBS="$CORE_LIBS $GLIB_LIBS $GTK_LIBS"
202   CORE_CFLAGS="$CORE_CFLAGS $GLIB_CFLAGS $GTK_CFLAGS"
203 fi
204
205
206 dnl Check for libxml
207 AC_PATH_PROG(XML_CONFIG, xml-config, no)
208 if test x$XML_CONFIG = xno; then
209   AC_MSG_ERROR(Couldn't find xml-config)
210 fi
211 XML_LIBS=`xml-config --libs`
212 XML_CFLAGS=`xml-config --cflags`
213 AC_CHECK_LIB(xml, xmlDocGetRootElement, ,
214   [ AC_MSG_ERROR(Need version 1.8.1 or better of libxml) ],
215   $XML_LIBS)
216 AC_SUBST(XML_LIBS)
217 AC_SUBST(XML_CFLAGS)
218 CORE_LIBS="$CORE_LIBS $XML_LIBS"
219 CORE_CFLAGS="$CORE_CFLAGS $XML_CFLAGS"
220
221
222 dnl ==========================================================================
223 dnl ========================= Macro definitions ==============================
224 dnl ==========================================================================
225
226 dnl These macros should be moved out to separate files (acinclude.m4?), but
227 dnl can't currently be because of the SUBSTFOR magic.
228
229 dnl Perform a check for existence of ARTS
230 dnl Richard Boulton <richard-alsa@tartarus.org>
231 dnl Last modification: 26/06/2001
232 dnl GST_CHECK_FEATURE(FEATURE-NAME, FEATURE-DESCRIPTION,
233 dnl                   DEPENDENT-PLUGINS, TEST-FOR-FEATURE)
234 dnl
235 dnl This check was written for GStreamer: it should be renamed and checked
236 dnl for portability if you decide to use it elsewhere.
237 dnl
238 AC_DEFUN(GST_CHECK_ARTS,
239 [
240 dnl Set the flags
241 ARTS_LIBS="-L/usr/local/lib -L/usr/lib -lmcop -lartsflow -lartsflow_idl"
242 ARTS_CFLAGS="-I/usr/local/include/arts -I/usr/include/kde/arts -I/usr/include/arts"
243 ARTS_MCOPFLAGS=$ARTS_CFLAGS
244 dnl There's no arts-config script, so we make a guess based on the artsc-config
245 AC_PATH_PROG(ARTSC_CONFIG, artsc-config, no)
246 if test x$ARTSC_CONFIG = xyes; then
247   ARTS_ARTSC_CFLAGS=`artsc-config --cflags | sed 's/artsc/arts/g'`
248   ARTS_CFLAGS="$ARTS_CFLAGS $ARTS_ARTSC_CFLAGS"
249   ARTS_MCOPFLAGS="$ARTS_MCOPFLAGS $ARTS_ARTSC_CFLAGS"
250 fi
251 AC_SUBST(ARTS_LIBS)
252 AC_SUBST(ARTS_CFLAGS)
253 AC_SUBST(ARTS_MCOPFLAGS)
254
255 dnl Now check if it exists
256 SUBSTFOR configure.ac:AC_LANG_PUSH(C++)
257 SUBSTFOR configure.in:AC_LANG_SAVE
258 SUBSTFOR configure.in:AC_LANG_CPLUSPLUS
259 HAVE_ARTS=yes
260 dnl FIXME: Can't get this test to pass, so commented it out.  Rely on header check.
261 dnl AC_CHECK_LIB(artsflow, convert_stereo_2float_i16le, :, HAVE_ARTS=no, $LIBS)
262
263 dnl AC_CHECK_HEADER uses CPPFLAGS, but not CFLAGS.
264 dnl FIXME: ensure only suitable flags result from artsc-config --cflags
265 CPPFLAGS="$CPPFLAGS $ARTS_CFLAGS"
266 AC_CHECK_HEADER(artsflow.h, :, HAVE_ARTS=no)
267
268 SUBSTFOR configure.ac:AC_LANG_POP(C++)
269 SUBSTFOR configure.in:AC_LANG_RESTORE
270 dnl Check for the idl generator
271 AC_CHECK_PROG(HAVE_MCOPIDL, mcopidl, yes, no)
272 if test x$HAVE_MCOPIDL = xno; then
273   HAVE_ARTS=no
274 fi
275 ])
276
277 dnl ==========================================================================
278 dnl ========================= End macro definitions ==========================
279 dnl ==========================================================================
280
281
282 dnl Next, check for the optional libraries:
283 dnl =======================================
284
285
286 dnl ***** ESound *****
287 GST_CHECK_FEATURE(LIBESD, [esound plugins], esdsrc esdsink, [
288   AM_PATH_ESD(0.2.12, HAVE_LIBESD=yes, HAVE_LIBESD=no)
289 ])
290
291 dnl Check for artsc
292 GST_CHECK_FEATURE(ARTSC, [artsd plugins], artsdsink, [GST_CHECK_ARTSC()])
293
294 dnl Check for artsc
295 GST_CHECK_FEATURE(ARTS, [arts plugins], arts, [GST_CHECK_ARTS()])
296
297 dnl Check for xmms
298 GST_CHECK_FEATURE(LIBXMMS, [xmms plugin], xmms, [
299   AM_PATH_XMMS(0.1.0, HAVE_LIBXMMS=yes, HAVE_LIBXMMS=no)
300 ], disabled)
301
302 dnl Check for alsa
303 GST_CHECK_FEATURE(ALSA, [alsa plugins], gstalsa, [
304   HAVE_ALSA=yes
305   AM_PATH_ALSA(0.9.0, HAVE_ALSA=no; AC_MSG_WARN(Alsa 0.9.x not yet supported),:)
306   if test x$HAVE_ALSA = xno; then
307     ALSA_CFLAGS=
308     ALSA_LIBS=
309   else
310     AM_PATH_ALSA(0.5.0, :, HAVE_ALSA=no)
311   fi
312 ])
313
314 dnl Check for libaudiofile
315 GST_CHECK_FEATURE(LIBAUDIOFILE, [use gdk pixbuf], afsink afsrc, [
316   GST_CHECK_CONFIGPROG(LIBAUDIOFILE, audiofile-config)
317 ])
318
319 dnl Check for libgdk-pixbuf
320 dnl FIXME: not sure that this is still used anywhere.
321 GST_CHECK_FEATURE(GDK_PIXBUF, [use gdk pixbuf], , [
322   GST_CHECK_CONFIGPROG(GDK_PIXBUF, gdk-pixbuf-config)
323 ])
324
325 if test x$USE_GLIB2 = xyes; then
326   dnl we don't support gnome/gtk with glib2.0 yet
327   GNOME_LIBS=
328   GNOME_CFLAGS=
329   HAVE_GNOME=no
330   AC_MSG_WARN(gnome disabled for glib2.0)
331 else
332   dnl Check for libgnome
333   GST_CHECK_CONFIGPROG(GNOME, gnome-config, gnome gnomeui)
334 fi
335
336 dnl Check for libghttp
337 GST_CHECK_FEATURE(LIBGHTTP, [libghttp plugins], gsthttpsrc, [
338   dnl FIXME: need to check for header
339   GHTTP_LIBS=
340   GST_HTTPSRC_GET_TYPE=
341   if test x$USE_GLIB2 = xyes; then
342     AC_MSG_WARN(ghttp disabled for glib2.0)
343   else
344     AC_CHECK_LIB(ghttp, ghttp_request_new,
345       [GHTTP_LIBS="-lghttp"
346        GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
347        HAVE_LIBGHTTP=yes
348       ], :, $LIBS)
349   fi
350   AC_SUBST(GHTTP_LIBS)
351   AC_SUBST(GST_HTTPSRC_GET_TYPE)
352 ])
353
354 dnl Check for libglade
355 HAVE_LIBGLADE_GNOME="no"
356 if test x$USE_GLIB2 = xyes; then
357   dnl no glade for glib2.0
358   LIBGLADE_GNOME_LIBS=
359   LIBGLADE_GNOME_CFLAGS=
360   AC_MSG_WARN(libglade disabled for glib2.0)
361 else
362   AC_PATH_PROG(LIBGLADE_CONFIG_PATH, libglade-config, no)
363   if test x$LIBGLADE_CONFIG_PATH = xno; then
364     AC_MSG_WARN(Couldn't find libglade-config - Can't build gstplay)
365     LIBGLADE_GNOME_LIBS=
366     LIBGLADE_GNOME_CFLAGS=
367   else
368     LIBGLADE_GNOME_LIBS=`libglade-config --libs gnome`
369     LIBGLADE_GNOME_CFLAGS=`libglade-config --cflags gnome`
370     libglade_save_CFLAGS="$CFLAGS"
371     libglade_save_LIBS="$LIBS"
372     CFLAGS="$CFLAGS $LIBGLADE_GNOME_CFLAGS $GTK_CFLAGS"
373     LIBS="$LIBS $LIBGLADE_GNOME_LIBS $GTK_LIBS"
374     AC_TRY_LINK([#include <glade/glade.h>],[glade_gnome_init();],
375                 HAVE_LIBGLADE_GNOME="yes",
376                 AC_MSG_WARN(
377       [Couldn't find gnome libraries for libglade - Can't build gstmediaplay and gsteditor])
378              )
379     CFLAGS="$libglade_save_CFLAGS"
380     LIBS="$libglade_save_LIBS"
381   fi
382 fi
383 AC_SUBST(LIBGLADE_GNOME_LIBS)
384 AC_SUBST(LIBGLADE_GNOME_CFLAGS)
385
386 dnl Check for Gnome VFS
387 HAVE_GNOME_VFS="no"
388 if test x$USE_GLIB2 = xyes; then
389   VFS_LIBS=
390   VFS_CFLAGS=
391   AC_MSG_WARN(Gnome-VFS disabled for glib2.0)
392 else
393   AC_MSG_CHECKING(for Gnome VFS)
394   if gnome-config --libs vfs > /dev/null 2>&1; then
395         HAVE_GNOME_VFS="yes"
396         AC_MSG_RESULT(found)
397         VFS_LIBS="`gnome-config --libs vfs`"
398         VFS_CFLAGS="`gnome-config --cflags vfs`"
399   else
400         AC_MSG_WARN(Did not find Gnome-VFS installed)
401         VFS_LIBS=
402         VFS_CFLAGS=
403   fi
404 fi
405 AC_SUBST(VFS_LIBS)
406 AC_SUBST(VFS_CFLAGS)
407
408 dnl Check for Avifile
409 HAVE_AVIFILE="no"
410 AC_MSG_CHECKING(for Avifile)
411 if avifile-config --libs > /dev/null 2>&1; then
412         HAVE_AVIFILE="yes"
413         AC_MSG_RESULT(found)
414 else
415         AC_MSG_WARN(Did not find Avifile installed)
416 fi
417 AVIFILE_LIBS="`avifile-config --libs`"
418 AVIFILE_CFLAGS="`avifile-config --cflags`"
419 AC_SUBST(AVIFILE_LIBS)
420 AC_SUBST(AVIFILE_CFLAGS)
421
422 dnl Check for atomic.h
423 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
424 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
425 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
426 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
427 if test x$HAVE_ATOMIC_H = xyes; then
428   AC_TRY_RUN([
429 #include "asm/atomic.h"
430 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
431   ],, [
432     # Not successful
433     if test x$HAVE_ATOMIC_H = xyes; then
434       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
435     fi
436     HAVE_ATOMIC_H=no
437   ], [
438     # Cross compiling
439     AC_MSG_RESULT(yes)
440     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
441   ])
442 fi
443
444
445 dnl Check for X11 extensions
446 AC_PATH_XTRA
447 if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
448   AC_MSG_ERROR(can not find X11)
449 fi
450 AC_SUBST(X_CFLAGS)
451 AC_SUBST(X_PRE_LIBS)
452 AC_SUBST(X_EXTRA_LIBS)
453 AC_SUBST(X_LIBS)
454
455
456 dnl Check for the Xv library
457 xvsave_LIBS=${LIBS}
458 AC_CHECK_LIB(Xv, XvQueryExtension,
459   HAVE_LIBXV=yes,
460   HAVE_LIBXV=no,
461   $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS
462 )
463 LIBS=${xvsave_LIBS}
464 AC_CHECK_HEADER(X11/extensions/Xv.h, :, HAVE_LIBXV=no)
465 AC_CHECK_HEADER(X11/extensions/Xvlib.h, :, HAVE_LIBXV=no)
466
467 dnl Check for OSS audio
468 AC_CHECK_HEADER(sys/soundcard.h, HAVE_OSS=yes, HAVE_OSS=no)
469
470 dnl Check for xaudio
471 AC_CHECK_HEADER(xaudio/decoder.h,
472   AC_DEFINE(HAVE_XAUDIO, 1, [Define if xaudio is available])
473   HAVE_XAUDIO="yes",
474   AC_MSG_WARN(
475 ***** NOTE: These plugins won't be built: gstxa
476 )
477   HAVE_XAUDIO="no",
478 )
479
480 dnl Check for libmad
481 AC_MSG_CHECKING(MAD library)
482 AC_CHECK_LIB(mad, mad_decoder_finish,
483   HAVE_LIBMAD=yes
484   AC_DEFINE(HAVE_LIBMAD, 1, [Define if libmad is available]),
485   AC_MSG_WARN(
486 ***** NOTE: These plugins won't be built: mad
487 )
488   HAVE_LIBMAD=no,
489 )
490
491 dnl Check for libvorbis
492 AC_MSG_CHECKING(Vorbis library)
493 AC_CHECK_LIB(vorbis, ogg_sync_init,
494   HAVE_VORBIS=yes
495   AC_DEFINE(HAVE_VORBIS, 1, [Define if vorbis library is available]),
496   AC_MSG_WARN(
497 ***** NOTE: These plugins won't be built: vorbisdec vorbisenc
498 )
499   HAVE_VORBIS=no,
500 )
501
502 dnl Check for libjpeg
503 AC_MSG_CHECKING(libjpeg library)
504 AC_CHECK_LIB(jpeg, jpeg_set_defaults,
505   HAVE_LIBJPEG=yes
506   AC_DEFINE(HAVE_LIBJPEG, 1, [Define if libjpeg is available]),
507   AC_MSG_WARN(
508 ***** NOTE: These plugins won't be built: jpegdec jpegenc
509 )
510   HAVE_LIBJPEG=no,
511 )
512
513 dnl Check for libHermes
514 AC_MSG_CHECKING(Hermes library)
515 AC_CHECK_LIB(Hermes, Hermes_ConverterInstance,
516   HAVE_LIBHERMES=yes
517   AC_DEFINE(HAVE_LIBHERMES, 1, [Define if Hermes library is available]),
518   AC_MSG_WARN(
519 ***** NOTE: These plugins won't be built: colorspace
520 )
521   HAVE_LIBHERMES=no,
522 )
523 AC_CHECK_HEADER(Hermes/Hermes.h, :, HAVE_LIBHERMES=no)
524
525 dnl Check for libgsm
526 AC_MSG_CHECKING(GSM library)
527 AC_CHECK_LIB(gsm, gsm_create, HAVE_LIBGSM=yes, HAVE_LIBGSM=no,)
528 GSM_CFLAGS=
529 GSM_LIBS=-lgsm
530 AC_CHECK_HEADER(gsm.h, :, 
531   GSM_CFLAGS="$GSM_CFLAGS -DGSM_HEADER_IN_SUBDIR"
532   AC_CHECK_HEADER(gsm/gsm.h, :, HAVE_LIBGSM=no)
533 )
534 AC_SUBST(GSM_CFLAGS)
535 AC_SUBST(GSM_LIBS)
536
537 if test "x$HAVE_LIBGSM" == "xyes"; then
538   AC_DEFINE(HAVE_LIBGSM, 1, [Define if GSM library is available])
539 else
540   AC_MSG_WARN(
541 ***** NOTE: These plugins won't be built: gsmdec, gsmenc
542 )
543 fi
544
545 dnl Check for cdparanoia
546 AC_MSG_CHECKING(CDparanoia library)
547 HAVE_CDPARANOIA=yes
548 AC_CHECK_LIB(cdda_interface, cdda_open, : , HAVE_CDPARANOIA=no, )
549 AC_CHECK_HEADER(cdda_interface.h, :, HAVE_CDPARANOIA=no)
550 AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
551 AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
552
553 dnl Check for liblame
554 AC_MSG_CHECKING(LAME library)
555 AC_CHECK_LIB(mp3lame, lame_init, HAVE_LIBLAME=yes, HAVE_LIBLAME=no, -lm)
556 AC_CHECK_HEADER(lame/lame.h, :, HAVE_LIBLAME=no)
557
558 dnl Check for libshout
559 AC_MSG_CHECKING(Shout library)
560 AC_CHECK_LIB(shout, shout_init_connection, HAVE_LIBSHOUT=yes, HAVE_LIBSHOUT=no, )
561 AC_CHECK_HEADER(shout/shout.h, :, HAVE_LIBSHOUT=no)
562
563 dnl Check for mpeg2dec
564 AC_MSG_CHECKING(mpeg2dec library)
565 AC_CHECK_LIB(mpeg2, mpeg2_init, HAVE_MPEG2DEC=yes, HAVE_MPEG2DEC=no, )
566 AC_CHECK_HEADER(mpeg2dec/mpeg2.h, :, HAVE_MPEG2DEC=no)
567
568 dnl Check for flac
569 AC_MSG_CHECKING(FLAC library)
570 AC_CHECK_LIB(FLAC, FLAC__stream_decoder_new, HAVE_FLAC=yes, HAVE_FLAC=no, -lm)
571 AC_CHECK_HEADER(FLAC/all.h, :, HAVE_FLAC=no)
572
573 dnl Check for librtp
574 AC_MSG_CHECKING(rtp library)
575 AC_CHECK_LIB(rtp, rtp_packet_new_take_data, HAVE_LIBRTP=yes, HAVE_LIBRTP=no, $GLIB_LIBS $GLIB_CFLAGS)
576 AC_CHECK_HEADER(rtp/rtp-packet.h, :, HAVE_LIBRTP=no)
577 AC_CHECK_HEADER(rtp/rtcp-packet.h, :, HAVE_LIBRTP=no)
578 AC_CHECK_HEADER(rtp/rtp-audio.h, :, HAVE_LIBRTP=no)
579
580 dnl Check for libraw1394
581 AC_MSG_CHECKING(raw1394 library)
582 AC_CHECK_LIB(raw1394, raw1394_get_handle, HAVE_RAW1394=yes, HAVE_RAW1394=no, )
583 AC_CHECK_HEADER(libraw1394/raw1394.h, :, HAVE_RAW1394=no)
584
585 dnl Check for libdv
586 AC_MSG_CHECKING(libdv)
587 AC_CHECK_LIB(dv, dv_init, HAVE_LIBDV=yes, HAVE_LIBDV=no, -lm $GLIB_LIBS $GLIB_CFLAGS)
588 libdvcheck_save_CPPFLAGS="$CPPFLAGS"
589 CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
590 AC_CHECK_HEADER(libdv/dv.h, :, HAVE_LIBDV=no)
591 CPPFLAGS="$libdvcheck_save_CPPFLAGS"
592
593 dnl Check for aalib
594 AC_MSG_CHECKING(aalib)
595 AC_CHECK_LIB(aa, aa_init, HAVE_LIBAA=yes, HAVE_LIBAA=no, )
596 AC_CHECK_HEADER(aalib.h, :, HAVE_LIBAA=no)
597
598 dnl Check for quicktime
599 AC_MSG_CHECKING(openquicktime)
600 AC_CHECK_LIB(openquicktime, quicktime_init, HAVE_LIBOPENQUICKTIME=yes, HAVE_LIBOPENQUICKTIME=no, )
601 AC_CHECK_HEADER(openquicktime/openquicktime.h, :, HAVE_LIBOPENQUICKTIME=no)
602
603
604 dnl check if css-auth.c exists (FIXME)
605 AC_MSG_CHECKING(DVD CSS code)
606 if test -f plugins/dvdsrc/css-auth.c
607 then
608   AC_MSG_RESULT(yes)
609   HAVE_CSSAUTH="yes"
610 else
611   AC_MSG_RESULT(no)
612   HAVE_CSSAUTH="no"
613 fi
614
615 dnl Check for SDL library
616 AC_MSG_CHECKING(SDL library)
617 HAVE_LIBSDL=yes
618 if sdl-config --libs > /dev/null 2>&1; then
619   SDL_VERSION=`sdl-config --version`
620   AC_MSG_RESULT([found (version $SDL_VERSION)])
621   SDL_LIBS="`sdl-config --libs`"
622   SDL_CFLAGS="`sdl-config --cflags`"
623   AC_CHECK_LIB(SDL, SDL_Init, :, HAVE_LIBSDL=no, $SDL_LIBS)
624   dnl AC_CHECK_HEADER uses CPPFLAGS, but not CFLAGS.
625   dnl Assume only suitable flags result from artsc-config --cflags
626   sdlcheck_save_CPPFLAGS="$CPPFLAGS"
627   CPPFLAGS="$CPPFLAGS $SDL_CFLAGS"
628   AC_CHECK_HEADER(SDL.h, :, HAVE_LIBSDL=no)
629   CPPFLAGS="$sdlcheck_save_CPPFLAGS"
630   AC_CHECK_LIB(SDL, SDL_CreateYUVOverlay, :, HAVE_LIBSDL=no, $SDL_LIBS)
631 else
632   AC_MSG_RESULT(not found)
633   HAVE_LIBSDL=no
634   SDL_LIBS=
635   SDL_CFLAGS=
636 fi
637 AC_SUBST(SDL_LIBS)
638 AC_SUBST(SDL_CFLAGS)
639
640 if test "x$HAVE_LIBSDL" == "xno"; then
641   AC_MSG_WARN(
642 ***** NOTE: These plugins won't be built: sdlvideosink
643 )
644 fi
645
646
647 dnl Check for linux/cdrom.h
648 AC_CHECK_HEADER(linux/cdrom.h,
649   HAVE_LINUX_CDROM=yes, HAVE_LINUX_CDROM=no
650 )
651
652 dnl Check for linux/videodev.h
653 AC_CHECK_HEADER(linux/videodev.h,
654   HAVE_LINUX_VIDEODEV=yes, HAVE_LINUX_VIDEODEV=no
655 )
656
657
658 dnl ######################################################################
659 dnl # Check command line parameters, and set shell variables accordingly #
660 dnl ######################################################################
661
662 AC_ARG_ENABLE(libmmx,
663 [  --enable-libmmx              use libmmx, if available],
664 [case "${enableval}" in
665   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
666   no)  USE_LIBMMX=no ;;
667   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
668 esac], 
669 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
670
671 AC_ARG_ENABLE(atomic,
672 [  --enable-atomic              use atomic reference counting header],
673 [case "${enableval}" in
674   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
675   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
676   no)  USE_ATOMIC_H=no;;
677   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
678 esac], 
679 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
680
681 AC_ARG_ENABLE(plugin-builddir,
682 [  --enable-plugin-builddir     allow tests/demos to use non-installed plugins ],
683 [case "${enableval}" in
684   yes) PLUGINS_USE_BUILDDIR=yes ;;
685   no)  PLUGINS_USE_BUILDDIR=no ;;
686   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
687 esac], 
688 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
689
690 AC_ARG_ENABLE(debug,
691 [  --enable-debug               compile with -g debugging info],
692 [case "${enableval}" in
693   yes) USE_DEBUG=yes ;;
694   no)  USE_DEBUG=no ;;
695   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
696 esac], 
697 [USE_DEBUG=no]) dnl Default value
698
699 AC_ARG_ENABLE(DEBUG,
700 [  --enable-DEBUG               compiles in a large number of debugging messages],
701 [case "${enableval}" in
702   yes) ENABLE_DEBUG=yes ;;
703   no)  ENABLE_DEBUG=no ;;
704   *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
705 esac], 
706 [ENABLE_DEBUG=no]) dnl Default value
707 if test x$ENABLE_DEBUG = xyes; then
708   AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
709 fi
710
711 AC_ARG_ENABLE(INFO,
712 [  --disable-INFO               disables compilation of informational messages],
713 [case "${enableval}" in
714   yes) ENABLE_INFO=yes ;;
715   no)  ENABLE_INFO=no ;;
716   *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
717 esac], 
718 [ENABLE_INFO=yes]) dnl Default value
719 if test x$ENABLE_INFO = xyes; then
720   AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
721 fi
722
723 AC_ARG_ENABLE(debug-color,
724 [  --disable-debug-color        disables color output of DEBUG and INFO output],
725 [case "${enableval}" in
726   yes) ENABLE_DEBUG_COLOR=yes ;;
727   no)  ENABLE_DEBUG_COLOR=no ;;
728   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
729 esac], 
730 [ENABLE_DEBUG_COLOR=yes]) dnl Default value
731 if test "x$ENABLE_DEBUG_COLOR" = xyes; then
732   AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
733 fi
734
735 AC_ARG_ENABLE(profiling,
736 [  --enable-profiling           adds -pg to compiler commandline, for profiling],
737 [case "${enableval}" in
738   yes) USE_PROFILING=yes ;;
739   no)  UES_PROFILING=no ;;
740   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
741 esac], 
742 [USE_PROFILING=no]) dnl Default value
743
744 dnl Default value
745 GST_CONFIG_DIR=${sysconfdir}/gstreamer
746 AC_ARG_WITH(configdir,
747 [  --with-configdir             specify path to use for configdir],
748 [case "${withval}" in
749   yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
750   no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
751   *) GST_CONFIG_DIR="${withval}" ;;
752 esac], 
753 [:]) dnl Default value
754
755 dnl Default value
756 GST_WIN32_LIBDIR="/usr/lib/win32"
757 AC_ARG_WITH(win32_libdir,
758 [  --with-win32-libdir          specify location for win32 DLLs],
759 [case "${withval}" in
760   yes) AC_MSG_ERROR(bad value ${withval} for --with-win32-libdir) ;;
761   no) AC_MSG_ERROR(bad value ${withval} for --with-win32-libdir) ;;
762   *) GST_WIN32_LIBDIR="${withval}" ;;
763 esac],
764 [:]) dnl Default value
765
766 AC_ARG_ENABLE(docs-build,
767 [  --enable-docs-build          enable building of documentation],
768 [case "${enableval}" in
769   yes) BUILD_DOCS=yes ;;
770   no)  BUILD_DOCS=no ;;
771   *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs-build) ;;
772 esac], 
773 [BUILD_DOCS=no]) dnl Default value
774
775 AC_ARG_ENABLE(plugin-docs,
776 [  --enable-plugin-docs         enable the building of plugin documentation
777                                (this is currently broken, so off by default)],
778 [case "${enableval}" in
779   yes) BUILD_PLUGIN_DOCS=yes ;;
780   no)  BUILD_PLUGIN_DOCS=no ;;
781   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;;
782 esac], 
783 [BUILD_PLUGIN_DOCS=no]) dnl Default value
784
785 AC_ARG_ENABLE(tests,
786 [  --disable-tests              disable building test apps],
787 [case "${enableval}" in
788   yes) BUILD_TESTS=yes ;;
789   no)  BUILD_TESTS=no ;;
790   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
791 esac], 
792 [BUILD_TESTS=yes]) dnl Default value
793
794 AC_ARG_ENABLE(examples,
795 [  --disable-examples           disable building examples],
796 [case "${enableval}" in
797   yes) BUILD_EXAMPLES=yes ;;
798   no)  BUILD_EXAMPLES=no ;;
799   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
800 esac], 
801 [BUILD_EXAMPLES=yes]) dnl Default value
802
803 dnl Next, check for the optional components:
804 dnl ========================================
805
806
807 AC_DEFUN(GST_SUBSYSTEM_DISABLE,
808 [dnl
809 dnl Add a subsystem --disable flag and all the necessary symbols and substitions
810 dnl
811 AC_ARG_ENABLE(translit([$1], A-Z, a-z), 
812 [  ]builtin(format, --disable-%-17s  disable %s, translit([$1], A-Z, a-z), $2),
813 [ case "${enableval}" in
814     yes) GST_DISABLE_[$1]=no ;;
815     no) GST_DISABLE_[$1]=yes ;;
816     *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;;
817   esac],
818 [GST_DISABLE_[$1]=no]) dnl Default value
819 if test x$GST_DISABLE_[$1] = xyes; then
820   AC_DEFINE(GST_DISABLE_[$1], 1, [Disable $2])
821   GST_DISABLE_[$1]_DEFINE=-DGST_DISABLE_[$1]
822 fi
823 AM_CONDITIONAL(GST_DISABLE_[$1], test x$GST_DISABLE_[$1] = xyes)
824 AC_SUBST(GST_DISABLE_[$1]_DEFINE)
825 GST_SUBSYSTEM_DISABLE_DEFINES="$GST_SUBSYTEM_DISABLE_DEFINES $GST_DISABLE_[$1]_DEFINE"
826 ])
827
828 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
829 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
830 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
831 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
832 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
833
834 GST_DEFINE_CFLAGS="$GST_DEFINE_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
835
836
837 dnl ################################################
838 dnl # Set defines according to variables set above #
839 dnl ################################################
840
841
842 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
843 dnl HAVE_ and it is likely to be easier to stick with the old name
844 if test "x$USE_LIBGHTTP" = xyes; then
845   AC_DEFINE(HAVE_LIBGHTTP, 1, [Define if ghttp library is available])
846 fi
847
848 if test "x$USE_LIBMMX" = xyes; then
849   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
850 fi
851
852 if test "x$USE_ATOMIC_H" = xyes; then
853   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
854 fi
855
856 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
857   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
858 fi
859
860 if test "x$USE_DEBUG" = xyes; then
861   CFLAGS="$CFLAGS -g"
862 fi
863
864 if test "x$USE_PROFILING" = xyes; then
865   CFLAGS="$CFLAGS -pg"
866   FOMIT_FRAME_POINTER=""
867 else
868   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
869 fi
870
871 if test "x$HAVE_LIBXV" = xyes; then
872   AC_DEFINE(HAVE_LIBXV)
873 fi
874
875 if test "x$HAVE_OSS" = xyes; then
876   AC_DEFINE(HAVE_OSS)
877 fi
878
879 if test "x$HAVE_XAUDIO" = xyes; then
880   AC_DEFINE(HAVE_XAUDIO)
881 fi
882
883 if test "x$HAVE_LIBMAD" = xyes; then
884   AC_DEFINE(HAVE_LIBMAD)
885 fi
886
887 if test "x$HAVE_VORBIS" = xyes; then
888   AC_DEFINE(HAVE_VORBIS)
889 fi
890
891 if test "x$HAVE_LIBJPEG" = xyes; then
892   AC_DEFINE(HAVE_LIBJPEG)
893 fi
894
895 if test "x$HAVE_LIBSDL" = xyes; then
896   AC_DEFINE(HAVE_LIBSDL)
897 fi
898
899 if test "x$HAVE_LIBHERMES" = "xyes"; then
900   AC_DEFINE(HAVE_LIBHERMES)
901 fi
902
903 if test "x$HAVE_CSSAUTH" = xyes; then
904   AC_DEFINE(HAVE_CSSAUTH)
905 fi
906
907 if test "x$HAVE_LINUX_CDROM" = xyes; then
908   AC_DEFINE(HAVE_LINUX_CDROM)
909 fi
910
911 if test "x$HAVE_LINUX_VIDEODEV" = xyes; then
912   AC_DEFINE(HAVE_LINUX_VIDEODEV)
913 fi
914
915 if test "x$HAVE_MPEG2DEC" = xyes; then
916   AC_DEFINE(HAVE_MPEG2DEC)
917 fi
918
919 if test "x$HAVE_FLAC" = xyes; then
920   AC_DEFINE(HAVE_FLAC)
921 fi
922
923 if test "x$HAVE_LIBGSM" = xyes; then
924   AC_DEFINE(HAVE_LIBGSM)
925 fi
926
927 dnl #############################
928 dnl # Set automake conditionals #
929 dnl #############################
930
931 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
932 dnl HAVE_ and it is likely to be easier to stick with the old name
933 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
934 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
935 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
936 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
937 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
938 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
939 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
940 AM_CONDITIONAL(HAVE_OSS,            test "x$HAVE_OSS" = "xyes")
941 AM_CONDITIONAL(HAVE_XAUDIO,         test "x$HAVE_XAUDIO" = "xyes")
942 AM_CONDITIONAL(HAVE_LIBMAD,         test "x$HAVE_LIBMAD" = "xyes")
943 AM_CONDITIONAL(HAVE_LINUX_CDROM,    test "x$HAVE_LINUX_CDROM" = "xyes")
944 AM_CONDITIONAL(HAVE_LINUX_VIDEODEV, test "x$HAVE_LINUX_VIDEODEV" = "xyes")
945 AM_CONDITIONAL(HAVE_CSSAUTH,        test "x$HAVE_CSSAUTH" = "xyes")
946 AM_CONDITIONAL(HAVE_VORBIS,         test "x$HAVE_VORBIS" = "xyes")
947 AM_CONDITIONAL(HAVE_LIBJPEG,        test "x$HAVE_LIBJPEG" = "xyes")
948 AM_CONDITIONAL(HAVE_LIBSDL,         test "x$HAVE_LIBSDL" = "xyes")
949 AM_CONDITIONAL(HAVE_LIBHERMES,      test "x$HAVE_LIBHERMES" = "xyes")
950 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
951 AM_CONDITIONAL(HAVE_LIBGLADE_GNOME, test "x$HAVE_LIBGLADE_GNOME" = "xyes")
952 AM_CONDITIONAL(HAVE_GNOME,          test "x$HAVE_GNOME" = "xyes")
953 AM_CONDITIONAL(HAVE_LIBXV,          test "x$HAVE_LIBXV" = "xyes")
954 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
955 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
956 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
957 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
958 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
959 AM_CONDITIONAL(HAVE_DB2HTML,        $HAVE_DB2HTML)
960 AM_CONDITIONAL(HAVE_DB2PS,          $HAVE_DB2PS)
961 AM_CONDITIONAL(HAVE_PS2PDF,         $HAVE_PS2PDF)
962 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
963 AM_CONDITIONAL(HAVE_FIG2DEV_EPS,    $HAVE_FIG2DEV_EPS)
964 AM_CONDITIONAL(HAVE_CDPARANOIA,     test "x$HAVE_CDPARANOIA" = "xyes")
965 AM_CONDITIONAL(HAVE_LIBLAME,        test "x$HAVE_LIBLAME" = "xyes")
966 AM_CONDITIONAL(HAVE_LIBSHOUT,       test "x$HAVE_LIBSHOUT" = "xyes")
967 AM_CONDITIONAL(HAVE_MPEG2DEC,       test "x$HAVE_MPEG2DEC" = "xyes")
968 AM_CONDITIONAL(HAVE_FLAC,           test "x$HAVE_FLAC" = "xyes")
969 AM_CONDITIONAL(HAVE_LIBRTP,         test "x$HAVE_LIBRTP" = "xyes")
970 AM_CONDITIONAL(HAVE_ARTS,           test "x$HAVE_ARTS" = "xyes")
971 AM_CONDITIONAL(HAVE_RAW1394,        test "x$HAVE_RAW1394" = "xyes")
972 AM_CONDITIONAL(HAVE_LIBDV,          test "x$HAVE_LIBDV" = "xyes")
973 AM_CONDITIONAL(HAVE_LIBAA,          test "x$HAVE_LIBAA" = "xyes")
974 AM_CONDITIONAL(HAVE_GNOME_VFS,      test "x$HAVE_GNOME_VFS" = "xyes")
975 AM_CONDITIONAL(HAVE_AVIFILE,        test "x$HAVE_AVIFILE" = "xyes")
976 AM_CONDITIONAL(HAVE_LIBOPENQUICKTIME, test "x$HAVE_LIBOPENQUICKTIME" = "xyes")
977 AM_CONDITIONAL(HAVE_LIBGSM,         test "x$HAVE_LIBGSM" = "xyes")
978 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
979
980
981 dnl ############################
982 dnl # Set up some more defines #
983 dnl ############################
984
985 dnl Set location of configuration dir.
986 dnl AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
987 AC_SUBST(GST_CONFIG_DIR)
988
989 dnl Set location of windows dll dir.
990 AC_DEFINE_UNQUOTED(GST_WIN32_LIBDIR,"$GST_WIN32_LIBDIR")
991 AC_SUBST(GST_WIN32_LIBDIR)
992
993 dnl Set location of plugin directory
994 if test "x${prefix}" = "xNONE"; then
995   PLUGINS_DIR=${ac_default_prefix}/lib/gst
996 else
997   PLUGINS_DIR=${prefix}/lib/gst
998 fi
999 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
1000 AC_SUBST(PLUGINS_DIR)
1001
1002 dnl Set location of uninstalled plugin directory
1003 PLUGINS_BUILDDIR=${builddir}
1004 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
1005 AC_SUBST(PLUGINS_BUILDDIR)
1006
1007
1008
1009 dnl ##############################
1010 dnl # Set up the defaults cflags #
1011 dnl ##############################
1012 dnl CC="kgcc"
1013 if test "x$USE_PROFILING" = xyes; then
1014   CFLAGS="$CORE_CFLAGS $CFLAGS -Wall"
1015 else
1016   CFLAGS="$CORE_CFLAGS $CFLAGS -O6 -Wall"
1017 fi
1018 LIBS="$CORE_LIBS $LIBS"
1019 AC_SUBST(CORE_LIBS)
1020 AC_SUBST(CORE_CFLAGS)
1021
1022 dnl Vars for everyone else
1023 GST_LIBS="\$(top_builddir)/gst/libgst.la"
1024 GST_CFLAGS="-I\$(top_srcdir) -I\$(top_srcdir)/include"
1025 AC_SUBST(GST_LIBS)
1026 AC_SUBST(GST_CFLAGS)
1027
1028 dnl Private vars for libgst only
1029 LIBGST_LIBS="$LIBS"
1030 LIBGST_CFLAGS="$CFLAGS $GST_CFLAGS"
1031 AC_SUBST(LIBGST_LIBS)
1032 AC_SUBST(LIBGST_CFLAGS)
1033
1034 dnl CFLAGS for everyone else
1035 CFLAGS="$GST_CFLAGS $CFLAGS"
1036
1037 dnl Needed to make automake 1.4g happy.
1038 dnl FIXME: find as properly, rather than just using CC
1039 AS="\$(CC)"
1040
1041 dnl Having to AC_SUBST these is messy, but doesn't seem to do any harm.
1042 dnl I'm not sure whether it's really necessary, but it removes some warnings
1043 dnl when automake 1.4g runs, and may be beneficial elsewhere.
1044 AC_SUBST(LIBS)
1045 AC_SUBST(CFLAGS)
1046 AC_SUBST(CPPFLAGS)
1047 AC_SUBST(LDFLAGS)
1048 AC_SUBST(AS)
1049 AC_SUBST(ASFLAGS)
1050
1051 AC_SUBST(GST_DEFINE_CFLAGS)
1052
1053 dnl #############################
1054 dnl # Configure the subpackages #
1055 dnl #############################
1056
1057 dnl AC_CONFIG_SUBDIRS(gist)
1058 dnl AC_CONFIG_SUBDIRS(plugins/mp3decode/xing/libxing)
1059
1060 dnl ##################################################
1061 dnl # Prepare informative messages to display at end #
1062 dnl ##################################################
1063
1064 infomessages=
1065
1066 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
1067   infomessages="$infomessages
1068 *** Warning: You have configured using the --enable-plugin-builddir option.
1069
1070 This option is for development purposes only: binaries built with
1071 it should be used with code in the build tree only.  To build an
1072 installable version, use ./configure without the --enable-plugin-builddir
1073 option.  Note that the autogen.sh script supplies the plugin builddir
1074 option automatically - it cannot be used to configure installable builds.
1075
1076 "
1077 fi
1078
1079 dnl #########################
1080 dnl # Make the output files #
1081 dnl #########################
1082
1083 SUBSTFOR configure.ac:AC_OUTPUT(
1084 SUBSTFOR configure.ac:Makefile
1085 SUBSTFOR configure.in:AC_OUTPUT([Makefile
1086 include/Makefile
1087 gst/Makefile
1088 gst/gstversion.h
1089 gst/types/Makefile
1090 gst/elements/Makefile
1091 gst/autoplug/Makefile
1092 libs/Makefile
1093 libs/riff/Makefile
1094 libs/getbits/Makefile
1095 libs/putbits/Makefile
1096 libs/idct/Makefile
1097 libs/audio/Makefile
1098 plugins/Makefile
1099 plugins/aasink/Makefile
1100 plugins/alsa/Makefile
1101 plugins/au/Makefile
1102 plugins/audiofile/Makefile
1103 plugins/audioscale/Makefile
1104 plugins/avi/Makefile
1105 plugins/avi/wincodec/Makefile
1106 plugins/avi/winaudio/Makefile
1107 plugins/flx/Makefile
1108 plugins/festival/Makefile
1109 plugins/flac/Makefile
1110 plugins/jpeg/Makefile
1111 plugins/mp3decode/Makefile
1112 plugins/mp3decode/types/Makefile
1113 plugins/mp3decode/xa/Makefile
1114 plugins/mp3decode/mpg123/Makefile
1115 plugins/mp3decode/mad/Makefile
1116 plugins/mp3decode/parse/Makefile
1117 plugins/mp3encode/Makefile
1118 plugins/mp3encode/lame/Makefile
1119 plugins/mpeg2/Makefile
1120 plugins/mpeg2/parse/Makefile
1121 plugins/mpeg2/ac3parse/Makefile
1122 plugins/mpeg2/ac3dec/Makefile
1123 plugins/mpeg2/video/Makefile
1124 plugins/mpeg2/mpeg2enc/Makefile
1125 plugins/mpeg2/mpeg2dec/Makefile
1126 plugins/mpeg2/subtitles/Makefile
1127 plugins/mpeg2/videoparse/Makefile
1128 plugins/mpeg2/mpegtypes/Makefile
1129 plugins/mpeg1/Makefile
1130 plugins/mpeg1/mpegtypes/Makefile
1131 plugins/mpeg1/mpeg_play/Makefile
1132 plugins/mpeg1/mpegaudio/Makefile
1133 plugins/mpeg1/parse/Makefile
1134 plugins/mpeg1/system_encode/Makefile
1135 plugins/mpeg1/mpeg1encoder/Makefile
1136 plugins/mpeg1video/Makefile
1137 plugins/mpeg1video/parse/Makefile
1138 plugins/oss/Makefile
1139 plugins/rtp/Makefile
1140 plugins/rtp/rtpsend/Makefile
1141 plugins/mulaw/Makefile
1142 plugins/alaw/Makefile
1143 plugins/filters/Makefile
1144 plugins/filters/smooth/Makefile
1145 plugins/filters/median/Makefile
1146 plugins/filters/ladspa/Makefile
1147 plugins/filters/stereo2mono/Makefile
1148 plugins/filters/mono2stereo/Makefile
1149 plugins/filters/intfloatconvert/Makefile
1150 plugins/filters/passthrough/Makefile
1151 plugins/filters/adder/Makefile
1152 plugins/filters/colorspace/Makefile
1153 plugins/filters/volenv/Makefile
1154 plugins/filters/level/Makefile
1155 plugins/filters/lav/Makefile
1156 plugins/filters/cutter/Makefile
1157 plugins/filters/deinterlace/Makefile
1158 plugins/gnomevfs/Makefile
1159 plugins/icecast/Makefile
1160 plugins/icecast/icecastsend/Makefile
1161 plugins/effects/Makefile
1162 plugins/effects/stereo/Makefile
1163 plugins/effects/volume/Makefile
1164 plugins/udp/Makefile
1165 plugins/visualization/Makefile
1166 plugins/visualization/spectrum/Makefile
1167 plugins/visualization/vumeter/Makefile
1168 plugins/visualization/synaesthesia/Makefile
1169 plugins/visualization/smoothwave/Makefile
1170 plugins/visualization/chart/Makefile
1171 plugins/videoscale/Makefile
1172 plugins/xvideosink/Makefile
1173 plugins/wav/Makefile
1174 plugins/dvdsrc/Makefile
1175 plugins/vcdsrc/Makefile
1176 plugins/rtjpeg/Makefile
1177 plugins/vorbis/Makefile
1178 plugins/capture/Makefile
1179 plugins/capture/v4l/Makefile
1180 plugins/cdparanoia/Makefile
1181 plugins/esd/Makefile
1182 plugins/esd/esdsink/Makefile
1183 plugins/artsd/Makefile
1184 plugins/quicktime/Makefile
1185 plugins/xmms/Makefile
1186 plugins/arts/Makefile
1187 plugins/gsm/Makefile
1188 plugins/1394/Makefile
1189 plugins/sdlsink/Makefile
1190 plugins/dv/Makefile
1191 gstplay/Makefile
1192 dnl components/bonobo-gstmediaplay/Makefile
1193 test/Makefile
1194 test/xml/Makefile
1195 test/bindings/Makefile
1196 tests/Makefile
1197 tests/sched/Makefile
1198 tests/eos/Makefile
1199 testsuite/Makefile
1200 testsuite/capsnego/Makefile
1201 testsuite/refcounting/Makefile
1202 tests/nego/Makefile
1203 examples/Makefile
1204 examples/autoplug/Makefile
1205 examples/helloworld/Makefile
1206 examples/helloworld2/Makefile
1207 examples/launch/Makefile
1208 examples/queue/Makefile
1209 examples/queue2/Makefile
1210 examples/queue3/Makefile
1211 examples/queue4/Makefile
1212 examples/thread/Makefile
1213 examples/mixer/Makefile
1214 examples/cutter/Makefile
1215 examples/launch/Makefile
1216 examples/xml/Makefile
1217 examples/plugins/Makefile
1218 examples/typefind/Makefile
1219 examples/mixer/Makefile
1220 editor/Makefile
1221 editor/pixmaps/Makefile
1222 tools/Makefile
1223 docs/Makefile
1224 docs/gst/Makefile
1225 docs/gst/gstreamer.types
1226 docs/libs/Makefile
1227 docs/plugins/Makefile
1228 docs/plugins/gstreamer-plugins.types
1229 docs/manual/Makefile
1230 docs/fwg/Makefile
1231 debian/Makefile
1232 stamp.h
1233 gstreamer-config
1234 gstreamer.pc
1235 gstreamer-uninstalled.pc
1236 SUBSTFOR configure.in:gstreamer.spec])
1237 SUBSTFOR configure.in:AC_OUTPUT_COMMANDS([chmod +x gstreamer-config;
1238 SUBSTFOR configure.in:echo "$infomessages"], infomessages="$infomessages")
1239 SUBSTFOR configure.ac:gstreamer.spec,
1240 SUBSTFOR configure.ac:chmod +x gstreamer-config
1241 SUBSTFOR configure.ac:echo "$infomessages", infomessages="$infomessages"
1242 SUBSTFOR configure.ac:)