3 dnl please read gstreamer/docs/random/autotools before changing this file
5 dnl initialize autoconf
6 dnl releases only do -Wall, cvs and prerelease does -Werror too
7 dnl use a three digit version number for releases, and four for cvs/prerelease
8 AC_INIT(GStreamer Ugly Plug-ins, 0.11.1.1,
9 http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
14 dnl initialize automake
15 AM_INIT_AUTOMAKE([-Wno-portability 1.10])
17 dnl define PACKAGE_VERSION_* variables
20 dnl check if this is a release version
21 AS_NANO(GST_GIT="no", GST_GIT="yes")
23 dnl can autoconf find the source ?
24 AC_CONFIG_SRCDIR([ext/mad/gstmad.c])
26 dnl define the output header for config
27 AM_CONFIG_HEADER(config.h)
29 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
32 dnl sets host_* variables
35 dnl use pretty build output with automake >= 1.11
36 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
37 [AM_DEFAULT_VERBOSITY=1
38 AC_SUBST(AM_DEFAULT_VERBOSITY)])
40 dnl our libraries and install dirs use major.minor as a version
41 GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
42 dnl we override it here if we need to for the release candidate of new series
44 AC_SUBST(GST_MAJORMINOR)
46 dnl FIXME: this macro doesn't actually work;
47 dnl the generated libtool script has no support for the listed tags.
48 dnl So this needs to be fixed first if we want to use this
49 dnl AS_LIBTOOL_TAGS([CXX])
54 dnl *** required versions of GStreamer stuff ***
58 dnl *** autotools stuff ****
60 dnl allow for different autotools
61 AS_AUTOTOOLS_ALTERNATE
63 dnl Add parameters for aclocal
64 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
67 dnl the version check needs to stay here because autopoint greps for it
68 AM_GNU_GETTEXT_VERSION(0.17)
69 AM_GNU_GETTEXT([external])
70 AG_GST_GETTEXT([gst-plugins-ugly-$GST_MAJORMINOR])
72 dnl *** check for arguments to configure ***
74 AG_GST_ARG_DISABLE_FATAL_WARNINGS
83 AG_GST_ARG_WITH_PKG_CONFIG_PATH
84 AG_GST_ARG_WITH_PACKAGE_NAME
85 AG_GST_ARG_WITH_PACKAGE_ORIGIN
87 AG_GST_ARG_WITH_PLUGINS
89 AG_GST_ARG_ENABLE_EXTERNAL
91 AG_GST_ARG_ENABLE_EXPERIMENTAL
93 dnl *** checks for platform ***
95 dnl * hardware/architecture *
97 dnl common/m4/gst-arch.m4
101 dnl Determine endianness
104 dnl *** checks for programs ***
110 dnl determine c++ compiler
112 dnl determine if c++ is available on this system
113 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
115 dnl check if the compiler supports '-c' and '-o' options
118 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
119 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
121 dnl check if the compiler supports do while(0) macros
122 AG_GST_CHECK_DOWHILE_MACROS
124 dnl check for documentation tools
126 AS_PATH_PYTHON([2.1])
127 AG_GST_PLUGIN_DOCS([1.3],[2.1])
129 dnl *** checks for libraries ***
131 dnl check for libm, for sin()
135 dnl *** checks for header files ***
137 dnl used by ext/a52dec
140 dnl Check for malloc.h
141 AC_CHECK_HEADERS([malloc.h])
143 dnl *** checks for types/defines ***
145 dnl *** checks for structures ***
147 dnl *** checks for compiler characteristics ***
149 dnl *** checks for library functions ***
151 dnl Check for a way to display the function name in debug output
152 AG_GST_CHECK_FUNCTION
154 dnl *** checks for dependency libraries ***
158 AG_GST_GLIB_CHECK([$GLIB_REQ])
162 dnl checks for gstreamer
163 dnl uninstalled is selected preferentially -- see pkg-config(1)
164 AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ], yes)
165 AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ], yes)
166 AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
167 AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GSTPB_REQ], yes)
168 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
170 dnl Check for documentation xrefs
171 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
172 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_MAJORMINOR`"
173 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_MAJORMINOR`"
174 AC_SUBST(GLIB_PREFIX)
176 AC_SUBST(GSTPB_PREFIX)
178 dnl *** set variables based on configure arguments ***
180 dnl set license and copyright notice
182 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
183 AC_SUBST(GST_LICENSE)
185 dnl set location of plugin directory
188 dnl set release date/time
189 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
190 ["${srcdir}/gst-plugins-ugly.doap"],
191 [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
193 dnl define an ERROR_CFLAGS Makefile variable
194 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
195 -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
196 -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition
197 -Winit-self -Wmissing-include-dirs -Waddress
198 -Waggregate-return -Wno-multichar -Wnested-externs ])
200 dnl define an ERROR_CXXFLAGS Makefile variable
201 AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
202 -Wmissing-declarations -Wredundant-decls
203 -Wwrite-strings -Wformat-nonliteral -Wformat-security
204 -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
207 dnl define correct level for debugging messages
208 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
211 AG_GST_DEFAULT_ELEMENTS
213 dnl *** plug-ins to include ***
215 dnl Non ported plugins (non-dependant, then dependant)
216 dnl Make sure you have a space before and after all plugins
217 GST_PLUGINS_NONPORTED=" "
218 AC_SUBST(GST_PLUGINS_NONPORTED)
220 dnl these are all the gst plug-ins, compilable without additional libs
221 AG_GST_CHECK_PLUGIN(asfdemux)
222 AG_GST_CHECK_PLUGIN(dvdlpcmdec)
223 AG_GST_CHECK_PLUGIN(dvdsub)
224 AG_GST_CHECK_PLUGIN(xingmux)
225 AG_GST_CHECK_PLUGIN(realmedia)
226 AG_GST_CHECK_PLUGIN(synaesthesia)
228 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
230 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
231 WIN32_LIBS="-lws2_32"
235 dnl disable experimental plug-ins
236 if test "x$BUILD_EXPERIMENTAL" != "xyes"; then
237 AG_GST_DISABLE_PLUGIN(synaesthesia)
240 dnl *** ext plug-ins ***
241 dnl keep this list sorted alphabetically !
243 if test "x$BUILD_EXTERNAL" = "xyes"; then
246 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
250 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
251 AG_GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
252 AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
256 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
257 AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [
258 PKG_CHECK_MODULES(AMRNB, opencore-amrnb, HAVE_AMRNB="yes",
259 [ AG_GST_CHECK_LIBHEADER(AMRNB, opencore-amrnb,
260 Decoder_Interface_init, $LIBM,
261 opencore-amrnb/interf_dec.h,
262 AMRNB_LIBS="-lopencore-amrnb")
264 AC_SUBST(AMRNB_CFLAGS)
268 dnl *** amr-wb dec ***
269 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
270 AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [
271 PKG_CHECK_MODULES(AMRWB, opencore-amrwb, HAVE_AMRWB="yes",
272 [ AG_GST_CHECK_LIBHEADER(AMRWB, opencore-amrwb,
274 opencore-amrwb/dec_if.h,
275 AMRWB_LIBS="-lopencore-amrwb")
277 AC_SUBST(AMRWB_CFLAGS)
282 translit(dnm, m, l) AM_CONDITIONAL(USE_CDIO, true)
283 AG_GST_CHECK_FEATURE(CDIO, [cdio library], cdio, [
284 AG_GST_PKG_CHECK_MODULES(CDIO, libcdio >= 0.76)
288 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
289 AG_GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
290 AG_GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
291 AC_SUBST(DVDREAD_LIBS)
295 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
296 AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
297 AG_GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, $LIBM, lame/lame.h,
300 LAME_LIBS="-lmp3lame $LIBM"
301 dnl is lame presets available
303 AC_TRY_COMPILE([#include <lame/lame.h>], [ int preset = MEDIUM ],
304 [LAME_CFLAGS="-DGSTLAME_PRESET"],
307 AC_TRY_COMPILE([#include <lame/lame.h>], [
308 void *ptr = &lame_set_VBR_quality
310 [LAME_CFLAGS="$LAME_CFLAGS -DHAVE_LAME_SET_VBR_QUALITY"],
311 [LAME_CFLAGS="$LAME_CFLAGS"]
313 AC_SUBST(LAME_CFLAGS)
319 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
320 AG_GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
322 dnl check with pkg-config first
323 AG_GST_PKG_CHECK_MODULES(MAD, mad >= 0.15)
325 if test "x$HAVE_MAD" = "xno"; then
326 dnl fall back to oldskool detection
327 AC_CHECK_HEADER(mad.h, [
328 AC_CHECK_LIB(mad, mad_decoder_finish,
329 HAVE_MAD="yes" MAD_LIBS="-lmad")
336 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
337 AG_GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
338 AG_GST_PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0)
341 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
342 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
343 AG_GST_CHECK_FEATURE(SIDPLAY, [libsidplay], sid, [
348 translit(dnm, m, l) AM_CONDITIONAL(USE_TWOLAME, true)
349 AG_GST_CHECK_FEATURE(TWOLAME, [twolame], twolame, [
350 PKG_CHECK_MODULES(TWOLAME, twolame >= 0.3.10, [
351 HAVE_TWOLAME="yes"], [
354 AC_SUBST(TWOLAME_CFLAGS)
355 AC_SUBST(TWOLAME_LIBS)
358 dnl *** x264 (MPEG-4 part 10/h.264/AVC encoder) ***
359 translit(dnm, m, l) AM_CONDITIONAL(USE_X264, true)
360 AG_GST_CHECK_FEATURE(X264, [x264 plug-in], x264, [
361 AG_GST_PKG_CHECK_MODULES(X264, x264 >= 0.55.0)
366 dnl not building plugins with external dependencies,
367 dnl but we still need to set the conditionals
369 AM_CONDITIONAL(USE_A52DEC, false)
370 AM_CONDITIONAL(USE_AMRNB, false)
371 AM_CONDITIONAL(USE_AMRWB, false)
372 AM_CONDITIONAL(USE_CDIO, false)
373 AM_CONDITIONAL(USE_DVDREAD, false)
374 AM_CONDITIONAL(USE_LAME, false)
375 AM_CONDITIONAL(USE_MAD, false)
376 AM_CONDITIONAL(USE_MPEG2DEC, false)
377 AM_CONDITIONAL(USE_SIDPLAY, false)
378 AM_CONDITIONAL(USE_TWOLAME, false)
379 AM_CONDITIONAL(USE_X264, false)
381 fi dnl of EXT plugins
383 dnl *** finalize CFLAGS, LDFLAGS, LIBS
386 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
387 dnl GST_*: flags shared by built objects to link against GStreamer
388 dnl GST_ALL_LDFLAGS: linker flags shared by all
389 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
390 dnl GST_LT_LDFLAGS: library versioning of our libraries
391 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
393 dnl GST_OPTION_CFLAGS
394 if test "x$USE_DEBUG" = xyes; then
397 AC_SUBST(PROFILE_CFLAGS)
399 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
400 dnl Define _only_ during CVS (not pre-releases or releases)
401 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
405 AC_SUBST(DEPRECATED_CFLAGS)
407 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
408 dnl at make time with e.g. make ERROR_CFLAGS=""
409 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
410 GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
411 AC_SUBST(GST_OPTION_CFLAGS)
412 AC_SUBST(GST_OPTION_CXXFLAGS)
414 dnl FIXME: do we want to rename to GST_ALL_* ?
415 dnl prefer internal headers to already installed ones
416 dnl also add builddir include for enumtypes and marshal
417 dnl add GST_OPTION_CFLAGS, but overridable
418 GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API"
419 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS)"
420 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
422 AC_SUBST(GST_CXXFLAGS)
425 dnl LDFLAGS really should only contain flags, not libs - they get added before
426 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
427 GST_ALL_LDFLAGS="-no-undefined"
428 AC_SUBST(GST_ALL_LDFLAGS)
430 dnl this really should only contain flags, not libs - they get added before
431 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
432 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc.*' $GST_ALL_LDFLAGS"
433 AC_SUBST(GST_PLUGIN_LDFLAGS)
435 dnl *** output files ***
442 gst-libs/gst/Makefile
444 gst/asfdemux/Makefile
445 gst/dvdlpcmdec/Makefile
447 gst/realmedia/Makefile
448 gst/synaesthesia/Makefile
453 ext/amrwbdec/Makefile
458 ext/mpeg2dec/Makefile
463 docs/plugins/Makefile
464 docs/version.entities
470 pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
471 gst-plugins-ugly.spec
474 dnl Create the config.h file for Visual Studio builds
475 dnl Beware of spaces and /'s in some of the shell variable contents.
477 -e 's/.*config.h.in.*autoheader.*/\/* Autogenerated config.h created for win32 Visual Studio builds *\/\n\n\/* PREFIX -- specifically added for Windows for easier moving *\/\n#define PREFIX "C:\\\\gstreamer"\n\n/' \
478 -e 's/.* GETTEXT_PACKAGE$/#define GETTEXT_PACKAGE "'$GETTEXT_PACKAGE'"/' \
479 -e 's/.* GST_DATADIR$/#define GST_DATADIR PREFIX "\\\\share"/' \
480 -e 's/.* GST_LEVEL_DEFAULT$/#define GST_LEVEL_DEFAULT GST_LEVEL_ERROR/' \
481 -e 's/.* GST_LICENSE$/#define GST_LICENSE "'$GST_LICENSE'"/' \
482 -e 's/.* GST_MAJORMINOR$/#define GST_MAJORMINOR "'$GST_MAJORMINOR'"/' \
483 -e "s,.* GST_PACKAGE_NAME$,#define GST_PACKAGE_NAME \"${GST_PACKAGE_NAME}\"," \
484 -e 's/.* GST_PACKAGE_ORIGIN$/#define GST_PACKAGE_ORIGIN "Unknown package origin"/' \
485 -e "s,.* GST_PACKAGE_RELEASE_DATETIME$,#define GST_PACKAGE_RELEASE_DATETIME \"${GST_PACKAGE_RELEASE_DATETIME}\"," \
486 -e 's/.* HAVE_CPU_I386$/#define HAVE_CPU_I386 1/' \
487 -e 's/.* HAVE_FGETPOS$/#define HAVE_FGETPOS 1/' \
488 -e 's/.* HAVE_FSETPOS$/#define HAVE_FSETPOS 1/' \
489 -e 's/.* HAVE_LIBXML2$/#define HAVE_LIBXML2 1/' \
490 -e 's/.* HAVE_PROCESS_H$/#define HAVE_PROCESS_H 1/' \
491 -e 's/.* HAVE_STDLIB_H$/#define HAVE_STDLIB_H 1/' \
492 -e 's/.* HAVE_STRING_H$/#define HAVE_STRING_H 1/' \
493 -e 's/.* HAVE_SYS_STAT_H$/#define HAVE_SYS_STAT_H 1/' \
494 -e 's/.* HAVE_SYS_TYPES_H$/#define HAVE_SYS_TYPES_H 1/' \
495 -e 's/.* HAVE_WIN32$/#define HAVE_WIN32 1/' \
496 -e 's/.* HAVE_WINSOCK2_H$/#define HAVE_WINSOCK2_H 1/' \
497 -e 's/.* HOST_CPU$/#define HOST_CPU "i686"/' \
498 -e 's/.* LIBDIR$/#ifdef _DEBUG\n# define LIBDIR PREFIX "\\\\debug\\\\lib"\n#else\n# define LIBDIR PREFIX "\\\\lib"\n#endif/' \
499 -e 's/.* LOCALEDIR$/#define LOCALEDIR PREFIX "\\\\share\\\\locale"/' \
500 -e "s/.* PACKAGE$/#define PACKAGE \"$PACKAGE\"/" \
501 -e 's/.* PACKAGE_BUGREPORT$/#define PACKAGE_BUGREPORT "http:\/\/bugzilla.gnome.org\/enter_bug.cgi?product=GStreamer"/' \
502 -e "s/.* PACKAGE_NAME$/#define PACKAGE_NAME \"$PACKAGE_NAME\"/" \
503 -e "s/.* PACKAGE_STRING$/#define PACKAGE_STRING \"$PACKAGE_STRING\"/" \
504 -e 's/.* PACKAGE_TARNAME$/#define PACKAGE_TARNAME "'$PACKAGE_TARNAME'"/' \
505 -e 's/.* PACKAGE_VERSION$/#define PACKAGE_VERSION "'$PACKAGE_VERSION'"/' \
506 -e 's/.* PLUGINDIR$/#ifdef _DEBUG\n# define PLUGINDIR PREFIX "\\\\debug\\\\lib\\\\gstreamer-0.11"\n#else\n# define PLUGINDIR PREFIX "\\\\lib\\\\gstreamer-0.11"\n#endif/' \
507 -e 's/.* USE_BINARY_REGISTRY$/#define USE_BINARY_REGISTRY/' \
508 -e 's/.* VERSION$/#define VERSION "'$VERSION'"/' \
509 -e "s/.* DEFAULT_AUDIOSINK$/#define DEFAULT_AUDIOSINK \"directsoundsink\"/" \
510 -e "s/.* DEFAULT_AUDIOSRC$/#define DEFAULT_AUDIOSRC \"audiotestsrc\"/" \
511 -e "s/.* DEFAULT_VIDEOSRC$/#define DEFAULT_VIDEOSRC \"videotestsrc\"/" \
512 -e "s/.* DEFAULT_VISUALIZER$/#define DEFAULT_VISUALIZER \"goom\"/" \
513 config.h.in >win32/common/config.h-new
517 AG_GST_OUTPUT_PLUGINS