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