bump to 0.7.1
[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 AM_MAINTAINER_MODE only provides the option to configure to enable it
11 AM_MAINTAINER_MODE
12
13 dnl when going to/from release please set the nano (fourth number) right !
14 dnl releases only do Wall, cvs and prerelease does Werror too
15 AS_VERSION(gst-plugins, GST_PLUGINS_VERSION, 0, 7, 1, 0, GST_CVS="no", GST_CVS="yes")
16
17 dnl add a suffix to apps
18 if test x$program_suffix = xNONE ; then
19   program_suffix=-$GST_PLUGINS_VERSION_MAJOR.$GST_PLUGINS_VERSION_MINOR
20 fi
21
22 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
23
24 dnl our libraries and install dirs use major.minor as a version
25 GST_MAJORMINOR=$GST_PLUGINS_VERSION_MAJOR.$GST_PLUGINS_VERSION_MINOR
26 AC_SUBST(GST_MAJORMINOR)
27
28 dnl CURRENT, REVISION, AGE
29 dnl - library source changed -> increment REVISION
30 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
31 dnl - interfaces added -> increment AGE
32 dnl - interfaces removed -> AGE = 0
33 AS_LIBTOOL(GST_PLUGINS, 1, 0, 0)
34
35 dnl FIXME take something else ?
36 AC_CONFIG_SRCDIR([gst/law/alaw.c])
37 AM_CONFIG_HEADER(config.h)
38
39 dnl Add parameters for aclocal
40 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
41 ACLOCAL_FLAGS="-I m4 -I common/m4"
42 AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)
43
44 AC_PROG_CC
45 AM_PROG_CC_STDC
46 AM_PROG_AS
47 AS="${CC}"
48
49 dnl decide on error flags
50 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
51
52 if test "x$GST_WALL" = "xyes"; then
53    GST_ERROR="$GST_ERROR -Wall"
54
55    if test "x$GST_CVS" = "xyes"; then
56      AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
57    fi
58 fi
59
60 dnl determine c++ compiler
61 AC_PROG_CXX
62 dnl determine if c++ is available on this system
63 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
64 dnl determine c++ preprocessor
65 AC_PROG_CXXCPP
66 AC_ISC_POSIX
67
68 AC_HEADER_STDC([])
69
70 dnl ############################################
71 dnl # Super Duper options for plug-in building #
72 dnl ############################################
73
74 dnl ext plug-ins; plug-ins that have external dependencies
75 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
76 [HAVE_EXTERNAL=yes],enabled,
77 [
78   AC_MSG_WARN(building external plug-ins)
79   BUILD_EXTERNAL="yes"
80 ],[
81   AC_MSG_WARN(all plug-ins with external dependencies will not be built)
82   BUILD_EXTERNAL="no"
83 ])
84 # make BUILD_EXTERNAL available to Makefile.am
85 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
86
87 dnl experimental plug-ins; stuff that hasn't had the dust settle yet
88 dnl read 'builds, but might not work'UTO
89 GST_CHECK_FEATURE(EXPERIMENTAL, [enable building of experimental plug-ins],,
90 [HAVE_EXPERIMENTAL=yes],disabled,
91 [
92   AC_MSG_WARN(building experimental plug-ins)
93   USE_TARKIN="yes"
94   USE_SHOUT2="yes"
95 ],[
96   AC_MSG_NOTICE(not building experimental plug-ins)
97   USE_TARKIN="no"
98   USE_SHOUT2="no"
99 ])
100
101 dnl broken plug-ins; stuff that doesn't seem to build at the moment
102 GST_CHECK_FEATURE(BROKEN, [enable building of broken plug-ins],,
103 HAVE_BROKEN=yes,disabled,
104 [  
105   AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches :)])
106 ],[
107   AC_MSG_NOTICE([not building broken plug-ins])
108 ])
109
110 dnl ##############################
111 dnl # Do automated configuration #
112 dnl ##############################
113
114 dnl Check for tools:
115 dnl ================
116
117 dnl allow for different autotools
118 AS_AUTOTOOLS_ALTERNATE()
119
120 dnl modify pkg-config path
121 AC_ARG_WITH(pkg-config-path, 
122    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
123    [export PKG_CONFIG_PATH=${withval}])
124
125 dnl Check for nasm
126 AC_PATH_PROG(NASM_PATH, nasm, no)
127 AC_SUBST(NASM_PATH)
128 if test x$NASM_PATH = xno; then
129   AC_MSG_WARN(Couldn't find nasm)
130   HAVE_NASM="no"
131 else
132   AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
133   HAVE_NASM="yes"
134 fi
135
136 dnl check for gconftool-2
137 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONFTOOL, true)
138 GST_CHECK_FEATURE(GCONFTOOL, [GConf schemas], , [
139   AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
140   if test x$GCONFTOOL = xno; then
141     AC_MSG_WARN(Not installing GConf schemas)
142     HAVE_GCONFTOOL="no"
143   else
144     AM_GCONF_SOURCE_2
145     HAVE_GCONFTOOL="yes"
146   fi
147   AC_SUBST(HAVE_GCONFTOOL)
148 ])
149
150 dnl check for GConf libraries
151 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONF, true)
152 GST_CHECK_FEATURE(GCONF, [GConf libraries], , [
153   PKG_CHECK_MODULES(GCONF, gconf-2.0, HAVE_GCONF="yes", HAVE_GCONF="no")
154   AC_SUBST(GCONF_CFLAGS)
155   AC_SUBST(GCONF_LIBS)
156 ])
157
158 dnl check for gstreamer; uninstalled is selected preferentially -- see pkg-config(1)
159 PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_PLUGINS_VERSION_MAJOR.$GST_PLUGINS_VERSION_MINOR.$GST_PLUGINS_VERSION_MICRO,
160   HAVE_GST="yes", HAVE_GST="no")
161
162 if test "x$HAVE_GST" = "xno"; then
163   AC_MSG_ERROR(no GStreamer found)
164 fi
165
166 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR`
167 if test -z $GST_TOOLS_DIR; then
168   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
169 fi
170 AC_SUBST(GST_TOOLS_DIR)
171
172 dnl check for gstreamer-control; uninstalled is selected preferentially
173 PKG_CHECK_MODULES(GST_CONTROL, gstreamer-control-$GST_MAJORMINOR >= $GST_PLUGINS_VERSION_MAJOR.$GST_PLUGINS_VERSION_MINOR.$GST_PLUGINS_VERSION_MICRO,
174   HAVE_GST_CONTROL="yes", HAVE_GST_CONTROL="no")
175
176 if test "x$HAVE_GST_CONTROL" = "xno"; then
177   AC_MSG_ERROR(no GStreamer Control Libs found)
178 fi
179
180 AC_SUBST(GST_CONTROL_LIBS)
181
182
183 dnl Set up conditionals for (target) architecture:
184 dnl ==============================================
185
186 dnl Determine CPU
187 case "x${target_cpu}" in
188   xi?86 | k?) HAVE_CPU_I386=yes
189               AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
190               dnl FIXME could use some better detection
191               dnl       (ie CPUID)
192               case "x${target_cpu}" in
193                 xi386 | xi486) ;;
194                 *)             AC_DEFINE(HAVE_RDTSC, 1, [Define if RDTSC is available]) ;;
195               esac ;;
196   xpowerpc)   HAVE_CPU_PPC=yes
197               AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
198   xalpha)     HAVE_CPU_ALPHA=yes
199               AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
200   xarm*)      HAVE_CPU_ARM=yes
201               AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
202   xsparc*)    HAVE_CPU_SPARC=yes
203               AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
204   xmips*)     HAVE_CPU_MIPS=yes
205               AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;;
206   xhppa*)     HAVE_CPU_HPPA=yes
207               AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;;
208 esac
209
210 dnl Determine endianness
211 AC_C_BIGENDIAN
212
213 dnl Check for fast float to int casting as defined in C99
214 AC_C99_FUNC_LRINT()
215 AC_C99_FUNC_LRINTF()
216
217 dnl Check for essential libraries first:
218 dnl ====================================
219
220 GST_GLIB2_CHECK()
221
222 dnl GTK
223 HAVE_GTK=NO
224 PKG_CHECK_MODULES(GTK2, gtk+-2.0 >= 2.2.0, HAVE_GTK_22=yes, HAVE_GTK_22=no)
225 if test "x$HAVE_GTK_22" = "xyes"; then
226   HAVE_GTK=yes
227 else
228   PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK_20=yes, HAVE_GTK_20=no)
229 fi
230 if test "x$HAVE_GTK_20" = "xyes"; then
231   HAVE_GTK=yes
232 fi
233 GTK_CFLAGS=$GTK2_CFLAGS
234 GTK_LIBS=$GTK2_LIBS
235 AC_SUBST(GTK_LIBS)
236 AC_SUBST(GTK_CFLAGS)
237 AC_SUBST(HAVE_GTK)
238
239
240 dnl Check for X11 extensions
241 AC_PATH_XTRA
242 if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
243   AC_MSG_NOTICE([cannot find X11, the build system needs fixage])
244 fi
245 AC_SUBST(X_CFLAGS)
246 AC_SUBST(X_PRE_LIBS)
247 AC_SUBST(X_EXTRA_LIBS)
248 AC_SUBST(X_LIBS)
249
250 dnl ===========================================================================
251 dnl ============================= gst plug-ins ================================
252 dnl ===========================================================================
253
254 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
255 AC_SUBST(plugindir)
256
257 GST_PLUGIN_LDFLAGS='-module -avoid-version'
258 AC_SUBST(GST_PLUGIN_LDFLAGS)
259
260 dnl these are all the gst plug-ins, compilable without additional libs
261 GST_PLUGINS_ALL="\
262         ac3parse adder audioscale auparse avi \
263         asfdemux audioconvert cdxaparse chart \
264         cutter debug deinterlace effectv festival \
265         filter flx goom id3 intfloat law level median mixmatrix \
266         mpeg1sys mpeg1videoparse mpeg2enc mpeg2sub \
267         mpegaudio mpegaudioparse mpegstream mpegtypes \
268         monoscope oneton overlay passthrough playondemand qtdemux \
269         realmedia rtp rtjpeg silence sine smooth smpte \
270         spectrum speed stereo synaesthesia tcp udp vbidec \
271         videocrop videodrop videofilter videoflip videoscale \
272         videotestsrc volenv volume wavenc wavparse y4m"
273
274 dnl see if we can build C++ plug-ins
275 if test "x$HAVE_CXX" = "xyes"; then
276   GST_PLUGINS_ALL="$GST_PLUGINS_ALL \
277                   modplug"
278 else
279   AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
280 fi
281
282 AC_SUBST(GST_PLUGINS_ALL)
283
284 GST_PLUGINS_SELECTED=""
285
286 AC_ARG_WITH(plugins,
287     AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
288     [for i in `echo $withval | tr , ' '`; do
289         if test -n `echo $i | grep $GST_PLUGINS_ALL`; then
290             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
291         else
292             echo "plug-in $i not recognized, ignoring..."
293         fi
294     done],
295     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
296
297 AC_SUBST(GST_PLUGINS_SELECTED)
298
299 dnl ==========================================================================
300 dnl ============================= sys plug-ins ================================
301 dnl ==========================================================================
302
303 dnl *** DXR3 card ***
304 translit(dnm, m, l) AM_CONDITIONAL(USE_DXR3, true)
305 GST_CHECK_FEATURE(DXR3, [DXR3 hardware MPEG DVD decoder],
306   dxr3videosink dxr3audiosink dxr3spusink, [
307   HAVE_DXR3=yes
308   AC_CHECK_HEADER(linux/em8300.h, ,
309                   [ AC_MSG_WARN([DXR3/em8300 header file not found]) &&
310                     HAVE_DXR3=no ] )
311   AC_CHECK_HEADER(linux/soundcard.h, ,
312                   [ AC_MSG_WARN([Generic sound header file not found]) &&
313                     HAVE_DXR3=no ] )
314 ])
315
316 dnl *** OSS audio ***
317 translit(dnm, m, l) AM_CONDITIONAL(USE_OSS, true)
318 GST_CHECK_FEATURE(OSS, [OSS audio], osssrc osssink, [
319   AC_CHECK_HEADER(sys/soundcard.h, HAVE_OSS="yes", HAVE_OSS="no")
320 ])
321
322 dnl *** QuickCam ***
323 translit(dnm, m, l) AM_CONDITIONAL(USE_QCAM, true)
324 GST_CHECK_FEATURE(QCAM, [QuickCam], qcamsrc, [
325   if test "x$HAVE_CPU_I386" != "xyes";
326   then
327     HAVE_QCAM="no"
328   else
329     AC_CHECK_HEADER(sys/io.h, HAVE_QCAM="yes", HAVE_QCAM="no")
330   fi
331   if test "x$HAVE_QCAM" != "xyes";
332   then
333     AC_MSG_WARN([QuickCam only works on i386-linux])
334   fi
335 ])
336
337 dnl *** Video 4 Linux ***
338 dnl for information about the header/define, see sys/v4l/gstv4lelement.h
339 translit(dnm, m, l) AM_CONDITIONAL(USE_V4L, true)
340 GST_CHECK_FEATURE(V4L, [Video 4 Linux], v4lsrc v4lmjpegsrc v4lmjpegsink, [
341   AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_V4L="yes", HAVE_V4L="no", [
342 #include <sys/types.h>
343 #define _LINUX_TIME_H
344 #include <linux/videodev.h>
345   ])
346 ])
347
348 dnl *** Video 4 Linux 2***
349 dnl for information about the header/define, see sys/v4l2/gstv4l2element.h
350 translit(dnm, m, l) AM_CONDITIONAL(USE_V4L2, true)
351 GST_CHECK_FEATURE(V4L2, [Video 4 Linux 2], v4l2src, [
352   AC_MSG_CHECKING([Checking for uptodate v4l2 installation])
353   AC_TRY_COMPILE([
354 #include <sys/types.h>
355 #include <linux/types.h>
356 #define _LINUX_TIME_H
357 #include <linux/videodev2.h>
358 #if defined(V4L2_MAJOR_VERSION) || defined(V4L2_MINOR_VERSION)
359 #error too early v4l2 version or no v4l2 at all
360 #endif
361   ], [
362 return 0;
363   ], [ HAVE_V4L2="yes" && AC_MSG_RESULT(yes)],
364      [ HAVE_V4L2="no"  && AC_MSG_RESULT(no) &&
365        AC_CHECK_HEADER(linux/videodev2.h,
366                        [ AC_MSG_WARN([video4linux2 headers were found, but they're old. Please update v4l2 to compile the v4l2 plugins])],
367                        [ AC_MSG_WARN([video4linux2 was not found])])])
368 ])
369
370 dnl *** Video CD ***
371 translit(dnm, m, l) AM_CONDITIONAL(USE_VCD, true)
372 GST_CHECK_FEATURE(VCD, [Video CD], vcdsrc, [
373   AC_CHECK_HEADER(linux/cdrom.h, HAVE_VCD="yes", HAVE_VCD="no")
374 ])
375
376 dnl *** CDROM Audio ***
377 translit(dnm, m, l) AM_CONDITIONAL(USE_CDROM, true)
378 GST_CHECK_FEATURE(CDROM, [CDROM Audio], cdrom, [
379   AC_CHECK_HEADERS(linux/cdrom.h) dnl linux
380   AC_CHECK_HEADERS(sys/cdio.h) dnl almost everything else
381 dnl  AC_CHECK_HEADERS(dmedia/cdaudio.h) dnl irix
382
383   if test "${ac_cv_header_linux_cdrom_h}" = "yes" || test "${ac_cv_header_sys_cdio_h}" = "yes" || test "${ac_cv_header_dmedia_cdaudio_h}" = "yes"; then
384         case "$host" in 
385                 *-sun-* | *-*-linux*)
386                         AC_DEFINE(HAVE_CDROM_SOLARIS,, [Define if cdrom access is in Solaris style])
387                 ;;
388                 *-*-freebsd*)
389                         AC_DEFINE(HAVE_CDROM_BSD,, [Define if cdrom access is in BSD style])
390                 ;;
391                 *-*-netbsd* | *-*-openbsd*)
392                         AC_DEFINE(HAVE_CDROM_BSD,, [Define if cdrom access is in BSD style])
393                         AC_DEFINE(HAVE_CDROM_BSD_NETBSD,, [Define if cdrom access uses NetBSD variant])
394                 ;;
395                 *-*darwin*)
396                         AC_DEFINE(HAVE_CDROM_BSD,, [Define if cdrom access is in BSD style])
397                         AC_DEFINE(HAVE_CDROM_BSD_DARWIN,, [Define if cdrom access uses Darwin variant])
398                 ;;
399 dnl             *-irix-*)
400 dnl                     AC_DEFINE(HAVE_CDROM_IRIX,, [Define if cdrom access is in Irix DMedia style])
401 dnl             ;;
402     esac
403
404         HAVE_CDROM="yes"
405   else
406         HAVE_CDROM="no"
407   fi
408 ])
409
410 dnl *** XVideo ***
411 dnl Look for the PIC library first, Debian requires it.
412 dnl Check debian-devel archives for gory details.
413 dnl 20020110:
414 dnl At the moment XFree86 doesn't distribute shared libXv due
415 dnl to unstable API.  On many platforms you CAN NOT link a shared
416 dnl lib to a static non-PIC lib.  This is what the xvideo GStreamer
417 dnl plug-in wants to do.  So Debian distributes a PIC compiled
418 dnl version of the static lib for plug-ins to link to when it is
419 dnl inappropriate to link the main application to libXv directly.
420 dnl FIXME: add check if this platform can support linking to a
421 dnl        non-PIC libXv, if not then don not use Xv.
422 dnl FIXME: perhaps warn user if they have a shared libXv since
423 dnl        this is an error until XFree86 starts shipping one
424 translit(dnm, m, l) AM_CONDITIONAL(USE_XFREE, true)
425 GST_CHECK_FEATURE(XFREE, [X11 XFree86], xvideosink-X, [
426    if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
427      HAVE_XFREE=no
428    else
429      HAVE_XFREE=yes
430    fi
431 ])
432    
433 dnl Check for Xv extension
434 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
435 GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions], xvideosink-Xv, [
436   if test x$HAVE_XFREE = xyes; then
437     AC_CHECK_LIB(Xv_pic, XvQueryExtension,
438                  HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
439                  $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
440
441     if test x$HAVE_XVIDEO = xyes; then
442       XVIDEO_LIBS="-lXv_pic -lXext"
443       AC_SUBST(XVIDEO_LIBS)
444     else
445       dnl try again using something else if we didn't find it first
446       if test x$HAVE_XVIDEO = xno; then
447         AC_CHECK_LIB(Xv, XvQueryExtension,
448                    HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
449                    $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
450
451         if test x$HAVE_XVIDEO = xyes; then
452           XVIDEO_LIBS="-lXv -lXext"
453           AC_SUBST(XVIDEO_LIBS)
454         fi
455       fi
456     fi
457   fi
458 ])
459
460 dnl Next, check for the optional libraries:
461 dnl These are all libraries used in building plug-ins
462 dnl ================================================
463 dnl let's try and sort them alphabetically, shall we ?
464
465 if test "x$BUILD_EXTERNAL" = "xyes"; then
466
467 AC_MSG_NOTICE(Checking for plug-in dependency libraries)
468
469 dnl *** a52dec ***
470 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
471 GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
472   AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
473 ])
474
475 dnl *** aalib ***
476 translit(dnm, m, l) AM_CONDITIONAL(USE_AALIB, true)
477 GST_CHECK_FEATURE(AALIB, [aasink plug-in], aasink, [
478   AM_PATH_AALIB(, HAVE_AALIB=yes, HAVE_AALIB=no)
479   AS_SCRUB_INCLUDE(AALIB_CFLAGS)
480 ])
481
482 dnl *** alsa ***
483 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
484 GST_CHECK_FEATURE(ALSA, [alsa plug-ins], gstalsa, [
485    AM_PATH_ALSA(0.9.0, HAVE_ALSA=yes, HAVE_ALSA=no)
486 ])
487
488 dnl *** arts ***
489 dnl if mcopidl can't be found there's no use in compiling it
490 AC_CHECK_PROG(MCOPIDL, mcopidl, yes, no)
491 if test "x$HAVE_MCOPIDL" = "xno";
492 then
493   USE_ARTS=no
494 fi
495
496 translit(dnm, m, l) AM_CONDITIONAL(USE_ARTS, true)
497 GST_CHECK_FEATURE(ARTS, [arts plug-ins], arts, [
498   AM_PATH_ARTS(, HAVE_ARTS=yes, HAVE_ARTS=no)
499 ])
500
501 dnl *** artsc ***
502 translit(dnm, m, l) AM_CONDITIONAL(USE_ARTSC, true)
503 GST_CHECK_FEATURE(ARTSC, [artsd plug-ins], artsdsink, [
504   GST_CHECK_ARTSC()
505 ])
506
507 dnl *** audiofile ***
508 dnl this check uses the GST_CHECK_CONFIGPROG macro
509 translit(dnm, m, l) AM_CONDITIONAL(USE_AUDIOFILE, true)
510 GST_CHECK_FEATURE(AUDIOFILE, [audiofile], afsink afsrc, [
511   translit(dnm, m, l) AC_SUBST(AUDIOFILE_LIBS)
512   translit(dnm, m, l) AC_SUBST(AUDIOFILE_CFLAGS)
513   dnl check with pkg-config first
514   PKG_CHECK_MODULES(AUDIOFILE, audiofile, HAVE_AUDIOFILE="yes", HAVE_AUDIOFILE="no")
515   if test "x$HAVE_AUDIOFILE" = "xno"; then
516     GST_CHECK_CONFIGPROG(AUDIOFILE, audiofile-config)
517     dnl we need this function
518     AC_CHECK_LIB(audiofile, afOpenVirtualFile, , HAVE_AUDIOFILE="no")
519   fi])
520
521 dnl *** CDParanoia ***
522 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
523 GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
524   GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface, 
525                       cdda_open, -lm, 
526                       cdda_interface.h, 
527                       CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
528                       HEADER_DIR="no"
529                       FOUND_CDPARANOIA="yes")
530   if test "x$FOUND_CDPARANOIA" != "xyes";
531   then
532     GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface, 
533                         cdda_open, -lm, 
534                         cdda/cdda_interface.h, 
535                         CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia"
536                         HEADER_DIR="yes"
537                         FOUND_CDPARANOIA="yes")
538   fi
539   if test "x$HEADER_DIR" = "xyes";
540   then
541     AC_DEFINE_UNQUOTED(CDPARANOIA_HEADERS_IN_DIR, ,
542                        defined if cdda headers are in a cdda/ directory)
543   fi
544   AC_SUBST(CDPARANOIA_LIBS)
545 ])
546 dnl FIXME : add second check somehow if that is necessary
547 dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
548 dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
549
550 dnl *** DIVX ***
551 translit(dnm, m, l) AM_CONDITIONAL(USE_DIVX, true)
552 GST_CHECK_FEATURE(DIVX, [divx plugins], divx, [
553   HAVE_DIVX=yes
554   AC_CHECK_HEADER(encore2.h, ,
555                   [ AC_MSG_WARN([Divx4linux encore headers not found]) &&
556                     HAVE_DIVX=no ] )
557   if [ test x$HAVE_DIVX = xyes ]; then
558     AC_MSG_CHECKING([Checking for valid divx4linux encore version])
559     AC_TRY_COMPILE([
560 #include <encore2.h>
561 #if ENCORE_VERSION != 20021024
562 #error Wrong version of divx encore libraries
563 #endif
564     ], [
565 return 0;
566     ], [ HAVE_DIVX=yes && AC_MSG_RESULT(yes)],
567        [ HAVE_DIVX=no  && AC_MSG_RESULT(no) &&
568          AC_MSG_WARN([Wrong version of divx4linux installed]) ])
569   fi
570   if [ test x$HAVE_DIVX = xyes ]; then
571     AC_CHECK_HEADER(decore.h, ,
572                     [ AC_MSG_WARN([Divx4linux decoder headers not found]) &&
573                       HAVE_DIVX=no ] )
574   fi
575   if [ test x$HAVE_DIVX = xyes ]; then
576     AC_MSG_CHECKING([Checking for valid divx4linux decore version])
577     AC_TRY_COMPILE([
578 #include <decore.h>
579 #if DECORE_VERSION != 20021112
580 #error Wrong version of divx decore libraries
581 #endif
582     ], [
583 return 0;
584     ], [ HAVE_DIVX=yes && AC_MSG_RESULT(yes)],
585        [ HAVE_DIVX=no  && AC_MSG_RESULT(no) &&
586          AC_MSG_WARN([Wrong version of divx4linux installed]) ])
587   fi
588   LIBS="-lm"
589   if test x$HAVE_DIVX = xyes; then
590     AC_CHECK_LIB(divxencore, encore, ,
591                  [ AC_MSG_WARN([Divx4linux encore libs not found]) &&
592                    HAVE_DIVX=no ] )
593   fi
594   if test x$HAVE_DIVX = xyes; then
595     AC_CHECK_LIB(divxdecore, decore, ,
596                  [ AC_MSG_WARN([Divx4linux decore libs not found]) &&
597                    HAVE_DIVX=no ] )
598   fi
599   if test x$HAVE_DIVX = xyes; then
600     DIVXENC_LIBS="-ldivxencore -lm"
601     DIVXDEC_LIBS="-ldivxdecore -lm"
602     AC_SUBST(DIVXENC_LIBS)
603     AC_SUBST(DIVXDEC_LIBS)
604   fi
605 ])
606
607 dnl *** dvdread ***
608 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
609 GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
610   GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
611   AC_SUBST(DVDREAD_LIBS)
612 ])
613
614 dnl *** dvdnav ***
615 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDNAV, true)
616 GST_CHECK_FEATURE(DVDNAV, [dvdnav library], dvdnavsrc, [
617   translit(dnm, m, l) AC_SUBST(DVDNAV_LIBS)
618   translit(dnm, m, l) AC_SUBST(DVDNAV_CFLAGS)
619   GST_CHECK_CONFIGPROG(DVDNAV, dvdnav-config)
620   if test x"$HAVE_DVDNAV" = x"yes"; then
621     dnl check version
622     DVDNAV_VERSION=`dvdnav-config --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
623     DVDNAV_MAJOR=`echo $DVDNAV_VERSION | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
624     DVDNAV_MINOR=`echo $DVDNAV_VERSION | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
625     DVDNAV_MICRO=`echo $DVDNAV_VERSION | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
626     if [[ "$DVDNAV_MAJOR" -eq "0" ]] && \
627        [[ "$DVDNAV_MINOR" -lt "1" ]]; then
628       AC_MSG_WARN([libdvdnav >= 0.1.7 is required, you have $DVDNAV_VERSION])
629       HAVE_DVDNAV="no"
630     elif [[ "$DVDNAV_MAJOR" -eq "0" ]] && \
631          [[ "$DVDNAV_MINOR" -eq "1" ]] && \
632          [[ "$DVDNAV_MICRO" -lt "7" ]]; then
633       AC_MSG_WARN([libdvdnav >= 0.1.7 is required, you have $DVDNAV_VERSION])
634       HAVE_DVDNAV="no"
635       fi
636     fi
637   AS_SCRUB_INCLUDE(DVDNAV_CFLAGS)
638 ])
639
640 dnl *** MAS ***
641 translit(dnm, m, l) AM_CONDITIONAL(USE_MAS, true)
642 GST_CHECK_FEATURE(MAS, [mas library], massink, [
643   translit(dnm, m, l) AC_SUBST(MAS_LIBS)
644   translit(dnm, m, l) AC_SUBST(MAS_CFLAGS)
645   GST_CHECK_CONFIGPROG(MAS, mas-config)
646   AS_SCRUB_INCLUDE(MAS_CFLAGS)
647 ])
648
649 dnl **** ESound ****
650 translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
651 GST_CHECK_FEATURE(ESD, [esound plug-ins], esdsink esdmon, [
652   AM_PATH_ESD(0.2.12, HAVE_ESD=yes, HAVE_ESD=no)
653   AS_SCRUB_INCLUDE(ESD_CFLAGS)
654 ])
655
656 dnl **** festival ****
657 dnl translit(dnm, m, l) AM_CONDITIONAL(USE_FESTIVAL, true)
658 dnl GST_CHECK_FEATURE(FESTIVAL, [festival plug-ins], festivalsrc, [
659   dnl NOTE: just using local net connection now, add this lib check
660   dnl       in the future if needed
661   dnl AC_LANG_PUSH(C++)
662   dnl dnl FIXME: took out func to check for
663   dnl dnl This check puts festival_tidy_up in extern "C".
664   dnl dnl But, at least on Debian as of 20020110, it is compiled with name
665   dnl dnl mangling C++ nonsense and symbols can't resolve
666   dnl dnl GST_CHECK_LIBHEADER(FESTIVAL, Festival, festival_tidy_up, , festival/festival.h, FESTIVAL_LIBS="-lFestival")
667   dnl GST_CHECK_LIBHEADER(FESTIVAL, Festival, , , festival/festival.h, FESTIVAL_LIBS="-lFestival")
668   dnl AC_LANG_POP(C++)
669   dnl AC_SUBST(FESTIVAL_LIBS)
670 dnl  HAVE_FESTIVAL=yes
671 dnl])
672
673 dnl *** FLAC ***
674 translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
675 GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flacenc flacdec, [
676   GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__seekable_stream_encoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC")
677   AC_SUBST(FLAC_LIBS)
678 ])
679
680 dnl *** FFMPEG ***
681 translit(dnm, m, l) AM_CONDITIONAL(USE_FFMPEG, true)
682 GST_CHECK_FEATURE(FFMPEG, [ffmpeg plug-ins], ffmpeg, [
683   # only slurp in the case where we are in CVS mode;
684   # prerelease and release should get it disted
685   if test "x$GST_PLUGINS_VERSION_NANO" = x1; then
686     AC_MSG_NOTICE(slurping FFmpeg CVS source)
687     AS_SLURP_FFMPEG(gst-libs/ext/ffmpeg, 2003-07-05 22:00 GMT,
688                     HAVE_FFMPEG=yes, HAVE_FFMPEG=no)
689   else
690     AC_MSG_NOTICE(FFmpeg CVS code should be included already)
691     HAVE_FFMPEG=yes
692   fi
693   # we only bother with uninstalled (included) ffmpeg for now
694   AC_DEFINE_UNQUOTED(HAVE_FFMPEG_UNINSTALLED, 1,
695                      [defined if we use uninstalled ffmpeg])
696 ])
697
698 dnl *** GDK pixbuf ***
699 translit(dnm, m, l) AM_CONDITIONAL(USE_GDK_PIXBUF, true)
700 GST_CHECK_FEATURE(GDK_PIXBUF, [GDK pixbuf], gdkpixbufsrc, [
701   if test $HAVE_GTK_22 = "yes"; then HAVE_GDK_PIXBUF=yes; fi;
702 ])
703
704 dnl *** Gnome VFS ***
705 translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
706 GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
707   PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0, HAVE_GNOME_VFS="yes", HAVE_GNOME_VFS="no")
708   AC_SUBST(GNOME_VFS_CFLAGS)
709   AC_SUBST(GNOME_VFS_LIBS)
710 ])
711
712 dnl *** gsm ***
713 translit(dnm, m, l) AM_CONDITIONAL(USE_GSM, true)
714 GST_CHECK_FEATURE(GSM, [GSM library], gsmenc gsmdec, [
715   GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm.h, GSM_LIBS="-lgsm")
716   if test $HAVE_GSM != "yes"; then
717     GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm/gsm.h, GSM_LIBS="-lgsm")
718     if test $HAVE_GSM = "yes"; then 
719       AC_DEFINE(GSM_HEADER_IN_SUBDIR, 1, [Define if GSM header in gsm/ subdir])
720     fi
721   fi
722   AC_SUBST(GSM_LIBS)
723 ])
724
725 dnl *** Hermes ***
726 translit(dnm, m, l) AM_CONDITIONAL(USE_HERMES, true)
727 GST_CHECK_FEATURE(HERMES, [Hermes library], colorspace, [
728   GST_CHECK_LIBHEADER(HERMES, Hermes, Hermes_ConverterInstance, , Hermes/Hermes.h, HERMES_LIBS="-lHermes")
729 ], AC_SUBST(HERMES_LIBS))
730
731 dnl *** http ***
732 dnl translit(dnm, m, l) AM_CONDITIONAL(USE_HTTP, true)
733 dnl GST_CHECK_FEATURE(HTTP, [http plug-ins], gsthttpsrc, [
734 dnl  dnl FIXME: need to check for header
735 dnl  GHTTP_LIBS=
736 dnl  GST_HTTPSRC_GET_TYPE=
737 dnl  if test x$USE_GLIB2 = xyes; then
738 dnl    AC_MSG_WARN(ghttp disabled for glib2.0)
739 dnl  else
740 dnl    AC_CHECK_LIB(ghttp, ghttp_request_new,
741 dnl      [HTTP_LIBS="-lghttp"
742 dnl       GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
743 dnl       HAVE_HTTP=yes
744 dnl      ], :, $LIBS)
745 dnl  fi
746 dnl  AC_SUBST(HTTP_LIBS)
747 dnl  AC_SUBST(GST_HTTPSRC_GET_TYPE)
748 dnl ])
749
750 dnl *** ivorbis ***
751 dnl AM_PATH_IVORBIS only takes two options
752 translit(dnm, m, l) AM_CONDITIONAL(USE_IVORBIS, true)
753 GST_CHECK_FEATURE(IVORBIS, [integer vorbis plug-in], ivorbisdec, [
754   IVORBIS_LIBS=
755   IVORBIS_CFLAGS=
756   AC_CHECK_LIB(vorbisidec, vorbis_block_init,
757     [IVORBIS_LIBS=-lvorbisidec
758      HAVE_IVORBIS=yes],
759     HAVE_IVORBIS=no)
760   AC_SUBST(IVORBIS_LIBS)
761   AC_SUBST(IVORBIS_CFLAGS)
762 ])
763
764 dnl *** Jack ***
765 translit(dnm, m, l) AM_CONDITIONAL(USE_JACK, true)
766 GST_CHECK_FEATURE(JACK, Jack, jack, [
767   PKG_CHECK_MODULES(JACK, jack >= 0.29.0, HAVE_JACK="yes", HAVE_JACK="no")
768   AC_SUBST(JACK_CFLAGS)
769   AC_SUBST(JACK_LIBS)
770 ])
771
772 dnl *** jpeg ***
773 dnl FIXME: we could use header checks here as well IMO
774 translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
775 GST_CHECK_FEATURE(JPEG, [jpeg], jpegenc jpegdec, [
776   AC_ARG_WITH(jpeg-mmx,
777     [  --with-jpeg-mmx, path to MMX'ified JPEG library])
778   OLD_LIBS="$LIBS"
779   if test x$with_jpeg_mmx != x; then
780     LIBS="$LIBS -L$with_jpeg_mmx"
781   fi
782   AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
783   JPEG_LIBS="$LIBS -ljpeg-mmx"
784   LIBS="$OLD_LIBS"
785   if test x$HAVE_JPEG != xyes; then
786     AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
787     JPEG_LIBS="-ljpeg"
788   fi
789   AC_SUBST(JPEG_LIBS)
790 ])
791
792 dnl *** ladspa ***
793 translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
794 GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
795   AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA="yes", HAVE_LADSPA="no")
796 ])
797
798 dnl *** lame ***
799 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
800 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
801   GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h, HAVE_LAME="yes" LAME_LIBS="-lmp3lame")
802 ])
803 AC_SUBST(LAME_LIBS)
804
805 dnl *** libcolorspace ***
806 translit(dnm, m, l) AM_CONDITIONAL(USE_LCS, true)
807 GST_CHECK_FEATURE(LCS, Lcs, lcs, [
808   PKG_CHECK_MODULES(LCS, lcs, HAVE_LCS="yes", HAVE_LCS="no")
809   AC_SUBST(LCS_CFLAGS)
810   AC_SUBST(LCS_LIBS)
811 ])
812
813 dnl *** libdv ***
814 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBDV, true)
815 GST_CHECK_FEATURE(LIBDV, [libdv DV/video decoder], dvdec, [
816   PKG_CHECK_MODULES(LIBDV, libdv >= 0.98, HAVE_LIBDV="yes", HAVE_LIBDV="no")
817   AC_SUBST(LIBDV_CFLAGS)
818   AC_SUBST(LIBDV_LIBS)
819 ])
820
821 dnl *** libfame ***
822 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBFAME, true)
823 GST_CHECK_FEATURE(LIBFAME, [libfame MPEG1/4 encoder], libfame, [
824   AM_PATH_LIBFAME(0.9.0, HAVE_LIBFAME="yes", HAVE_LIBFAME="no")
825   AC_SUBST(LIBFAME_CFLAGS)
826   AC_SUBST(LIBFAME_LIBS)
827 ])
828
829 dnl *** libpng ***
830 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
831 GST_CHECK_FEATURE(LIBPNG, [libpng PNG encoder], pngenc, [
832   PKG_CHECK_MODULES(LIBPNG, libpng12, HAVE_LIBPNG="yes", HAVE_LIBPNG="no")
833   AC_SUBST(LIBPNG_CFLAGS)
834   AC_SUBST(LIBPNG_LIBS)
835 ])
836
837
838 dnl *** mad ***
839 dnl FIXME: we could use header checks here as well IMO
840 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
841 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
842   dnl check with pkg-config first
843   PKG_CHECK_MODULES(MAD, mad id3tag, HAVE_MAD="yes", HAVE_MAD="no")
844   if test "x$HAVE_MAD" = "xno"; then
845     dnl fall back to oldskool detection
846     AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad")
847     if test "x$HAVE_MAD" = "xyes"; then
848       # installed with mad >= 0.14
849       HAVE_MAD="no"
850       save_libs=$LIBS
851       LIBS="-lz"
852       AC_CHECK_LIB(id3tag, id3_tag_query, HAVE_MAD="yes" MAD_LIBS="$MAD_LIBS -lid3tag")
853       LIBS=$save_LIBS
854     fi
855   fi    
856 ])
857 AC_SUBST(MAD_LIBS)
858
859 dnl *** matroska ***
860 translit(dnm, m, l) AM_CONDITIONAL(USE_MATROSKA, true)
861 GST_CHECK_FEATURE(MATROSKA, [matroska muxer/demuxer], matroska muxer/demuxer, [
862   PATH_EBML([HAVE_MATROSKA=yes], [HAVE_MATROSKA=no])
863   if test x$HAVE_MATROSKA = xyes; then
864     PATH_MATROSKA(0.4.4, [HAVE_MATROSKA=yes], [HAVE_MATROSKA=no])
865   fi
866 ])
867
868 dnl *** mikmod ***
869 translit(dnm, m, l) AM_CONDITIONAL(USE_MIKMOD, true)
870 GST_CHECK_FEATURE(MIKMOD, [mikmod plug-in], mikmod, [
871   AM_PATH_LIBMIKMOD(, HAVE_MIKMOD=yes, HAVE_MIKMOD=no)
872   AC_SUBST(MIKMOD_LIBS, "$LIBMIKMOD_LIBS")
873   AC_SUBST(MIKMOD_CFLAGS, "$LIBMIKMODCFLAGS")
874 ])
875
876 dnl *** mpeg2dec ***
877 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
878 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
879   PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.3.1,
880       HAVE_MPEG2DEC="yes", HAVE_MPEG2DEC="no")
881   AC_SUBST(MPEG2DEC_CFLAGS)
882   AC_SUBST(MPEG2DEC_LIBS)
883 ])
884
885 dnl *** mplex ***
886 translit(dnm, m, l) AM_CONDITIONAL(USE_MPLEX, true)
887 GST_CHECK_FEATURE(MPLEX, [mplex], mplex, [HAVE_MPLEX=$HAVE_CXX])
888
889 dnl *** pango ***
890 translit(dnm, m, l) AM_CONDITIONAL(USE_PANGO, true)
891 GST_CHECK_FEATURE(PANGO, [pango], pango, [
892   PKG_CHECK_MODULES(PANGO, pango pangoft2,
893       HAVE_PANGO="yes", HAVE_PANGO="no")
894   AC_SUBST(PANGO_CFLAGS)
895   AC_SUBST(PANGO_LIBS)
896 ])
897
898 dnl *** raw1394 ***
899 translit(dnm, m, l) AM_CONDITIONAL(USE_RAW1394, true)
900 GST_CHECK_FEATURE(RAW1394, [raw1394 library], dv1394src, [
901   GST_CHECK_LIBHEADER(RAW1394, raw1394, raw1394_new_handle,, libraw1394/raw1394.h, RAW1394_LIBS="-lraw1394")
902   AC_SUBST(RAW1394_LIBS)
903 ])
904
905 dnl *** SDL ***
906 translit(dnm, m, l) AM_CONDITIONAL(USE_SDL, true)
907 GST_CHECK_FEATURE(SDL, [SDL plug-in], sdlvideosink, [
908  AM_PATH_SDL(, HAVE_SDL=yes, HAVE_SDL=no)
909 ])
910
911 dnl *** shout ***
912 translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT, true)
913 GST_CHECK_FEATURE(SHOUT, [shout plug-in], icecastsend, [
914   GST_CHECK_LIBHEADER(SHOUT, shout, shout_init_connection,, shout/shout.h, SHOUT_LIBS="-lshout")
915   AC_SUBST(SHOUT_LIBS)
916 ])
917
918 dnl *** shout2 *** 
919 translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
920 GST_CHECK_FEATURE(SHOUT2, [shout2 plug-in], shout2send, [
921   AM_PATH_SHOUT2(HAVE_SHOUT2=yes, HAVE_SHOUT2=no)
922   AC_SUBST(SHOUT2_CFLAGS)
923   AC_SUBST(SHOUT2_LIBS)
924 ])
925
926 dnl *** sidplay ***
927 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
928 GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
929   GST_PATH_SIDPLAY()
930 ])
931
932 dnl *** smoothwave ***
933 translit(dnm, m, l) AM_CONDITIONAL(USE_SMOOTHWAVE, true)
934 GST_CHECK_FEATURE(SMOOTHWAVE, [smoothwave plug-in], smoothwave, [
935   if test $HAVE_GTK = "yes"; then HAVE_SMOOTHWAVE=yes; fi;
936 ])
937
938
939 dnl *** snapshot ***
940 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
941 GST_CHECK_FEATURE(LIBPNG, [snapshot plug-in], snapshot, [
942   GST_CHECK_LIBHEADER(LIBPNG, png, png_read_info, -lz -lm, png.h, LIBPNG_LIBS="-lpng -lz -lm")
943   AC_SUBST(LIBPNG_LIBS)
944 ])
945
946 dnl *** speex ***
947 translit(dnm, m, l) AM_CONDITIONAL(USE_SPEEX, true)
948 GST_CHECK_FEATURE(SPEEX, [speex plug-in], speex, [
949   GST_CHECK_LIBHEADER(SPEEX, speex, speex_bits_init, , speex.h, HAVE_SPEEX="yes" SPEEX_LIBS="-lspeex")
950   AC_SUBST(SPEEX_CFLAGS)
951   AC_SUBST(SPEEX_LIBS)
952 ])
953
954 dnl *** sndfile ***
955 translit(dnm, m, l) AM_CONDITIONAL(USE_SNDFILE, true)
956 GST_CHECK_FEATURE(SNDFILE, [sndfile plug-in], sfsrc sfsink, [
957   PKG_CHECK_MODULES(SNDFILE, sndfile >= 1.0.0, HAVE_SNDFILE="yes", HAVE_SNDFILE="no")
958   AC_SUBST(SNDFILE_CFLAGS)
959   AC_SUBST(SNDFILE_LIBS)
960 ])
961
962 dnl *** swfdec ***
963 translit(dnm, m, l) AM_CONDITIONAL(USE_SWFDEC, true)
964 GST_CHECK_FEATURE(SWFDEC, [swfdec plug-in], swfdec, [
965   PKG_CHECK_MODULES(SWFDEC, swfdec >= 0.1.3.1, HAVE_SWFDEC=yes, HAVE_SWFDEC=no)
966   AC_SUBST(SWFDEC_CFLAGS)
967   AC_SUBST(SWFDEC_LIBS)
968 ])
969
970 dnl *** tarkin ***
971 dnl for now the sources are included in the plug-in
972 dnl and should be moved to ext-libs/ perhaps
973 translit(dnm, m, l) AM_CONDITIONAL(USE_TARKIN, true)
974 GST_CHECK_FEATURE(TARKIN, [tarkinenc tarkindec], tarkin, [
975   HAVE_TARKIN="yes"
976 ])
977
978 dnl *** vorbis ***
979 dnl AM_PATH_VORBIS only takes two options
980 translit(dnm, m, l) AM_CONDITIONAL(USE_VORBIS, true)
981 GST_CHECK_FEATURE(VORBIS, [vorbis plug-in], vorbisenc vorbisdec, [
982   XIPH_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
983   AS_SCRUB_INCLUDE(VORBIS_CFLAGS)
984 ])
985
986 dnl *** XVID ***
987 translit(dnm, m, l) AM_CONDITIONAL(USE_XVID, true)
988 GST_CHECK_FEATURE(XVID, [xvid plugins], xvid, [
989   HAVE_XVID=yes
990   AC_CHECK_HEADER(xvid.h, ,
991                   [ AC_MSG_WARN([Xvid headers not found]) &&
992                     HAVE_XVID=no ] )
993   LIBS="-lm"
994   AC_CHECK_LIB(xvidcore, xvid_encore, ,
995                [ AC_MSG_WARN([Xvid encore libs not found]) &&
996                  HAVE_XVID=no ] )
997   AC_CHECK_LIB(xvidcore, xvid_decore, ,
998                [ AC_MSG_WARN([Xvid decore libs not found]) &&
999                  HAVE_XVID=no ] )
1000   if test x$HAVE_XVID = xyes; then
1001     XVID_LIBS="-lxvidcore -lm"
1002     AC_SUBST(XVID_LIBS)
1003   fi
1004 ])
1005
1006
1007 fi dnl of EXT plugins
1008
1009 dnl Check for atomic.h
1010 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
1011 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
1012 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
1013 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
1014 if test x$HAVE_ATOMIC_H = xyes; then
1015   AC_TRY_RUN([
1016 #include "asm/atomic.h"
1017 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
1018   ],, [
1019     # Not successful
1020     if test x$HAVE_ATOMIC_H = xyes; then
1021       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
1022     fi
1023     HAVE_ATOMIC_H=no
1024   ], [
1025     # Cross compiling
1026     AC_MSG_RESULT(yes)
1027     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
1028   ])
1029 fi
1030
1031
1032 dnl ######################################################################
1033 dnl # Check command line parameters, and set shell variables accordingly #
1034 dnl ######################################################################
1035
1036 AC_ARG_ENABLE(libmmx,
1037   AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
1038 [case "${enableval}" in
1039   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
1040   no)  USE_LIBMMX=no ;;
1041   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
1042 esac], 
1043 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
1044
1045 AC_ARG_ENABLE(atomic,
1046   AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
1047 [case "${enableval}" in
1048   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
1049   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
1050   no)  USE_ATOMIC_H=no;;
1051   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
1052 esac], 
1053 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
1054
1055 AC_ARG_ENABLE(profiling,
1056   AC_HELP_STRING([--enable-profiling],
1057                  [-pg to compiler commandline, for profiling]),
1058 [case "${enableval}" in
1059   yes) USE_PROFILING=yes ;;
1060   no)  UES_PROFILING=no ;;
1061   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
1062 esac], 
1063 [USE_PROFILING=no]) dnl Default value
1064
1065 AC_ARG_ENABLE(tests,
1066   AC_HELP_STRING([--disable-tests],[disable building test apps]),
1067 [case "${enableval}" in
1068   yes) BUILD_TESTS=yes ;;
1069   no)  BUILD_TESTS=no ;;
1070   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
1071 esac], 
1072 [BUILD_TESTS=yes]) dnl Default value
1073
1074 AC_ARG_ENABLE(examples,
1075   AC_HELP_STRING([--disable-examples],[disable building examples]),
1076 [case "${enableval}" in
1077   yes) BUILD_EXAMPLES=yes ;;
1078   no)  BUILD_EXAMPLES=no ;;
1079   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
1080 esac], 
1081 [BUILD_EXAMPLES=yes]) dnl Default value
1082
1083 dnl seeking needs freetype, so check for it here
1084 AC_CHECK_FT2(2.0.9,HAVE_FT2=yes,HAVE_FT2=no)
1085 dnl make the HAVE_FT2 variable available to automake and Makefile.am
1086 AM_CONDITIONAL(HAVE_FT2, test "x$HAVE_FT2" = "xyes")
1087 AC_SUBST(FT2_CFLAGS)
1088 AC_SUBST(FT2_LIBS)
1089
1090 dnl ################################################
1091 dnl # Set defines according to variables set above #
1092 dnl ################################################
1093
1094
1095 if test "x$USE_LIBMMX" = xyes; then
1096   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
1097 fi
1098
1099 if test "x$USE_ATOMIC_H" = xyes; then
1100   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
1101 fi
1102
1103 # do not use deprecated stuff
1104 GST_CFLAGS="$GST_CFLAGS -DGST_DISABLE_DEPRECATED"
1105
1106 if test "x$USE_DEBUG" = xyes; then
1107   GST_CFLAGS="$GST_CFLAGS -g"
1108 fi
1109
1110 dnl #############################
1111 dnl # Set automake conditionals #
1112 dnl #############################
1113
1114 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
1115 dnl HAVE_ and it is likely to be easier to stick with the old name
1116 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
1117 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
1118 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
1119 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
1120 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
1121 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
1122
1123 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
1124
1125 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
1126 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
1127
1128 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
1129 AM_CONDITIONAL(HAVE_GTK,            test "x$HAVE_GTK" = "xyes")
1130 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
1131 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
1132 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
1133 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
1134 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
1135 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
1136 AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
1137 AM_CONDITIONAL(HAVE_RAW1394,        test "x$HAVE_RAW1394" = "xyes")
1138
1139 dnl prefer internal headers to already installed ones
1140 GST_CFLAGS="-I\$(top_srcdir)/gst-libs $GST_CFLAGS $GST_ERROR"
1141
1142 AC_SUBST(GST_LIBS)
1143 AC_SUBST(GST_CFLAGS)
1144
1145 dnl ###########################
1146 dnl # Configure external libs #
1147 dnl ###########################
1148 if test "x$HAVE_FFMPEG" = xyes; then
1149   AC_CONFIG_SUBDIRS(gst-libs/ext/ffmpeg/ffmpeg)
1150 fi 
1151
1152 dnl #########################
1153 dnl # Make the output files #
1154 dnl #########################
1155
1156 AC_CONFIG_FILES(
1157 Makefile
1158 pkgconfig/gstreamer-libs.pc
1159 pkgconfig/gstreamer-libs-uninstalled.pc
1160 pkgconfig/gstreamer-play.pc
1161 pkgconfig/gstreamer-play-uninstalled.pc
1162 gst-libs/gst/gconf/gstreamer-gconf.pc
1163 gst-libs/gst/gconf/gstreamer-gconf-uninstalled.pc
1164 gst-plugins.spec
1165 gst/Makefile
1166 gst/ac3parse/Makefile
1167 gst/adder/Makefile
1168 gst/audioconvert/Makefile
1169 gst/audioscale/Makefile
1170 gst/auparse/Makefile
1171 gst/avi/Makefile
1172 gst/asfdemux/Makefile
1173 gst/cdxaparse/Makefile
1174 gst/chart/Makefile
1175 gst/cutter/Makefile
1176 gst/debug/Makefile
1177 gst/deinterlace/Makefile
1178 gst/effectv/Makefile
1179 gst/festival/Makefile
1180 gst/filter/Makefile
1181 gst/flx/Makefile
1182 gst/goom/Makefile
1183 gst/id3/Makefile
1184 gst/intfloat/Makefile
1185 gst/law/Makefile
1186 gst/level/Makefile
1187 gst/median/Makefile
1188 gst/mixmatrix/Makefile
1189 gst/mpeg1sys/Makefile
1190 gst/mpeg1videoparse/Makefile
1191 gst/mpeg2enc/Makefile
1192 gst/mpeg2sub/Makefile
1193 gst/mpegaudio/Makefile
1194 gst/mpegaudioparse/Makefile
1195 gst/mpegstream/Makefile
1196 gst/mpegtypes/Makefile
1197 gst/modplug/Makefile
1198 gst/modplug/libmodplug/Makefile
1199 gst/monoscope/Makefile
1200 gst/oneton/Makefile
1201 gst/overlay/Makefile
1202 gst/passthrough/Makefile
1203 gst/playondemand/Makefile
1204 gst/qtdemux/Makefile
1205 gst/realmedia/Makefile
1206 gst/rtjpeg/Makefile
1207 gst/rtp/Makefile
1208 gst/silence/Makefile
1209 gst/sine/Makefile
1210 gst/smooth/Makefile
1211 gst/smpte/Makefile
1212 gst/spectrum/Makefile
1213 gst/speed/Makefile
1214 gst/stereo/Makefile
1215 gst/synaesthesia/Makefile
1216 gst/tcp/Makefile
1217 gst/udp/Makefile
1218 gst/vbidec/Makefile
1219 gst/videocrop/Makefile
1220 gst/videodrop/Makefile
1221 gst/videofilter/Makefile
1222 gst/videoflip/Makefile
1223 gst/videoscale/Makefile
1224 gst/videotestsrc/Makefile
1225 gst/volenv/Makefile
1226 gst/volume/Makefile
1227 gst/wavenc/Makefile
1228 gst/wavparse/Makefile
1229 gst/y4m/Makefile
1230 sys/Makefile
1231 sys/cdrom/Makefile
1232 sys/dxr3/Makefile
1233 sys/oss/Makefile
1234 sys/qcam/Makefile
1235 sys/v4l/Makefile
1236 sys/v4l2/Makefile
1237 sys/vcd/Makefile
1238 sys/xvideo/Makefile
1239 ext/Makefile
1240 ext/a52dec/Makefile
1241 ext/aalib/Makefile
1242 ext/alsa/Makefile
1243 ext/arts/Makefile
1244 ext/artsd/Makefile
1245 ext/audiofile/Makefile
1246 ext/cdparanoia/Makefile
1247 ext/divx/Makefile
1248 ext/dv/Makefile
1249 ext/dvdread/Makefile
1250 ext/dvdnav/Makefile
1251 ext/esd/Makefile
1252 ext/ffmpeg/Makefile
1253 ext/flac/Makefile
1254 ext/gdk_pixbuf/Makefile
1255 ext/gnomevfs/Makefile
1256 ext/gsm/Makefile
1257 ext/hermes/Makefile
1258 dnl ext/http/Makefile
1259 ext/jack/Makefile
1260 ext/jpeg/Makefile
1261 ext/ladspa/Makefile
1262 ext/lame/Makefile
1263 ext/ivorbis/Makefile
1264 ext/lcs/Makefile
1265 ext/libfame/Makefile
1266 ext/libpng/Makefile
1267 ext/mad/Makefile
1268 ext/mas/Makefile
1269 ext/matroska/Makefile
1270 ext/mikmod/Makefile
1271 ext/mpeg2dec/Makefile
1272 ext/mplex/Makefile
1273 ext/pango/Makefile
1274 ext/raw1394/Makefile
1275 ext/sdl/Makefile
1276 ext/shout/Makefile
1277 ext/shout2/Makefile
1278 ext/sidplay/Makefile
1279 ext/smoothwave/Makefile
1280 ext/snapshot/Makefile
1281 ext/speex/Makefile
1282 ext/sndfile/Makefile
1283 ext/swfdec/Makefile
1284 ext/vorbis/Makefile
1285 ext/tarkin/Makefile
1286 ext/xvid/Makefile
1287 gst-libs/Makefile
1288 gst-libs/gst/Makefile
1289 gst-libs/gst/audio/Makefile
1290 gst-libs/gst/colorbalance/Makefile
1291 gst-libs/gst/floatcast/Makefile
1292 gst-libs/gst/gconf/Makefile
1293 gst-libs/gst/idct/Makefile
1294 gst-libs/gst/media-info/Makefile
1295 gst-libs/gst/mixer/Makefile
1296 gst-libs/gst/navigation/Makefile
1297 gst-libs/gst/play/Makefile
1298 gst-libs/gst/resample/Makefile
1299 gst-libs/gst/riff/Makefile
1300 gst-libs/gst/tuner/Makefile
1301 gst-libs/gst/video/Makefile
1302 gst-libs/gst/xoverlay/Makefile
1303 gst-libs/gst/xwindowlistener/Makefile
1304 gst-libs/ext/Makefile
1305 gst-libs/ext/ffmpeg/Makefile
1306 gst-libs/ext/mplex/Makefile
1307 examples/dynparams/Makefile
1308 examples/capsfilter/Makefile
1309 examples/seeking/Makefile
1310 examples/indexing/Makefile
1311 examples/Makefile
1312 testsuite/autoplug/Makefile
1313 testsuite/spider/Makefile
1314 testsuite/alsa/Makefile
1315 testsuite/Makefile
1316 tools/Makefile
1317 tools/gst-launch-ext
1318 gconf/Makefile
1319 pkgconfig/Makefile
1320 )
1321 AC_OUTPUT
1322
1323 echo -n "configure: *** Plug-ins that will be built :"
1324 echo -e "$GST_PLUGINS_YES" | sort
1325 echo
1326 echo -n "configure: *** Plug-ins that will not be built :"
1327 echo -e "$GST_PLUGINS_NO" | sort
1328 echo
1329 if test "x$BUILD_EXTERNAL" = "xno"; then
1330   echo "configure: *** No external plug-ins will be built"
1331 fi