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