2 AC_CANONICAL_TARGET([])
4 dnl when going to/from release please set the nano (fourth number) right !
5 AS_VERSION(gstreamer, GST_VERSION, 0, 3, 3, 1)
6 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
7 AS_LIBTOOL(GST, 0, 0, 0, yes)
9 AC_CONFIG_SRCDIR([gst/gst.c])
10 AM_CONFIG_HEADER(config.h)
12 dnl Add parameters for aclocal
13 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
14 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
26 dnl We disable static building for development, for time savings
27 dnl *NOTE*: dnl this line before release, so release does static too
33 dnl ##############################
34 dnl # Do automated configuration #
35 dnl ##############################
40 dnl modify pkg-config path
41 AC_ARG_WITH(pkg-config-path,
42 AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
43 [export PKG_CONFIG_PATH=${withval}])
46 AC_PATH_PROG(NASM_PATH, nasm, no)
48 if test x$NASM_PATH = xno; then
49 AC_MSG_WARN(Couldn't find nasm)
51 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
59 dnl We should really use AC_SYS_LARGEFILE, but the problem is
60 dnl many of the plugins don't include "config.h". To assure
61 dnl binary compatibility, it is necessary that all gstreamer
62 dnl code be compiled with the same sizeof(off_t), so we use
63 dnl the following crude hack.
67 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
69 dnl this is so we can make GST_CFLAGS for external modules available
70 dnl without mixing in internal (uninstalled) CFLAGS
73 AC_MSG_CHECKING(for large file support)
75 #define _LARGEFILE_SOURCE
76 #define _FILE_OFFSET_BITS 64
77 #include <sys/types.h>
78 int main () { return !(sizeof(off_t) == 8); }
82 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
91 dnl Check for essential libraries first:
92 dnl ====================================
95 dnl Minimum required version of GLib2
100 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
101 HAVE_GLIB2=yes,HAVE_GLIB2=no)
102 GLIB_LIBS=$GLIB2_LIBS
103 GLIB_CFLAGS=$GLIB2_CFLAGS
105 AC_SUBST(GLIB_CFLAGS)
107 if test "x$HAVE_GLIB2" = "xno"; then
108 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
111 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
112 AC_SUBST(GST_PKG_DEPS)
115 dnl Minimum required version of libxml2
117 AC_SUBST(LIBXML2_REQ)
119 dnl check for libxml2
120 LIBXML_PKG=', libxml-2.0'
121 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
122 if test "x$HAVE_LIBXML2" = "xyes"; then
123 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
125 AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
131 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
132 AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
133 download the latest version from ftp://people.redhat.com/sopwith/popt/]))
135 dnl Check for atomic.h
136 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
137 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
138 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
139 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
140 if test x$HAVE_ATOMIC_H = xyes; then
142 #include "asm/atomic.h"
143 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
146 if test x$HAVE_ATOMIC_H = xyes; then
147 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
153 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
157 dnl ######################################################################
158 dnl # Check command line parameters, and set shell variables accordingly #
159 dnl ######################################################################
161 dnl FIXME: simplify all this down using a few m4 macros
163 AC_ARG_ENABLE(libmmx,
164 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
165 [case "${enableval}" in
166 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
168 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
170 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
172 AC_ARG_ENABLE(atomic,
173 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
174 [case "${enableval}" in
175 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
176 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
177 no) USE_ATOMIC_H=no;;
178 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
180 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
182 AC_ARG_ENABLE(plugin-builddir,
183 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
184 [case "${enableval}" in
185 yes) PLUGINS_USE_BUILDDIR=yes ;;
186 no) PLUGINS_USE_BUILDDIR=no ;;
187 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
189 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
193 AC_ARG_ENABLE(profiling,
194 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
195 [case "${enableval}" in
196 yes) USE_PROFILING=yes ;;
197 no) UES_PROFILING=no ;;
198 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
200 [USE_PROFILING=no]) dnl Default value
202 dnl default to building registry in the source tree if we are enabling plugin build dir
203 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
206 GST_CONFIG_DIR=/etc/gstreamer
208 AC_ARG_WITH(configdir,
209 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
210 [case "${withval}" in
211 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
212 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
213 *) GST_CONFIG_DIR="${withval}" ;;
215 [:]) dnl Default value
218 AC_HELP_STRING([--disable-tests][disable building test apps]),
219 [case "${enableval}" in
220 yes) BUILD_TESTS=yes ;;
221 no) BUILD_TESTS=no ;;
222 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
224 [BUILD_TESTS=yes]) dnl Default value
226 AC_ARG_ENABLE(examples,
227 AC_HELP_STRING([--disable-examples][disable building examples]),
228 [case "${enableval}" in
229 yes) BUILD_EXAMPLES=yes ;;
230 no) BUILD_EXAMPLES=no ;;
231 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
233 [BUILD_EXAMPLES=yes]) dnl Default value
235 dnl Next, check for the optional components:
236 dnl ========================================
238 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
239 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
240 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
241 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
242 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
243 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
244 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
245 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
246 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
247 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
248 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
249 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
251 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
253 dnl ################################################
254 dnl # Set defines according to variables set above #
255 dnl ################################################
258 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
259 dnl HAVE_ and it is likely to be easier to stick with the old name
260 if test "x$USE_LIBMMX" = xyes; then
261 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
264 if test "x$USE_ATOMIC_H" = xyes; then
265 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
268 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
269 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
272 dnl if test "x$USE_DEBUG" = xyes; then
273 dnl CFLAGS="$CFLAGS -g"
276 if test "x$USE_PROFILING" = xyes; then
277 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
278 FOMIT_FRAME_POINTER=""
280 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
284 dnl AC_SUBST(FOMIT_FRAME_POINTER)
287 dnl #############################
288 dnl # Set automake conditionals #
289 dnl #############################
291 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
292 dnl HAVE_ and it is likely to be easier to stick with the old name
293 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
295 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
296 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
298 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
299 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
300 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
301 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
304 dnl ############################
305 dnl # Set up some more defines #
306 dnl ############################
308 dnl Set location of configuration dir.
309 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
310 AC_SUBST(GST_CONFIG_DIR)
312 dnl Set location of plugin directory
313 if test "x${prefix}" = "xNONE"; then
314 PLUGINS_DIR=${ac_default_prefix}/lib/gst
316 PLUGINS_DIR=${prefix}/lib/gst
318 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
319 AC_SUBST(PLUGINS_DIR)
321 dnl Set location of uninstalled plugin directory
322 PLUGINS_BUILDDIR=`pwd`
323 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
324 AC_SUBST(PLUGINS_BUILDDIR)
326 dnl since glib and xml are package deps, there's no need to include their cflags
327 dnl in the pkg-config file
330 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
331 GST_PKG_LIBS=$GST_EXT_LIBS
332 AC_SUBST(GST_PKG_CFLAGS)
333 AC_SUBST(GST_PKG_LIBS)
335 dnl finalize _CFLAGS and _LIBS
336 dnl add GLIB and XML if necessary to EXT_*
337 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
338 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
340 dnl Private vars for libgst only
341 LIBGST_LIBS="$GST_LIBS"
342 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) -Wall"
343 AC_SUBST(LIBGST_LIBS)
344 AC_SUBST(LIBGST_CFLAGS)
346 dnl Vars for everyone else
347 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
348 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
350 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
351 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
353 GST_PLUGIN_LDFLAGS='-module -avoid-version'
354 AC_SUBST(GST_PLUGIN_LDFLAGS)
356 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
358 dnl ##################################################
359 dnl # Prepare informative messages to display at end #
360 dnl ##################################################
364 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
365 infomessages="$infomessages
366 *** Warning: You have configured using the --enable-plugin-builddir option.
368 This option is for development purposes only: binaries built with
369 it should be used with code in the build tree only. To build an
370 installable version, use ./configure without the --enable-plugin-builddir
371 option. Note that the autogen.sh script supplies the plugin builddir
372 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
373 an installable build.
378 dnl #########################
379 dnl # Make the output files #
380 dnl #########################
382 dnl libs/ext/Makefile
388 gst/autoplug/Makefile
389 gst/elements/Makefile
391 gst/schedulers/Makefile
395 libs/gst/bytestream/Makefile
396 libs/gst/getbits/Makefile
397 libs/gst/putbits/Makefile
398 libs/gst/control/Makefile
401 tests/bufspeed/Makefile
402 tests/memchunk/Makefile
403 tests/muxing/Makefile
406 testsuite/bytestream/Makefile
407 testsuite/caps/Makefile
408 testsuite/cleanup/Makefile
409 testsuite/elements/Makefile
410 testsuite/plugin/Makefile
411 testsuite/dynparams/Makefile
413 examples/autoplug/Makefile
414 examples/helloworld/Makefile
415 examples/helloworld2/Makefile
416 examples/launch/Makefile
417 examples/queue/Makefile
418 examples/queue2/Makefile
419 examples/queue3/Makefile
420 examples/queue4/Makefile
421 examples/thread/Makefile
422 examples/mixer/Makefile
423 examples/cutter/Makefile
424 examples/launch/Makefile
425 examples/xml/Makefile
426 examples/plugins/Makefile
427 examples/typefind/Makefile
428 examples/mixer/Makefile
432 docs/gst/gstreamer.types
434 docs/plugins/Makefile
435 docs/plugins/gstreamer-plugins.types
439 docs/devhelp/Makefile
442 gstreamer-uninstalled.pc
444 echo "$infomessages", infomessages="$infomessages"