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.2.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 GST_API_VERSION in the filename
41 dnl to allow side-by-side installation of different API versions
43 AC_SUBST(GST_API_VERSION)
44 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
45 [GStreamer API Version])
47 dnl FIXME: this macro doesn't actually work;
48 dnl the generated libtool script has no support for the listed tags.
49 dnl So this needs to be fixed first if we want to use this
50 dnl AS_LIBTOOL_TAGS([CXX])
55 dnl *** required versions of GStreamer stuff ***
59 dnl *** autotools stuff ****
61 dnl allow for different autotools
62 AS_AUTOTOOLS_ALTERNATE
64 dnl Add parameters for aclocal
65 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
68 dnl the version check needs to stay here because autopoint greps for it
69 AM_GNU_GETTEXT_VERSION(0.17)
70 AM_GNU_GETTEXT([external])
71 AG_GST_GETTEXT([gst-plugins-ugly-$GST_API_VERSION])
73 dnl *** check for arguments to configure ***
75 AG_GST_ARG_DISABLE_FATAL_WARNINGS
84 AG_GST_ARG_WITH_PKG_CONFIG_PATH
85 AG_GST_ARG_WITH_PACKAGE_NAME
86 AG_GST_ARG_WITH_PACKAGE_ORIGIN
88 AG_GST_ARG_WITH_PLUGINS
90 AG_GST_ARG_ENABLE_EXTERNAL
92 AG_GST_ARG_ENABLE_EXPERIMENTAL
94 dnl *** checks for platform ***
96 dnl * hardware/architecture *
98 dnl common/m4/gst-arch.m4
102 dnl Determine endianness
105 dnl *** checks for programs ***
111 dnl determine c++ compiler
113 dnl determine if c++ is available on this system
114 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
116 dnl check if the compiler supports '-c' and '-o' options
119 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
120 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
122 dnl check if the compiler supports do while(0) macros
123 AG_GST_CHECK_DOWHILE_MACROS
125 dnl check for documentation tools
127 AS_PATH_PYTHON([2.1])
128 AG_GST_PLUGIN_DOCS([1.3],[2.1])
130 dnl *** checks for libraries ***
132 dnl check for libm, for sin()
136 dnl *** checks for header files ***
138 dnl used by ext/a52dec
141 dnl Check for malloc.h
142 AC_CHECK_HEADERS([malloc.h])
144 dnl *** checks for types/defines ***
146 dnl *** checks for structures ***
148 dnl *** checks for compiler characteristics ***
150 dnl *** checks for library functions ***
152 dnl Check for a way to display the function name in debug output
153 AG_GST_CHECK_FUNCTION
155 dnl *** checks for dependency libraries ***
159 AG_GST_GLIB_CHECK([$GLIB_REQ])
163 dnl checks for gstreamer
164 dnl uninstalled is selected preferentially -- see pkg-config(1)
165 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
166 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
167 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
168 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
169 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
171 dnl Check for documentation xrefs
172 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
173 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
174 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
175 AC_SUBST(GLIB_PREFIX)
177 AC_SUBST(GSTPB_PREFIX)
179 dnl *** set variables based on configure arguments ***
181 dnl set license and copyright notice
183 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
184 AC_SUBST(GST_LICENSE)
186 dnl set location of plugin directory
189 dnl set release date/time
190 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
191 ["${srcdir}/gst-plugins-ugly.doap"],
192 [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
194 dnl define an ERROR_CFLAGS Makefile variable
195 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
196 -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
197 -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition
198 -Winit-self -Wmissing-include-dirs -Waddress
199 -Waggregate-return -Wno-multichar -Wnested-externs ])
201 dnl define an ERROR_CXXFLAGS Makefile variable
202 AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
203 -Wmissing-declarations -Wredundant-decls
204 -Wwrite-strings -Wformat-nonliteral -Wformat-security
205 -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
208 dnl define correct level for debugging messages
209 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
212 AG_GST_DEFAULT_ELEMENTS
214 dnl *** plug-ins to include ***
216 dnl Non ported plugins (non-dependant, then dependant)
217 dnl Make sure you have a space before and after all plugins
218 GST_PLUGINS_NONPORTED=" "
219 AC_SUBST(GST_PLUGINS_NONPORTED)
221 dnl these are all the gst plug-ins, compilable without additional libs
222 AG_GST_CHECK_PLUGIN(asfdemux)
223 AG_GST_CHECK_PLUGIN(dvdlpcmdec)
224 AG_GST_CHECK_PLUGIN(dvdsub)
225 AG_GST_CHECK_PLUGIN(xingmux)
226 AG_GST_CHECK_PLUGIN(realmedia)
227 AG_GST_CHECK_PLUGIN(synaesthesia)
229 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
231 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
232 WIN32_LIBS="-lws2_32"
236 dnl disable experimental plug-ins
237 if test "x$BUILD_EXPERIMENTAL" != "xyes"; then
238 AG_GST_DISABLE_PLUGIN(synaesthesia)
241 dnl *** ext plug-ins ***
242 dnl keep this list sorted alphabetically !
244 if test "x$BUILD_EXTERNAL" = "xyes"; then
247 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
251 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
252 AG_GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
253 AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
257 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
258 AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [
259 PKG_CHECK_MODULES(AMRNB, opencore-amrnb, [
260 if $PKG_CONFIG --atleast-version=0.1.3 opencore-amrnb; then
261 AC_DEFINE(HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER, 1, [Defined for newer opencore-amrnb])
267 AC_SUBST(AMRNB_CFLAGS)
271 dnl *** amr-wb dec ***
272 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
273 AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [
274 PKG_CHECK_MODULES(AMRWB, opencore-amrwb, [
275 if $PKG_CONFIG --atleast-version=0.1.3 opencore-amrwb; then
276 AC_DEFINE(HAVE_OPENCORE_AMRWB_0_1_3_OR_LATER, 1, [Defined for newer opencore-amrwb])
282 AC_SUBST(AMRWB_CFLAGS)
287 translit(dnm, m, l) AM_CONDITIONAL(USE_CDIO, true)
288 AG_GST_CHECK_FEATURE(CDIO, [cdio library], cdio, [
289 AG_GST_PKG_CHECK_MODULES(CDIO, libcdio >= 0.76)
293 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
294 AG_GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
295 AG_GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
296 AC_SUBST(DVDREAD_LIBS)
300 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
301 AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
302 AG_GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, $LIBM, lame/lame.h,
305 LAME_LIBS="-lmp3lame $LIBM"
306 dnl is lame presets available
308 AC_TRY_COMPILE([#include <lame/lame.h>], [ int preset = MEDIUM ],
309 [LAME_CFLAGS="-DGSTLAME_PRESET"],
312 AC_TRY_COMPILE([#include <lame/lame.h>], [
313 void *ptr = &lame_set_VBR_quality
315 [LAME_CFLAGS="$LAME_CFLAGS -DHAVE_LAME_SET_VBR_QUALITY"],
316 [LAME_CFLAGS="$LAME_CFLAGS"]
318 AC_SUBST(LAME_CFLAGS)
324 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
325 AG_GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
327 dnl check with pkg-config first
328 AG_GST_PKG_CHECK_MODULES(MAD, mad >= 0.15)
330 if test "x$HAVE_MAD" = "xno"; then
331 dnl fall back to oldskool detection
332 AC_CHECK_HEADER(mad.h, [
333 AC_CHECK_LIB(mad, mad_decoder_finish,
334 HAVE_MAD="yes" MAD_LIBS="-lmad")
341 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
342 AG_GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
343 AG_GST_PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.4.0)
346 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
347 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
348 AG_GST_CHECK_FEATURE(SIDPLAY, [libsidplay], sid, [
353 translit(dnm, m, l) AM_CONDITIONAL(USE_TWOLAME, true)
354 AG_GST_CHECK_FEATURE(TWOLAME, [twolame], twolame, [
355 PKG_CHECK_MODULES(TWOLAME, twolame >= 0.3.10, [
356 HAVE_TWOLAME="yes"], [
359 AC_SUBST(TWOLAME_CFLAGS)
360 AC_SUBST(TWOLAME_LIBS)
363 dnl *** x264 (MPEG-4 part 10/h.264/AVC encoder) ***
364 translit(dnm, m, l) AM_CONDITIONAL(USE_X264, true)
365 AG_GST_CHECK_FEATURE(X264, [x264 plug-in], x264, [
366 AG_GST_PKG_CHECK_MODULES(X264, x264 >= 0.55.0)
371 dnl not building plugins with external dependencies,
372 dnl but we still need to set the conditionals
374 AM_CONDITIONAL(USE_A52DEC, false)
375 AM_CONDITIONAL(USE_AMRNB, false)
376 AM_CONDITIONAL(USE_AMRWB, false)
377 AM_CONDITIONAL(USE_CDIO, false)
378 AM_CONDITIONAL(USE_DVDREAD, false)
379 AM_CONDITIONAL(USE_LAME, false)
380 AM_CONDITIONAL(USE_MAD, false)
381 AM_CONDITIONAL(USE_MPEG2DEC, false)
382 AM_CONDITIONAL(USE_SIDPLAY, false)
383 AM_CONDITIONAL(USE_TWOLAME, false)
384 AM_CONDITIONAL(USE_X264, false)
386 fi dnl of EXT plugins
388 dnl *** finalize CFLAGS, LDFLAGS, LIBS
391 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
392 dnl GST_*: flags shared by built objects to link against GStreamer
393 dnl GST_ALL_LDFLAGS: linker flags shared by all
394 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
395 dnl GST_LT_LDFLAGS: library versioning of our libraries
396 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
398 dnl GST_OPTION_CFLAGS
399 if test "x$USE_DEBUG" = xyes; then
402 AC_SUBST(PROFILE_CFLAGS)
404 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
405 dnl Define _only_ during CVS (not pre-releases or releases)
406 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
410 AC_SUBST(DEPRECATED_CFLAGS)
412 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
413 dnl at make time with e.g. make ERROR_CFLAGS=""
414 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
415 GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
416 AC_SUBST(GST_OPTION_CFLAGS)
417 AC_SUBST(GST_OPTION_CXXFLAGS)
419 dnl FIXME: do we want to rename to GST_ALL_* ?
420 dnl prefer internal headers to already installed ones
421 dnl also add builddir include for enumtypes and marshal
422 dnl add GST_OPTION_CFLAGS, but overridable
423 GST_CFLAGS="$GST_CFLAGS -DGST_USE_UNSTABLE_API"
424 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS)"
425 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
427 AC_SUBST(GST_CXXFLAGS)
430 dnl LDFLAGS 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_ALL_LDFLAGS="-no-undefined"
433 AC_SUBST(GST_ALL_LDFLAGS)
435 dnl this really should only contain flags, not libs - they get added before
436 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
437 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc.*' $GST_ALL_LDFLAGS"
438 AC_SUBST(GST_PLUGIN_LDFLAGS)
440 dnl *** output files ***
447 gst-libs/gst/Makefile
449 gst/asfdemux/Makefile
450 gst/dvdlpcmdec/Makefile
452 gst/realmedia/Makefile
453 gst/synaesthesia/Makefile
458 ext/amrwbdec/Makefile
463 ext/mpeg2dec/Makefile
468 docs/plugins/Makefile
469 docs/version.entities
475 pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
476 gst-plugins-ugly.spec
479 dnl Create the config.h file for Visual Studio builds
480 dnl Beware of spaces and /'s in some of the shell variable contents.
482 -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/' \
483 -e 's/.* GETTEXT_PACKAGE$/#define GETTEXT_PACKAGE "'$GETTEXT_PACKAGE'"/' \
484 -e 's/.* GST_DATADIR$/#define GST_DATADIR PREFIX "\\\\share"/' \
485 -e 's/.* GST_LEVEL_DEFAULT$/#define GST_LEVEL_DEFAULT GST_LEVEL_ERROR/' \
486 -e 's/.* GST_LICENSE$/#define GST_LICENSE "'$GST_LICENSE'"/' \
487 -e 's/.* GST_API_VERSION$/#define GST_API_VERSION "'$GST_API_VERSION'"/' \
488 -e "s,.* GST_PACKAGE_NAME$,#define GST_PACKAGE_NAME \"${GST_PACKAGE_NAME}\"," \
489 -e 's/.* GST_PACKAGE_ORIGIN$/#define GST_PACKAGE_ORIGIN "Unknown package origin"/' \
490 -e "s,.* GST_PACKAGE_RELEASE_DATETIME$,#define GST_PACKAGE_RELEASE_DATETIME \"${GST_PACKAGE_RELEASE_DATETIME}\"," \
491 -e 's/.* HAVE_CPU_I386$/#define HAVE_CPU_I386 1/' \
492 -e 's/.* HAVE_FGETPOS$/#define HAVE_FGETPOS 1/' \
493 -e 's/.* HAVE_FSETPOS$/#define HAVE_FSETPOS 1/' \
494 -e 's/.* HAVE_LIBXML2$/#define HAVE_LIBXML2 1/' \
495 -e 's/.* HAVE_PROCESS_H$/#define HAVE_PROCESS_H 1/' \
496 -e 's/.* HAVE_STDLIB_H$/#define HAVE_STDLIB_H 1/' \
497 -e 's/.* HAVE_STRING_H$/#define HAVE_STRING_H 1/' \
498 -e 's/.* HAVE_SYS_STAT_H$/#define HAVE_SYS_STAT_H 1/' \
499 -e 's/.* HAVE_SYS_TYPES_H$/#define HAVE_SYS_TYPES_H 1/' \
500 -e 's/.* HAVE_WIN32$/#define HAVE_WIN32 1/' \
501 -e 's/.* HAVE_WINSOCK2_H$/#define HAVE_WINSOCK2_H 1/' \
502 -e 's/.* HOST_CPU$/#define HOST_CPU "i686"/' \
503 -e 's/.* LIBDIR$/#ifdef _DEBUG\n# define LIBDIR PREFIX "\\\\debug\\\\lib"\n#else\n# define LIBDIR PREFIX "\\\\lib"\n#endif/' \
504 -e 's/.* LOCALEDIR$/#define LOCALEDIR PREFIX "\\\\share\\\\locale"/' \
505 -e "s/.* PACKAGE$/#define PACKAGE \"$PACKAGE\"/" \
506 -e 's/.* PACKAGE_BUGREPORT$/#define PACKAGE_BUGREPORT "http:\/\/bugzilla.gnome.org\/enter_bug.cgi?product=GStreamer"/' \
507 -e "s/.* PACKAGE_NAME$/#define PACKAGE_NAME \"$PACKAGE_NAME\"/" \
508 -e "s/.* PACKAGE_STRING$/#define PACKAGE_STRING \"$PACKAGE_STRING\"/" \
509 -e 's/.* PACKAGE_TARNAME$/#define PACKAGE_TARNAME "'$PACKAGE_TARNAME'"/' \
510 -e 's/.* PACKAGE_VERSION$/#define PACKAGE_VERSION "'$PACKAGE_VERSION'"/' \
511 -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/' \
512 -e 's/.* USE_BINARY_REGISTRY$/#define USE_BINARY_REGISTRY/' \
513 -e 's/.* VERSION$/#define VERSION "'$VERSION'"/' \
514 -e "s/.* DEFAULT_AUDIOSINK$/#define DEFAULT_AUDIOSINK \"directsoundsink\"/" \
515 -e "s/.* DEFAULT_AUDIOSRC$/#define DEFAULT_AUDIOSRC \"audiotestsrc\"/" \
516 -e "s/.* DEFAULT_VIDEOSRC$/#define DEFAULT_VIDEOSRC \"videotestsrc\"/" \
517 -e "s/.* DEFAULT_VISUALIZER$/#define DEFAULT_VISUALIZER \"goom\"/" \
518 config.h.in >win32/common/config.h-new
522 AG_GST_OUTPUT_PLUGINS