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, 4, 1)
6 AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
7 AS_LIBTOOL(GST, 0, 0, 0, yes)
9 dnl we'll move this to a configure option later on which will be turned on
11 dnl GST_ERROR="-Wall -Werror"
14 AC_CONFIG_SRCDIR([gst/gst.c])
15 AM_CONFIG_HEADER(config.h)
17 dnl Add parameters for aclocal
18 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
19 ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
31 dnl We disable static building for development, for time savings
32 dnl *NOTE*: dnl this line before release, so release does static too
38 dnl ##############################
39 dnl # Do automated configuration #
40 dnl ##############################
45 dnl modify pkg-config path
46 AC_ARG_WITH(pkg-config-path,
47 AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
48 [export PKG_CONFIG_PATH=${withval}])
51 AC_PATH_PROG(NASM_PATH, nasm, no)
53 if test x$NASM_PATH = xno; then
54 AC_MSG_WARN(Couldn't find nasm)
56 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
64 dnl We should really use AC_SYS_LARGEFILE, but the problem is
65 dnl many of the plugins don't include "config.h". To assure
66 dnl binary compatibility, it is necessary that all gstreamer
67 dnl code be compiled with the same sizeof(off_t), so we use
68 dnl the following crude hack.
72 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
74 dnl this is so we can make GST_CFLAGS for external modules available
75 dnl without mixing in internal (uninstalled) CFLAGS
78 AC_MSG_CHECKING(for large file support)
80 #define _LARGEFILE_SOURCE
81 #define _FILE_OFFSET_BITS 64
82 #include <sys/types.h>
83 int main () { return !(sizeof(off_t) == 8); }
87 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
96 dnl Check for essential libraries first:
97 dnl ====================================
100 dnl Minimum required version of GLib2
101 dnl required for compilation without warnings
106 PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,
107 HAVE_GLIB2=yes,HAVE_GLIB2=no)
108 GLIB_LIBS=$GLIB2_LIBS
109 GLIB_CFLAGS=$GLIB2_CFLAGS
111 AC_SUBST(GLIB_CFLAGS)
113 if test "x$HAVE_GLIB2" = "xno"; then
114 AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
117 GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
118 AC_SUBST(GST_PKG_DEPS)
121 dnl Minimum required version of libxml2
123 AC_SUBST(LIBXML2_REQ)
125 dnl check for libxml2
126 LIBXML_PKG=', libxml-2.0'
127 PKG_CHECK_MODULES(XML, libxml-2.0 >= $LIBXML2_REQ, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
128 if test "x$HAVE_LIBXML2" = "xyes"; then
129 AC_DEFINE(HAVE_LIBXML2, 1, [Define if libxml2 is available])
131 AC_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
137 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
138 AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
139 download the latest version from ftp://people.redhat.com/sopwith/popt/]))
141 dnl Check for atomic.h
142 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
143 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
144 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
145 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
146 if test x$HAVE_ATOMIC_H = xyes; then
148 #include "asm/atomic.h"
149 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
152 if test x$HAVE_ATOMIC_H = xyes; then
153 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
159 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
163 dnl ######################################################################
164 dnl # Check command line parameters, and set shell variables accordingly #
165 dnl ######################################################################
167 dnl FIXME: simplify all this down using a few m4 macros
169 AC_ARG_ENABLE(libmmx,
170 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
171 [case "${enableval}" in
172 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
174 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
176 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
178 AC_ARG_ENABLE(atomic,
179 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
180 [case "${enableval}" in
181 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
182 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
183 no) USE_ATOMIC_H=no;;
184 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
186 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
188 AC_ARG_ENABLE(plugin-builddir,
189 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
190 [case "${enableval}" in
191 yes) PLUGINS_USE_BUILDDIR=yes ;;
192 no) PLUGINS_USE_BUILDDIR=no ;;
193 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
195 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
199 AC_ARG_ENABLE(profiling,
200 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
201 [case "${enableval}" in
202 yes) USE_PROFILING=yes ;;
203 no) UES_PROFILING=no ;;
204 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
206 [USE_PROFILING=no]) dnl Default value
208 dnl default to building registry in the source tree if we are enabling plugin build dir
209 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
212 GST_CONFIG_DIR=${sysconfdir}/gstreamer
214 AC_ARG_WITH(configdir,
215 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
216 [case "${withval}" in
217 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
218 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
219 *) GST_CONFIG_DIR="${withval}" ;;
221 [:]) dnl Default value
223 AS_AC_EXPAND(GST_CONFIG_DIR, $GST_CONFIG_DIR)
224 AC_MSG_NOTICE(Using $GST_CONFIG_DIR as configuration dir)
226 AC_HELP_STRING([--disable-tests][disable building test apps]),
227 [case "${enableval}" in
228 yes) BUILD_TESTS=yes ;;
229 no) BUILD_TESTS=no ;;
230 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
232 [BUILD_TESTS=yes]) dnl Default value
234 AC_ARG_ENABLE(examples,
235 AC_HELP_STRING([--disable-examples][disable building examples]),
236 [case "${enableval}" in
237 yes) BUILD_EXAMPLES=yes ;;
238 no) BUILD_EXAMPLES=no ;;
239 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
241 [BUILD_EXAMPLES=yes]) dnl Default value
243 dnl Next, check for the optional components:
244 dnl ========================================
246 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
247 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
248 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
249 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
250 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
251 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
252 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
253 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
254 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
255 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
256 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
257 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
259 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
261 dnl ################################################
262 dnl # Set defines according to variables set above #
263 dnl ################################################
266 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
267 dnl HAVE_ and it is likely to be easier to stick with the old name
268 if test "x$USE_LIBMMX" = xyes; then
269 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
272 if test "x$USE_ATOMIC_H" = xyes; then
273 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
276 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
277 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
280 dnl if test "x$USE_DEBUG" = xyes; then
281 dnl CFLAGS="$CFLAGS -g"
284 if test "x$USE_PROFILING" = xyes; then
285 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
286 FOMIT_FRAME_POINTER=""
288 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
292 dnl AC_SUBST(FOMIT_FRAME_POINTER)
295 dnl #############################
296 dnl # Set automake conditionals #
297 dnl #############################
299 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
300 dnl HAVE_ and it is likely to be easier to stick with the old name
301 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
303 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
304 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
306 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
307 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
308 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
309 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
312 dnl ############################
313 dnl # Set up some more defines #
314 dnl ############################
316 dnl Set location of configuration dir.
317 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR, "$GST_CONFIG_DIR", [Define the configuration directory])
318 AC_SUBST(GST_CONFIG_DIR)
320 dnl Set location of plugin directory
321 if test "x${prefix}" = "xNONE"; then
322 PLUGINS_DIR=${ac_default_prefix}/lib/gst
324 PLUGINS_DIR=${prefix}/lib/gst
326 AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
327 AC_SUBST(PLUGINS_DIR)
329 dnl Set location of uninstalled plugin directory
330 PLUGINS_BUILDDIR=`pwd`
331 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
332 AC_SUBST(PLUGINS_BUILDDIR)
334 dnl since glib and xml are package deps, there's no need to include their cflags
335 dnl in the pkg-config file
338 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
339 GST_PKG_LIBS=$GST_EXT_LIBS
340 AC_SUBST(GST_PKG_CFLAGS)
341 AC_SUBST(GST_PKG_LIBS)
343 dnl finalize _CFLAGS and _LIBS
344 dnl add GLIB and XML if necessary to EXT_*
345 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
346 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
348 dnl Private vars for libgst only
349 LIBGST_LIBS="$GST_LIBS"
350 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
351 AC_SUBST(LIBGST_LIBS)
352 AC_SUBST(LIBGST_CFLAGS)
354 dnl Vars for everyone else
355 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
356 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
358 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
359 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
361 GST_PLUGIN_LDFLAGS='-module -avoid-version'
362 AC_SUBST(GST_PLUGIN_LDFLAGS)
364 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
366 dnl ##################################################
367 dnl # Prepare informative messages to display at end #
368 dnl ##################################################
372 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
373 infomessages="$infomessages
374 *** Warning: You have configured using the --enable-plugin-builddir option.
376 This option is for development purposes only: binaries built with
377 it should be used with code in the build tree only. To build an
378 installable version, use ./configure without the --enable-plugin-builddir
379 option. Note that the autogen.sh script supplies the plugin builddir
380 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
381 an installable build.
386 dnl #########################
387 dnl # Make the output files #
388 dnl #########################
390 dnl libs/ext/Makefile
396 gst/autoplug/Makefile
397 gst/elements/Makefile
399 gst/schedulers/Makefile
403 libs/gst/bytestream/Makefile
404 libs/gst/getbits/Makefile
405 libs/gst/putbits/Makefile
406 libs/gst/control/Makefile
409 tests/bufspeed/Makefile
410 tests/memchunk/Makefile
411 tests/muxing/Makefile
414 testsuite/bytestream/Makefile
415 testsuite/caps/Makefile
416 testsuite/cleanup/Makefile
417 testsuite/elements/Makefile
418 testsuite/plugin/Makefile
419 testsuite/dynparams/Makefile
421 examples/autoplug/Makefile
422 examples/helloworld/Makefile
423 examples/helloworld2/Makefile
424 examples/launch/Makefile
425 examples/queue/Makefile
426 examples/queue2/Makefile
427 examples/queue3/Makefile
428 examples/queue4/Makefile
429 examples/thread/Makefile
430 examples/mixer/Makefile
431 examples/cutter/Makefile
432 examples/launch/Makefile
433 examples/xml/Makefile
434 examples/plugins/Makefile
435 examples/typefind/Makefile
436 examples/mixer/Makefile
440 docs/gst/gstreamer.types
442 docs/plugins/Makefile
443 docs/plugins/gstreamer-plugins.types
447 docs/devhelp/Makefile
450 gstreamer-uninstalled.pc
452 echo "$infomessages", infomessages="$infomessages"