2 AC_CANONICAL_TARGET([])
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 AS_VERSION(gstreamer, GST_VERSION, 0, 3, 4, 1, GST_ERROR="-Wall", GST_ERROR="-Wall -Werror")
8 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
9 AS_LIBTOOL(GST, 0, 0, 0, yes)
11 AC_CONFIG_SRCDIR([gst/gst.c])
12 AM_CONFIG_HEADER(config.h)
14 dnl Add parameters for aclocal
15 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
16 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
28 dnl We disable static building for development, for time savings
29 dnl *NOTE*: dnl this line before release, so release does static too
35 dnl ##############################
36 dnl # Do automated configuration #
37 dnl ##############################
42 dnl modify pkg-config path
43 AC_ARG_WITH(pkg-config-path,
44 AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
45 [export PKG_CONFIG_PATH=${withval}])
48 AC_PATH_PROG(NASM_PATH, nasm, no)
50 if test x$NASM_PATH = xno; then
51 AC_MSG_WARN(Couldn't find nasm)
53 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
60 dnl we require bison for building of some of the marshal files
61 AC_PATH_PROG(BISON_PATH, bison, no)
62 if test x$BISON_PATH = xno; then
63 AC_MSG_ERROR(Could not find bison)
67 dnl We should really use AC_SYS_LARGEFILE, but the problem is
68 dnl many of the plugins don't include "config.h". To assure
69 dnl binary compatibility, it is necessary that all gstreamer
70 dnl code be compiled with the same sizeof(off_t), so we use
71 dnl the following crude hack.
75 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
77 dnl this is so we can make GST_CFLAGS for external modules available
78 dnl without mixing in internal (uninstalled) CFLAGS
81 AC_MSG_CHECKING(for large file support)
83 #define _LARGEFILE_SOURCE
84 #define _FILE_OFFSET_BITS 64
85 #include <sys/types.h>
86 int main () { return !(sizeof(off_t) == 8); }
90 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
99 dnl Check for essential libraries first:
100 dnl ====================================
103 dnl Minimum required version of GLib2
104 dnl required for compilation without warnings
109 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
110 HAVE_GLIB2=yes,HAVE_GLIB2=no)
111 GLIB_LIBS=$GLIB2_LIBS
112 GLIB_CFLAGS=$GLIB2_CFLAGS
114 AC_SUBST(GLIB_CFLAGS)
116 if test "x$HAVE_GLIB2" = "xno"; then
117 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
120 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
121 AC_SUBST(GST_PKG_DEPS)
124 dnl Minimum required version of libxml2
126 AC_SUBST(LIBXML2_REQ)
128 dnl check for libxml2
129 LIBXML_PKG=', libxml-2.0'
130 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
131 if test "x$HAVE_LIBXML2" = "xyes"; then
132 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
134 AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
140 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
141 AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
142 download the latest version from ftp://people.redhat.com/sopwith/popt/]))
144 dnl Check for atomic.h
145 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
146 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
147 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
148 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
149 if test x$HAVE_ATOMIC_H = xyes; then
151 #include "asm/atomic.h"
152 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
155 if test x$HAVE_ATOMIC_H = xyes; then
156 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
162 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
166 dnl ######################################################################
167 dnl # Check command line parameters, and set shell variables accordingly #
168 dnl ######################################################################
170 dnl FIXME: simplify all this down using a few m4 macros
172 AC_ARG_ENABLE(libmmx,
173 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
174 [case "${enableval}" in
175 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
177 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
179 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
181 AC_ARG_ENABLE(atomic,
182 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
183 [case "${enableval}" in
184 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
185 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
186 no) USE_ATOMIC_H=no;;
187 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
189 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
191 AC_ARG_ENABLE(plugin-builddir,
192 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
193 [case "${enableval}" in
194 yes) PLUGINS_USE_BUILDDIR=yes ;;
195 no) PLUGINS_USE_BUILDDIR=no ;;
196 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
198 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
202 AC_ARG_ENABLE(profiling,
203 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
204 [case "${enableval}" in
205 yes) USE_PROFILING=yes ;;
206 no) UES_PROFILING=no ;;
207 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
209 [USE_PROFILING=no]) dnl Default value
211 dnl default to building registry in the source tree if we are enabling plugin build dir
212 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
215 GST_CONFIG_DIR=${sysconfdir}/gstreamer
217 AC_ARG_WITH(configdir,
218 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
219 [case "${withval}" in
220 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
221 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
222 *) GST_CONFIG_DIR="${withval}" ;;
224 [:]) dnl Default value
226 AS_AC_EXPAND(GST_CONFIG_DIR, $GST_CONFIG_DIR)
227 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
229 AC_HELP_STRING([--disable-tests][disable building test apps]),
230 [case "${enableval}" in
231 yes) BUILD_TESTS=yes ;;
232 no) BUILD_TESTS=no ;;
233 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
235 [BUILD_TESTS=yes]) dnl Default value
237 AC_ARG_ENABLE(examples,
238 AC_HELP_STRING([--disable-examples][disable building examples]),
239 [case "${enableval}" in
240 yes) BUILD_EXAMPLES=yes ;;
241 no) BUILD_EXAMPLES=no ;;
242 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
244 [BUILD_EXAMPLES=yes]) dnl Default value
246 dnl Next, check for the optional components:
247 dnl ========================================
249 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
250 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
251 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
252 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
253 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
254 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
255 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
256 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
257 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
258 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
259 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
260 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
262 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
264 dnl ################################################
265 dnl # Set defines according to variables set above #
266 dnl ################################################
269 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
270 dnl HAVE_ and it is likely to be easier to stick with the old name
271 if test "x$USE_LIBMMX" = xyes; then
272 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
275 if test "x$USE_ATOMIC_H" = xyes; then
276 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
279 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
280 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
283 dnl if test "x$USE_DEBUG" = xyes; then
284 dnl CFLAGS="$CFLAGS -g"
287 if test "x$USE_PROFILING" = xyes; then
288 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
289 FOMIT_FRAME_POINTER=""
291 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
295 dnl AC_SUBST(FOMIT_FRAME_POINTER)
298 dnl #############################
299 dnl # Set automake conditionals #
300 dnl #############################
302 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
303 dnl HAVE_ and it is likely to be easier to stick with the old name
304 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
306 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
307 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
309 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
310 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
311 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
312 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
315 dnl ############################
316 dnl # Set up some more defines #
317 dnl ############################
319 dnl Set location of configuration dir.
320 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
321 AC_SUBST(GST_CONFIG_DIR)
323 dnl Set location of plugin directory
324 if test "x${prefix}" = "xNONE"; then
325 PLUGINS_DIR=${ac_default_prefix}/lib/gst
327 PLUGINS_DIR=${prefix}/lib/gst
329 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
330 AC_SUBST(PLUGINS_DIR)
332 dnl Set location of uninstalled plugin directory
333 PLUGINS_BUILDDIR=`pwd`
334 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
335 AC_SUBST(PLUGINS_BUILDDIR)
337 dnl since glib and xml are package deps, there's no need to include their cflags
338 dnl in the pkg-config file
341 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
342 GST_PKG_LIBS=$GST_EXT_LIBS
343 AC_SUBST(GST_PKG_CFLAGS)
344 AC_SUBST(GST_PKG_LIBS)
346 dnl finalize _CFLAGS and _LIBS
347 dnl add GLIB and XML if necessary to EXT_*
348 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
349 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
351 dnl Private vars for libgst only
352 LIBGST_LIBS="$GST_LIBS"
353 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
354 AC_SUBST(LIBGST_LIBS)
355 AC_SUBST(LIBGST_CFLAGS)
357 dnl Vars for everyone else
358 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
359 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
361 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
362 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
364 GST_PLUGIN_LDFLAGS='-module -avoid-version'
365 AC_SUBST(GST_PLUGIN_LDFLAGS)
367 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
369 dnl ##################################################
370 dnl # Prepare informative messages to display at end #
371 dnl ##################################################
375 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
376 infomessages="$infomessages
377 *** Warning: You have configured using the --enable-plugin-builddir option.
379 This option is for development purposes only: binaries built with
380 it should be used with code in the build tree only. To build an
381 installable version, use ./configure without the --enable-plugin-builddir
382 option. Note that the autogen.sh script supplies the plugin builddir
383 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
384 an installable build.
389 dnl #########################
390 dnl # Make the output files #
391 dnl #########################
393 dnl libs/ext/Makefile
401 gst/autoplug/Makefile
402 gst/elements/Makefile
404 gst/schedulers/Makefile
406 gst/registries/Makefile
409 libs/gst/bytestream/Makefile
410 libs/gst/getbits/Makefile
411 libs/gst/putbits/Makefile
412 libs/gst/control/Makefile
415 tests/bufspeed/Makefile
416 tests/memchunk/Makefile
417 tests/muxing/Makefile
420 testsuite/bytestream/Makefile
421 testsuite/caps/Makefile
422 testsuite/cleanup/Makefile
423 testsuite/clock/Makefile
424 testsuite/elements/Makefile
425 testsuite/plugin/Makefile
426 testsuite/dynparams/Makefile
428 examples/autoplug/Makefile
429 examples/helloworld/Makefile
430 examples/helloworld2/Makefile
431 examples/launch/Makefile
432 examples/queue/Makefile
433 examples/queue2/Makefile
434 examples/queue3/Makefile
435 examples/queue4/Makefile
436 examples/thread/Makefile
437 examples/mixer/Makefile
438 examples/cutter/Makefile
439 examples/launch/Makefile
440 examples/xml/Makefile
441 examples/plugins/Makefile
442 examples/typefind/Makefile
443 examples/mixer/Makefile
447 docs/gst/gstreamer.types
449 docs/plugins/Makefile
450 docs/plugins/gstreamer-plugins.types
454 docs/devhelp/Makefile
457 gstreamer-uninstalled.pc
459 echo "$infomessages", infomessages="$infomessages"