ext/ladspa/gstladspa.*: Halfway-ported. Doesn't compile yet.
[platform/upstream/gst-plugins-good.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, 9, 0, 1, GST_CVS="no", GST_CVS="yes")
16
17 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
18
19 dnl our libraries and install dirs use major.minor as a version
20 GST_MAJORMINOR=$GST_PLUGINS_VERSION_MAJOR.$GST_PLUGINS_VERSION_MINOR
21 dnl we override it here if we need to for the release candidate of new series
22 GST_MAJORMINOR=0.9
23 AC_SUBST(GST_MAJORMINOR)
24
25 dnl CURRENT, REVISION, AGE
26 dnl - library source changed -> increment REVISION
27 dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
28 dnl - interfaces added -> increment AGE
29 dnl - interfaces removed -> AGE = 0
30 dnl for 0.8.3 release, gst_play_get_all_by_interface was added, so update
31 AS_LIBTOOL(GST_PLUGINS, 1, 0, 1)
32 AS_LIBTOOL_TAGS([CXX])
33 AM_PROG_LIBTOOL
34
35 dnl FIXME take something else ?
36 AC_CONFIG_SRCDIR([gst/law/alaw.c])
37 AM_CONFIG_HEADER(config.h)
38
39 dnl Add parameters for aclocal
40 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
41 ACLOCAL_FLAGS="-I m4 -I common/m4"
42 AC_SUBST(ACLOCAL_AMFLAGS, $ACLOCAL_FLAGS)
43
44 AC_PROG_CC
45 AM_PROG_CC_STDC
46 AM_PROG_AS
47 AS="${CC}"
48 AS_PROG_OBJC
49
50 dnl the gettext stuff needed
51 AM_GNU_GETTEXT_VERSION(0.11.5)
52 AM_GNU_GETTEXT([external])
53                                                                             
54 GETTEXT_PACKAGE=gst-plugins-$GST_MAJORMINOR
55 AC_SUBST(GETTEXT_PACKAGE)
56 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], "$GETTEXT_PACKAGE",
57                   [gettext package name])
58
59 dnl define LOCALEDIR in config.h
60 AS_AC_EXPAND(LOCALEDIR, $datadir/locale)
61 AC_DEFINE_UNQUOTED([LOCALEDIR], "$LOCALEDIR",
62                    [gettext locale dir])
63
64 dnl decide on error flags
65 AS_COMPILER_FLAG(-Wall, GST_WALL="yes", GST_WALL="no")
66
67 if test "x$GST_WALL" = "xyes"; then
68    GST_ERROR="$GST_ERROR -Wall"
69
70    if test "x$GST_CVS" = "xyes"; then
71      AS_COMPILER_FLAG(-Werror,GST_ERROR="$GST_ERROR -Werror",GST_ERROR="$GST_ERROR")
72    fi
73 fi
74
75 dnl determine c++ compiler
76 AC_PROG_CXX
77 dnl determine if c++ is available on this system
78 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
79 dnl determine c++ preprocessor
80 AC_PROG_CXXCPP
81 AC_ISC_POSIX
82
83 AC_HEADER_STDC([])
84 AC_C_INLINE
85 AX_CREATE_STDINT_H
86
87 dnl Check for malloc.h
88 AC_CHECK_HEADER(malloc.h,[
89   AC_DEFINE(HAVE_MALLOC_H, 1, [whether malloc.h available])
90 ])
91
92 dnl Check for a way to display the function name in debug output
93 GST_CHECK_FUNCTION()
94
95 dnl define correct errorlevel for debugging messages. We want to have GST_ERROR
96 dnl messages printed when running cvs builds
97 if test "x$GST_CVS" = "xyes"; then
98   AC_DEFINE(GST_LEVEL_DEFAULT, GST_LEVEL_ERROR, [Default errorlevel to use])
99 fi
100
101 dnl Check for FIONREAD ioctl declaration :
102 GST_CHECK_FIONREAD()
103
104 DEFAULT_AUDIOSINK="autoaudiosink"
105 DEFAULT_VIDEOSINK="autovideosink"
106 DEFAULT_AUDIOSRC="alsasrc"
107 DEFAULT_VIDEOSRC="v4lsrc"
108 DEFAULT_VISUALIZER="goom"
109 case "$host" in 
110   *-sun-* | *pc-solaris* )
111     DEFAULT_AUDIOSRC="sunaudiosrc"
112     ;;
113   *-darwin* )
114     DEFAULT_AUDIOSRC="osxaudiosrc"
115     ;;
116 esac
117
118 AC_SUBST(DEFAULT_AUDIOSINK)
119 AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSINK,"$DEFAULT_AUDIOSINK",[Default audio sink])
120 AC_SUBST(DEFAULT_AUDIOSRC)
121 AC_DEFINE_UNQUOTED(DEFAULT_AUDIOSRC,"$DEFAULT_AUDIOSRC",[Default audio source])
122 AC_SUBST(DEFAULT_VIDEOSINK)
123 AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSINK,"$DEFAULT_VIDEOSINK",[Default video sink])
124 AC_SUBST(DEFAULT_VIDEOSRC)
125 AC_DEFINE_UNQUOTED(DEFAULT_VIDEOSRC,"$DEFAULT_VIDEOSRC",[Default video source])
126 AC_SUBST(DEFAULT_VISUALIZER)
127 AC_DEFINE_UNQUOTED(DEFAULT_VISUALIZER,"$DEFAULT_VISUALIZER",[Default visualizer])
128
129 dnl ############################################
130 dnl # Super Duper options for plug-in building #
131 dnl ############################################
132
133 dnl ext plug-ins; plug-ins that have external dependencies
134 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
135 [HAVE_EXTERNAL=yes],enabled,
136 [
137   AC_MSG_WARN(building external plug-ins)
138   BUILD_EXTERNAL="yes"
139 ],[
140   AC_MSG_WARN(all plug-ins with external dependencies will not be built)
141   BUILD_EXTERNAL="no"
142 ])
143 # make BUILD_EXTERNAL available to Makefile.am
144 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
145
146 dnl experimental plug-ins; stuff that hasn't had the dust settle yet
147 dnl read 'builds, but might not work'UTO
148 GST_CHECK_FEATURE(EXPERIMENTAL, [enable building of experimental plug-ins],,
149 [HAVE_EXPERIMENTAL=yes],disabled,
150 [
151   AC_MSG_WARN(building experimental plug-ins)
152   USE_TARKIN="yes"
153 ],[
154   AC_MSG_NOTICE(not building experimental plug-ins)
155   USE_TARKIN="no"
156 ])
157
158 dnl broken plug-ins; stuff that doesn't seem to build at the moment
159 GST_CHECK_FEATURE(BROKEN, [enable building of broken plug-ins],,
160 HAVE_BROKEN=yes,disabled,
161 [  
162   AC_MSG_WARN([building broken plug-ins -- no bug reports on these, only patches :)])
163 ],[
164   AC_MSG_NOTICE([not building broken plug-ins])
165 ])
166
167 dnl ##############################
168 dnl # Do automated configuration #
169 dnl ##############################
170
171 dnl Check for tools:
172 dnl ================
173
174 dnl allow for different autotools
175 AS_AUTOTOOLS_ALTERNATE()
176
177 dnl modify pkg-config path
178 AC_ARG_WITH(pkg-config-path, 
179    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
180    [export PKG_CONFIG_PATH=${withval}])
181
182 GST_DOC()
183 dnl check architecture
184 GST_ARCH()
185
186 dnl check for gconftool-2
187
188 dnl this macro defines an am conditional, so it needs to be run always
189 AM_GCONF_SOURCE_2
190
191 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONFTOOL, true)
192 GST_CHECK_FEATURE(GCONFTOOL, [GConf schemas], , [
193   AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
194   if test x$GCONFTOOL = xno; then
195     AC_MSG_WARN(Not installing GConf schemas)
196     HAVE_GCONFTOOL="no"
197   else
198     HAVE_GCONFTOOL="yes"
199   fi
200   AC_SUBST(HAVE_GCONFTOOL)
201 ])
202
203 dnl check for GConf libraries
204 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONF, true)
205 GST_CHECK_FEATURE(GCONF, [GConf libraries], , [
206   PKG_CHECK_MODULES(GCONF, gconf-2.0, HAVE_GCONF="yes", HAVE_GCONF="no")
207   AC_SUBST(GCONF_CFLAGS)
208   AC_SUBST(GCONF_LIBS)
209 ])
210
211 dnl check for gstreamer
212 dnl uninstalled is selected preferentially -- see pkg-config(1)
213 GST_REQ=0.9.0.1
214 PKG_CHECK_MODULES(GST, gstreamer-$GST_MAJORMINOR >= $GST_REQ,
215   HAVE_GST="yes", HAVE_GST="no")
216
217 if test "x$HAVE_GST" = "xno"; then
218   AC_MSG_ERROR(no GStreamer found)
219 fi
220
221 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR`
222 if test -z $GST_TOOLS_DIR; then
223   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
224 fi
225 AC_SUBST(GST_TOOLS_DIR)
226
227 dnl check for gstreamer-base; uninstalled is selected preferentially
228 PKG_CHECK_MODULES(GST_BASE, gstreamer-base-$GST_MAJORMINOR >= $GST_REQ,
229   HAVE_GST_BASE="yes", HAVE_GST_BASE="no")
230
231 if test "x$HAVE_GST_BASE" = "xno"; then
232   AC_MSG_ERROR(no GStreamer Base Libs found)
233 fi
234
235 AC_SUBST(GST_BASE_LIBS)
236 AC_SUBST(GST_BASE_CFLAGS)
237
238 dnl check for gstreamer-plugins-base; uinstalled is selected preferentially
239 PKG_CHECK_MODULES(GST_PLUGINS_BASE,
240   gstreamer-plugins-base-$GST_MAJORMINOR >= $GST_REQ,
241   HAVE_GST_PLUGINS_BASE="yes", HAVE_GST_PLUGINS_BASE="no")
242
243 if test "x$HAVE_GST_PLUGINS_BASE" = "xno"; then
244   AC_MSG_ERROR(no GStreamer Base Plugins development files found)
245 fi
246
247 AC_SUBST(GST_PLUGINS_BASE_LIBS)
248 AC_SUBST(GST_PLUGINS_BASE_CFLAGS)
249
250 dnl Determine endianness
251 AC_C_BIGENDIAN
252
253 dnl Check for fast float to int casting as defined in C99
254 AC_C99_FUNC_LRINT()
255 AC_C99_FUNC_LRINTF()
256
257 dnl Check for essential libraries first:
258 dnl ====================================
259
260 GST_GLIB2_CHECK()
261
262 dnl Check for additional libraries that we might use:
263 dnl =================================================
264
265 # we set the defaults always to make sure we have non-empty variables
266 # for the Makefile
267
268 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.0, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
269 AC_SUBST(LIBOIL_CFLAGS)
270 AC_SUBST(LIBOIL_LIBS)
271 if test "x${HAVE_LIBOIL}" = xyes ; then
272   #AC_DEFINE_UNQUOTED(HAVE_LIBOIL, 1, [Define if liboil is being used])
273   true
274 fi
275
276 dnl ===========================================================================
277 dnl ============================= gst plug-ins ================================
278 dnl ===========================================================================
279
280 plugindir="\$(libdir)/gstreamer-$GST_MAJORMINOR"
281 AC_SUBST(plugindir)
282
283 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '[_]*(gst_|Gst|GST_).*' $GST_LIBS"
284 AC_SUBST(GST_PLUGIN_LDFLAGS)
285
286 dnl these are all the gst plug-ins, compilable without additional libs
287 GST_PLUGINS_ALL="\
288                 videofilter \
289                 alpha \
290                 autodetect \
291                 avi \
292                 effectv \
293                 fdsrc \
294                 goom \
295                 law \
296                 level \
297                 mpegaudioparse \
298                 qtdemux \
299                 realmedia \
300                 rtp     \
301                 rtsp    \
302                 smpte   \
303                 silence \
304                 udp     \
305                 videobox \
306                 wavparse \
307                 mpegaudioparse \
308                 "
309
310 dnl see if we can build C++ plug-ins
311 if test "x$HAVE_CXX" = "xyes"; then
312   GST_PLUGINS_ALL="$GST_PLUGINS_ALL"
313 else
314   AC_MSG_WARN([Not compiling plug-ins requiring C++ compiler])
315 fi
316
317 AC_SUBST(GST_PLUGINS_ALL)
318
319 GST_PLUGINS_SELECTED=""
320
321 AC_ARG_WITH(plugins,
322     AC_HELP_STRING([--with-plugins],[comma-separated list of plug-ins to compile]),
323     [for i in `echo $withval | tr , ' '`; do
324         if echo $GST_PLUGINS_ALL | grep $i > /dev/null
325         then
326             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
327         else
328             echo "plug-in $i not recognized, ignoring..."
329         fi
330     done],
331     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
332
333 AC_SUBST(GST_PLUGINS_SELECTED)
334
335 dnl ==========================================================================
336 dnl ============================= sys plug-ins ================================
337 dnl ==========================================================================
338
339 dnl *** OSS audio *** (Linux, *BSD)
340 translit(dnm, m, l) AM_CONDITIONAL(USE_OSS, true)
341 GST_CHECK_FEATURE(OSS, [OSS audio], osssrc osssink, [
342  HAVE_OSS="yes"
343 dnl Linux and newer BSD versions :
344  AC_CHECK_HEADER(sys/soundcard.h, [
345    AC_DEFINE(HAVE_OSS_INCLUDE_IN_SYS,, [Define if OSS includes are in /sys/])
346    ] , [
347 dnl Some old BSD versions :
348    AC_CHECK_HEADER(soundcard.h, [
349      AC_DEFINE(HAVE_OSS_INCLUDE_IN_ROOT,, [Define if OSS includes are in /])
350      ], [
351   dnl Some old BSD versions :
352      AC_CHECK_HEADER(machine/soundcard.h, [
353        AC_DEFINE(HAVE_OSS_INCLUDE_IN_MACHINE,, [Define if OSS includes are in /machine/])
354        ], [
355        HAVE_OSS="no"
356      ])
357    ])
358  ])
359 ])
360
361 dnl ###########################
362 dnl # Configure external libs #
363 dnl ###########################
364
365 dnl *** aalib ***
366 translit(dnm, m, l) AM_CONDITIONAL(USE_AALIB, true)
367 GST_CHECK_FEATURE(AALIB, [aasink plug-in], aasink, [
368   AM_PATH_AALIB(, HAVE_AALIB=yes, HAVE_AALIB=no)
369   AS_SCRUB_INCLUDE(AALIB_CFLAGS)
370 ])
371
372 dnl *** AMR-NB ***
373 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
374 GST_CHECK_FEATURE(AMRNB, [AMR-NB], amrnbdec amrnbenc, [
375   GST_CHECK_LIBHEADER(AMRNB, amrnb,
376                       Decoder_Interface_init, -lm,
377                       amrnb/interf_dec.h,
378                       AMRNB_LIBS="-lamrnb -lm"
379                       AC_SUBST(AMRNB_LIBS))
380 ])
381
382 dnl **** ESound ****
383 translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
384 GST_CHECK_FEATURE(ESD, [esound plug-ins], esdsink, [
385   PKG_CHECK_MODULES(ESD, esound >= 0.2.12, [
386     HAVE_ESD="yes"
387     AC_SUBST(ESD_CFLAGS)
388     AC_SUBST(ESD_LIBS)
389   ], [
390     AM_PATH_ESD(0.2.12, HAVE_ESD="yes", HAVE_ESD="no")
391     AS_SCRUB_INCLUDE(ESD_CFLAGS)
392   ])
393 ])
394
395 dnl **** Free AAC Decoder (FAAD) ****
396 translit(dnm, m, l) AM_CONDITIONAL(USE_FAAD, true)
397 GST_CHECK_FEATURE(FAAD, [AAC decoder plug-in], faad, [
398   HAVE_FAAD="yes"
399   GST_CHECK_LIBHEADER(FAAD, faad, faacDecOpen, -lm, faad.h, FAAD_LIBS="-lfaad -lm", HAVE_FAAD="no")
400   if test $HAVE_FAAD = "yes"; then
401     AC_MSG_CHECKING([Checking for FAAD >= 2])
402     AC_TRY_RUN([
403
404 #include <faad.h>
405 #if !defined(FAAD2_VERSION) || !defined(FAAD_FMT_DOUBLE)
406 #error Not faad2
407 #else
408 #include <string.h>
409
410 int main()
411 {
412 char version[9] = FAAD2_VERSION;
413 // a release candidate of 2.0 is not enought for us
414 if ( strstr( version, "2.0 RC" ) ) { return 1; }
415
416 return 0;
417 }
418
419 #endif
420     ],
421        [ HAVE_FAAD="yes" && AC_MSG_RESULT(yes)],
422        [ HAVE_FAAD="no"  && AC_MSG_RESULT(no)])
423   fi;
424   AS_SCRUB_INCLUDE(FAAD_CFLAGS)
425   AC_SUBST(FAAD_LIBS)
426 ])
427
428 dnl *** FLAC ***
429 translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
430 GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flacenc flacdec, [
431   GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__seekable_stream_encoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC -lm")
432   dnl API change in FLAC 1.1.1, so require that...
433   if test x$HAVE_FLAC = xyes; then
434     AC_CHECK_DECL(FLAC__SEEKABLE_STREAM_ENCODER_TELL_ERROR,
435                   HAVE_FLAC="yes", HAVE_FLAC="no", [
436 #include <FLAC/seekable_stream_encoder.h>
437                   ])
438   fi
439   AC_SUBST(FLAC_LIBS)
440 ])
441
442 dnl *** jpeg ***
443 dnl FIXME: we could use header checks here as well IMO
444 translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
445 GST_CHECK_FEATURE(JPEG, [jpeg], jpegenc jpegdec, [
446   AC_ARG_WITH(jpeg-mmx,
447     [  --with-jpeg-mmx, path to MMX'ified JPEG library])
448   OLD_LIBS="$LIBS"
449   if test x$with_jpeg_mmx != x; then
450     LIBS="$LIBS -L$with_jpeg_mmx"
451   fi
452   AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
453   JPEG_LIBS="$LIBS -ljpeg-mmx"
454   LIBS="$OLD_LIBS"
455   if test x$HAVE_JPEG != xyes; then
456     AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
457     JPEG_LIBS="-ljpeg"
458   fi
459   AC_SUBST(JPEG_LIBS)
460 ])
461
462
463 dnl *** ladspa ***
464 translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
465 GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
466   AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA="yes", HAVE_LADSPA="no")
467 ])
468
469 dnl *** lame ***
470 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
471 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
472   GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h,
473   [
474     HAVE_LAME="yes"
475     LAME_LIBS="-lmp3lame -lm"
476     dnl is lame presets available
477     LAME_CFLAGS=""
478     AC_TRY_RUN([
479 #include <lame/lame.h>
480 int main (int argc, char *argv[])
481 {
482   printf("%d\n", MEDIUM);
483   return 0;
484 }
485       ],
486       [LAME_CFLAGS="-DGSTLAME_PRESET"],
487       [LAME_CFLAGS=""]
488     )
489   AC_SUBST(LAME_CFLAGS)
490   AC_SUBST(LAME_LIBS)
491   ])
492 ])
493
494 dnl *** libcaca ***
495 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBCACA, true)
496 GST_CHECK_FEATURE(LIBCACA, [libcaca], libcaca, [
497   GST_CHECK_CONFIGPROG(LIBCACA, caca-config)
498   AC_SUBST(LIBCACA_CFLAGS)
499   AC_SUBST(LIBCACA_LIBS)
500 ])
501
502 dnl *** libdv ***
503 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBDV, true)
504 GST_CHECK_FEATURE(LIBDV, [libdv DV/video decoder], dvdec, [
505   PKG_CHECK_MODULES(LIBDV, libdv >= 0.100, HAVE_LIBDV="yes", HAVE_LIBDV="no")
506   AC_SUBST(LIBDV_CFLAGS)
507   AC_SUBST(LIBDV_LIBS)
508 ])
509
510 dnl *** libpng ***
511 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
512 GST_CHECK_FEATURE(LIBPNG, [libpng PNG encoder], pngenc, [
513   PKG_CHECK_MODULES(LIBPNG, libpng12, HAVE_LIBPNG="yes", HAVE_LIBPNG="no")
514   AC_SUBST(LIBPNG_CFLAGS)
515   AC_SUBST(LIBPNG_LIBS)
516 ])
517
518 dnl *** mad ***
519 dnl FIXME: we could use header checks here as well IMO
520 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
521 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
522   dnl check with pkg-config first
523   PKG_CHECK_MODULES(MAD, mad >= 0.15 id3tag >= 0.15, HAVE_MAD="yes", HAVE_MAD="no")
524   if test "x$HAVE_MAD" = "xno"; then
525     dnl fall back to oldskool detection
526     AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad")
527     if test "x$HAVE_MAD" = "xyes"; then
528       HAVE_MAD="no"
529       save_LIBS=$LIBS
530       LIBS="-lz"
531       AC_CHECK_LIB(id3tag, id3_tag_options, HAVE_MAD="yes" MAD_LIBS="-lmad -lid3tag -lz")
532       LIBS=$save_LIBS
533     fi
534   fi    
535 ])
536 AC_SUBST(MAD_LIBS)
537
538 dnl *** mpeg2dec ***
539 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
540 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
541   PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0,
542       HAVE_MPEG2DEC="yes", HAVE_MPEG2DEC="no")
543   AC_SUBST(MPEG2DEC_CFLAGS)
544   AC_SUBST(MPEG2DEC_LIBS)
545 ])
546
547 dnl *** dv1394 ***
548 translit(dnm, m, l) AM_CONDITIONAL(USE_DV1394, true)
549 GST_CHECK_FEATURE(DV1394, [raw1394 and avc1394 library], dv1394src, [
550   dnl we need to test three headers and three libs
551   GST_CHECK_LIBHEADER(RAW1394,
552     raw1394, raw1394_new_handle,,
553     libraw1394/raw1394.h, RAW1394_LIBS="-lraw1394")
554   GST_CHECK_LIBHEADER(AVC1394,
555     avc1394, avc1394_send_command, $RAW1394_LIBS,
556     libavc1394/avc1394.h, AVC1394_LIBS="-lavc1394")
557   GST_CHECK_LIBHEADER(ROM1394,
558     rom1394, rom1394_free_directory, $RAW1394_LIBS,
559     libavc1394/rom1394.h, ROM1394_LIBS="-lrom1394")
560
561   dnl now see how far we got
562   if test x$HAVE_RAW1394 = xyes && \
563      test x$HAVE_AVC1394 = xyes && \
564      test x$HAVE_ROM1394 = xyes; then
565        HAVE_DV1394=yes
566        DV1394_LIBS="$RAW1394_LIBS $AVC1394_LIBS $ROM1394_LIBS"
567        AC_SUBST(DV1394_LIBS)
568   else
569        HAVE_DV1394=no
570   fi
571 ])
572
573 dnl *** shout2 ***
574 translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
575 GST_CHECK_FEATURE(SHOUT2, [shout2 plug-in], shout2send, [
576   PKG_CHECK_MODULES(SHOUT2, shout >= 2.0, [
577     HAVE_SHOUT2="yes"
578     AC_SUBST(SHOUT2_CFLAGS)
579     AC_SUBST(SHOUT2_LIBS)
580   ], [
581     AM_PATH_SHOUT2(HAVE_SHOUT2="yes", HAVE_SHOUT2="no")
582     AC_SUBST(SHOUT2_CFLAGS)
583     AC_SUBST(SHOUT2_LIBS)
584   ])
585 ])
586
587 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
588 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
589 GST_CHECK_FEATURE(SIDPLAY, [sidplay plug-in], sidplay, [
590   GST_PATH_SIDPLAY()
591 ])
592
593 dnl *** speex >= 1.0.4 or >= 1.1.5 ***
594 dnl   1.1.4 and earlier were not API/ABI compatible with 1.0
595 dnl   1.1.6 is the first to use a .pc/pkg-config file ***
596 dnl   speex_jitter.h is 1.1.x only
597 translit(dnm, m, l) AM_CONDITIONAL(USE_SPEEX, true)
598 GST_CHECK_FEATURE(SPEEX, [speex plug-in], speex, [
599   PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, [
600     HAVE_SPEEX="yes"
601     AC_SUBST(SPEEX_CFLAGS)
602     AC_SUBST(SPEEX_LIBS)
603   ], [
604     GST_CHECK_LIBHEADER(SPEEX, speex, speex_bits_init, , speex/speex.h, [
605       AC_CHECK_HEADER(speex/speex_jitter.h, [
606         dnl speex 1.1.x :
607         GST_CHECK_LIBHEADER(SPEEX, speex, speex_encode_int, , speex/speex.h, [
608           dnl speex 1.1.5 or + :
609           HAVE_SPEEX="yes"
610           SPEEX_LIBS="-lspeex"
611           AC_SUBST(SPEEX_CFLAGS)
612           AC_SUBST(SPEEX_LIBS)
613         ],[
614           HAVE_SPEEX="no"
615         ])
616       ],[
617         dnl speex 1.0.x :
618           AC_CHECK_DECL(SPEEX_GET_LOOKAHEAD, [
619             dnl speex 1.0.4
620             HAVE_SPEEX="yes"
621             SPEEX_LIBS="-lspeex"
622             AC_SUBST(SPEEX_CFLAGS)
623             AC_SUBST(SPEEX_LIBS)
624
625             AC_DEFINE_UNQUOTED(SPEEX_1_0, 1,
626               [defined if speex 1.0.x API detected])
627         ],[
628             HAVE_SPEEX="no"
629             AC_MSG_NOTICE(You need at least 1.0.4 to compile the speex plugin)
630         ], [
631 #include <speex/speex.h>
632         ])
633       ])
634     ])
635   ])
636 ])
637
638 dnl also add builddir include for enumtypes and marshal
639 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GST_ERROR"
640
641 AC_SUBST(GST_LIBS)
642 AC_SUBST(GST_CFLAGS)
643
644 dnl ############################
645 dnl # Set up some more defines #
646 dnl ############################
647
648 dnl set license and copyright notice
649 AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
650
651 dnl package name in plugins
652 AC_ARG_WITH(package-name,
653 AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
654 [case "${withval}" in
655   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
656   no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
657   *) GST_PACKAGE="${withval}" ;;
658 esac], 
659 [
660 dnl default value
661 if test "x$GST_CVS" = "xyes"
662 then
663   dnl nano >= 1
664   GST_PACKAGE="GStreamer CVS/prerelease"
665 else
666   GST_PACKAGE="GStreamer source release"
667 fi
668 ]
669 )
670 AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
671 AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
672
673 dnl package origin URL
674 AC_ARG_WITH(package-origin,
675 AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
676 [case "${withval}" in
677   yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
678   no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
679   *) GST_ORIGIN="${withval}" ;;
680 esac], 
681 [GST_ORIGIN="http://gstreamer.freedesktop.org/"]) dnl Default value
682 AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
683 AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
684
685 dnl #########################
686 dnl # Make the output files #
687 dnl #########################
688
689 AC_CONFIG_FILES(
690 Makefile
691 gst-plugins.spec
692 gst/Makefile
693 gst/alpha/Makefile
694 gst/autodetect/Makefile
695 gst/avi/Makefile
696 gst/effectv/Makefile
697 gst/fdsrc/Makefile
698 gst/goom/Makefile
699 gst/law/Makefile
700 gst/level/Makefile
701 gst/mpegaudioparse/Makefile
702 gst/realmedia/Makefile
703 gst/rtp/Makefile
704 gst/rtsp/Makefile
705 gst/smpte/Makefile
706 gst/silence/Makefile
707 gst/udp/Makefile
708 gst/videobox/Makefile
709 gst/videofilter/Makefile
710 ext/jpeg/Makefile
711 gst/qtdemux/Makefile
712 gst/wavparse/Makefile
713 gst-libs/Makefile
714 gst-libs/gst/Makefile
715 sys/Makefile
716 sys/oss/Makefile
717 ext/Makefile
718 ext/aalib/Makefile
719 ext/dv/Makefile
720 ext/flac/Makefile
721 ext/gconf/Makefile
722 ext/ladspa/Makefile
723 ext/lame/Makefile
724 ext/libcaca/Makefile
725 ext/libpng/Makefile
726 ext/mad/Makefile
727 ext/raw1394/Makefile
728 ext/shout2/Makefile
729 ext/sidplay/Makefile
730 ext/speex/Makefile
731 ext/esd/Makefile
732 ext/mpeg2dec/Makefile
733 ext/faad/Makefile
734 ext/amrnb/Makefile
735 po/Makefile.in
736 common/Makefile
737 common/m4/Makefile
738 m4/Makefile
739 )
740 AC_OUTPUT
741
742 echo -n "configure: *** Plug-ins that will be built :"
743 echo -e "$GST_PLUGINS_YES" | sort
744 echo
745 echo -n "configure: *** Plug-ins that will not be built :"
746 echo -e "$GST_PLUGINS_NO" | sort
747 echo
748 if test "x$BUILD_EXTERNAL" = "xno"; then
749   echo "configure: *** No external plug-ins will be built"
750 fi