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_MSG_ERROR([Need libxml2 for glib2 builds -- you should be able to do without it -- this needs fixing])
120 GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
121 AC_MSG_ERROR([popt 1.5 or newer is required to build gstreamer. You can
122 download the latest version from ftp://people.redhat.com/sopwith/popt/]))
124 dnl Check for atomic.h
125 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
126 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
127 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
128 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
129 if test x$HAVE_ATOMIC_H = xyes; then
131 #include "asm/atomic.h"
132 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
135 if test x$HAVE_ATOMIC_H = xyes; then
136 AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
142 AC_MSG_WARN(Can't check properly for atomic reference counting. Assuming OK.)
146 dnl ==========================================================================
147 dnl ============================= gst plugins ================================
148 dnl ==========================================================================
149 GST_PLUGIN_LDFLAGS='-module -avoid-version'
150 AC_SUBST(GST_PLUGIN_LDFLAGS)
152 dnl ######################################################################
153 dnl # Check command line parameters, and set shell variables accordingly #
154 dnl ######################################################################
156 dnl FIXME: simplify all this down using a few m4 macros
158 AC_ARG_ENABLE(libmmx,
159 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
160 [case "${enableval}" in
161 yes) USE_LIBMMX=$HAVE_LIBMMX ;;
163 *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
165 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
167 AC_ARG_ENABLE(atomic,
168 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
169 [case "${enableval}" in
170 yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
171 noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
172 no) USE_ATOMIC_H=no;;
173 *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
175 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
177 AC_ARG_ENABLE(plugin-builddir,
178 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
179 [case "${enableval}" in
180 yes) PLUGINS_USE_BUILDDIR=yes ;;
181 no) PLUGINS_USE_BUILDDIR=no ;;
182 *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
184 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
188 AC_ARG_ENABLE(profiling,
189 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
190 [case "${enableval}" in
191 yes) USE_PROFILING=yes ;;
192 no) UES_PROFILING=no ;;
193 *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
195 [USE_PROFILING=no]) dnl Default value
197 dnl default to building registry in the source tree if we are enabling plugin build dir
198 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
201 GST_CONFIG_DIR=/etc/gstreamer
203 AC_ARG_WITH(configdir,
204 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
205 [case "${withval}" in
206 yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
207 no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
208 *) GST_CONFIG_DIR="${withval}" ;;
210 [:]) dnl Default value
213 AC_HELP_STRING([--disable-tests][disable building test apps]),
214 [case "${enableval}" in
215 yes) BUILD_TESTS=yes ;;
216 no) BUILD_TESTS=no ;;
217 *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
219 [BUILD_TESTS=yes]) dnl Default value
221 AC_ARG_ENABLE(examples,
222 AC_HELP_STRING([--disable-examples][disable building examples]),
223 [case "${enableval}" in
224 yes) BUILD_EXAMPLES=yes ;;
225 no) BUILD_EXAMPLES=no ;;
226 *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
228 [BUILD_EXAMPLES=yes]) dnl Default value
230 dnl Next, check for the optional components:
231 dnl ========================================
233 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
234 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
235 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
236 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
237 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
238 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
239 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
240 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
241 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
242 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
243 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
244 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
246 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
248 dnl ################################################
249 dnl # Set defines according to variables set above #
250 dnl ################################################
253 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
254 dnl HAVE_ and it is likely to be easier to stick with the old name
255 if test "x$USE_LIBMMX" = xyes; then
256 AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
259 if test "x$USE_ATOMIC_H" = xyes; then
260 AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
263 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
264 AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
267 dnl if test "x$USE_DEBUG" = xyes; then
268 dnl CFLAGS="$CFLAGS -g"
271 if test "x$USE_PROFILING" = xyes; then
272 dnl CFLAGS="$CFLAGS -pg -fprofile-arcs"
273 FOMIT_FRAME_POINTER=""
275 FOMIT_FRAME_POINTER="-fomit-frame-pointer"
279 dnl AC_SUBST(FOMIT_FRAME_POINTER)
282 dnl #############################
283 dnl # Set automake conditionals #
284 dnl #############################
286 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
287 dnl HAVE_ and it is likely to be easier to stick with the old name
288 AM_CONDITIONAL(HAVE_ATOMIC_H, test "x$USE_ATOMIC_H" = "xyes")
290 AM_CONDITIONAL(EXPERIMENTAL, test "$EXPERIMENTAL" = "$xyes")
291 AM_CONDITIONAL(BROKEN, test "$BROKEN" = "$xyes")
293 AM_CONDITIONAL(HAVE_NASM, test "x$HAVE_NASM" = "xyes")
294 AM_CONDITIONAL(BUILD_TESTS, test "x$BUILD_TESTS" = "xyes")
295 AM_CONDITIONAL(BUILD_EXAMPLES, test "x$BUILD_EXAMPLES" = "xyes")
296 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR, test "x$PLUGINS_USE_BUILDDIR" = "xyes")
299 dnl ############################
300 dnl # Set up some more defines #
301 dnl ############################
303 dnl Set location of configuration dir.
304 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
305 AC_SUBST(GST_CONFIG_DIR)
307 dnl Set location of plugin directory
308 if test "x${prefix}" = "xNONE"; then
309 PLUGINS_DIR=${ac_default_prefix}/lib/gst
311 PLUGINS_DIR=${prefix}/lib/gst
313 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
314 AC_SUBST(PLUGINS_DIR)
316 dnl Set location of uninstalled plugin directory
317 PLUGINS_BUILDDIR=`pwd`
318 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
319 AC_SUBST(PLUGINS_BUILDDIR)
321 dnl since glib and xml are package deps, there's no need to include their cflags
322 dnl in the pkg-config file
325 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
326 GST_PKG_LIBS=$GST_EXT_LIBS
327 AC_SUBST(GST_PKG_CFLAGS)
328 AC_SUBST(GST_PKG_LIBS)
330 dnl finalize _CFLAGS and _LIBS
331 dnl add GLIB and XML if necessary to EXT_*
332 GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
333 GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
335 dnl Private vars for libgst only
336 LIBGST_LIBS="$GST_LIBS"
337 LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) -Wall"
338 AC_SUBST(LIBGST_LIBS)
339 AC_SUBST(LIBGST_CFLAGS)
341 dnl Vars for everyone else
342 GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer.la"
343 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
345 AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
346 AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
348 AC_CONFIG_SUBDIRS(libs/ext/cothreads)
350 dnl ##################################################
351 dnl # Prepare informative messages to display at end #
352 dnl ##################################################
356 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
357 infomessages="$infomessages
358 *** Warning: You have configured using the --enable-plugin-builddir option.
360 This option is for development purposes only: binaries built with
361 it should be used with code in the build tree only. To build an
362 installable version, use ./configure without the --enable-plugin-builddir
363 option. Note that the autogen.sh script supplies the plugin builddir
364 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
365 an installable build.
370 dnl #########################
371 dnl # Make the output files #
372 dnl #########################
374 dnl libs/ext/Makefile
381 gst/elements/Makefile
382 gst/autoplug/Makefile
383 gst/schedulers/Makefile
386 libs/gst/bytestream/Makefile
387 libs/gst/getbits/Makefile
388 libs/gst/putbits/Makefile
389 libs/gst/control/Makefile
392 tests/bufspeed/Makefile
393 tests/memchunk/Makefile
394 tests/muxing/Makefile
397 testsuite/bytestream/Makefile
398 testsuite/caps/Makefile
399 testsuite/cleanup/Makefile
400 testsuite/elements/Makefile
401 testsuite/plugin/Makefile
402 testsuite/dynparams/Makefile
404 examples/autoplug/Makefile
405 examples/helloworld/Makefile
406 examples/helloworld2/Makefile
407 examples/launch/Makefile
408 examples/queue/Makefile
409 examples/queue2/Makefile
410 examples/queue3/Makefile
411 examples/queue4/Makefile
412 examples/thread/Makefile
413 examples/mixer/Makefile
414 examples/cutter/Makefile
415 examples/launch/Makefile
416 examples/xml/Makefile
417 examples/plugins/Makefile
418 examples/typefind/Makefile
419 examples/mixer/Makefile
423 docs/gst/gstreamer.types
425 docs/plugins/Makefile
426 docs/plugins/gstreamer-plugins.types
430 docs/devhelp/Makefile
433 gstreamer-uninstalled.pc
435 echo "$infomessages", infomessages="$infomessages"