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, 2, 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 PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
96 HAVE_GLIB2=yes,HAVE_GLIB2=no)
98 GLIB_CFLAGS=$GLIB2_CFLAGS
100 AC_SUBST(GLIB_CFLAGS)
102 if test "x$HAVE_GLIB2" = "xno"; then
103 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
106 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
107 AC_SUBST(GST_PKG_DEPS)
109 LIBXML_PKG=', libxml-2.0'
110 PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
111 if test "x$HAVE_LIBXML2" = "xyes"; then
112 AC_DEFINE(HAVE_LIBXML2)
114 AC_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
120 GST_CHECK_LIBHEADER(POPT, popt, poptAddItem,, popt.h, POPT_LIBS="-lpopt",
122 [popt 1.6.3 or newer is required to build gstreamer. You can download the latest
123 version from ftp://people.redhat.com/sopwith/popt/]))
125 dnl Check for atomic.h
126 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
127 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
128 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
129 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
130 if test x$HAVE_ATOMIC_H = xyes; then
132 #include "asm/atomic.h"
133 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
136 if test x$HAVE_ATOMIC_H = xyes; then
137 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
143 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
147 dnl ==========================================================================
148 dnl ============================= gst plugins ================================
149 dnl ==========================================================================
150 GST_PLUGIN_LDFLAGS='-module -avoid-version'
151 AC_SUBST(GST_PLUGIN_LDFLAGS)
153 dnl ######################################################################
154 dnl # Check command line parameters, and set shell variables accordingly #
155 dnl ######################################################################
157 dnl FIXME: simplify all this down using a few m4 macros
159 AC_ARG_ENABLE(libmmx,
160 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
161 [case "${enableval}" in
162 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
164 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
166 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
168 AC_ARG_ENABLE(atomic,
169 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
170 [case "${enableval}" in
171 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
172 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
173 no) USE_ATOMIC_H=no;;
174 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
176 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
178 AC_ARG_ENABLE(plugin-builddir,
179 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
180 [case "${enableval}" in
181 yes) PLUGINS_USE_BUILDDIR=yes ;;
182 no) PLUGINS_USE_BUILDDIR=no ;;
183 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
185 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
188 AC_HELP_STRING([--disable-debug][disable addition of -g debugging info]),
189 [case "${enableval}" in
190 yes) USE_DEBUG=yes ;;
192 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
194 [USE_DEBUG=yes]) dnl Default value
197 AC_HELP_STRING([--disable-DEBUG][disables compilation of debugging messages]),
198 [case "${enableval}" in
199 yes) ENABLE_DEBUG=yes ;;
200 no) ENABLE_DEBUG=no ;;
201 *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
203 [ENABLE_DEBUG=yes]) dnl Default value
204 if test x$ENABLE_DEBUG = xyes; then
205 AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
209 AC_HELP_STRING([--disable-INFO][disables compilation of informational messages]),
210 [case "${enableval}" in
211 yes) ENABLE_INFO=yes ;;
212 no) ENABLE_INFO=no ;;
213 *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
215 [ENABLE_INFO=yes]) dnl Default value
216 if test x$ENABLE_INFO = xyes; then
217 AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
220 AC_ARG_ENABLE(debug-color,
221 AC_HELP_STRING([--disable-debug-color][disables color output of DEBUG and INFO output]),
222 [case "${enableval}" in
223 yes) ENABLE_DEBUG_COLOR=yes ;;
224 no) ENABLE_DEBUG_COLOR=no ;;
225 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
227 [ENABLE_DEBUG_COLOR=yes]) dnl Default value
228 if test "x$ENABLE_DEBUG_COLOR" = xyes; then
229 AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
232 AC_ARG_ENABLE(profiling,
233 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
234 [case "${enableval}" in
235 yes) USE_PROFILING=yes ;;
236 no) UES_PROFILING=no ;;
237 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
239 [USE_PROFILING=no]) dnl Default value
241 dnl default to building registry in the source tree if we are enabling plugin build dir
242 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
245 GST_CONFIG_DIR=/etc/gstreamer
247 AC_ARG_WITH(configdir,
248 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
249 [case "${withval}" in
250 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
251 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
252 *) GST_CONFIG_DIR="${withval}" ;;
254 [:]) dnl Default value
257 AC_HELP_STRING([--disable-tests][disable building test apps]),
258 [case "${enableval}" in
259 yes) BUILD_TESTS=yes ;;
260 no) BUILD_TESTS=no ;;
261 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
263 [BUILD_TESTS=yes]) dnl Default value
265 AC_ARG_ENABLE(examples,
266 AC_HELP_STRING([--disable-examples][disable building examples]),
267 [case "${enableval}" in
268 yes) BUILD_EXAMPLES=yes ;;
269 no) BUILD_EXAMPLES=no ;;
270 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
272 [BUILD_EXAMPLES=yes]) dnl Default value
274 dnl Next, check for the optional components:
275 dnl ========================================
277 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
278 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
279 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
280 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
281 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
282 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
283 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
284 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
285 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
286 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
287 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
288 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
290 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
292 dnl ################################################
293 dnl # Set defines according to variables set above #
294 dnl ################################################
297 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
298 dnl HAVE_ and it is likely to be easier to stick with the old name
299 if test "x$USE_LIBMMX" = xyes; then
300 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
303 if test "x$USE_ATOMIC_H" = xyes; then
304 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
307 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
308 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
311 dnl if test "x$USE_DEBUG" = xyes; then
312 dnl CFLAGS="$CFLAGS -g"
315 if test "x$USE_PROFILING" = xyes; then
316 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
317 FOMIT_FRAME_POINTER=""
319 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
323 dnl AC_SUBST(FOMIT_FRAME_POINTER)
326 dnl #############################
327 dnl # Set automake conditionals #
328 dnl #############################
330 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
331 dnl HAVE_ and it is likely to be easier to stick with the old name
332 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
334 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
335 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
337 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
338 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
339 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
340 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
343 dnl ############################
344 dnl # Set up some more defines #
345 dnl ############################
347 dnl Set location of configuration dir.
348 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
349 AC_SUBST(GST_CONFIG_DIR)
351 dnl Set location of plugin directory
352 if test "x${prefix}" = "xNONE"; then
353 PLUGINS_DIR=${ac_default_prefix}/lib/gst
355 PLUGINS_DIR=${prefix}/lib/gst
357 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
358 AC_SUBST(PLUGINS_DIR)
360 dnl Set location of uninstalled plugin directory
361 PLUGINS_BUILDDIR=`pwd`
362 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
363 AC_SUBST(PLUGINS_BUILDDIR)
365 dnl since glib and xml are package deps, there's no need to include their cflags
366 dnl in the pkg-config file
369 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
370 GST_PKG_LIBS=$GST_EXT_LIBS
371 AC_SUBST(GST_PKG_CFLAGS)
372 AC_SUBST(GST_PKG_LIBS)
374 dnl finalize _CFLAGS and _LIBS
375 dnl add GLIB and XML if necessary to EXT_*
376 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
377 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
379 dnl Private vars for libgst only
380 LIBGST_LIBS="$GST_LIBS"
381 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) -Wall"
382 AC_SUBST(LIBGST_LIBS)
383 AC_SUBST(LIBGST_CFLAGS)
385 dnl Vars for everyone else
386 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
387 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
389 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
390 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
392 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
394 dnl ##################################################
395 dnl # Prepare informative messages to display at end #
396 dnl ##################################################
400 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
401 infomessages="$infomessages
402 *** Warning: You have configured using the --enable-plugin-builddir option.
404 This option is for development purposes only: binaries built with
405 it should be used with code in the build tree only. To build an
406 installable version, use ./configure without the --enable-plugin-builddir
407 option. Note that the autogen.sh script supplies the plugin builddir
408 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
409 an installable build.
414 dnl #########################
415 dnl # Make the output files #
416 dnl #########################
418 dnl libs/ext/Makefile
425 gst/elements/Makefile
426 gst/autoplug/Makefile
427 gst/schedulers/Makefile
430 libs/gst/bytestream/Makefile
431 libs/gst/getbits/Makefile
432 libs/gst/putbits/Makefile
433 libs/gst/control/Makefile
436 tests/bufspeed/Makefile
437 tests/memchunk/Makefile
438 tests/muxing/Makefile
441 testsuite/bytestream/Makefile
442 testsuite/caps/Makefile
443 testsuite/cleanup/Makefile
444 testsuite/elements/Makefile
445 testsuite/plugin/Makefile
447 examples/autoplug/Makefile
448 examples/helloworld/Makefile
449 examples/helloworld2/Makefile
450 examples/launch/Makefile
451 examples/queue/Makefile
452 examples/queue2/Makefile
453 examples/queue3/Makefile
454 examples/queue4/Makefile
455 examples/thread/Makefile
456 examples/mixer/Makefile
457 examples/cutter/Makefile
458 examples/launch/Makefile
459 examples/xml/Makefile
460 examples/plugins/Makefile
461 examples/typefind/Makefile
462 examples/mixer/Makefile
466 docs/gst/gstreamer.types
468 docs/plugins/Makefile
469 docs/plugins/gstreamer-plugins.types
475 gstreamer-uninstalled.pc
477 echo "$infomessages", infomessages="$infomessages"