2a55242a148b7180ef52ccbae459e76b4dd526b7
[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 when going to/from release please set the nano (fourth number) right !
11 dnl We disable static building for development, for time savings
12 AM_DISABLE_STATIC
13 AS_VERSION(gst-plugins, GST_PLUGINS, 0, 3, 4, 1)
14 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
15 AS_LIBTOOL(GST_PLUGINS, 0, 0, 0, yes)
16
17 dnl we'll move this to a configure option later on which will be turned on
18 dnl by autogen
19 dnl GST_ERROR="-Wall -Werror"
20 GST_ERROR="-Werror"
21
22 dnl FIXME take something else ?
23 AC_CONFIG_SRCDIR([gst/law/alaw.c])
24 AM_CONFIG_HEADER(config.h)
25
26 ##AUTOMAKE="$AUTOMAKE"
27 dnl Add parameters for aclocal
28 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
29 ACLOCAL="$ACLOCAL -I m4 -I common/m4 $ACLOCAL_FLAGS"
30
31 AM_MAINTAINER_MODE
32
33 AC_PROG_CC
34 AM_PROG_CC_STDC
35 AM_PROG_AS
36 AS="${CC}"
37 AC_PROG_CXX
38 AC_PROG_CXXCPP
39 AC_ISC_POSIX
40
41 AC_HEADER_STDC([])
42
43 dnl ###########################################
44 dnl # Super Duper options for plugin building #
45 dnl ###########################################
46
47 dnl experimental plugins; stuff that hasn't had the dust settle yet
48 dnl read 'builds, but might not work'UTO
49 GST_CHECK_FEATURE(EXPERIMENTAL, [enable building of experimental plugins],,
50 [HAVE_EXPERIMENTAL=yes],disabled,
51 [
52   AC_MSG_WARN(building experimental plugins)
53   USE_TARKIN="yes"
54 ],[
55   AC_MSG_NOTICE(not building experimental plugins)
56   USE_TARKIN="no"
57 ])
58
59 dnl broken plugins; stuff that doesn't seem to build at the moment
60 GST_CHECK_FEATURE(BROKEN, [enable building of broken plugins],,
61 HAVE_BROKEN=yes,disabled,
62 [  
63   AC_MSG_WARN([building broken plugins -- no bug reports on these, only patches :)])
64   USE_SMOOTHWAVE="yes"
65   USE_VGA="yes"
66   USE_XMMS="yes"
67   USE_ARTS="yes"
68 ],[
69   USE_SMOOTHWAVE="no"
70   USE_VGA="no"
71   USE_XMMS="no"
72   USE_ARTS="no"
73   AC_MSG_NOTICE(not building broken plugins)
74 ])
75
76 dnl ##############################
77 dnl # Do automated configuration #
78 dnl ##############################
79
80 dnl Check for tools:
81 dnl ================
82
83 dnl allow for different autotools
84 AS_AUTOTOOLS_ALTERNATE()
85
86 dnl modify pkg-config path
87 AC_ARG_WITH(pkg-config-path, 
88    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
89    [export PKG_CONFIG_PATH=${withval}])
90
91 dnl Check for nasm
92 AC_PATH_PROG(NASM_PATH, nasm, no)
93 AC_SUBST(NASM_PATH)
94 if test x$NASM_PATH = xno; then
95   AC_MSG_WARN(Couldn't find nasm)
96   HAVE_NASM="no"
97 else
98   AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
99   HAVE_NASM="yes"
100 fi
101
102 dnl check for gconf
103 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONF, true)
104 GST_CHECK_FEATURE(GCONF, [GConf stuff], , [
105   AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
106   if test x$GCONFTOOL = xno; then
107     AC_MSG_WARN(Not installing GConf schemas)
108     HAVE_GCONF="no"
109   else
110     AM_GCONF_SOURCE_2
111     HAVE_GCONF="yes"
112   fi
113   AC_SUBST(HAVE_GCONF)
114 ])
115
116 dnl check for gstreamer; uninstalled is selected preferentially -- see pkg-config(1)
117 PKG_CHECK_MODULES(GST, gstreamer >= $GST_PLUGINS_MAJOR.$GST_PLUGINS_MINOR.$GST_PLUGINS_MICRO,
118   HAVE_GST="yes", HAVE_GST="no")
119
120 if test "x$HAVE_GST" = "xno"; then
121   AC_MSG_ERROR(no GStreamer found)
122 fi
123
124 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer`
125 if test -z $GST_TOOLS_DIR; then
126   AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
127 fi
128 AC_SUBST(GST_TOOLS_DIR)
129
130 dnl Set up conditionals for (target) architecture:
131 dnl ==============================================
132
133 dnl Determine CPU
134 case "x${target_cpu}" in
135   xi?86 | k?) HAVE_CPU_I386=yes
136               AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
137               dnl FIXME could use some better detection
138               dnl       (ie CPUID)
139               case "x${target_cpu}" in
140                 xi386 | xi486) ;;
141                 *)             AC_DEFINE(HAVE_RDTSC, 1, [Define if RDTSC is available]) ;;
142               esac ;;
143   xpowerpc)   HAVE_CPU_PPC=yes
144               AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
145   xalpha)     HAVE_CPU_ALPHA=yes
146               AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
147   xarm*)      HAVE_CPU_ARM=yes
148               AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
149   xsparc*)    HAVE_CPU_SPARC=yes
150               AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
151   xmips*)     HAVE_CPU_MIPS=yes
152               AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;;
153   xhppa*)     HAVE_CPU_HPPA=yes
154               AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;;
155 esac
156
157 dnl Determine endianness
158 AC_C_BIGENDIAN
159
160 dnl Check for fast float to int casting as defined in C99
161 AC_C99_FUNC_LRINT()
162 AC_C99_FUNC_LRINTF()
163
164 dnl Check for essential libraries first:
165 dnl ====================================
166
167 GST_GLIB2_CHECK()
168 PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK=yes, HAVE_GTK=no)
169 GTK_CFLAGS=$GTK2_CFLAGS
170 GTK_LIBS=$GTK2_LIBS
171 AC_SUBST(GTK_LIBS)
172 AC_SUBST(GTK_CFLAGS)
173
174 dnl Check for X11 extensions
175 AC_PATH_XTRA
176 if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
177   AC_MSG_NOTICE([cannot find X11, the build system needs fixage])
178 fi
179 AC_SUBST(X_CFLAGS)
180 AC_SUBST(X_PRE_LIBS)
181 AC_SUBST(X_EXTRA_LIBS)
182 AC_SUBST(X_LIBS)
183
184 dnl ==========================================================================
185 dnl ============================= gst plugins ================================
186 dnl ==========================================================================
187 GST_PLUGIN_LDFLAGS='-module -avoid-version'
188 AC_SUBST(GST_PLUGIN_LDFLAGS)
189
190 dnl these are all the gst plugins, compilable without additional libs
191 GST_PLUGINS_ALL="\
192         ac3parse adder audioscale auparse avi cdxaparse chart\
193         cutter deinterlace effectv festival filter flx goom intfloat law level\
194         median mpeg1enc mpeg1sys mpeg1videoparse mpeg2enc mpeg2sub\
195         mpegaudio mpegaudioparse mpegstream mpegtypes modplug\
196         monoscope passthrough playondemand qtdemux rtjpeg silence sine\
197         smooth spectrum speed stereo stereomono\
198         synaesthesia udp videoscale volenv volume vumeter wavparse y4m"
199
200 AC_SUBST(GST_PLUGINS_ALL)
201
202 GST_PLUGINS_SELECTED=""
203
204 AC_ARG_WITH(plugins,
205     AC_HELP_STRING([--with-plugins],[comma-separated list of plugins to compile]),
206     [for i in `echo $withval | tr , ' '`; do
207         if test -n `echo $i | grep $GST_PLUGINS_ALL`; then
208             GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
209         else
210             echo "plugin $i not recognized, ignoring..."
211         fi
212     done],
213     [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
214
215 AC_SUBST(GST_PLUGINS_SELECTED)
216
217 dnl ==========================================================================
218 dnl ============================= sys plugins ================================
219 dnl ==========================================================================
220
221 dnl *** DXR3 card ***
222 translit(dnm, m, l) AM_CONDITIONAL(USE_DXR3, true)
223 GST_CHECK_FEATURE(DXR3, [DXR3 hardware mpeg video decoder], dxr3videosink, [
224   AC_CHECK_HEADER(linux/em8300.h, HAVE_DXR3="yes", HAVE_DXR3="no")
225 ])
226
227 dnl *** OSS audio ***
228 translit(dnm, m, l) AM_CONDITIONAL(USE_OSS, true)
229 GST_CHECK_FEATURE(OSS, [OSS audio], osssrc osssink, [
230   AC_CHECK_HEADER(sys/soundcard.h, HAVE_OSS="yes", HAVE_OSS="no")
231 ])
232
233 dnl *** QuickCam ***
234 translit(dnm, m, l) AM_CONDITIONAL(USE_QCAM, true)
235 GST_CHECK_FEATURE(QCAM, [QuickCam], qcamsrc, [
236 dnl this one is for hadess, no qcam when no nasm found
237   if test "x$HAVE_NASM" = "xno";
238   then
239     HAVE_QCAM="no"
240     AC_MSG_WARN([QuickCam needs nasm])
241   else
242     HAVE_QCAM="yes"
243   fi
244 ])
245
246 dnl *** Video 4 Linux ***
247 translit(dnm, m, l) AM_CONDITIONAL(USE_V4L, true)
248 GST_CHECK_FEATURE(V4L, [Video 4 Linux], v4lsrc v4lmjpegsrc v4lmjpegsink, [
249   AC_CHECK_DECL(VID_TYPE_MPEG_ENCODER, HAVE_V4L="yes", HAVE_V4L="no", [#include <linux/videodev.h>])
250 ])
251
252 dnl *** Video CD ***
253 translit(dnm, m, l) AM_CONDITIONAL(USE_VCD, true)
254 GST_CHECK_FEATURE(VCD, [Video CD], vcdsrc, [
255   AC_CHECK_HEADER(linux/cdrom.h, HAVE_VCD="yes", HAVE_VCD="no")
256 ])
257
258 dnl *** VGA ***
259 translit(dnm, m, l) AM_CONDITIONAL(USE_VGA, true)
260 GST_CHECK_FEATURE(VGA, [VGA], vgavideosink, [
261   AC_CHECK_HEADER(asm/vga.h, HAVE_VGA="yes", HAVE_VGA="no")
262 ])
263
264 dnl *** XVideo ***
265 dnl Look for the PIC library first, Debian requires it.
266 dnl Check debian-devel archives for gory details.
267 dnl 20020110:
268 dnl At the moment XFree86 doesn't distribute shared libXv due
269 dnl to unstable API.  On many platforms you CAN NOT link a shared
270 dnl lib to a static non-PIC lib.  This is what the xvideo GStreamer
271 dnl plugin wants to do.  So Debian distributes a PIC compiled
272 dnl version of the static lib for plugins to link to when it is
273 dnl inappropriate to link the main application to libXv directly.
274 dnl FIXME: add check if this platform can support linking to a
275 dnl        non-PIC libXv, if not then don not use Xv.
276 dnl FIXME: perhaps warn user if they have a shared libXv since
277 dnl        this is an error until XFree86 starts shipping one
278 translit(dnm, m, l) AM_CONDITIONAL(USE_XVIDEO, true)
279 GST_CHECK_FEATURE(XVIDEO, [X11 XVideo extensions], xvideosink videosink, [
280   dnl check for PIC static lib
281   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")
282   if test x$HAVE_XVIDEO = xno; then
283     dnl PIC lib not found, check for regular lib
284     GST_CHECK_LIBHEADER(XVIDEO, Xv, XvQueryExtension, $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS, X11/extensions/Xvlib.h, XVIDEO_LIBS="-lXv -lXext")
285   fi
286   AC_SUBST(XVIDEO_LIBS)
287 ])
288
289 dnl Next, check for the optional libraries:
290 dnl These are all libraries used in building plugins
291 dnl ================================================
292 dnl let's try and sort them alphabetically, shall we ?
293
294 AC_MSG_NOTICE(Checking for plugin libraries)
295
296 dnl *** a52dec ***
297 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
298 GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
299   AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
300 ])
301
302 dnl *** aalib ***
303 translit(dnm, m, l) AM_CONDITIONAL(USE_AALIB, true)
304 GST_CHECK_FEATURE(AALIB, [aasink plugin], aasink, [
305   AM_PATH_AALIB(, HAVE_AALIB=yes, HAVE_AALIB=no)
306 ])
307
308 dnl *** alsa ***
309 translit(dnm, m, l) AM_CONDITIONAL(USE_ALSA, true)
310 GST_CHECK_FEATURE(ALSA, [alsa plugins], gstalsa, [
311    AM_PATH_ALSA(0.9.0, HAVE_ALSA=yes, HAVE_ALSA=no)
312 ])
313
314 dnl *** arts ***
315 dnl if mcopidl can't be found there's no use in compiling it
316 AC_CHECK_PROG(MCOPIDL, mcopidl, yes, no)
317 if test "xHAVE_MCOPIDL" = "xno";
318 then
319   USE_ARTS=no
320 fi
321
322 translit(dnm, m, l) AM_CONDITIONAL(USE_ARTS, true)
323 GST_CHECK_FEATURE(ARTS, [arts plugins], arts, [
324   AM_PATH_ARTS(, HAVE_ARTS=yes, HAVE_ARTS=no)
325 ])
326
327 dnl *** artsc ***
328 translit(dnm, m, l) AM_CONDITIONAL(USE_ARTSC, true)
329 GST_CHECK_FEATURE(ARTSC, [artsd plugins], artsdsink, [
330   GST_CHECK_ARTSC()
331 ])
332
333 dnl *** audiofile ***
334 dnl this check uses the GST_CHECK_CONFIGPROG macro
335 translit(dnm, m, l) AM_CONDITIONAL(USE_AUDIOFILE, true)
336 GST_CHECK_FEATURE(AUDIOFILE, [audiofile], afsink afsrc, [
337   translit(dnm, m, l) AC_SUBST(AUDIOFILE_LIBS)
338   translit(dnm, m, l) AC_SUBST(AUDIOFILE_CFLAGS)
339   GST_CHECK_CONFIGPROG(AUDIOFILE, audiofile-config)
340 ])
341
342 dnl *** avifile ***
343 dnl this check uses the GST_CHECK_CONFIGPROG macro
344 dnl this check needs more fixing
345 dnl translit(dnm, m, l) AC_SUBST(AVIFILE_LIBS)
346 translit(dnm, m, l) AM_CONDITIONAL(USE_AVIFILE, true)
347 GST_CHECK_FEATURE(AVIFILE, [avifile], windec winenc, [
348   translit(dnm, m, l) AC_SUBST(AVIFILE_CFLAGS)
349   GST_CHECK_CONFIGPROG(AVIFILE, avifile-config)
350   AVIFILE_LIBS="$AVIFILE_LIBS -lstdc++"
351   AC_SUBST(AVIFILE_LIBS)
352 ])
353
354 dnl *** CDParanoia ***
355 translit(dnm, m, l) AM_CONDITIONAL(USE_CDPARANOIA, true)
356 GST_CHECK_FEATURE(CDPARANOIA, [CDParanoia], cdparanoia, [
357   GST_CHECK_LIBHEADER(CDPARANOIA, cdda_interface, cdda_open, -lm, cdda_interface.h, CDPARANOIA_LIBS="-lcdda_interface -lcdda_paranoia")
358   AC_SUBST(CDPARANOIA_LIBS)
359 ])
360 dnl FIXME : add second check somehow if that is necessary
361 dnl AC_CHECK_LIB(cdda_paranoia, paranoia_init, : , HAVE_CDPARANOIA=no, -lcdda_interface )
362 dnl AC_CHECK_HEADER(cdda_paranoia.h, :, HAVE_CDPARANOIA=no)
363
364 dnl *** dv ***
365 translit(dnm, m, l) AM_CONDITIONAL(USE_DV, true)
366 GST_CHECK_FEATURE(DV, [dv library], dv, [
367   AM_PATH_LIBDV(HAVE_DV=yes, HAVE_DV=no)
368   AC_SUBST(DV_LIBS)
369 ])
370
371 dnl *** dvdread ***
372 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
373 GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
374   GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
375   AC_SUBST(DVDREAD_LIBS)
376 ])
377
378 dnl *** dvdnav ***
379 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDNAV, true)
380 GST_CHECK_FEATURE(DVDNAV, [dvdnav library], dvdnavsrc, [
381   translit(dnm, m, l) AC_SUBST(DVDNAV_LIBS)
382   translit(dnm, m, l) AC_SUBST(DVDNAV_CFLAGS)
383   GST_CHECK_CONFIGPROG(DVDNAV, dvdnav-config)
384 ])
385
386 dnl **** ESound ****
387 translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
388 GST_CHECK_FEATURE(ESD, [esound plugins], esdsink esdmon, [
389   AM_PATH_ESD(0.2.12, HAVE_ESD=yes, HAVE_ESD=no)
390 ])
391
392 dnl **** festival ****
393 dnl translit(dnm, m, l) AM_CONDITIONAL(USE_FESTIVAL, true)
394 dnl GST_CHECK_FEATURE(FESTIVAL, [festival plugins], festivalsrc, [
395   dnl NOTE: just using local net connection now, add this lib check
396   dnl       in the future if needed
397   dnl AC_LANG_PUSH(C++)
398   dnl dnl FIXME: took out func to check for
399   dnl dnl This check puts festival_tidy_up in extern "C".
400   dnl dnl But, at least on Debian as of 20020110, it is compiled with name
401   dnl dnl mangling C++ nonsense and symbols can't resolve
402   dnl dnl GST_CHECK_LIBHEADER(FESTIVAL, Festival, festival_tidy_up, , festival/festival.h, FESTIVAL_LIBS="-lFestival")
403   dnl GST_CHECK_LIBHEADER(FESTIVAL, Festival, , , festival/festival.h, FESTIVAL_LIBS="-lFestival")
404   dnl AC_LANG_POP(C++)
405   dnl AC_SUBST(FESTIVAL_LIBS)
406 dnl  HAVE_FESTIVAL=yes
407 dnl])
408
409 dnl *** FLAC ***
410 translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
411 GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flacenc flacdec, [
412   GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__stream_decoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC")
413   AC_SUBST(FLAC_LIBS)
414 ])
415
416 dnl *** Gnome VFS ***
417 translit(dnm, m, l) AM_CONDITIONAL(USE_GNOME_VFS, true)
418 GST_CHECK_FEATURE(GNOME_VFS, [Gnome VFS], gnomevfssrc, [
419   PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0, HAVE_GNOME_VFS="yes", HAVE_GNOME_VFS="no")
420   AC_SUBST(GNOME_VFS_CFLAGS)
421   AC_SUBST(GNOME_VFS_LIBS)
422 ])
423
424 dnl *** gsm ***
425 translit(dnm, m, l) AM_CONDITIONAL(USE_GSM, true)
426 GST_CHECK_FEATURE(GSM, [GSM library], gsmenc gsmdec, [
427   GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm.h, GSM_LIBS="-lgsm")
428   if test $HAVE_GSM != "yes"; then
429     GST_CHECK_LIBHEADER(GSM, gsm, gsm_create, , gsm/gsm.h, GSM_LIBS="-lgsm")
430     if test $HAVE_GSM = "yes"; then 
431       AC_DEFINE(GSM_HEADER_IN_SUBDIR, 1, [Define if GSM header in gsm/ subdir])
432     fi
433   fi
434   AC_SUBST(GSM_LIBS)
435 ])
436
437 dnl *** Hermes ***
438 translit(dnm, m, l) AM_CONDITIONAL(USE_HERMES, true)
439 GST_CHECK_FEATURE(HERMES, [Hermes library], colorspace, [
440   GST_CHECK_LIBHEADER(HERMES, Hermes, Hermes_ConverterInstance, , Hermes/Hermes.h, HERMES_LIBS="-lHermes")
441 ], AC_SUBST(HERMES_LIBS))
442
443 dnl *** http ***
444 translit(dnm, m, l) AM_CONDITIONAL(USE_HTTP, true)
445 GST_CHECK_FEATURE(HTTP, [http plugins], gsthttpsrc, [
446   dnl FIXME: need to check for header
447   GHTTP_LIBS=
448   GST_HTTPSRC_GET_TYPE=
449   if test x$USE_GLIB2 = xyes; then
450     AC_MSG_WARN(ghttp disabled for glib2.0)
451   else
452     AC_CHECK_LIB(ghttp, ghttp_request_new,
453       [HTTP_LIBS="-lghttp"
454        GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
455        HAVE_HTTP=yes
456       ], :, $LIBS)
457   fi
458   AC_SUBST(HTTP_LIBS)
459   AC_SUBST(GST_HTTPSRC_GET_TYPE)
460 ])
461
462 dnl *** Jack ***
463 translit(dnm, m, l) AM_CONDITIONAL(USE_JACK, true)
464 GST_CHECK_FEATURE(JACK, Jack, jack, [
465   PKG_CHECK_MODULES(JACK, jack >= 0.29.0, HAVE_JACK="yes", HAVE_JACK="no")
466   AC_SUBST(JACK_CFLAGS)
467   AC_SUBST(JACK_LIBS)
468 ])
469
470 dnl *** jpeg ***
471 dnl FIXME: we could use header checks here as well IMO
472 translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
473 GST_CHECK_FEATURE(JPEG, [jpeg], jpegenc jpegdec, [
474   AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
475   JPEG_LIBS="-ljpeg"
476   AC_SUBST(JPEG_LIBS)
477 ])
478
479 dnl *** ladspa ***
480 translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
481 GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
482   AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA="yes", HAVE_LADSPA="no")
483 ])
484
485 dnl *** lame ***
486 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
487 GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
488   GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, -lm, lame/lame.h, HAVE_LAME="yes" LAME_LIBS="-lmp3lame")
489 ])
490 AC_SUBST(LAME_LIBS)
491
492 dnl *** libcolorspace ***
493 translit(dnm, m, l) AM_CONDITIONAL(USE_LCS, true)
494 GST_CHECK_FEATURE(LCS, Lcs, lcs, [
495   PKG_CHECK_MODULES(LCS, lcs, HAVE_LCS="yes", HAVE_LCS="no")
496   AC_SUBST(LCS_CFLAGS)
497   AC_SUBST(LCS_LIBS)
498 ])
499
500 dnl *** libfame ***
501 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBFAME, true)
502 GST_CHECK_FEATURE(LIBFAME, [libfame MPEG1/4 encoder], libfame, [
503   AM_PATH_LIBFAME(0.9.0, HAVE_LIBFAME="yes", HAVE_LIBFAME="no")
504   AC_SUBST(LIBFAME_CFLAGS)
505   AC_SUBST(LIBFAME_LIBS)
506 ])
507
508 dnl FIXME : check if these CPP flags can be dealt with otherwise
509 dnl libdvcheck_save_CPPFLAGS="$CPPFLAGS"
510 dnl CPPFLAGS="$CPPFLAGS $GST_CFLAGS"
511 dnl AC_CHECK_HEADER(libdv/dv.h, :, HAVE_LIBDV=no)
512 dnl CPPFLAGS="$libdvcheck_save_CPPFLAGS"
513
514 dnl *** mad ***
515 dnl FIXME: we could use header checks here as well IMO
516 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
517 GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
518   AC_CHECK_LIB(mad, mad_decoder_finish, HAVE_MAD="yes" MAD_LIBS="-lmad")
519   if test "x$HAVE_MAD" = "xyes"; then
520     # installed with mad >= 0.14
521     HAVE_MAD="no"
522     save_libs=$LIBS
523     LIBS="-lz"
524     AC_CHECK_LIB(id3tag, id3_tag_query, HAVE_MAD="yes" MAD_LIBS="$MAD_LIBS -lid3tag")
525     LIBS=$save_LIBS
526   fi    
527 ])
528 AC_SUBST(MAD_LIBS)
529
530 dnl *** mikmod ***
531 translit(dnm, m, l) AM_CONDITIONAL(USE_MIKMOD, true)
532 GST_CHECK_FEATURE(MIKMOD, [mikmod plugin], mikmod, [
533   AM_PATH_LIBMIKMOD(, HAVE_MIKMOD=yes, HAVE_MIKMOD=no)
534   AC_SUBST(MIKMOD_LIBS, "$LIBMIKMOD_LIBS")
535   AC_SUBST(MIKMOD_CFLAGS, "$LIBMIKMODCFLAGS")
536 ])
537
538 dnl *** mjpegtools ***
539 translit(dnm, m, l) AM_CONDITIONAL(USE_MJPEGTOOLS, true)
540 GST_CHECK_FEATURE(MJPEGTOOLS, [mjpegtools], jpegmmxenc jpegmmxdec, [
541   PKG_CHECK_MODULES(MJPEGTOOLS, mjpegtools, HAVE_MJPEGTOOLS="yes", HAVE_MJPEGTOOLS="no")
542   AC_SUBST(MJPEGTOOLS_LIBS)
543   AC_SUBST(MJPEGTOOLS_CFLAGS)
544 ])
545
546 dnl *** mpeg2dec ***
547 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
548 GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
549   AC_CHECK_MPEG2DEC(HAVE_MPEG2DEC=yes, HAVE_MPEG2DEC=no)
550 ])
551
552 dnl *** openquicktime ***
553 translit(dnm, m, l) AM_CONDITIONAL(USE_OPENQUICKTIME, true)
554 GST_CHECK_FEATURE(OPENQUICKTIME, [Open Quicktime], quicktime_parser quicktime_decoder quicktime_demux,[
555   GST_CHECK_LIBHEADER(OPENQUICKTIME, openquicktime, quicktime_init,, openquicktime/openquicktime.h, OPENQUICKTIME_LIBS="-lopenquicktime")
556   AC_SUBST(OPENQUICKTIME_LIBS)
557 ])
558
559 dnl *** raw1394 ***
560 translit(dnm, m, l) AM_CONDITIONAL(USE_RAW1394, true)
561 GST_CHECK_FEATURE(RAW1394, [raw1394 library], dv1394src, [
562   GST_CHECK_LIBHEADER(RAW1394, raw1394, raw1394_get_handle,, libraw1394/raw1394.h, RAW1394_LIBS="-raw1394")
563   AC_SUBST(RAW1394_LIBS)
564 ])
565
566 dnl *** rtp ***
567 dnl FIXME : adapt and make it work
568 translit(dnm, m, l) AM_CONDITIONAL(USE_RTP, true)
569 GST_CHECK_FEATURE(RTP, [RTP library], rtpenc rtpdec,[
570   AC_CHECK_LIB(rtp, rtp_packet_new_take_data, HAVE_RTP=yes, HAVE_RTP=no, $GST_CFLAGS $GST_LIBS)
571   RTP_LIBS="-lrtp"
572   AC_SUBST(RTP_LIBS)
573 ])
574
575 dnl FIXME header check needs to use GLIB_CFLAGS in order to succeed for rtp
576 dnl can use GST_* which should have GLIB_* info
577 dnl AC_CHECK_HEADERS(rtp/rtp.h, HAVE_LIBRTP=yes, HAVE_LIBRTP=no)
578 dnl AC_CHECK_HEADERS(rtp/rtp-packet.h, :, HAVE_LIBRTP=no)
579 dnl AC_CHECK_HEADERS(rtp/rtcp-packet.h, :, HAVE_LIBRTP=no)
580 dnl AC_CHECK_HEADERS(rtp/rtp-audio.h, :, HAVE_LIBRTP=no)
581
582 dnl *** SDL ***
583 translit(dnm, m, l) AM_CONDITIONAL(USE_SDL, true)
584 GST_CHECK_FEATURE(SDL, [SDL plugin], sdlvideosink, [
585  AM_PATH_SDL(, HAVE_SDL=yes, HAVE_SDL=no)
586 ])
587
588 dnl *** shout ***
589 translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT, true)
590 GST_CHECK_FEATURE(SHOUT, [shout plugin], icecastsend, [
591   GST_CHECK_LIBHEADER(SHOUT, shout, shout_init_connection,, shout/shout.h, SHOUT_LIBS="-lshout")
592   AC_SUBST(SHOUT_LIBS)
593 ])
594
595 dnl *** sidplay ***
596 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
597 GST_CHECK_FEATURE(SIDPLAY, [sidplay plugin], sidplay, [
598   GST_PATH_SIDPLAY()
599 ])
600
601 dnl *** smoothwave ***
602 translit(dnm, m, l) AM_CONDITIONAL(USE_SMOOTHWAVE, true)
603 GST_CHECK_FEATURE(SMOOTHWAVE, [smoothwave plugin], smoothwave, [
604   if test $HAVE_GTK = "yes"; then HAVE_SMOOTHWAVE=yes; fi;
605 ])
606
607
608 dnl *** snapshot ***
609 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
610 GST_CHECK_FEATURE(LIBPNG, [snapshot plugin], snapshot, [
611   GST_CHECK_LIBHEADER(LIBPNG, png, png_read_info, -lz, png.h, LIBPNG_LIBS="-lpng -lz")
612   AC_SUBST(LIBPNG_LIBS)
613 ])
614
615 dnl *** tarkin ***
616 dnl for now the sources are included in the plugin
617 dnl and should be moved to ext-libs/ perhaps
618 translit(dnm, m, l) AM_CONDITIONAL(USE_TARKIN, true)
619 GST_CHECK_FEATURE(TARKIN, [tarkinenc tarkindec], tarkin, [
620   HAVE_TARKIN="yes"
621 ])
622
623 dnl *** vorbis ***
624 dnl AM_PATH_VORBIS only takes two options
625 translit(dnm, m, l) AM_CONDITIONAL(USE_VORBIS, true)
626 GST_CHECK_FEATURE(VORBIS, [vorbis plugin], vorbisenc vorbisdec, [
627   AM_PATH_VORBIS(HAVE_VORBIS=yes, HAVE_VORBIS=no)
628 ])
629
630 dnl *** XMMS ***
631 translit(dnm, m, l) AM_CONDITIONAL(USE_XMMS, true)
632 GST_CHECK_FEATURE(XMMS, [xmms plugin], xmms, [
633   AM_PATH_XMMS(0.1.0, HAVE_XMMS=yes, HAVE_XMMS=no)
634 ])
635
636 dnl Check for atomic.h
637 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
638 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
639 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
640 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
641 if test x$HAVE_ATOMIC_H = xyes; then
642   AC_TRY_RUN([
643 #include "asm/atomic.h"
644 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
645   ],, [
646     # Not successful
647     if test x$HAVE_ATOMIC_H = xyes; then
648       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
649     fi
650     HAVE_ATOMIC_H=no
651   ], [
652     # Cross compiling
653     AC_MSG_RESULT(yes)
654     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
655   ])
656 fi
657
658
659 dnl ######################################################################
660 dnl # Check command line parameters, and set shell variables accordingly #
661 dnl ######################################################################
662
663 GST_DEBUGINFO
664
665 AC_ARG_ENABLE(libmmx,
666   AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
667 [case "${enableval}" in
668   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
669   no)  USE_LIBMMX=no ;;
670   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
671 esac], 
672 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
673
674 AC_ARG_ENABLE(atomic,
675   AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
676 [case "${enableval}" in
677   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
678   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
679   no)  USE_ATOMIC_H=no;;
680   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
681 esac], 
682 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
683
684 AC_ARG_ENABLE(profiling,
685   AC_HELP_STRING([--enable-profiling],
686                  [-pg to compiler commandline, for profiling]),
687 [case "${enableval}" in
688   yes) USE_PROFILING=yes ;;
689   no)  UES_PROFILING=no ;;
690   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
691 esac], 
692 [USE_PROFILING=no]) dnl Default value
693
694 AC_ARG_ENABLE(tests,
695   AC_HELP_STRING([--disable-tests],[disable building test apps]),
696 [case "${enableval}" in
697   yes) BUILD_TESTS=yes ;;
698   no)  BUILD_TESTS=no ;;
699   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
700 esac], 
701 [BUILD_TESTS=yes]) dnl Default value
702
703 AC_ARG_ENABLE(examples,
704   AC_HELP_STRING([--disable-examples],[disable building examples]),
705 [case "${enableval}" in
706   yes) BUILD_EXAMPLES=yes ;;
707   no)  BUILD_EXAMPLES=no ;;
708   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
709 esac], 
710 [BUILD_EXAMPLES=yes]) dnl Default value
711
712 dnl ################################################
713 dnl # Set defines according to variables set above #
714 dnl ################################################
715
716
717 if test "x$USE_LIBMMX" = xyes; then
718   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
719 fi
720
721 if test "x$USE_ATOMIC_H" = xyes; then
722   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
723 fi
724
725 dnl if test "x$USE_DEBUG" = xyes; then
726 dnl   CFLAGS="$CFLAGS -g"
727 dnl fi
728
729 if test "x$USE_PROFILING" = xyes; then
730 dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
731   FOMIT_FRAME_POINTER=""
732 else
733   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
734 fi
735
736 dnl
737 dnl AC_SUBST(FOMIT_FRAME_POINTER)
738 dnl
739
740 dnl #############################
741 dnl # Set automake conditionals #
742 dnl #############################
743
744 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
745 dnl HAVE_ and it is likely to be easier to stick with the old name
746 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
747 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
748 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
749 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
750 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
751 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
752
753 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
754
755 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
756 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
757
758 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
759 AM_CONDITIONAL(HAVE_LIBGLADE_GNOME, test "x$HAVE_LIBGLADE_GNOME" = "xyes")
760 AM_CONDITIONAL(HAVE_GNOME,          test "x$HAVE_GNOME" = "xyes")
761 AM_CONDITIONAL(HAVE_GTK,            test "x$HAVE_GTK" = "xyes")
762 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
763 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
764 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
765 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
766 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
767 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
768 AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
769 AM_CONDITIONAL(HAVE_RAW1394,        test "x$HAVE_RAW1394" = "xyes")
770
771 GST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir)/gst-libs -Wall -Werror"
772 AC_SUBST(GST_LIBS)
773 AC_SUBST(GST_CFLAGS)
774
775 dnl #########################
776 dnl # Make the output files #
777 dnl #########################
778
779 dnl testsuite/autoplug/Makefile
780 dnl testsuite/Makefile
781 AC_CONFIG_FILES(
782 Makefile
783 gstreamer-libs.pc
784 gstreamer-libs-uninstalled.pc
785 gst-plugins.spec
786 gst/Makefile
787 gst/ac3parse/Makefile
788 gst/adder/Makefile
789 gst/audioscale/Makefile
790 gst/auparse/Makefile
791 gst/avi/Makefile
792 gst/cdxaparse/Makefile
793 gst/chart/Makefile
794 gst/cutter/Makefile
795 gst/deinterlace/Makefile
796 gst/effectv/Makefile
797 gst/festival/Makefile
798 gst/filter/Makefile
799 gst/flx/Makefile
800 gst/goom/Makefile
801 gst/intfloat/Makefile
802 gst/law/Makefile
803 gst/level/Makefile
804 gst/median/Makefile
805 gst/mpeg1enc/Makefile
806 gst/mpeg1sys/Makefile
807 gst/mpeg1videoparse/Makefile
808 gst/mpeg2enc/Makefile
809 gst/mpeg2sub/Makefile
810 gst/mpegaudio/Makefile
811 gst/mpegaudioparse/Makefile
812 gst/mpegstream/Makefile
813 gst/mpegtypes/Makefile
814 gst/modplug/Makefile
815 gst/modplug/libmodplug/Makefile
816 gst/monoscope/Makefile
817 gst/passthrough/Makefile
818 gst/playondemand/Makefile
819 gst/qtdemux/Makefile
820 gst/rtjpeg/Makefile
821 gst/silence/Makefile
822 gst/sine/Makefile
823 gst/smooth/Makefile
824 gst/spectrum/Makefile
825 gst/speed/Makefile
826 gst/stereo/Makefile
827 gst/stereomono/Makefile
828 gst/synaesthesia/Makefile
829 gst/udp/Makefile
830 gst/videoscale/Makefile
831 gst/volenv/Makefile
832 gst/volume/Makefile
833 gst/vumeter/Makefile
834 gst/wavparse/Makefile
835 gst/y4m/Makefile
836 sys/Makefile
837 sys/dxr3/Makefile
838 sys/oss/Makefile
839 sys/qcam/Makefile
840 sys/v4l/Makefile
841 sys/vcd/Makefile
842 sys/vga/Makefile
843 sys/xvideo/Makefile
844 sys/videosink/Makefile
845 ext/Makefile
846 ext/a52dec/Makefile
847 ext/aalib/Makefile
848 ext/alsa/Makefile
849 ext/arts/Makefile
850 ext/artsd/Makefile
851 ext/audiofile/Makefile
852 ext/avifile/Makefile
853 ext/cdparanoia/Makefile
854 ext/dv/Makefile
855 ext/dvdread/Makefile
856 ext/dvdnav/Makefile
857 ext/esd/Makefile
858 ext/ffmpeg/Makefile
859 ext/flac/Makefile
860 ext/gnomevfs/Makefile
861 ext/gsm/Makefile
862 ext/hermes/Makefile
863 ext/http/Makefile
864 ext/jack/Makefile
865 ext/jpeg/Makefile
866 ext/ladspa/Makefile
867 ext/lame/Makefile
868 ext/lcs/Makefile
869 ext/libfame/Makefile
870 ext/mad/Makefile
871 ext/mikmod/Makefile
872 ext/mjpegtools/Makefile
873 ext/mpeg2dec/Makefile
874 ext/openquicktime/Makefile
875 ext/raw1394/Makefile
876 ext/rtp/Makefile
877 ext/sdl/Makefile
878 ext/shout/Makefile
879 ext/sidplay/Makefile
880 ext/smoothwave/Makefile
881 ext/vorbis/Makefile
882 ext/tarkin/Makefile
883 ext/xmms/Makefile
884 gst-libs/Makefile
885 gst-libs/gst/Makefile
886 gst-libs/gst/audio/Makefile
887 gst-libs/gst/idct/Makefile
888 gst-libs/gst/resample/Makefile
889 gst-libs/gst/riff/Makefile
890 gst-libs/gst/floatcast/Makefile
891 examples/dynparams/Makefile
892 examples/capsfilter/Makefile
893 examples/seeking/Makefile
894 examples/Makefile
895 tools/Makefile
896 gconf/Makefile
897 )
898
899 AC_OUTPUT
900
901 echo -e "configure: *** Plugins that will be built : $GST_PLUGINS_YES"
902 echo
903 echo -e "configure: *** Plugins that will not be built : $GST_PLUGINS_NO"
904 echo