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