3 dnl initialize autoconf
4 dnl we don't specify PACKAGE and VERSION because AS_VERSION puts it together
7 dnl when going to/from release please set the nano (fourth number) right !
8 dnl releases only do Wall, cvs and prerelease does Werror too
9 AS_VERSION(gst-plugins-good, GST_PLUGINS_GOOD_VERSION, 0, 10, 0, 1,
10 GST_CVS="no", GST_CVS="yes")
12 dnl can autoconf find the source ?
13 AC_CONFIG_SRCDIR([gst/law/alaw.c])
15 dnl define the output header for config
16 AM_CONFIG_HEADER([config.h])
18 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
21 dnl sets host_* variables
24 dnl initialize automake
25 dnl FIXME: this is deprecated use, we should move PACKAGE and VERSION to
26 dnl AC_INIT, but then we need to parse the version to pass to AS_VERSION
27 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
29 dnl our libraries and install dirs use major.minor as a version
30 GST_MAJORMINOR=$GST_PLUGINS_GOOD_VERSION_MAJOR.$GST_PLUGINS_GOOD_VERSION_MINOR
31 dnl we override it here if we need to for the release candidate of new series
33 AC_SUBST(GST_MAJORMINOR)
35 AS_LIBTOOL_TAGS([CXX])
38 dnl *** autotools stuff ****
40 dnl allow for different autotools
41 AS_AUTOTOOLS_ALTERNATE
43 dnl Add parameters for aclocal
44 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
47 dnl the version check needs to stay here because autopoint greps for it
48 AM_GNU_GETTEXT_VERSION([0.11.5])
49 AM_GNU_GETTEXT([external])
50 GST_GETTEXT([gst-plugins-good-$GST_MAJORMINOR])
52 dnl *** check for arguments to configure ***
61 GST_ARG_WITH_PKG_CONFIG_PATH
62 GST_ARG_WITH_PACKAGE_NAME([GStreamer Good Plug-ins])
63 GST_ARG_WITH_PACKAGE_ORIGIN
65 dnl these are all the gst plug-ins, compilable without additional libs
66 dnl videofilter is at the top because others depend on it
91 AC_SUBST(GST_PLUGINS_ALL)
93 GST_PLUGINS_SELECTED=""
96 AC_HELP_STRING([--with-plugins],
97 [comma-separated list of plug-ins to compile]),
98 [for i in `echo $withval | tr , ' '`; do
99 if echo $GST_PLUGINS_ALL | grep $i > /dev/null
101 GST_PLUGINS_SELECTED="$GST_PLUGINS_SELECTED $i"
103 echo "plug-in $i not recognized, ignoring..."
106 [GST_PLUGINS_SELECTED=$GST_PLUGINS_ALL])
108 AC_SUBST(GST_PLUGINS_SELECTED)
110 dnl ext plug-ins; plug-ins that have external dependencies
111 GST_CHECK_FEATURE(EXTERNAL, [enable building of plug-ins with external deps],,
112 [HAVE_EXTERNAL=yes], enabled,
114 AC_MSG_NOTICE(building external plug-ins)
117 AC_MSG_NOTICE(all plug-ins with external dependencies will not be built)
120 AM_CONDITIONAL(BUILD_EXTERNAL, test "x$BUILD_EXTERNAL" = "xyes")
122 dnl *** checks for platform ***
124 dnl * hardware/architecture *
126 dnl common/m4/gst-arch.m4
130 dnl Determine endianness
133 dnl *** checks for programs ***
138 dnl determine c++ compiler
140 dnl determine if c++ is available on this system
141 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
143 dnl determine c++ preprocessor
144 dnl FIXME: do we need this ?
149 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
150 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
152 dnl check for gconftool-2
153 dnl this macro defines an am conditional, so it needs to be run always
156 dnl check for documentation tools
158 AS_PATH_PYTHON([2.1])
160 dnl *** checks for header files ***
162 dnl check if we have ANSI C header files
165 dnl used in gst/rtp/gstasteriskh263.c
166 AC_CHECK_HEADERS([netinet/in.h])
167 AC_CHECK_HEADERS([winsock2.h])
168 AM_CONDITIONAL(HAVE_WINSOCK2_H, test "x$HAVE_WINSOCK2_H" = "xyes")
170 dnl *** checks for compiler characteristics ***
172 dnl FIXME: check if this is used; was used for floatcast.h in base
173 dnl Check for fast float to int casting as defined in C99
177 dnl *** checks for library functions ***
179 dnl Check for mmap (needed by electricfence plugin)
181 AM_CONDITIONAL(GST_HAVE_MMAP, test "x$ac_cv_func_mmap_fixed_mapped" == "xyes")
183 dnl *** checks for dependancy libraries ***
186 GST_GLIB_CHECK([2.6])
188 dnl liboil is required
189 PKG_CHECK_MODULES(LIBOIL, liboil-0.3 >= 0.3.2, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
190 if test "x${HAVE_LIBOIL}" != xyes ; then
191 AC_ERROR([liboil-0.3 is required])
194 dnl checks for gstreamer
195 dnl uninstalled is selected preferentially -- see pkg-config(1)
198 GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
199 GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
200 GST_CHECK_GST_GDP($GST_MAJORMINOR, [$GST_REQ])
201 GST_CHECK_GST_CONTROLLER($GST_MAJORMINOR, [$GST_REQ])
202 GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
203 GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ])
205 GST_TOOLS_DIR=`pkg-config --variable=toolsdir gstreamer-$GST_MAJORMINOR`
206 if test -z $GST_TOOLS_DIR; then
207 AC_MSG_ERROR([no tools dir defined in GStreamer pkg-config file; core upgrade needed.])
209 AC_SUBST(GST_TOOLS_DIR)
211 dnl FIXME: get rid of this by making sure gstreamer-check brings it in
212 dnl check for "check", unit testing library/header
213 AM_PATH_CHECK(0.9.2, HAVE_CHECK=yes, HAVE_CHECK=no)
214 AM_CONDITIONAL(HAVE_CHECK, test "x$HAVE_CHECK" = "xyes")
216 dnl should we install schemas ?
217 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONFTOOL, true)
218 GST_CHECK_FEATURE(GCONFTOOL, [GConf schemas], , [
219 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
220 if test x$GCONFTOOL = xno; then
221 AC_MSG_WARN(Not installing GConf schemas)
226 AC_SUBST(HAVE_GCONFTOOL)
229 dnl *** set variables based on configure arguments ***
231 dnl set license and copyright notice
233 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
234 AC_SUBST(GST_LICENSE)
236 dnl set location of plugin directory
239 dnl define an ERROR_CFLAGS Makefile variable
240 GST_SET_ERROR_CFLAGS($GST_CVS)
242 dnl define correct level for debugging messages
243 GST_SET_LEVEL_DEFAULT($GST_CVS)
248 dnl *** sys plug-ins ***
251 AC_MSG_NOTICE([Checking libraries for plugins in sys/])
254 dnl *** OSS audio *** (Linux, *BSD)
255 translit(dnm, m, l) AM_CONDITIONAL(USE_OSS, true)
256 GST_CHECK_FEATURE(OSS, [OSS audio], osssrc osssink, [
258 dnl Linux and newer BSD versions :
259 AC_CHECK_HEADER(sys/soundcard.h, [
260 AC_DEFINE(HAVE_OSS_INCLUDE_IN_SYS,, [Define if OSS includes are in /sys/])
262 dnl Some old BSD versions and also newer OpenBSD versions :
263 AC_CHECK_HEADER(soundcard.h, [
264 AC_DEFINE(HAVE_OSS_INCLUDE_IN_ROOT,, [Define if OSS includes are in /])
266 dnl Some old BSD versions :
267 AC_CHECK_HEADER(machine/soundcard.h, [
268 AC_DEFINE(HAVE_OSS_INCLUDE_IN_MACHINE,,
269 [Define if OSS includes are in /machine/])
277 dnl *** ext plug-ins ***
278 dnl keep this list sorted alphabetically !
280 if test "x$BUILD_EXTERNAL" = "xyes"; then
283 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
287 translit(dnm, m, l) AM_CONDITIONAL(USE_AALIB, true)
288 GST_CHECK_FEATURE(AALIB, [aasink plug-in], aasink, [
289 AM_PATH_AALIB(, HAVE_AALIB=yes, HAVE_AALIB=no)
290 AS_SCRUB_INCLUDE(AALIB_CFLAGS)
294 translit(dnm, m, l) AM_CONDITIONAL(USE_CAIRO, true)
295 GST_CHECK_FEATURE(CAIRO, [cairo plug-in], cairo, [
296 PKG_CHECK_MODULES(CAIRO, cairo >= 1.0.0, [
298 AC_SUBST(CAIRO_CFLAGS)
306 translit(dnm, m, l) AM_CONDITIONAL(USE_ESD, true)
307 GST_CHECK_FEATURE(ESD, [esound plug-ins], esdsink, [
308 PKG_CHECK_MODULES(ESD, esound >= 0.2.12, [
313 AM_PATH_ESD(0.2.12, HAVE_ESD="yes", HAVE_ESD="no")
314 AS_SCRUB_INCLUDE(ESD_CFLAGS)
319 translit(dnm, m, l) AM_CONDITIONAL(USE_FLAC, true)
320 GST_CHECK_FEATURE(FLAC, [FLAC lossless audio], flacenc flacdec, [
321 GST_CHECK_LIBHEADER(FLAC, FLAC, FLAC__seekable_stream_encoder_new, -lm, FLAC/all.h, FLAC_LIBS="-lFLAC -lm")
322 dnl API change in FLAC 1.1.1, so require that...
323 if test x$HAVE_FLAC = xyes; then
324 AC_CHECK_DECL(FLAC__SEEKABLE_STREAM_ENCODER_TELL_ERROR,
325 HAVE_FLAC="yes", HAVE_FLAC="no", [
326 #include <FLAC/seekable_stream_encoder.h>
333 translit(dnm, m, l) AM_CONDITIONAL(USE_GCONF, true)
334 GST_CHECK_FEATURE(GCONF, [GConf libraries], , [
335 PKG_CHECK_MODULES(GCONF, gconf-2.0, HAVE_GCONF="yes", HAVE_GCONF="no")
336 AC_SUBST(GCONF_CFLAGS)
341 dnl FIXME: we could use header checks here as well IMO
342 translit(dnm, m, l) AM_CONDITIONAL(USE_JPEG, true)
343 GST_CHECK_FEATURE(JPEG, [jpeg], jpegenc jpegdec, [
344 AC_ARG_WITH(jpeg-mmx,
345 [ --with-jpeg-mmx, path to MMX'ified JPEG library])
347 if test x$with_jpeg_mmx != x; then
348 LIBS="$LIBS -L$with_jpeg_mmx"
350 AC_CHECK_LIB(jpeg-mmx, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
351 JPEG_LIBS="$LIBS -ljpeg-mmx"
353 if test x$HAVE_JPEG != xyes; then
354 AC_CHECK_LIB(jpeg, jpeg_set_defaults, HAVE_JPEG="yes", HAVE_JPEG="no")
361 translit(dnm, m, l) AM_CONDITIONAL(USE_LADSPA, true)
362 GST_CHECK_FEATURE(LADSPA, [ladspa], ladspa, [
363 AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA="yes", HAVE_LADSPA="no")
367 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBCACA, true)
368 GST_CHECK_FEATURE(LIBCACA, [libcaca], libcaca, [
369 GST_CHECK_CONFIGPROG(LIBCACA, caca-config)
370 AC_SUBST(LIBCACA_CFLAGS)
371 AC_SUBST(LIBCACA_LIBS)
375 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBDV, true)
376 GST_CHECK_FEATURE(LIBDV, [libdv DV/video decoder], dvdec, [
377 PKG_CHECK_MODULES(LIBDV, libdv >= 0.100, HAVE_LIBDV="yes", HAVE_LIBDV="no")
378 AC_SUBST(LIBDV_CFLAGS)
383 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBPNG, true)
384 GST_CHECK_FEATURE(LIBPNG, [libpng PNG encoder], pngenc, [
385 PKG_CHECK_MODULES(LIBPNG, libpng12, HAVE_LIBPNG="yes", HAVE_LIBPNG="no")
386 AC_SUBST(LIBPNG_CFLAGS)
387 AC_SUBST(LIBPNG_LIBS)
391 translit(dnm, m, l) AM_CONDITIONAL(USE_DV1394, true)
392 GST_CHECK_FEATURE(DV1394, [raw1394 and avc1394 library], dv1394src, [
393 dnl we need to test three headers and three libs
394 GST_CHECK_LIBHEADER(RAW1394,
395 raw1394, raw1394_new_handle,,
396 libraw1394/raw1394.h, RAW1394_LIBS="-lraw1394")
397 GST_CHECK_LIBHEADER(AVC1394,
398 avc1394, avc1394_send_command, $RAW1394_LIBS,
399 libavc1394/avc1394.h, AVC1394_LIBS="-lavc1394")
400 GST_CHECK_LIBHEADER(ROM1394,
401 rom1394, rom1394_free_directory, $RAW1394_LIBS,
402 libavc1394/rom1394.h, ROM1394_LIBS="-lrom1394")
404 dnl now see how far we got
405 if test x$HAVE_RAW1394 = xyes && \
406 test x$HAVE_AVC1394 = xyes && \
407 test x$HAVE_ROM1394 = xyes; then
409 DV1394_LIBS="$RAW1394_LIBS $AVC1394_LIBS $ROM1394_LIBS"
410 AC_SUBST(DV1394_LIBS)
417 translit(dnm, m, l) AM_CONDITIONAL(USE_SHOUT2, true)
418 GST_CHECK_FEATURE(SHOUT2, [shout2 plug-in], shout2send, [
419 PKG_CHECK_MODULES(SHOUT2, shout >= 2.0, [
421 AC_SUBST(SHOUT2_CFLAGS)
422 AC_SUBST(SHOUT2_LIBS)
424 AM_PATH_SHOUT2(HAVE_SHOUT2="yes", HAVE_SHOUT2="no")
425 AC_SUBST(SHOUT2_CFLAGS)
426 AC_SUBST(SHOUT2_LIBS)
430 dnl *** speex >= 1.0.4 or >= 1.1.5 ***
431 dnl 1.1.4 and earlier were not API/ABI compatible with 1.0
432 dnl 1.1.6 is the first to use a .pc/pkg-config file ***
433 dnl speex_jitter.h is 1.1.x only
434 translit(dnm, m, l) AM_CONDITIONAL(USE_SPEEX, true)
435 GST_CHECK_FEATURE(SPEEX, [speex plug-in], speex, [
436 PKG_CHECK_MODULES(SPEEX, speex >= 1.1.6, [
438 AC_SUBST(SPEEX_CFLAGS)
441 GST_CHECK_LIBHEADER(SPEEX, speex, speex_bits_init, , speex/speex.h, [
442 AC_CHECK_HEADER(speex/speex_jitter.h, [
444 GST_CHECK_LIBHEADER(SPEEX, speex, speex_encode_int, , speex/speex.h, [
445 dnl speex 1.1.5 or + :
448 AC_SUBST(SPEEX_CFLAGS)
455 AC_CHECK_DECL(SPEEX_GET_LOOKAHEAD, [
459 AC_SUBST(SPEEX_CFLAGS)
462 AC_DEFINE_UNQUOTED(SPEEX_1_0, 1,
463 [defined if speex 1.0.x API detected])
466 AC_MSG_NOTICE(You need at least 1.0.4 to compile the speex plugin)
468 #include <speex/speex.h>
475 fi dnl of EXT plugins
477 dnl *** finalize CFLAGS, LDFLAGS, LIBS
480 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
481 dnl GST_*: flags shared by all built objects
482 dnl GST_ALL_LDFLAGS: linker flags shared by all
483 dnl GST_LIB_LDFLAGS: not needed, we don't install libraries
484 dnl GST_LT_LDFLAGS: library versioning of our libraries
485 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
487 dnl GST_OPTION_CFLAGS
488 if test "x$USE_DEBUG" = xyes; then
491 AC_SUBST(PROFILE_CFLAGS)
493 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
494 AC_SUBST(DEPRECATED_CFLAGS)
496 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
497 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
498 AC_SUBST(GST_OPTION_CFLAGS)
500 dnl our libraries need to be versioned correctly
501 AC_SUBST(GST_LT_LDFLAGS)
503 dnl FIXME: do we want to rename to GST_ALL_* ?
504 dnl prefer internal headers to already installed ones
505 dnl also add builddir include for enumtypes and marshal
506 dnl add ERROR_CFLAGS, but overridable
507 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
511 dnl LDFLAGS really should only contain flags, not libs - they get added before
512 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
513 GST_ALL_LDFLAGS="-no-undefined"
514 AC_SUBST(GST_ALL_LDFLAGS)
516 dnl this really should only contain flags, not libs - they get added before
517 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
518 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
519 AC_SUBST(GST_PLUGIN_LDFLAGS)
521 dnl *** output files ***
523 dnl keep this alphabetic per directory, please
529 gst/autodetect/Makefile
537 gst/matroska/Makefile
538 gst/multipart/Makefile
543 gst/videobox/Makefile
544 gst/videofilter/Makefile
545 gst/videomixer/Makefile
547 gst/wavparse/Makefile
567 gconf/gstreamer.schemas
569 docs/plugins/Makefile
570 docs/version.entities
576 gst-plugins-good.spec
580 echo "configure: *** Core plug-ins, always built:"
581 ( for i in $GST_PLUGINS_ALL; do echo -e '\t'$i; done ) | sort
583 echo -n "configure: *** Plug-ins relying on libraries that will be built:"
584 echo -e "$GST_PLUGINS_YES" | sort
586 echo -n "configure: *** Plug-ins relying on libraries that will NOT be built:"
587 echo -e "$GST_PLUGINS_NO" | sort
589 if test "x$BUILD_EXTERNAL" = "xno"; then
590 echo "configure: *** No external plug-ins will be built"