3 dnl initialize autoconf
4 dnl when going to/from release please set the nano (fourth number) right !
5 dnl releases only do Wall, cvs and prerelease does Werror too
6 AC_INIT(GStreamer FFMpeg, 0.10.6.1,
7 http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer,
12 dnl initialize automake
15 dnl define PACKAGE_VERSION_* variables
18 dnl check if this is a release version
19 AS_NANO(GST_CVS="no", GST_CVS="yes")
21 dnl can autoconf find the source ?
22 AC_CONFIG_SRCDIR([ext/ffmpeg/gstffmpeg.c])
24 dnl where are our m4 macros ?
25 AC_CONFIG_MACRO_DIR([common/m4])
27 dnl define the output header for config
28 AM_CONFIG_HEADER([config.h])
30 dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
33 dnl sets host_* variables
36 dnl our libraries and install dirs use major.minor as a version
37 GST_MAJORMINOR=$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR
38 dnl we override it here if we need to for the release candidate of new series
40 AC_SUBST(GST_MAJORMINOR)
45 dnl *** required versions of GStreamer stuff ***
50 dnl *** autotools stuff ****
52 dnl allow for different autotools
53 AS_AUTOTOOLS_ALTERNATE
55 dnl Add parameters for aclocal
56 AC_SUBST(ACLOCAL_AMFLAGS, "-I m4 -I common/m4")
58 dnl *** check for arguments to configure ***
60 AG_GST_ARG_WITH_PACKAGE_NAME
61 AG_GST_ARG_WITH_PACKAGE_ORIGIN
64 dnl *** checks for platform ***
66 dnl * hardware/architecture *
68 dnl common/m4/gst-arch.m4
72 dnl *** checks for programs ***
77 # FIXME: are these two lines needed ?
81 dnl check if the compiler supports '-c' and '-o' options
84 AC_PATH_PROG(VALGRIND_PATH, valgrind, no)
85 AM_CONDITIONAL(HAVE_VALGRIND, test ! "x$VALGRIND_PATH" = "xno")
87 dnl check for documentation tools
91 AG_GST_PLUGIN_DOCS([1.3],[2.1])
93 dnl *** checks for libraries ***
95 dnl check for libm, for sin()
99 dnl *** checks for header files ***
101 dnl check if we have ANSI C header files
104 dnl *** checks for types/defines ***
106 dnl *** checks for structures ***
108 dnl *** checks for compiler characteristics ***
110 dnl *** checks for library functions ***
112 dnl *** checks for dependancy libraries ***
114 dnl checks for gstreamer
115 dnl uninstalled is selected preferentially -- see pkg-config(1)
116 AG_GST_CHECK_GST($GST_MAJORMINOR, [$GST_REQ])
117 AG_GST_CHECK_GST_BASE($GST_MAJORMINOR, [$GST_REQ])
118 AG_GST_CHECK_GST_PLUGINS_BASE($GST_MAJORMINOR, [$GST_REQ])
119 AG_GST_CHECK_GST_CHECK($GST_MAJORMINOR, [$GST_REQ], no)
120 AM_CONDITIONAL(HAVE_GST_CHECK, test "x$HAVE_GST_CHECK" = "xyes")
122 AC_MSG_NOTICE(Using GStreamer Core Plugins in $GST_PLUGINS_DIR)
123 AC_MSG_NOTICE(Using GStreamer Base Plugins in $GSTPB_PLUGINS_DIR)
125 dnl liboil is required for cpu detection for libpostproc
126 dnl FIXME : In theory we should be able to compile libpostproc with cpudetect
127 dnl capabilities, which would enable us to get rid of this
128 PKG_CHECK_MODULES(LIBOIL, liboil-$LIBOIL_MAJORMINOR >= $LIBOIL_REQ, HAVE_LIBOIL=yes, HAVE_LIBOIL=no)
129 if test "x$HAVE_LIBOIL" != "xyes"
131 AC_MSG_ERROR([liboil-$LIBOIL_REQ or later is required])
135 AC_SUBST(LIBOIL_CFLAGS)
136 AC_SUBST(LIBOIL_LIBS)
138 dnl *** set variables based on configure arguments ***
140 dnl set location of plugin directory
143 dnl define an ERROR_CFLAGS Makefile variable
144 AG_GST_SET_ERROR_CFLAGS($GST_CVS)
146 dnl define correct level for debugging messages
147 AG_GST_SET_LEVEL_DEFAULT($GST_CVS)
149 dnl *** finalize CFLAGS, LDFLAGS, LIBS ***
152 dnl GST_OPTION_CFLAGS: common flags for profiling, debugging, errors, ...
153 dnl GST_*: flags shared by built objects to link against GStreamer
154 dnl GST_ALL_LDFLAGS: linker flags shared by all
155 dnl GST_LIB_LDFLAGS: additional linker flags for all libaries
156 dnl GST_LT_LDFLAGS: library versioning of our libraries
157 dnl GST_PLUGIN_LDFLAGS: flags to be used for all plugins
159 dnl GST_OPTION_CFLAGS
160 if test "x$USE_DEBUG" = xyes; then
163 AC_SUBST(PROFILE_CFLAGS)
165 if test "x$GST_CVS" = "xyes"; then
166 DEPRECATED_CFLAGS="-DGST_DISABLE_DEPRECATED"
170 AC_SUBST(DEPRECATED_CFLAGS)
172 dnl every flag in GST_OPTION_CFLAGS can be overridden at make time
173 GST_OPTION_CFLAGS="\$(ERROR_CFLAGS) \$(DEBUG_CFLAGS) \$(PROFILE_CFLAGS) \$(GCOV_CFLAGS) \$(OPT_CFLAGS) \$(DEPRECATED_CFLAGS)"
175 AC_SUBST(GST_OPTION_CFLAGS)
177 dnl FIXME: do we want to rename to GST_ALL_* ?
178 dnl prefer internal headers to already installed ones
179 dnl also add builddir include for enumtypes and marshal
180 dnl add GST_OPTION_CFLAGS, but overridable
181 GST_CFLAGS="-I\$(top_srcdir)/gst-libs -I\$(top_builddir)/gst-libs $GST_CFLAGS \$(GST_OPTION_CFLAGS)"
185 GST_ALL_LDFLAGS="-no-undefined"
186 AC_SUBST(GST_ALL_LDFLAGS)
188 dnl this really should only contain flags, not libs - they get added before
189 dnl whatevertarget_LIBS and -L flags here affect the rest of the linking
190 GST_PLUGIN_LDFLAGS="-module -avoid-version -export-symbols-regex '^[_]*gst_plugin_desc\$\$' $GST_ALL_LDFLAGS"
191 AC_SUBST(GST_PLUGIN_LDFLAGS)
193 dnl Add MacOSX specific flags
197 DARWIN_LDFLAGS="-Wl,-read_only_relocs,suppress"
203 AC_SUBST(DARWIN_LDFLAGS)
205 dnl *** Check for bz2
206 AG_GST_CHECK_LIBHEADER(BZ2, bz2, BZ2_bzlibVersion, , bzlib.h,, AC_ERROR([libbz2 is required]))
208 dnl *** configure external libs ***
210 HAVE_FFMPEG_UNINSTALLED=1
212 AC_ARG_WITH(system-ffmpeg,
213 [AC_HELP_STRING([--with-system-ffmpeg], [use system FFmpeg libraries])])
215 if test "x$with_system_ffmpeg" = "xyes"; then
216 PKG_CHECK_MODULES(FFMPEG, libavutil libavcodec libavformat)
217 PKG_CHECK_MODULES(POSTPROC, libavutil libavcodec libpostproc)
218 PKG_CHECK_MODULES(SWSCALE, libavutil libswscale)
219 saved_CPPFLAGS="$CPPFLAGS"
220 CPPFLAGS="$CPPFLAGS $FFMPEG_CFLAGS"
221 AC_CHECK_HEADERS([avi.h])
222 CPPFLAGS="$saved_CPPFLAGS"
223 AC_DEFINE([FFMPEG_SOURCE], ["system install"], [Describes where the FFmpeg libraries come from.])
224 HAVE_FFMPEG_UNINSTALLED=0
225 AC_MSG_NOTICE([Using system-installed FFMpeg code])
227 ======================================================================
228 WARNING: you have chosen to build gst-ffmpeg against a random
229 external version of ffmpeg instead of building it against the tested
230 internal ffmpeg snapshot that is included with gst-ffmpeg.
232 This is a very bad idea. So bad in fact that words cannot express
233 just how bad it is. Suffice to say that it is BAD.
235 The GStreamer developers cannot and will not support a gst-ffmpeg
236 built this way. Any bug reports that indicate there is an external
237 version of ffmpeg involved will be closed immediately without further
240 The reason such a setup can't be supported is that the ffmpeg API
241 and ABI is in constant flux, yet there aren't any official releases
242 of the ffmpeg library to develop against. This makes it impossible
243 to guarantee that gst-ffmpeg will work reliably, or even compile,
244 with a randomly picked version ffmpeg. Even if gst-ffmpeg compiles
245 and superficially appears to work fine against your chosen external
246 ffmpeg version, that might just not be the case on other systems, or
247 even the same system at a later time, or when using decoders,
248 encoders, demuxers or muxers that have not been tested.
250 Please do not create or distribute binary packages of gst-ffmpeg
251 that link against an external ffmpeg. Thank you!
252 ======================================================================
255 dnl No, this is not too extreme, we want people to see and read the above
259 source "$srcdir/ffmpegrev"
261 AC_MSG_NOTICE([Using ffmpeg revision $FFMPEG_REVISION])
263 dnl libgstffmpeg.la: include dirs
264 FFMPEG_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavformat \
265 -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \
266 -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavcodec \
267 -I \$(top_srcdir)/gst-libs/ext/ffmpeg \
268 -Wno-deprecated-declarations"
270 dnl libgstffmpeg.la: libs to statically link to
271 FFMPEG_LIBS="\$(top_builddir)/gst-libs/ext/ffmpeg/libavformat/libavformat.a \
272 \$(top_builddir)/gst-libs/ext/ffmpeg/libavcodec/libavcodec.a \
273 \$(top_builddir)/gst-libs/ext/ffmpeg/libavutil/libavutil.a"
275 POSTPROC_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libpostproc \
276 -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \
277 -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavcodec \
278 -I \$(top_srcdir)/gst-libs/ext/ffmpeg \
279 -Wno-deprecated-declarations"
281 dnl libgstpostproc.la: libs to statically link to
282 POSTPROC_LIBS="\$(top_builddir)/gst-libs/ext/ffmpeg/libpostproc/libpostproc.a \
283 \$(top_builddir)/gst-libs/ext/ffmpeg/libavutil/libavutil.a"
286 SWSCALE_CFLAGS="-I \$(top_srcdir)/gst-libs/ext/ffmpeg/libswscale \
287 -I \$(top_srcdir)/gst-libs/ext/ffmpeg/libavutil \
288 -I \$(top_srcdir)/gst-libs/ext/ffmpeg \
289 -Wno-deprecated-declarations"
291 dnl libgstswscale.la: libs to statically link to
292 SWSCALE_LIBS="\$(top_builddir)/gst-libs/ext/ffmpeg/libswscale/libswscale.a \
293 \$(top_builddir)/gst-libs/ext/ffmpeg/libavutil/libavutil.a"
295 FFMPEG_SUBDIRS=gst-libs
296 AC_DEFINE(HAVE_AVI_H)
297 AC_DEFINE([FFMPEG_SOURCE], ["local snapshot"], [Describes where the FFmpeg libraries come from.])
299 AC_ARG_WITH(ffmpeg-extra-configure,
300 AC_HELP_STRING([--with-ffmpeg-extra-configure="xxx"],
301 [extra configure options for internal ffmpeg ./configure script]),,
302 with_ffmpeg_extra_configure=no)
304 # Enable shared and static so that we get .a files, but with PIC code.
305 ac_configure_args="$ac_configure_args --disable-vhook --disable-ffserver --disable-ffplay --enable-postproc --enable-swscale --enable-gpl --enable-static --enable-shared --disable-encoder=flac --disable-decoder=cavs --disable-protocols --disable-devices --disable-network"
307 # if we are cross-compiling, tell ffmpeg so
308 if test "x$cross_compiling" = xyes; then
309 ac_configure_args="$ac_configure_args --enable-cross-compile \
310 --target-os=$host_os --arch=$host_cpu --cross-prefix=$host_alias-"
314 # Unfortunately, in Mac OS 10.5 the current rev of ffmpeg builds
315 # some non-PIC code into the .a file. See
316 # http://trac.macosforge.org/projects/macports/ticket/13725 for more
319 ac_configure_args="$ac_configure_args --disable-mmx --disable-altivec"
322 ac_configure_args="$ac_configure_args --enable-memalign-hack"
323 WIN32_LIBS="-lws2_32"
330 # append extra configure options to ac_configure_args if needed
331 if test "x$with_ffmpeg_extra_configure" != no; then
332 ac_configure_args="$ac_configure_args $with_ffmpeg_extra_configure"
335 AC_SUBST(FFMPEG_CO_DIR)
337 AC_SUBST(FFMPEG_REVISION)
338 AC_CONFIG_SUBDIRS(gst-libs/ext/ffmpeg)
339 AC_MSG_NOTICE([Using included FFMpeg code])
342 AC_SUBST(FFMPEG_CFLAGS)
343 AC_SUBST(FFMPEG_LIBS)
344 AC_SUBST(FFMPEG_SUBDIRS)
345 AC_SUBST(POSTPROC_CFLAGS)
346 AC_SUBST(POSTPROC_LIBS)
347 AC_SUBST(SWSCALE_CFLAGS)
348 AC_SUBST(SWSCALE_LIBS)
351 if test x$HAVE_FFMPEG_UNINSTALLED = x1; then
352 AC_DEFINE(HAVE_FFMPEG_UNINSTALLED, [], [Defined if building against uninstalled FFmpeg source])
354 AM_CONDITIONAL(HAVE_FFMPEG_UNINSTALLED, test x$HAVE_FFMPEG_UNINSTALLED = x1)
361 ext/libpostproc/Makefile
362 ext/libswscale/Makefile
364 gst-libs/ext/Makefile
366 docs/version.entities