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],[1.11.0.1],[http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer],[gst-plugins-ugly])
12 dnl initialize automake
13 AM_INIT_AUTOMAKE([-Wno-portability 1.14 no-dist-gzip dist-xz tar-ustar subdir-objects])
15 dnl define PACKAGE_VERSION_* variables
18 dnl check if this is a release version
19 AS_NANO(GST_GIT="no", GST_GIT="yes")
21 dnl can autoconf find the source ?
22 AC_CONFIG_SRCDIR([ext/mad/gstmad.c])
24 dnl define the output header for config
25 AC_CONFIG_HEADERS(config.h)
27 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
28 AM_MAINTAINER_MODE([enable])
30 dnl sets host_* variables
33 dnl use pretty build output with automake >= 1.11
34 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],
35 [AM_DEFAULT_VERBOSITY=1
36 AC_SUBST(AM_DEFAULT_VERBOSITY)])
38 dnl our libraries and install dirs use GST_API_VERSION in the filename
39 dnl to allow side-by-side installation of different API versions
41 AC_SUBST(GST_API_VERSION)
42 AC_DEFINE_UNQUOTED(GST_API_VERSION, "$GST_API_VERSION",
43 [GStreamer API Version])
45 AS_LIBTOOL(GST, 1100, 0, 1100)
47 dnl *** required versions of GStreamer stuff ***
51 dnl *** autotools stuff ****
53 dnl allow for different autotools
54 AS_AUTOTOOLS_ALTERNATE
56 dnl Add parameters for aclocal
57 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
60 dnl the version check needs to stay here because autopoint greps for it
61 AM_GNU_GETTEXT_VERSION(0.17)
62 AM_GNU_GETTEXT([external])
63 AG_GST_GETTEXT([gst-plugins-ugly-$GST_API_VERSION])
65 dnl *** check for arguments to configure ***
67 AG_GST_ARG_DISABLE_FATAL_WARNINGS
68 AG_GST_ARG_ENABLE_EXTRA_CHECKS
77 AG_GST_ARG_WITH_PKG_CONFIG_PATH
78 AG_GST_ARG_WITH_PACKAGE_NAME
79 AG_GST_ARG_WITH_PACKAGE_ORIGIN
81 AG_GST_ARG_WITH_PLUGINS
83 AG_GST_ARG_ENABLE_EXTERNAL
85 AG_GST_ARG_ENABLE_EXPERIMENTAL
87 dnl *** checks for platform ***
89 dnl * hardware/architecture *
91 dnl common/m4/gst-arch.m4
95 dnl Determine endianness
98 dnl *** checks for programs ***
104 dnl determine c++ compiler
106 dnl determine if c++ is available on this system
107 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
109 dnl check if the compiler supports '-c' and '-o' options
112 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
113 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
115 dnl check if the compiler supports do while(0) macros
116 AG_GST_CHECK_DOWHILE_MACROS
118 dnl check for documentation tools
119 GTK_DOC_CHECK([1.12])
120 AG_GST_PLUGIN_DOCS([1.12])
122 dnl *** checks for libraries ***
124 dnl check for libm, for sin()
128 dnl *** checks for header files ***
130 dnl used by ext/a52dec
133 dnl Check for malloc.h
134 AC_CHECK_HEADERS([malloc.h])
136 dnl *** checks for types/defines ***
138 dnl *** checks for structures ***
140 dnl *** checks for compiler characteristics ***
142 dnl *** checks for library functions ***
144 dnl Check for a way to display the function name in debug output
145 AG_GST_CHECK_FUNCTION
147 dnl *** checks for dependency libraries ***
151 AG_GST_GLIB_CHECK([$GLIB_REQ])
155 dnl checks for gstreamer
156 dnl uninstalled is selected preferentially -- see pkg-config(1)
157 AG_GST_CHECK_GST($GST_API_VERSION, [$GST_REQ], yes)
158 AG_GST_CHECK_GST_BASE($GST_API_VERSION, [$GST_REQ], yes)
159 AG_GST_CHECK_GST_CHECK($GST_API_VERSION, [$GST_REQ], no)
160 AG_GST_CHECK_GST_PLUGINS_BASE($GST_API_VERSION, [$GSTPB_REQ], yes)
161 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
163 dnl Check for documentation xrefs
164 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
165 GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-$GST_API_VERSION`"
166 GSTPB_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-plugins-base-$GST_API_VERSION`"
167 AC_SUBST(GLIB_PREFIX)
169 AC_SUBST(GSTPB_PREFIX)
171 dnl Needed by plugins that use g_module_*() API
172 PKG_CHECK_MODULES(GMODULE_NO_EXPORT, gmodule-no-export-2.0)
174 dnl Check for -Bsymbolic-functions linker flag used to avoid
175 dnl intra-library PLT jumps, if available.
176 AC_ARG_ENABLE(Bsymbolic,
177 [AS_HELP_STRING([--disable-Bsymbolic],[avoid linking with -Bsymbolic])],,
178 [SAVED_LDFLAGS="${LDFLAGS}" SAVED_LIBS="${LIBS}"
179 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
180 LDFLAGS=-Wl,-Bsymbolic-functions
182 AC_TRY_LINK([], [return 0],
184 enable_Bsymbolic=yes,
187 LDFLAGS="${SAVED_LDFLAGS}" LIBS="${SAVED_LIBS}"])
189 dnl *** set variables based on configure arguments ***
191 dnl set license and copyright notice
193 AC_DEFINE_UNQUOTED(GST_LICENSE, "$GST_LICENSE", [GStreamer license])
194 AC_SUBST(GST_LICENSE)
196 dnl set location of plugin directory
199 dnl set release date/time
200 AG_GST_SET_PACKAGE_RELEASE_DATETIME_WITH_NANO([$PACKAGE_VERSION_NANO],
201 ["${srcdir}/gst-plugins-ugly.doap"],
202 [$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_MICRO])
204 dnl build static plugins or not
205 AC_MSG_CHECKING([whether to build static plugins or not])
209 [--enable-static-plugins],
210 [build static plugins @<:@default=no@:>@]),
212 [$enableval], [no], [], [yes], [],
213 [AC_MSG_ERROR([bad value "$enableval" for --enable-static-plugins])])],
214 [enable_static_plugins=no])
215 AC_MSG_RESULT([$enable_static_plugins])
216 if test "x$enable_static_plugins" = xyes; then
217 AC_DEFINE(GST_PLUGIN_BUILD_STATIC, 1,
218 [Define if static plugins should be built])
219 GST_PLUGIN_LIBTOOLFLAGS=""
221 GST_PLUGIN_LIBTOOLFLAGS="--tag=disable-static"
223 AC_SUBST(GST_PLUGIN_LIBTOOLFLAGS)
224 AM_CONDITIONAL(GST_PLUGIN_BUILD_STATIC, test "x$enable_static_plugins" = "xyes")
226 dnl define an ERROR_CFLAGS Makefile variable
227 AG_GST_SET_ERROR_CFLAGS($FATAL_WARNINGS, [
228 -Wmissing-declarations -Wmissing-prototypes -Wredundant-decls
229 -Wwrite-strings -Wformat-nonliteral -Wformat-security -Wold-style-definition
230 -Winit-self -Wmissing-include-dirs -Waddress
231 -Waggregate-return -Wno-multichar -Wnested-externs ])
233 dnl define an ERROR_CXXFLAGS Makefile variable
234 AG_GST_SET_ERROR_CXXFLAGS($FATAL_WARNINGS, [
235 -Wmissing-declarations -Wredundant-decls
236 -Wwrite-strings -Wformat-nonliteral -Wformat-security
237 -Winit-self -Wmissing-include-dirs -Waddress -Waggregate-return
240 dnl define correct level for debugging messages
241 AG_GST_SET_LEVEL_DEFAULT($GST_GIT)
244 AG_GST_DEFAULT_ELEMENTS
246 dnl *** plug-ins to include ***
248 dnl these are all the gst plug-ins, compilable without additional libs
249 AG_GST_CHECK_PLUGIN(asfdemux)
250 AG_GST_CHECK_PLUGIN(dvdlpcmdec)
251 AG_GST_CHECK_PLUGIN(dvdsub)
252 AG_GST_CHECK_PLUGIN(xingmux)
253 AG_GST_CHECK_PLUGIN(realmedia)
255 AC_CHECK_HEADERS([winsock2.h], HAVE_WINSOCK2_H=yes)
257 if test "x$HAVE_WINSOCK2_H" = "xyes"; then
258 WIN32_LIBS="-lws2_32"
262 dnl *** ext plug-ins ***
263 dnl keep this list sorted alphabetically !
265 if test "x$BUILD_EXTERNAL" = "xyes"; then
268 AC_MSG_NOTICE([Checking libraries for plugins in ext/])
272 translit(dnm, m, l) AM_CONDITIONAL(USE_A52DEC, true)
273 AG_GST_CHECK_FEATURE(A52DEC, [a52dec], a52dec, [
274 AC_CHECK_A52DEC(HAVE_A52DEC=yes, HAVE_A52DEC=no)
278 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
279 AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [
280 AG_GST_PKG_CHECK_MODULES(AMRNB, opencore-amrnb >= 0.1.3)
283 dnl *** amr-wb dec ***
284 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
285 AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [
286 AG_GST_PKG_CHECK_MODULES(AMRWB, opencore-amrwb >= 0.1.3)
290 translit(dnm, m, l) AM_CONDITIONAL(USE_CDIO, true)
291 AG_GST_CHECK_FEATURE(CDIO, [cdio library], cdio, [
292 AG_GST_PKG_CHECK_MODULES(CDIO, libcdio >= 0.76)
296 translit(dnm, m, l) AM_CONDITIONAL(USE_DVDREAD, true)
297 AG_GST_CHECK_FEATURE(DVDREAD, [dvdread library], dvdreadsrc, [
298 AG_GST_CHECK_LIBHEADER(DVDREAD, dvdread, DVDOpen, , dvdread/dvd_reader.h, DVDREAD_LIBS="-ldvdread")
299 AC_SUBST(DVDREAD_LIBS)
303 translit(dnm, m, l) AM_CONDITIONAL(USE_LAME, true)
304 AG_GST_CHECK_FEATURE(LAME, [lame mp3 encoder library], lame, [
305 AG_GST_CHECK_LIBHEADER(LAME, mp3lame, lame_init, $LIBM, lame/lame.h,
308 LAME_LIBS="-lmp3lame $LIBM"
309 dnl is lame presets available
311 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lame/lame.h>]], [[ int preset = MEDIUM ]])],[LAME_CFLAGS="-DGSTLAME_PRESET"],[LAME_CFLAGS=""
313 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <lame/lame.h>]], [[
314 void *ptr = &lame_set_VBR_quality
315 ]])],[LAME_CFLAGS="$LAME_CFLAGS -DHAVE_LAME_SET_VBR_QUALITY"],[LAME_CFLAGS="$LAME_CFLAGS"
317 AC_SUBST(LAME_CFLAGS)
323 translit(dnm, m, l) AM_CONDITIONAL(USE_MAD, true)
324 AG_GST_CHECK_FEATURE(MAD, [mad mp3 decoder], mad, [
326 dnl check with pkg-config first
327 AG_GST_PKG_CHECK_MODULES(MAD, mad >= 0.15)
329 if test "x$HAVE_MAD" = "xno"; then
330 dnl fall back to oldskool detection
331 AC_CHECK_HEADER(mad.h, [
332 AC_CHECK_LIB(mad, mad_decoder_finish,
333 HAVE_MAD="yes" MAD_LIBS="-lmad")
340 translit(dnm, m, l) AM_CONDITIONAL(USE_MPEG2DEC, true)
341 AG_GST_CHECK_FEATURE(MPEG2DEC, [mpeg2dec], mpeg2dec, [
342 AG_GST_PKG_CHECK_MODULES(MPEG2DEC, libmpeg2 >= 0.5.1)
346 translit(dnm, m, l) AM_CONDITIONAL(USE_MPG123, true)
347 AG_GST_CHECK_FEATURE(MPG123, [mpg123 audio decoder], mpg123, [
348 PKG_CHECK_MODULES(MPG123, libmpg123 >= 1.13, HAVE_MPG123="yes", HAVE_MPG123="no")
349 AC_SUBST(MPG123_CFLAGS)
350 AC_SUBST(MPG123_LIBS)
353 dnl *** sidplay : works with libsidplay 1.36.x (not 2.x.x) ***
354 translit(dnm, m, l) AM_CONDITIONAL(USE_SIDPLAY, true)
355 AG_GST_CHECK_FEATURE(SIDPLAY, [libsidplay], sid, [
360 translit(dnm, m, l) AM_CONDITIONAL(USE_TWOLAME, true)
361 AG_GST_CHECK_FEATURE(TWOLAME, [twolame], twolame, [
362 PKG_CHECK_MODULES(TWOLAME, twolame >= 0.3.10, [
363 HAVE_TWOLAME="yes"], [
366 AC_SUBST(TWOLAME_CFLAGS)
367 AC_SUBST(TWOLAME_LIBS)
370 dnl *** x264 (MPEG-4 part 10/h.264/AVC encoder) ***
371 translit(dnm, m, l) AM_CONDITIONAL(USE_X264, true)
372 AG_GST_CHECK_FEATURE(X264, [x264 plug-in], x264, [
373 AG_GST_PKG_CHECK_MODULES(X264, x264 >= 0.120)
375 dnl Paths to additional x264 library variants, e.g. 10/12 bit
376 AC_ARG_WITH([x264-libraries],
377 AS_HELP_STRING([--with-x264-libraries=PATHS], [Colon separated list of additional x264 library paths, e.g. for 10-bit version]),
379 if test "x$withval" != "x"
381 AC_DEFINE_UNQUOTED(HAVE_X264_ADDITIONAL_LIBRARIES, "$withval", [Additional x264 libraries])
389 dnl not building plugins with external dependencies,
390 dnl but we still need to set the conditionals
392 AM_CONDITIONAL(USE_A52DEC, false)
393 AM_CONDITIONAL(USE_AMRNB, false)
394 AM_CONDITIONAL(USE_AMRWB, false)
395 AM_CONDITIONAL(USE_CDIO, false)
396 AM_CONDITIONAL(USE_DVDREAD, false)
397 AM_CONDITIONAL(USE_LAME, false)
398 AM_CONDITIONAL(USE_MAD, false)
399 AM_CONDITIONAL(USE_MPEG2DEC, false)
400 AM_CONDITIONAL(USE_MPG123, false)
401 AM_CONDITIONAL(USE_SIDPLAY, false)
402 AM_CONDITIONAL(USE_TWOLAME, false)
403 AM_CONDITIONAL(USE_X264, false)
405 fi dnl of EXT plugins
407 dnl *** finalize CFLAGS, LDFLAGS, LIBS
410 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
411 dnl GST_*: flags shared by built objects to link against GStreamer
412 dnl GST_ALL_LDFLAGS: linker flags shared by all
413 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
414 dnl GST_LT_LDFLAGS: library versioning of our libraries
415 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
417 dnl GST_OPTION_CFLAGS
418 if test "x$USE_DEBUG" = xyes; then
421 AC_SUBST(PROFILE_CFLAGS)
423 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
424 dnl Define _only_ during CVS (not pre-releases or releases)
425 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
429 AC_SUBST(DEPRECATED_CFLAGS)
431 dnl every flag in GST_OPTION_CFLAGS and GST_OPTION_CXXFLAGS can be overridden
432 dnl at make time with e.g. make ERROR_CFLAGS=""
433 GST_OPTION_CFLAGS="\$(WARNING_CFLAGS) \$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
434 GST_OPTION_CXXFLAGS="\$(WARNING_CXXFLAGS) \$(ERROR_CXXFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
435 AC_SUBST(GST_OPTION_CFLAGS)
436 AC_SUBST(GST_OPTION_CXXFLAGS)
438 dnl FIXME: do we want to rename to GST_ALL_* ?
439 dnl prefer internal headers to already installed ones
440 dnl also add builddir include for enumtypes and marshal
441 dnl add GST_OPTION_CFLAGS, but overridable
442 GST_CFLAGS="$GST_CFLAGS"
443 GST_CXXFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CXXFLAGS)"
444 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS $GLIB_EXTRA_CFLAGS \$(GST_OPTION_CFLAGS)"
446 AC_SUBST(GST_CXXFLAGS)
449 dnl LDFLAGS really should only contain flags, not libs - they get added before
450 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
451 GST_ALL_LDFLAGS="-no-undefined"
452 if test "x${enable_Bsymbolic}" = "xyes"; then
453 GST_ALL_LDFLAGS="$GST_ALL_LDFLAGS -Wl,-Bsymbolic-functions"
455 AC_SUBST(GST_ALL_LDFLAGS)
457 dnl this really should only contain flags, not libs - they get added before
458 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
459 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_.*' $GST_ALL_LDFLAGS"
460 AC_SUBST(GST_PLUGIN_LDFLAGS)
462 dnl *** output files ***
469 gst-libs/gst/Makefile
471 gst/asfdemux/Makefile
472 gst/dvdlpcmdec/Makefile
474 gst/realmedia/Makefile
479 ext/amrwbdec/Makefile
484 ext/mpeg2dec/Makefile
490 docs/plugins/Makefile
491 docs/version.entities
498 pkgconfig/gstreamer-plugins-ugly-uninstalled.pc
503 AG_GST_OUTPUT_PLUGINS