1 dnl Note: this file is now the main autoconf file
3 AC_CANONICAL_TARGET([])
5 dnl when going to/from release please set the nano (fourth number) right !
6 AS_VERSION(gstreamer, GST_VERSION, 0, 3, 2, 1)
7 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
8 AS_LIBTOOL(GST, 0, 0, 0, yes)
10 AC_CONFIG_SRCDIR([gst/gst.c])
11 AM_CONFIG_HEADER(config.h)
13 dnl Add parameters for aclocal
14 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
15 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
27 dnl We disable static building for development, for time savings
28 dnl *NOTE*: dnl this line before release, so release does static too
34 dnl ##############################
35 dnl # Do automated configuration #
36 dnl ##############################
41 dnl modify pkg-config path
42 AC_ARG_WITH(pkg-config-path,
43 AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
44 [export PKG_CONFIG_PATH=${withval}])
47 AC_PATH_PROG(NASM_PATH, nasm, no)
49 if test x$NASM_PATH = xno; then
50 AC_MSG_WARN(Couldn't find nasm)
52 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
60 dnl We should really use AC_SYS_LARGEFILE, but the problem is
61 dnl many of the plugins don't include "config.h". To assure
62 dnl binary compatibility, it is necessary that all gstreamer
63 dnl code be compiled with the same sizeof(off_t), so we use
64 dnl the following crude hack.
68 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
70 dnl this is so we can make GST_CFLAGS for external modules available
71 dnl without mixing in internal (uninstalled) CFLAGS
74 AC_MSG_CHECKING(for large file support)
76 #define _LARGEFILE_SOURCE
77 #define _FILE_OFFSET_BITS 64
78 #include <sys/types.h>
79 int main () { return !(sizeof(off_t) == 8); }
83 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
92 dnl Check for essential libraries first:
93 dnl ====================================
96 PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
97 HAVE_GLIB2=yes,HAVE_GLIB2=no)
99 GLIB_CFLAGS=$GLIB2_CFLAGS
101 AC_SUBST(GLIB_CFLAGS)
103 if test "x$HAVE_GLIB2" = "xno"; then
104 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
107 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
108 AC_SUBST(GST_PKG_DEPS)
110 LIBXML_PKG=', libxml-2.0'
111 PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
112 if test "x$HAVE_LIBXML2" = "xyes"; then
113 AC_DEFINE(HAVE_LIBXML2)
115 AC_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
121 dnl Check for atomic.h
122 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
123 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
124 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
125 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
126 if test x$HAVE_ATOMIC_H = xyes; then
128 #include "asm/atomic.h"
129 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
132 if test x$HAVE_ATOMIC_H = xyes; then
133 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
139 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
143 dnl ==========================================================================
144 dnl ============================= gst plugins ================================
145 dnl ==========================================================================
146 GST_PLUGIN_LDFLAGS='-module -avoid-version'
147 AC_SUBST(GST_PLUGIN_LDFLAGS)
149 dnl ######################################################################
150 dnl # Check command line parameters, and set shell variables accordingly #
151 dnl ######################################################################
153 dnl FIXME: simplify all this down using a few m4 macros
155 AC_ARG_ENABLE(libmmx,
156 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
157 [case "${enableval}" in
158 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
160 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
162 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
164 AC_ARG_ENABLE(atomic,
165 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
166 [case "${enableval}" in
167 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
168 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
169 no) USE_ATOMIC_H=no;;
170 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
172 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
174 AC_ARG_ENABLE(plugin-builddir,
175 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
176 [case "${enableval}" in
177 yes) PLUGINS_USE_BUILDDIR=yes ;;
178 no) PLUGINS_USE_BUILDDIR=no ;;
179 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
181 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
184 AC_HELP_STRING([--disable-debug][disable addition of -g debugging info]),
185 [case "${enableval}" in
186 yes) USE_DEBUG=yes ;;
188 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
190 [USE_DEBUG=yes]) dnl Default value
193 AC_HELP_STRING([--disable-DEBUG][disables compilation of debugging messages]),
194 [case "${enableval}" in
195 yes) ENABLE_DEBUG=yes ;;
196 no) ENABLE_DEBUG=no ;;
197 *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
199 [ENABLE_DEBUG=yes]) dnl Default value
200 if test x$ENABLE_DEBUG = xyes; then
201 AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
205 AC_HELP_STRING([--disable-INFO][disables compilation of informational messages]),
206 [case "${enableval}" in
207 yes) ENABLE_INFO=yes ;;
208 no) ENABLE_INFO=no ;;
209 *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
211 [ENABLE_INFO=yes]) dnl Default value
212 if test x$ENABLE_INFO = xyes; then
213 AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
216 AC_ARG_ENABLE(debug-color,
217 AC_HELP_STRING([--disable-debug-color][disables color output of DEBUG and INFO output]),
218 [case "${enableval}" in
219 yes) ENABLE_DEBUG_COLOR=yes ;;
220 no) ENABLE_DEBUG_COLOR=no ;;
221 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
223 [ENABLE_DEBUG_COLOR=yes]) dnl Default value
224 if test "x$ENABLE_DEBUG_COLOR" = xyes; then
225 AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
228 AC_ARG_ENABLE(profiling,
229 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
230 [case "${enableval}" in
231 yes) USE_PROFILING=yes ;;
232 no) UES_PROFILING=no ;;
233 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
235 [USE_PROFILING=no]) dnl Default value
237 dnl default to building registry in the source tree if we are enabling plugin build dir
238 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
241 GST_CONFIG_DIR=/etc/gstreamer
243 AC_ARG_WITH(configdir,
244 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
245 [case "${withval}" in
246 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
247 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
248 *) GST_CONFIG_DIR="${withval}" ;;
250 [:]) dnl Default value
253 AC_HELP_STRING([--disable-tests][disable building test apps]),
254 [case "${enableval}" in
255 yes) BUILD_TESTS=yes ;;
256 no) BUILD_TESTS=no ;;
257 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
259 [BUILD_TESTS=yes]) dnl Default value
261 AC_ARG_ENABLE(examples,
262 AC_HELP_STRING([--disable-examples][disable building examples]),
263 [case "${enableval}" in
264 yes) BUILD_EXAMPLES=yes ;;
265 no) BUILD_EXAMPLES=no ;;
266 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
268 [BUILD_EXAMPLES=yes]) dnl Default value
270 dnl Next, check for the optional components:
271 dnl ========================================
273 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
274 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
275 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
276 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
277 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
278 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
279 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
280 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
281 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
282 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
283 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
284 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
286 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
288 dnl ################################################
289 dnl # Set defines according to variables set above #
290 dnl ################################################
293 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
294 dnl HAVE_ and it is likely to be easier to stick with the old name
295 if test "x$USE_LIBMMX" = xyes; then
296 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
299 if test "x$USE_ATOMIC_H" = xyes; then
300 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
303 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
304 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
307 dnl if test "x$USE_DEBUG" = xyes; then
308 dnl CFLAGS="$CFLAGS -g"
311 if test "x$USE_PROFILING" = xyes; then
312 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
313 FOMIT_FRAME_POINTER=""
315 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
319 dnl AC_SUBST(FOMIT_FRAME_POINTER)
322 dnl #############################
323 dnl # Set automake conditionals #
324 dnl #############################
326 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
327 dnl HAVE_ and it is likely to be easier to stick with the old name
328 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
330 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
331 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
333 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
334 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
335 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
336 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
339 dnl ############################
340 dnl # Set up some more defines #
341 dnl ############################
343 dnl Set location of configuration dir.
344 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
345 AC_SUBST(GST_CONFIG_DIR)
347 dnl Set location of plugin directory
348 if test "x${prefix}" = "xNONE"; then
349 PLUGINS_DIR=${ac_default_prefix}/lib/gst
351 PLUGINS_DIR=${prefix}/lib/gst
353 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
354 AC_SUBST(PLUGINS_DIR)
356 dnl Set location of uninstalled plugin directory
357 PLUGINS_BUILDDIR=`pwd`
358 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
359 AC_SUBST(PLUGINS_BUILDDIR)
361 dnl finalize _CFLAGS and _LIBS
362 dnl add GLIB and XML if necessary to EXT_*
363 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
364 GST_EXT_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS"
367 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
368 GST_PKG_LIBS=$GST_EXT_LIBS
369 AC_SUBST(GST_PKG_CFLAGS)
370 AC_SUBST(GST_PKG_LIBS)
372 dnl Private vars for libgst only
373 LIBGST_LIBS="$GST_EXT_LIBS"
374 LIBGST_CFLAGS="$GST_EXT_CFLAGS -I\$(top_srcdir)"
375 AC_SUBST(LIBGST_LIBS)
376 AC_SUBST(LIBGST_CFLAGS)
378 dnl Vars for everyone else
379 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
380 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include -I\$(top_srcdir) -Wall"
382 AC_SUBST(GST_CFLAGS, "$GST_EXT_CFLAGS $GST_INT_CFLAGS")
383 AC_SUBST(GST_LIBS, "$GST_EXT_LIBS $GST_INT_LIBS")
385 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
387 dnl ##################################################
388 dnl # Prepare informative messages to display at end #
389 dnl ##################################################
393 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
394 infomessages="$infomessages
395 *** Warning: You have configured using the --enable-plugin-builddir option.
397 This option is for development purposes only: binaries built with
398 it should be used with code in the build tree only. To build an
399 installable version, use ./configure without the --enable-plugin-builddir
400 option. Note that the autogen.sh script supplies the plugin builddir
401 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
402 an installable build.
407 dnl #########################
408 dnl # Make the output files #
409 dnl #########################
411 dnl libs/ext/Makefile
418 gst/elements/Makefile
419 gst/autoplug/Makefile
420 gst/schedulers/Makefile
423 libs/gst/bytestream/Makefile
424 libs/gst/getbits/Makefile
425 libs/gst/putbits/Makefile
426 libs/gst/control/Makefile
429 tests/bufspeed/Makefile
430 tests/memchunk/Makefile
431 tests/muxing/Makefile
434 testsuite/bytestream/Makefile
435 testsuite/caps/Makefile
436 testsuite/cleanup/Makefile
437 testsuite/elements/Makefile
438 testsuite/plugin/Makefile
440 examples/autoplug/Makefile
441 examples/helloworld/Makefile
442 examples/helloworld2/Makefile
443 examples/launch/Makefile
444 examples/queue/Makefile
445 examples/queue2/Makefile
446 examples/queue3/Makefile
447 examples/queue4/Makefile
448 examples/thread/Makefile
449 examples/mixer/Makefile
450 examples/cutter/Makefile
451 examples/launch/Makefile
452 examples/xml/Makefile
453 examples/plugins/Makefile
454 examples/typefind/Makefile
455 examples/mixer/Makefile
459 docs/gst/gstreamer.types
461 docs/plugins/Makefile
462 docs/plugins/gstreamer-plugins.types
468 gstreamer-uninstalled.pc
470 echo "$infomessages", infomessages="$infomessages"