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