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