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