fix mad check, add defaut options properly
[platform/upstream/gstreamer.git] / configure.ac
1 dnl autoconf configuration file for gst-plugins 
2 AC_INIT
3 AC_CANONICAL_TARGET([])
4
5 dnl when going to/from release please set the nano (fourth number) right !
6 AS_VERSION(gst-plugins, GST_PLUGINS, 0, 3, 2, 1)
7
8 dnl FIXME take something else ?
9 AC_CONFIG_SRCDIR([gst/law/alaw.c])
10 AM_CONFIG_HEADER(config.h)
11
12 dnl libtool
13 GST_CURRENT=0
14 GST_REVISION=0
15 GST_AGE=0
16 GST_LIBVERSION=$GST_CURRENT:$GST_REVISION:$GST_AGE
17 AC_SUBST(GST_CURRENT)
18 AC_SUBST(GST_REVISION)
19 AC_SUBST(GST_AGE)
20 AC_SUBST(GST_LIBVERSION)
21
22 dnl Add parameters for aclocal
23 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
24 ACLOCAL="cat m4/*.m4>acinclude.m4;$ACLOCAL $ACLOCAL_FLAGS"
25
26 AM_MAINTAINER_MODE
27
28 AC_PROG_CC
29 AM_PROG_CC_STDC
30 AM_PROG_AS
31 AS="${CC}"
32 AC_PROG_CXX
33 AC_PROG_CXXCPP
34 AC_ISC_POSIX
35
36 dnl We disable static building for development, for time savings
37 dnl *NOTE*: dnl this line before release, so release does static too
38 AM_DISABLE_STATIC
39 AC_LIBTOOL_DLOPEN
40 AM_PROG_LIBTOOL
41
42 AC_HEADER_STDC([])
43
44 dnl ###########################################
45 dnl # Super Duper options for plugin building #
46 dnl ###########################################
47
48 dnl experimental plugins; stuff that hasn't had the dust settle yet
49 dnl read 'builds, but might not work'
50 GST_CHECK_FEATURE(EXPERIMENTAL, [enable building of experimental plugins],,
51 [HAVE_EXPERIMENTAL=yes],disabled,
52 [
53   AC_MSG_WARN(building experimental plugins)
54   USE_SMOOTHWAVE="yes"
55   USE_TARKIN="yes"
56   USE_RTP="yes"
57 ],[
58   AC_MSG_NOTICE(not building experimental plugins)
59   USE_SMOOTHWAVE="no"
60   USE_TARKIN="no"
61   USE_RTP="no"
62 ])
63
64 dnl broken plugins; stuff that doesn't seem to build at the moment
65 GST_CHECK_FEATURE(BROKEN, [enable building of broken plugins],,
66 HAVE_BROKEN=yes,disabled,
67 [  
68   AC_MSG_WARN(building broken plugins)
69   USE_VGA="yes"
70   USE_XMMS="yes"
71   dnl AC_MSG_NOTICE(actually there are no broken plugins at the moment)
72 ],[
73   USE_VGA="no"
74   USE_XMMS="no"
75   AC_MSG_NOTICE(not building broken plugins)
76 ])
77
78 dnl ##############################
79 dnl # Do automated configuration #
80 dnl ##############################
81
82 dnl Check for tools:
83 dnl ================
84
85 dnl modify pkg-config path
86 AC_ARG_WITH(pkg-config-path, 
87    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
88    [export PKG_CONFIG_PATH=${withval}])
89
90 dnl Check for nasm
91 AC_PATH_PROG(NASM_PATH, nasm, no)
92 AC_SUBST(NASM_PATH)
93 if test x$NASM_PATH = xno; then
94   AC_MSG_WARN(Couldn't find nasm)
95   HAVE_NASM="no"
96 else
97   AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
98   HAVE_NASM="yes"
99 fi
100
101 dnl check for gstreamer; uninstalled is selected preferentially -- see pkg-config(1)
102 PKG_CHECK_MODULES(GST, gstreamer >= 0.3.1, HAVE_GST="yes", HAVE_GST="no")
103
104 if test "x$HAVE_GST" = "xno"; then
105   AC_MSG_ERROR(no GStreamer found)
106 fi
107
108 dnl Set up conditionals for (target) architecture:
109 dnl ==============================================
110
111 dnl Determine CPU
112 case "x${target_cpu}" in
113   xi?86 | k?) HAVE_CPU_I386=yes
114               AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
115               dnl FIXME could use some better detection
116               dnl       (ie CPUID)
117               case "x${target_cpu}" in
118                 xi386 | xi486) ;;
119                 *)             AC_DEFINE(HAVE_RDTSC) ;;
120               esac ;;
121   xpowerpc)   HAVE_CPU_PPC=yes
122               AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
123   xalpha)     HAVE_CPU_ALPHA=yes
124               AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
125   xarm*)      HAVE_CPU_ARM=yes
126               AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
127   xsparc*)    HAVE_CPU_SPARC=yes
128               AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
129   xmips*)     HAVE_CPU_MIPS=yes
130               AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;;
131   xhppa*)     HAVE_CPU_HPPA=yes
132               AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;;
133 esac
134
135 dnl Determine endianness
136 AC_C_BIGENDIAN
137
138 dnl Check for essential libraries first:
139 dnl ====================================
140
141 PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK=yes, HAVE_GTK=no)
142 GTK_CFLAGS=$GTK2_CFLAGS
143 GTK_LIBS=$GTK2_LIBS
144 AC_SUBST(GTK_LIBS)
145 AC_SUBST(GTK_CFLAGS)
146
147 dnl Check for X11 extensions
148 AC_PATH_XTRA
149 if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
150   AC_MSG_NOTICE([cannot find X11, the build system needs fixage])
151 fi
152 AC_SUBST(X_CFLAGS)
153 AC_SUBST(X_PRE_LIBS)
154 AC_SUBST(X_EXTRA_LIBS)
155 AC_SUBST(X_LIBS)
156
157 dnl ==========================================================================
158 dnl ============================= gst plugins ================================
159 dnl ==========================================================================
160 GST_PLUGIN_LDFLAGS='-module -avoid-version'
161 AC_SUBST(GST_PLUGIN_LDFLAGS)
162
163 GST_PLUGINS_ALL="\
164         ac3parse adder audioscale auparse avi chart\
165         cutter deinterlace flx goom intfloat law level\
166         median mpeg1enc mpeg1sys mpeg1videoparse mpeg2enc mpeg2sub\
167         mpegaudio mpegaudioparse mpegstream mpegtypes\
168         passthrough playondemand rtjpeg silence sine\
169         smooth spectrum speed stereo stereomono\
170         synaesthesia udp videoscale volenv volume vumeter wavparse y4m"
171
172 AC_SUBST(GST_PLUGINS_ALL)
173
174 GST_PLUGINS_SELECTED=""
175
176 AC_ARG_WITH(plugins,
177     AC_HELP_STRING([--with-plugins],[comma-separated list of plugins to compile]),
178     [for i in `echo $withval | tr , ' '`; do
179         if test -n `echo $i | grep $GST_PLUGINS_ALL`; then
180             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
181         else
182             echo "plugin $i not recognized, ignoring..."
183         fi
184     done],
185     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
186
187 AC_SUBST(GST_PLUGINS_SELECTED)
188
189 dnl ==========================================================================
190 dnl ============================= sys plugins ================================
191 dnl ==========================================================================
192
193
194 dnl *** OSS audio ***
195 translit(dnm, m, l) AM_CONDITIONAL(USE_OSS, true)
196 GST_CHECK_FEATURE(OSS, [OSS audio], osssrc osssink, [
197   AC_CHECK_HEADER(sys/soundcard.h, HAVE_OSS="yes", HAVE_OSS="no")
198 ])
199
200 dnl *** QuickCam ***
201 translit(dnm, m, l) AM_CONDITIONAL(USE_QCAM, true)
202 GST_CHECK_FEATURE(QCAM, [QuickCam], qcamsrc, [
203 dnl this one is for hadess, no qcam when no nasm found
204   if test "x$HAVE_NASM" = "xno";
205   then
206     HAVE_QCAM="no"
207     AC_MSG_WARN([QuickCam needs nasm])
208   else
209     HAVE_QCAM="yes"
210   fi
211 ])
212
213 dnl *** Video 4 Linux ***
214 translit(dnm, m, l) AM_CONDITIONAL(USE_V4L, true)
215 GST_CHECK_FEATURE(V4L, [Video 4 Linux], v4lsrc v4lmjpegsrc v4lmjpegsink, [
216   AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_V4L="yes", HAVE_V4L="no", [#include <linux/videodev.h>])
217 ])
218
219 dnl *** Video CD ***
220 translit(dnm, m, l) AM_CONDITIONAL(USE_VCD, true)
221 GST_CHECK_FEATURE(VCD, [Video CD], vcdsrc, [
222   AC_CHECK_HEADER(linux/cdrom.h, HAVE_VCD="yes", HAVE_VCD="no")
223 ])
224
225 dnl *** VGA ***
226 translit(dnm, m, l) AM_CONDITIONAL(USE_VGA, true)
227 GST_CHECK_FEATURE(VGA, [VGA], vgavideosink, [
228   AC_CHECK_HEADER(asm/vga.h, HAVE_VGA="yes", HAVE_VGA="no")
229 ])
230
231 dnl *** XVideo ***
232 dnl Look for the PIC library first, Debian requires it.
233 dnl Check debian-devel archives for gory details.
234 dnl 20020110:
235 dnl At the moment XFree86 doesn't distribute shared libXv due
236 dnl to unstable API.  On many platforms you CAN NOT link a shared
237 dnl lib to a static non-PIC lib.  This is what the xvideo GStreamer
238 dnl plugin wants to do.  So Debian distributes a PIC compiled
239 dnl version of the static lib for plugins to link to when it is
240 dnl inappropriate to link the main application to libXv directly.
241 dnl FIXME: add check if this platform can support linking to a
242 dnl        non-PIC libXv, if not then don not use Xv.
243 dnl FIXME: perhaps warn user if they have a shared libXv since
244 dnl        this is an error until XFree86 starts shipping one
245 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
246 GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions], xvideosink, [
247   dnl check for PIC static lib
248   GST_CHECK_LIBHEADER(XVIDEO, Xv_pic, XvQueryExtension, $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS, X11/extensions/Xvlib.h, XVIDEO_LIBS="-lXv_pic -lXext")
249   if test x$HAVE_XVIDEO = xno; then
250     dnl PIC lib not found, check for regular lib
251     GST_CHECK_LIBHEADER(XVIDEO, Xv, XvQueryExtension, $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS, X11/extensions/Xvlib.h, XVIDEO_LIBS="-lXv -lXext")
252   fi
253   AC_SUBST(XVIDEO_LIBS)
254 ])
255
256 dnl Next, check for the optional libraries:
257 dnl These are all libraries used in building plugins
258 dnl ================================================
259 dnl let's try and sort them alphabetically, shall we ?
260
261 echo
262 echo
263 AC_MSG_NOTICE(Checking for plugin libraries)
264
265 dnl *** a52dec ***
266 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
267 GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
268   GST_CHECK_LIBHEADER(A52DEC, a52, a52_init, -lm, a52dec/a52.h, A52DEC_LIBS="-la52")
269 ])
270
271 dnl *** aalib ***
272 translit(dnm, m, l) AM_CONDITIONAL(USE_AALIB, true)
273 GST_CHECK_FEATURE(AALIB, [aasink plugin], aasink, [
274   AM_PATH_AALIB(, HAVE_AALIB=yes, HAVE_AALIB=no)
275 ])
276
277 dnl *** alsa ***
278 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
279 GST_CHECK_FEATURE(ALSA, [alsa plugins], gstalsa, [
280   AM_PATH_ALSA(0.9.0, HAVE_ALSA=yes, HAVE_ALSA=no)
281 ])
282
283 dnl *** arts ***
284
285 dnl if mcopidl can't be found there's no use in compiling it
286 AC_CHECK_PROG(MCOPIDL, mcopidl, yes, no)
287 if test "xHAVE_MCOPIDL" = "xno";
288 then
289   USE_ARTS=no
290 fi
291
292 translit(dnm, m, l) AM_CONDITIONAL(USE_ARTS, true)
293 GST_CHECK_FEATURE(ARTS, [arts plugins], arts, [
294   AM_PATH_ARTS(, HAVE_ARTS=yes, HAVE_ARTS=no)
295 ])
296 dnl if mcopidl can't be found there's no use in compiling it
297 AC_PATH_PROG(MCOPIDL, mcopidl, yes, no)
298 if test "xHAVE_MCOPIDL" = "xno";
299 then
300   USE_ARTS=NO
301 fi
302
303 dnl *** artsc ***
304 translit(dnm, m, l) AM_CONDITIONAL(USE_ARTSC, true)
305 GST_CHECK_FEATURE(ARTSC, [artsd plugins], artsdsink, [
306   GST_CHECK_ARTSC()
307 ])
308
309 dnl *** audiofile ***
310 dnl this check uses the GST_CHECK_CONFIGPROG macro
311 translit(dnm, m, l) AM_CONDITIONAL(USE_AUDIOFILE, true)
312 GST_CHECK_FEATURE(AUDIOFILE, [audiofile], afsink afsrc, [
313   translit(dnm, m, l) AC_SUBST(AUDIOFILE_LIBS)
314   translit(dnm, m, l) AC_SUBST(AUDIOFILE_CFLAGS)
315   GST_CHECK_CONFIGPROG(AUDIOFILE, audiofile-config)
316 ])
317
318 dnl *** avifile ***
319 dnl this check uses the GST_CHECK_CONFIGPROG macro
320 dnl this check needs more fixing
321 dnl translit(dnm, m, l) AC_SUBST(AVIFILE_LIBS)
322 translit(dnm, m, l) AM_CONDITIONAL(USE_AVIFILE, true)
323 GST_CHECK_FEATURE(AVIFILE, [avifile], windec winenc, [
324   translit(dnm, m, l) AC_SUBST(AVIFILE_CFLAGS)
325   GST_CHECK_CONFIGPROG(AVIFILE, avifile-config)
326   AVIFILE_LIBS="$AVIFILE_LIBS -lstdc++"
327   AC_SUBST(AVIFILE_LIBS)
328 ])
329
330 dnl *** CDParanoia ***
331 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
332 GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
333   GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface, cdda_open, -lm, cdda_interface.h, CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia")
334   AC_SUBST(CDPARANOIA_LIBS)
335 ])
336 dnl FIXME : add second check somehow if that is necessary
337 dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
338 dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
339
340 dnl *** dv ***
341 translit(dnm, m, l) AM_CONDITIONAL(USE_DV, true)
342 GST_CHECK_FEATURE(DV, [dv library], dv, [
343   GST_CHECK_LIBHEADER(DV, dv, dv_init, -lm $GST_CFLAGS $GST_LIBS, libdv/dv.h, DV_LIBS="-ldv")
344   AC_SUBST(DV_LIBS)
345 ])
346
347 dnl *** dvdread ***
348 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
349 GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdsrc, [
350   GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
351   AC_SUBST(DVDREAD_LIBS)
352 ])
353
354 dnl **** ESound ****
355 translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
356 GST_CHECK_FEATURE(ESD, [esound plugins], esdsrc esdsink, [
357   AM_PATH_ESD(0.2.12, HAVE_ESD=yes, HAVE_ESD=no)
358 ])
359
360 dnl **** festival ****
361 translit(dnm, m, l) AM_CONDITIONAL(USE_FESTIVAL, true)
362 GST_CHECK_FEATURE(FESTIVAL, [festival plugins], festivalsrc, [
363   dnl NOTE: just using local net connection now, add this lib check
364   dnl       in the future if needed
365   dnl AC_LANG_PUSH(C++)
366   dnl dnl FIXME: took out func to check for
367   dnl dnl This check puts festival_tidy_up in extern "C".
368   dnl dnl But, at least on Debian as of 20020110, it is compiled with name
369   dnl dnl mangling C++ nonsense and symbols can't resolve
370   dnl dnl GST_CHECK_LIBHEADER(FESTIVAL, Festival, festival_tidy_up, , festival/festival.h, FESTIVAL_LIBS="-lFestival")
371   dnl GST_CHECK_LIBHEADER(FESTIVAL, Festival, , , festival/festival.h, FESTIVAL_LIBS="-lFestival")
372   dnl AC_LANG_POP(C++)
373   dnl AC_SUBST(FESTIVAL_LIBS)
374   HAVE_FESTIVAL=yes
375 ])
376
377 dnl *** FLAC ***
378 translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
379 GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flacenc flacdec, [
380   GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__stream_decoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC")
381   AC_SUBST(FLAC_LIBS)
382 ])
383
384 dnl *** Gnome VFS ***
385 translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
386 GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
387   PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0, HAVE_GNOME_VFS="yes", HAVE_GNOME_VFS="no")
388   AC_SUBST(GNOME_VFS_CFLAGS)
389   AC_SUBST(GNOME_VFS_LIBS)
390 ])
391
392 dnl *** gsm ***
393 translit(dnm, m, l) AM_CONDITIONAL(USE_GSM, true)
394 GST_CHECK_FEATURE(GSM, [GSM library], gsmenc gsmdec, [
395   GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm.h, GSM_LIBS="-lgsm")
396   if test $HAVE_GSM != "yes"; then
397     GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm/gsm.h, GSM_LIBS="-lgsm")
398     if test $HAVE_GSM = "yes"; then 
399       AC_DEFINE(GSM_HEADER_IN_SUBDIR)
400     fi
401   fi
402   AC_SUBST(GSM_LIBS)
403 ])
404
405 dnl *** Hermes ***
406 translit(dnm, m, l) AM_CONDITIONAL(USE_HERMES, true)
407 GST_CHECK_FEATURE(HERMES, [Hermes library], colorspace, [
408   GST_CHECK_LIBHEADER(HERMES, Hermes, Hermes_ConverterInstance, , Hermes/Hermes.h, HERMES_LIBS="-lHermes")
409 ], AC_SUBST(HERMES_LIBS))
410
411 dnl *** http ***
412 translit(dnm, m, l) AM_CONDITIONAL(USE_HTTP, true)
413 GST_CHECK_FEATURE(HTTP, [http plugins], gsthttpsrc, [
414   dnl FIXME: need to check for header
415   GHTTP_LIBS=
416   GST_HTTPSRC_GET_TYPE=
417   if test x$USE_GLIB2 = xyes; then
418     AC_MSG_WARN(ghttp disabled for glib2.0)
419   else
420     AC_CHECK_LIB(ghttp, ghttp_request_new,
421       [HTTP_LIBS="-lghttp"
422        GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
423        HAVE_HTTP=yes
424       ], :, $LIBS)
425   fi
426   AC_SUBST(HTTP_LIBS)
427   AC_SUBST(GST_HTTPSRC_GET_TYPE)
428 ])
429
430 dnl *** lame ***
431 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
432 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
433 GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h, HAVE_LAME="yes" LAME_LIBS="-lmp3lame")
434 ])
435 AC_SUBST(LAME_LIBS)
436
437
438 dnl FIXME : check if these CPP flags can be dealt with otherwise
439 dnl libdvcheck_save_CPPFLAGS="$CPPFLAGS"
440 dnl CPPFLAGS="$CPPFLAGS $GST_CFLAGS"
441 dnl AC_CHECK_HEADER(libdv/dv.h, :, HAVE_LIBDV=no)
442 dnl CPPFLAGS="$libdvcheck_save_CPPFLAGS"
443
444 dnl *** jpeg ***
445 dnl FIXME: we could use header checks here as well IMO
446 translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
447 GST_CHECK_FEATURE(JPEG, [jpeg], jpegenc jpegdec, [
448   AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
449   JPEG_LIBS="-ljpeg"
450   AC_SUBST(JPEG_LIBS)
451 ])
452
453 dnl *** mad ***
454 dnl FIXME: we could use header checks here as well IMO
455 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
456 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
457   AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad")
458   if test "x$HAVE_MAD" = "xyes"; then
459     # installed with mad >= 0.14
460     HAVE_MAD="no"
461     save_libs=$LIBS
462     LIBS="-lz"
463     AC_CHECK_LIB(id3tag, id3_tag_query, HAVE_MAD="yes" MAD_LIBS="$MAD_LIBS -lid3tag")
464     LIBS=$save_libs
465   fi    
466 ])
467 AC_SUBST(MAD_LIBS)
468
469 dnl *** mikmod ***
470 translit(dnm, m, l) AM_CONDITIONAL(USE_MIKMOD, true)
471 GST_CHECK_FEATURE(MIKMOD, [mikmod plugin], mikmod, [
472   AM_PATH_LIBMIKMOD(, HAVE_MIKMOD=yes, HAVE_MIKMOD=no)
473   AC_SUBST(MIKMOD_LIBS, "$LIBMIKMOD_LIBS")
474   AC_SUBST(MIKMOD_CFLAGS, "$LIBMIKMODCFLAGS")
475 ])
476
477 dnl *** mjpegtools ***
478 translit(dnm, m, l) AM_CONDITIONAL(USE_MJPEGTOOLS, true)
479 GST_CHECK_FEATURE(MJPEGTOOLS, [mjpegtools], jpegmmxenc jpegmmxdec, [
480   PKG_CHECK_MODULES(MJPEGTOOLS, mjpegtools, HAVE_MJPEGTOOLS="yes", HAVE_MJPEGTOOLS="no")
481   AC_SUBST(MJPEGTOOLS_LIBS)
482   AC_SUBST(MJPEGTOOLS_CFLAGS)
483 ])
484
485 dnl *** mpeg2dec ***
486 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
487 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [ GST_CHECK_MPEG2DEC() ])
488
489 dnl *** openquicktime ***
490 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENQUICKTIME, true)
491 GST_CHECK_FEATURE(OPENQUICKTIME, [Open Quicktime], quicktime_parser quicktime_decoder quicktime_demux,[
492   GST_CHECK_LIBHEADER(OPENQUICKTIME, openquicktime, quicktime_init,, openquicktime/openquicktime.h, OPENQUICKTIME_LIBS="-lopenquicktime")
493   AC_SUBST(OPENQUICKTIME_LIBS)
494 ])
495
496 dnl *** raw1394 ***
497 translit(dnm, m, l) AM_CONDITIONAL(USE_RAW1394, true)
498 GST_CHECK_FEATURE(RAW1394, [raw1394 library], dv1394src, [
499   GST_CHECK_LIBHEADER(RAW1394, raw1394, raw1394_get_handle,, libraw1394/raw1394.h, RAW1394_LIBS="-raw1394")
500   AC_SUBST(RAW1394_LIBS)
501 ])
502
503 dnl *** rtp ***
504 dnl FIXME : adapt and make it work
505 translit(dnm, m, l) AM_CONDITIONAL(USE_RTP, true)
506 GST_CHECK_FEATURE(RTP, [RTP library], rtpenc rtpdec,[
507   AC_CHECK_LIB(rtp, rtp_packet_new_take_data, HAVE_RTP=yes, HAVE_RTP=no, $GST_CFLAGS $GST_LIBS)
508   RTP_LIBS="-lrtp"
509   AC_SUBST(RTP_LIBS)
510 ])
511
512 dnl FIXME header check needs to use GLIB_CFLAGS in order to succeed for rtp
513 dnl can use GST_* which should have GLIB_* info
514 dnl AC_CHECK_HEADERS(rtp/rtp.h, HAVE_LIBRTP=yes, HAVE_LIBRTP=no)
515 dnl AC_CHECK_HEADERS(rtp/rtp-packet.h, :, HAVE_LIBRTP=no)
516 dnl AC_CHECK_HEADERS(rtp/rtcp-packet.h, :, HAVE_LIBRTP=no)
517 dnl AC_CHECK_HEADERS(rtp/rtp-audio.h, :, HAVE_LIBRTP=no)
518
519 dnl *** SDL ***
520 translit(dnm, m, l) AM_CONDITIONAL(USE_SDL, true)
521 GST_CHECK_FEATURE(SDL, [SDL plugin], sdlvideosink, [
522  AM_PATH_SDL(, HAVE_SDL=yes, HAVE_SDL=no)
523 ])
524
525 dnl *** shout ***
526 translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT, true)
527 GST_CHECK_FEATURE(SHOUT, [shout plugin], icecastsend, [
528   GST_CHECK_LIBHEADER(SHOUT, shout, shout_init_connection,, shout/shout.h, SHOUT_LIBS="-lshout")
529   AC_SUBST(SHOUT_LIBS)
530 ])
531
532 dnl *** sidplay ***
533 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
534 GST_CHECK_FEATURE(SIDPLAY, [sidplay plugin], sidplay, [
535   GST_PATH_SIDPLAY()
536 ])
537
538 dnl *** smoothwave ***
539 translit(dnm, m, l) AM_CONDITIONAL(USE_SMOOTHWAVE, true)
540 GST_CHECK_FEATURE(SMOOTHWAVE, [smoothwave plugin], smoothwave, [
541   if test $HAVE_GTK = "yes"; then HAVE_SMOOTHWAVE=yes; fi;
542 ])
543
544 dnl *** tarkin ***
545 dnl for now the sources are included in the plugin
546 dnl and should be moved to ext-libs/ perhaps
547 translit(dnm, m, l) AM_CONDITIONAL(USE_TARKIN, true)
548 GST_CHECK_FEATURE(TARKIN, [tarkinenc tarkindec], tarkin, [
549   HAVE_TARKIN="yes"
550 ])
551
552 dnl *** vorbis ***
553 dnl AM_PATH_VORBIS only takes two options
554 translit(dnm, m, l) AM_CONDITIONAL(USE_VORBIS, true)
555 GST_CHECK_FEATURE(VORBIS, [vorbis plugin], vorbisenc vorbisdec, [
556   AM_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
557 ])
558
559 dnl *** XMMS ***
560 translit(dnm, m, l) AM_CONDITIONAL(USE_XMMS, true)
561 GST_CHECK_FEATURE(XMMS, [xmms plugin], xmms, [
562   AM_PATH_XMMS(0.1.0, HAVE_XMMS=yes, HAVE_XMMS=no)
563 ])
564
565 dnl Check for atomic.h
566 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
567 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
568 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
569 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
570 if test x$HAVE_ATOMIC_H = xyes; then
571   AC_TRY_RUN([
572 #include "asm/atomic.h"
573 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
574   ],, [
575     # Not successful
576     if test x$HAVE_ATOMIC_H = xyes; then
577       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
578     fi
579     HAVE_ATOMIC_H=no
580   ], [
581     # Cross compiling
582     AC_MSG_RESULT(yes)
583     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
584   ])
585 fi
586
587 dnl ######################################################################
588 dnl # Check command line parameters, and set shell variables accordingly #
589 dnl ######################################################################
590
591 AC_ARG_ENABLE(libmmx,
592 [  --enable-libmmx              use libmmx, if available],
593 [case "${enableval}" in
594   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
595   no)  USE_LIBMMX=no ;;
596   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
597 esac], 
598 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
599
600 AC_ARG_ENABLE(atomic,
601 [  --enable-atomic              use atomic reference counting header],
602 [case "${enableval}" in
603   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
604   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
605   no)  USE_ATOMIC_H=no;;
606   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
607 esac], 
608 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
609
610 AC_ARG_ENABLE(profiling,
611 [  --enable-profiling           adds -pg to compiler commandline, for profiling],
612 [case "${enableval}" in
613   yes) USE_PROFILING=yes ;;
614   no)  UES_PROFILING=no ;;
615   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
616 esac], 
617 [USE_PROFILING=no]) dnl Default value
618
619 AC_ARG_ENABLE(tests,
620 [  --disable-tests              disable building test apps],
621 [case "${enableval}" in
622   yes) BUILD_TESTS=yes ;;
623   no)  BUILD_TESTS=no ;;
624   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
625 esac], 
626 [BUILD_TESTS=yes]) dnl Default value
627
628 AC_ARG_ENABLE(examples,
629 [  --disable-examples           disable building examples],
630 [case "${enableval}" in
631   yes) BUILD_EXAMPLES=yes ;;
632   no)  BUILD_EXAMPLES=no ;;
633   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
634 esac], 
635 [BUILD_EXAMPLES=yes]) dnl Default value
636
637 dnl ################################################
638 dnl # Set defines according to variables set above #
639 dnl ################################################
640
641
642 if test "x$USE_LIBMMX" = xyes; then
643   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
644 fi
645
646 if test "x$USE_ATOMIC_H" = xyes; then
647   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
648 fi
649
650 dnl if test "x$USE_DEBUG" = xyes; then
651 dnl   CFLAGS="$CFLAGS -g"
652 dnl fi
653
654 if test "x$USE_PROFILING" = xyes; then
655 dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
656   FOMIT_FRAME_POINTER=""
657 else
658   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
659 fi
660
661 dnl
662 dnl AC_SUBST(FOMIT_FRAME_POINTER)
663 dnl
664
665 dnl #############################
666 dnl # Set automake conditionals #
667 dnl #############################
668
669 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
670 dnl HAVE_ and it is likely to be easier to stick with the old name
671 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
672 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
673 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
674 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
675 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
676 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
677
678 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
679
680 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
681 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
682
683 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
684 AM_CONDITIONAL(HAVE_LIBGLADE_GNOME, test "x$HAVE_LIBGLADE_GNOME" = "xyes")
685 AM_CONDITIONAL(HAVE_GNOME,          test "x$HAVE_GNOME" = "xyes")
686 AM_CONDITIONAL(HAVE_GTK,            test "x$HAVE_GTK" = "xyes")
687 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
688 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
689 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
690 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
691 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
692 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
693 AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
694 AM_CONDITIONAL(HAVE_RAW1394,        test "x$HAVE_RAW1394" = "xyes")
695 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
696
697 GST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir)/gst-libs -Wall"
698 AC_SUBST(GST_LIBS)
699 AC_SUBST(GST_CFLAGS)
700
701 dnl #########################
702 dnl # Make the output files #
703 dnl #########################
704
705 AC_CONFIG_FILES(
706 Makefile
707 gstreamer-libs.pc
708 gstreamer-libs-uninstalled.pc
709 gst-plugins.spec
710 gst/Makefile
711 gst/ac3parse/Makefile
712 gst/adder/Makefile
713 gst/audioscale/Makefile
714 gst/auparse/Makefile
715 gst/avi/Makefile
716 gst/chart/Makefile
717 gst/cutter/Makefile
718 gst/deinterlace/Makefile
719 gst/flx/Makefile
720 gst/goom/Makefile
721 gst/intfloat/Makefile
722 gst/law/Makefile
723 gst/level/Makefile
724 gst/median/Makefile
725 gst/mpeg1enc/Makefile
726 gst/mpeg1sys/Makefile
727 gst/mpeg1videoparse/Makefile
728 gst/mpeg2enc/Makefile
729 gst/mpeg2sub/Makefile
730 gst/mpegaudio/Makefile
731 gst/mpegaudioparse/Makefile
732 gst/mpegstream/Makefile
733 gst/mpegtypes/Makefile
734 gst/passthrough/Makefile
735 gst/playondemand/Makefile
736 gst/rtjpeg/Makefile
737 gst/silence/Makefile
738 gst/sine/Makefile
739 gst/smooth/Makefile
740 gst/spectrum/Makefile
741 gst/speed/Makefile
742 gst/stereo/Makefile
743 gst/stereomono/Makefile
744 gst/synaesthesia/Makefile
745 gst/udp/Makefile
746 gst/videoscale/Makefile
747 gst/volenv/Makefile
748 gst/volume/Makefile
749 gst/vumeter/Makefile
750 gst/wavparse/Makefile
751 gst/y4m/Makefile
752 sys/Makefile
753 sys/oss/Makefile
754 sys/qcam/Makefile
755 sys/v4l/Makefile
756 sys/vcd/Makefile
757 sys/vga/Makefile
758 sys/xvideo/Makefile
759 ext/Makefile
760 ext/a52dec/Makefile
761 ext/aalib/Makefile
762 ext/alsa/Makefile
763 ext/arts/Makefile
764 ext/artsd/Makefile
765 ext/audiofile/Makefile
766 ext/avifile/Makefile
767 ext/cdparanoia/Makefile
768 ext/dv/Makefile
769 ext/dvdread/Makefile
770 ext/esd/Makefile
771 ext/festival/Makefile
772 ext/flac/Makefile
773 ext/gnomevfs/Makefile
774 ext/gsm/Makefile
775 ext/hermes/Makefile
776 ext/http/Makefile
777 ext/jpeg/Makefile
778 ext/ladspa/Makefile
779 ext/lame/Makefile
780 ext/mad/Makefile
781 ext/mikmod/Makefile
782 ext/mjpegtools/Makefile
783 ext/mpeg2dec/Makefile
784 ext/openquicktime/Makefile
785 ext/raw1394/Makefile
786 ext/rtp/Makefile
787 ext/sdl/Makefile
788 ext/shout/Makefile
789 ext/sidplay/Makefile
790 ext/smoothwave/Makefile
791 ext/vorbis/Makefile
792 ext/tarkin/Makefile
793 ext/xmms/Makefile
794 gst-libs/Makefile
795 gst-libs/gst/Makefile
796 gst-libs/gst/audio/Makefile
797 gst-libs/gst/idct/Makefile
798 gst-libs/gst/resample/Makefile
799 gst-libs/gst/riff/Makefile
800 examples/capsfilter/Makefile
801 examples/Makefile
802 tools/Makefile
803 )
804
805 AC_OUTPUT
806
807 echo -e "configure: *** Plugins that will be built : $GST_PLUGINS_YES"
808 echo
809 echo -e "configure: *** Plugins that will not be built : $GST_PLUGINS_NO"
810 echo