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