source: trunk/third/gstreamer/configure.ac @ 18743

Revision 18743, 16.9 KB checked in by ghudson, 21 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18742, which included commits to RCS files with non-trunk default branches.
Line 
1AC_INIT
2AC_CANONICAL_TARGET([])
3
4dnl when going to/from release please set the nano (fourth number) right !
5dnl releases only do Wall, cvs and prerelease does Werror too
6AS_VERSION(gstreamer, GST_VERSION, 0, 6, 0, 0, GST_CVS="no", GST_CVS="yes")
7
8dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
9AM_MAINTAINER_MODE
10AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
11
12dnl our libraries and install dirs use major.minor as a version
13GST_MAJORMINOR=$GST_VERSION_MAJOR.$GST_VERSION_MINOR
14AC_SUBST(GST_MAJORMINOR)
15
16AC_PROG_CC
17dnl For interactive UNIX (a Sun thing)
18AC_ISC_POSIX
19
20dnl CURRENT, REVISION, AGE
21dnl - library source changed at all -> increment REVISION
22dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
23dnl - interfaces added -> increment AGE
24dnl - interfaces removed -> AGE = 0
25dnl - major/minor got increased -> reset to 0,0,0
26AS_LIBTOOL(GST, 0, 0, 0)
27
28AC_CONFIG_SRCDIR([gst/gst.c])
29AM_CONFIG_HEADER(config.h)
30
31dnl Add parameters for aclocal
32dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
33ACLOCAL="$ACLOCAL -I common/m4 $ACLOCAL_FLAGS"
34
35AM_PROG_CC_STDC
36AM_PROG_AS
37AS="${CC}"
38
39dnl decide on error flags
40AS_COMPILER(COMPILER)
41if test "x$COMPILER" = "xforte"; then
42  GST_ERROR=
43else
44  if test "x$GST_CVS"="xyes"; then
45    GST_ERROR="-Wall -Werror"
46  else
47    GST_ERROR="-Wall"
48  fi
49fi
50dnl fix these error flags first, then reintroduce them
51GST_ERROR=
52
53dnl We disable static building for development, for time savings
54dnl *NOTE*: dnl this line before release, so release does static too
55dnl AM_DISABLE_STATIC
56
57AC_HEADER_STDC([])
58
59
60dnl ##############################
61dnl # Do automated configuration #
62dnl ##############################
63
64dnl Check for tools:
65dnl ================
66
67dnl allow for different autotools
68AS_AUTOTOOLS_ALTERNATE()
69
70dnl modify pkg-config path
71AC_ARG_WITH(pkg-config-path,
72   AC_HELP_STRING([--with-pkg-config-path],
73                  [colon-separated list of pkg-config(1) dirs]),
74   [export PKG_CONFIG_PATH=${withval}])
75
76GST_DOC()
77GST_ARCH()
78
79dnl we require bison for building of some of the marshal files
80dnl FIXME: check if AC_PROG_YACC is suitable here
81AC_PATH_PROG(BISON_PATH, bison, no)
82if test x$BISON_PATH = xno; then
83  AC_MSG_ERROR(Could not find bison)
84fi
85
86dnl we require flex for building the parser
87dnl FIXME: check if AC_PROG_LEX is suitable here
88AC_PATH_PROG(FLEX_PATH, flex, no)
89if test x$FLEX_PATH = xno; then
90  AC_MSG_ERROR(Could not find flex)
91fi
92
93dnl
94dnl We should really use AC_SYS_LARGEFILE, but the problem is
95dnl many of the plugins don't include "config.h".  To assure
96dnl binary compatibility, it is necessary that all gstreamer
97dnl code be compiled with the same sizeof(off_t), so we use
98dnl the following crude hack.
99dnl
100
101dnl
102dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
103dnl same for libs
104dnl this is so we can make GST_CFLAGS for external modules available
105dnl without mixing in internal (uninstalled) CFLAGS
106dnl
107
108dnl disable deprecated functions internally
109GST_INT_CFLAGS="-DGST_DISABLE_DEPRECATED"
110
111AC_MSG_CHECKING(for large file support)
112AC_TRY_RUN([
113#define _LARGEFILE_SOURCE
114#define _FILE_OFFSET_BITS 64
115#include <sys/types.h>
116int main () { return !(sizeof(off_t) == 8); }
117],
118[
119AC_MSG_RESULT(yes)
120GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
121],
122[
123AC_MSG_RESULT(no)
124],
125[
126AC_MSG_RESULT(no)
127])
128
129dnl check for makecontext and define HAVE_MAKECONTEXT if we have it
130AC_CHECK_MCSC()
131if test "$ac_cv_check_mcsc" == "yes"; then
132  AC_DEFINE_UNQUOTED(HAVE_MAKECONTEXT, $HAVE_MAKECONTEXT,
133                     [defined if we have makecontext ()])
134fi
135
136dnl Check for a way to display the function name in debug output
137GST_CHECK_FUNCTION()
138
139dnl Check for essential libraries first:
140dnl ====================================
141
142dnl === GLib 2 ===
143dnl Minimum required version of GLib2
144dnl required for compilation without warnings
145GLIB2_REQ="2.0.1"
146AC_SUBST(GLIB2_REQ)
147
148dnl Check for glib2
149PKG_CHECK_MODULES(GLIB2, glib-2.0 >= $GLIB2_REQ gobject-2.0 gthread-2.0 gmodule-2.0,HAVE_GLIB2=yes,HAVE_GLIB2=no)
150GLIB_LIBS=$GLIB2_LIBS
151GLIB_CFLAGS=$GLIB2_CFLAGS
152AC_SUBST(GLIB_LIBS)
153AC_SUBST(GLIB_CFLAGS)
154
155if test "x$HAVE_GLIB2" = "xno"; then
156  AC_MSG_ERROR([GStreamer requires GLib 2.0 to compile.])
157fi
158
159GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
160AC_SUBST(GST_PKG_DEPS)
161 
162dnl === libxml 2 ===
163dnl Minimum required version of libxml2
164LIBXML2_REQ="2.4.9"
165AC_SUBST(LIBXML2_REQ)
166
167dnl check for libxml2
168GST_LIBXML2_CHECK()
169
170dnl popt checks
171GST_CHECK_LIBHEADER(POPT, popt, poptStrippedArgv,, popt.h, POPT_LIBS="-lpopt",
172  AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
173                download the latest version from
174                ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
175)
176AC_MSG_NOTICE(Checking for POPT_TABLEEND)
177AC_COMPILE_IFELSE([
178#include <popt.h>
179int main ()
180{
181#ifndef POPT_TABLEEND
182#error
183#else
184  return 0;
185#endif
186}
187],, [
188  dnl it failed
189  AC_MSG_ERROR([popt 1.6.1 or newer is required to build gstreamer. You can
190                download the latest version from
191                ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/])
192])
193
194dnl Check for atomic.h
195dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
196dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
197AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
198dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
199if test x$HAVE_ATOMIC_H = xyes; then
200  AC_LINK_IFELSE([
201#include "asm/atomic.h"
202main() {atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
203  ],, [
204    # Not successful
205    if test x$HAVE_ATOMIC_H = xyes; then
206      AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
207    fi
208    HAVE_ATOMIC_H=no
209  ])
210fi
211
212dnl Check for ucontext.h
213AC_CHECK_HEADER(ucontext.h, AC_DEFINE(HAVE_UCONTEXT_H, 1, [defined if we have ucontext.h]))
214
215dnl ######################################################################
216dnl # Check command line parameters, and set shell variables accordingly #
217dnl ######################################################################
218
219dnl FIXME: simplify all this down using a few m4 macros
220
221AC_ARG_ENABLE(libmmx,
222AC_HELP_STRING([--enable-libmmx],[use libmmx, if available]),
223[case "${enableval}" in
224  yes) USE_LIBMMX=$HAVE_LIBMMX ;;
225  no)  USE_LIBMMX=no ;;
226  *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
227esac],
228[USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
229
230AC_ARG_ENABLE(atomic,
231AC_HELP_STRING([--enable-atomic],[use atomic reference counting header]),
232[case "${enableval}" in
233  yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
234  noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
235  no)  USE_ATOMIC_H=no;;
236  *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
237esac],
238[USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
239
240AC_ARG_ENABLE(plugin-builddir,
241AC_HELP_STRING([--enable-plugin-builddir],[allow tests/demos to use non-installed plugins]),
242[case "${enableval}" in
243  yes) PLUGINS_USE_BUILDDIR=yes ;;
244  no)  PLUGINS_USE_BUILDDIR=no ;;
245  *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
246esac],
247[PLUGINS_USE_BUILDDIR=no]) dnl Default value
248
249GST_DEBUGINFO
250
251AC_ARG_ENABLE(profiling,
252AC_HELP_STRING([--enable-profiling],[adds -pg to compiler commandline, for profiling]),
253[case "${enableval}" in
254  yes) USE_PROFILING=yes ;;
255  no)  UES_PROFILING=no ;;
256  *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
257esac],
258[USE_PROFILING=no]) dnl Default value
259
260dnl use a cache dir for storing element registry info.
261dnl default to building registry in the source tree if we are enabling plugin build dir
262if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
263  GST_CACHE_DIR=`pwd`
264else
265  dnl ${localstatedir} points to PREFIX/var
266  GST_CACHE_DIR=${localstatedir}/cache/gstreamer-$GST_MAJORMINOR
267fi
268AC_ARG_WITH(cachedir,
269AC_HELP_STRING([--with-cachedir],[specify path to use for plugin and command completion registries]),
270[case "${withval}" in
271  yes) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
272  no) AC_MSG_ERROR(bad value ${withval} for --with-cachedir) ;;
273  *) GST_CACHE_DIR="${withval}" ;;
274esac],
275[:]) dnl Default value
276
277AS_AC_EXPAND(GST_CACHE_DIR, $GST_CACHE_DIR)
278AC_MSG_NOTICE(Using $GST_CACHE_DIR as registry cache dir)
279
280
281dnl building of tests
282AC_ARG_ENABLE(tests,
283AC_HELP_STRING([--disable-tests],[disable building test apps]),
284[case "${enableval}" in
285  yes) BUILD_TESTS=yes ;;
286  no)  BUILD_TESTS=no ;;
287  *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
288esac],
289[BUILD_TESTS=yes]) dnl Default value
290AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
291
292dnl tests known to fail
293AC_ARG_ENABLE(failing-tests,
294AC_HELP_STRING([--disable-failing-tests],[disable building tests known to fail]),
295[case "${enableval}" in
296  yes) BUILD_FAILING_TESTS=yes ;;
297  no)  BUILD_FAILING_TESTS=no ;;
298  *) AC_MSG_ERROR(bad value ${enableval} for --disable-failing-tests) ;;
299esac],
300[BUILD_FAILING_TESTS=no]) dnl Default value
301AM_CONDITIONAL(BUILD_FAILING_TESTS, test "x$BUILD_FAILING_TESTS" = "xyes")
302if test x$BUILD_FAILING_TESTS = xyes; then
303  AC_MSG_WARN([building tests known to fail, use --disable-failing-tests to disable])
304else
305  AC_MSG_WARN([Sissy ! By asking to not build the tests known to fail, you hereby waive your right to customer support.  If you do not agree with this EULA, please press Ctrl-C before the next line is printed.  By allowing the next line to be printed, you expressly acknowledge your acceptance of this EULA.])
306fi
307
308AC_ARG_ENABLE(examples,
309AC_HELP_STRING([--disable-examples],[disable building examples]),
310[case "${enableval}" in
311  yes) BUILD_EXAMPLES=yes ;;
312  no)  BUILD_EXAMPLES=no ;;
313  *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
314esac],
315[BUILD_EXAMPLES=yes]) dnl Default value
316AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
317
318dnl Next, check for the optional components:
319dnl ========================================
320
321translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
322GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
323translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
324GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
325translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
326GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
327translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
328GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
329translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
330GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
331translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
332GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
333
334GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
335
336dnl ################################################
337dnl # Set defines according to variables set above #
338dnl ################################################
339
340
341dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
342dnl HAVE_ and it is likely to be easier to stick with the old name
343if test "x$USE_LIBMMX" = xyes; then
344  AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
345fi
346
347if test "x$USE_ATOMIC_H" = xyes; then
348  AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
349fi
350
351dnl test if we have pthread_attr_setstack; if not use the older calls
352AC_CHECK_LIB(pthread, pthread_attr_setstack,
353   AC_DEFINE(HAVE_PTHREAD_ATTR_SETSTACK, 1,
354             [Defined if libpthread has pthread_attr_setstack ()]))
355
356dnl test if we have posix_memalign; FreeBSD doesn't
357AC_CHECK_FUNC(posix_memalign,
358   AC_DEFINE(HAVE_POSIX_MEMALIGN, 1,
359             [Defined if we have posix_memalign ()]))
360
361if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
362  AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
363fi
364
365if test "x$USE_DEBUG" = xyes; then
366   GST_INT_CFLAGS="$GST_INT_CFLAGS -g"
367fi
368
369if test "x$USE_PROFILING" = xyes; then
370dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
371  FOMIT_FRAME_POINTER=""
372else
373  FOMIT_FRAME_POINTER="-fomit-frame-pointer"
374fi
375
376dnl
377dnl AC_SUBST(FOMIT_FRAME_POINTER)
378dnl
379
380dnl #############################
381dnl # Set automake conditionals #
382dnl #############################
383
384dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
385dnl HAVE_ and it is likely to be easier to stick with the old name
386AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
387
388AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
389AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
390
391AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
392
393
394dnl ############################
395dnl # Set up some more defines #
396dnl ############################
397
398dnl Set location of registry dir.
399AC_DEFINE_UNQUOTED(GST_CACHE_DIR, "$GST_CACHE_DIR", [Define the registry directory])
400AC_SUBST(GST_CACHE_DIR)
401
402dnl Set location of plugin directory
403if test "x${prefix}" = "xNONE"; then
404  PLUGINS_DIR=${ac_default_prefix}/lib/gstreamer-$GST_MAJORMINOR
405else
406  PLUGINS_DIR=${prefix}/lib/gstreamer-$GST_MAJORMINOR
407fi
408AC_DEFINE_UNQUOTED(PLUGINS_DIR, "$PLUGINS_DIR", [Define the plugin directory])
409AC_SUBST(PLUGINS_DIR)
410
411dnl Set location of uninstalled plugin directory
412PLUGINS_BUILDDIR=`pwd`
413AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR, "$PLUGINS_BUILDDIR", [Define the uninstalled plugin directory])
414AC_SUBST(PLUGINS_BUILDDIR)
415
416dnl since glib and xml are package deps, there's no need to include their cflags
417dnl in the pkg-config file
418
419dnl for pkg-config
420GST_PKG_CFLAGS=$GST_EXT_CFLAGS
421GST_PKG_LIBS=$GST_EXT_LIBS
422AC_SUBST(GST_PKG_CFLAGS)
423AC_SUBST(GST_PKG_LIBS)
424
425dnl finalize _CFLAGS and _LIBS
426dnl add GLIB and XML if necessary to EXT_*
427GST_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
428GST_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS -lpopt"
429
430dnl Private vars for libgst only
431LIBGST_LIBS="$GST_LIBS"
432LIBGST_CFLAGS="$GST_CFLAGS -I\$(top_srcdir) $GST_ERROR"
433AC_SUBST(LIBGST_LIBS)
434AC_SUBST(LIBGST_CFLAGS)
435
436dnl Vars for everyone else
437GST_INT_LIBS="\$(top_builddir)/gst/libgstreamer-$GST_MAJORMINOR.la"
438GST_INT_CFLAGS="$GST_INT_CFLAGS -I\$(top_srcdir)/libs -I\$(top_srcdir)/include"
439
440AC_SUBST(GST_CFLAGS, "$LIBGST_CFLAGS $GST_INT_CFLAGS")
441AC_SUBST(GST_LIBS, "$LIBGST_LIBS $GST_INT_LIBS")
442
443GST_PLUGIN_LDFLAGS="-module -avoid-version"
444AC_SUBST(GST_PLUGIN_LDFLAGS, "$GST_PLUGIN_LDFLAGS")
445
446AC_CONFIG_SUBDIRS(libs/ext/cothreads)
447
448dnl ##################################################
449dnl # deps for examples from manual                  #
450dnl ##################################################
451
452PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0,
453                  HAVE_LIBGNOMEUI="yes", HAVE_LIBGNOMEUI="no")
454AC_SUBST(LIBGNOMEUI_CFLAGS)
455AC_SUBST(LIBGNOMEUI_LIBS)
456AM_CONDITIONAL(HAVE_LIBGNOMEUI, test "x$HAVE_LIBGNOMEUI" = "xyes")
457
458dnl ##################################################
459dnl # Prepare informative messages to display at end #
460dnl ##################################################
461
462infomessages=
463
464if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
465  infomessages="$infomessages
466*** Warning: You have configured using the --enable-plugin-builddir option.
467
468This option is for development purposes only: binaries built with
469it should be used with code in the build tree only.  To build an
470installable version, use ./configure without the --enable-plugin-builddir
471option.  Note that the autogen.sh script supplies the plugin builddir
472option automatically -- run ./autogen.sh -- --disable-plugin-builddir to make
473an installable build.
474
475"
476fi
477
478dnl #########################
479dnl # Make the output files #
480dnl #########################
481
482dnl libs/ext/Makefile
483dnl nothing there yet !
484AC_OUTPUT(
485Makefile
486include/Makefile
487gst/Makefile
488gst/gstversion.h
489gst/autoplug/Makefile
490gst/indexers/Makefile
491gst/elements/Makefile
492gst/parse/Makefile
493gst/schedulers/Makefile
494gst/types/Makefile
495gst/registries/Makefile
496libs/Makefile
497libs/gst/Makefile
498libs/gst/bytestream/Makefile
499libs/gst/getbits/Makefile
500libs/gst/putbits/Makefile
501libs/gst/control/Makefile
502libs/ext/Makefile
503tests/Makefile
504tests/bufspeed/Makefile
505tests/memchunk/Makefile
506tests/muxing/Makefile
507tests/seeking/Makefile
508tests/sched/Makefile
509tests/threadstate/Makefile
510testsuite/Makefile
511testsuite/bytestream/Makefile
512testsuite/caps/Makefile
513testsuite/cleanup/Makefile
514testsuite/clock/Makefile
515testsuite/dynparams/Makefile
516testsuite/elements/Makefile
517testsuite/indexers/Makefile
518testsuite/plugin/Makefile
519testsuite/refcounting/Makefile
520testsuite/threads/Makefile
521examples/Makefile
522examples/autoplug/Makefile
523examples/cutter/Makefile
524examples/helloworld/Makefile
525examples/helloworld2/Makefile
526examples/launch/Makefile
527examples/manual/Makefile
528examples/mixer/Makefile
529examples/pingpong/Makefile
530examples/plugins/Makefile
531examples/queue/Makefile
532examples/queue2/Makefile
533examples/queue3/Makefile
534examples/queue4/Makefile
535examples/thread/Makefile
536examples/typefind/Makefile
537examples/xml/Makefile
538tools/Makefile
539docs/Makefile
540docs/devhelp/Makefile
541docs/faq/Makefile
542docs/gst/Makefile
543docs/gst/gstreamer.types
544docs/libs/Makefile
545docs/manual/Makefile
546docs/pwg/Makefile
547docs/plugins/Makefile
548docs/plugins/gstreamer-plugins.types
549docs/xsl/Makefile
550pkgconfig/Makefile
551pkgconfig/gstreamer.pc
552pkgconfig/gstreamer-uninstalled.pc
553pkgconfig/gstreamer-control.pc
554pkgconfig/gstreamer-control-uninstalled.pc
555stamp.h
556gstreamer.spec,
557echo "$infomessages", infomessages="$infomessages"
558)
Note: See TracBrowser for help on using the repository browser.