added -Wall to GST_INT_CFLAGS
[platform/upstream/gstreamer.git] / configure.ac
1 dnl Note: this file is now the main autoconf file
2 AC_INIT
3 AC_CONFIG_SRCDIR([gst/gstobject.h])
4
5 AC_CANONICAL_TARGET([])
6
7 AM_CONFIG_HEADER(config.h)
8
9 GST_VERSION_MAJOR=0
10 GST_VERSION_MINOR=3
11 GST_VERSION_MICRO=11
12
13 dnl we use a datestamped release tag during CVS development
14 GST_VERSION_RELEASE=`date +%Y%m%d`
15 dnl we use a normal release tag increased manually when releasing
16 dnl GST_VERSION_RELEASE=1
17
18 GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GST_VERSION_MICRO
19
20 PACKAGE=gstreamer
21 VERSION=$GST_VERSION
22
23 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
24 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
25 AC_SUBST(PACKAGE)
26 AC_SUBST(VERSION)
27 AC_DEFINE_UNQUOTED(GST_VERSION_RELEASE, "$GST_VERSION_RELEASE")
28 AC_SUBST(GST_VERSION_RELEASE)
29
30 dnl libtool
31 GST_CURRENT=2
32 GST_REVISION=0
33 GST_AGE=0
34 GST_LIBVERSION=$GST_CURRENT:$GST_REVISION:$GST_AGE
35
36 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
37 dnl Add parameters for aclocal
38 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
39 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
40
41 AC_SUBST(GST_VERSION_MAJOR)
42 AC_SUBST(GST_VERSION_MINOR)
43 AC_SUBST(GST_VERSION_MICRO)
44 AC_SUBST(GST_VERSION)
45
46 AC_SUBST(GST_CURRENT)
47 AC_SUBST(GST_REVISION)
48 AC_SUBST(GST_AGE)
49 AC_SUBST(GST_LIBVERSION)
50
51 AM_MAINTAINER_MODE
52
53 AC_PROG_CC
54 AM_PROG_CC_STDC
55 AM_PROG_AS
56 AS="${CC}"
57 AC_PROG_CXX
58 AC_PROG_CXXCPP
59 AC_ISC_POSIX
60
61 dnl We disable static building for development, for time savings
62 dnl *NOTE*: dnl this line before release, so release does static too
63 dnl AM_DISABLE_STATIC
64 AC_LIBTOOL_DLOPEN
65 AM_PROG_LIBTOOL
66
67 AC_HEADER_STDC([])
68
69
70 dnl ##############################
71 dnl # Do automated configuration #
72 dnl ##############################
73
74 dnl Check for tools:
75 dnl ================
76
77 dnl modify pkg-config path
78 AC_ARG_WITH(pkg-config-path, 
79    AC_HELP_STRING([--with-pkg-config-path],[colon-separated list of pkg-config(1) dirs]),
80    [export PKG_CONFIG_PATH=${withval}])
81
82 dnl Check for nasm
83 AC_PATH_PROG(NASM_PATH, nasm, no)
84 AC_SUBST(NASM_PATH)
85 if test x$NASM_PATH = xno; then
86   AC_MSG_WARN(Couldn't find nasm)
87   HAVE_NASM="no"
88 else AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
89   HAVE_NASM="yes"
90 fi
91
92 dnl check for gtk-doc
93 AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=PATH], [path to installed docs]))
94
95 if test "x$with_html_dir" = "x" ; then
96   HTML_DIR='${datadir}/gst/html'
97 else
98   HTML_DIR=$with_html_dir
99 fi
100
101 AC_SUBST(HTML_DIR)
102
103 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, true, false)
104 gtk_doc_min_version=0.6
105 if $HAVE_GTK_DOC ; then 
106     gtk_doc_version=`gtkdoc-mkdb --version`
107     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
108     if perl <<EOF ; then
109       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
110             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
111 EOF
112       AC_MSG_RESULT(yes)
113    else
114       AC_MSG_RESULT(no)
115       HAVE_GTK_DOC=false
116    fi
117 fi
118 GTK_DOC_SCANOBJ=gtkdoc-scanobj
119
120 AC_SUBST(HAVE_GTK_DOC)
121 AC_SUBST(GTK_DOC_SCANOBJ)
122
123 dnl check for docbook tools
124 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, true, false)
125 AC_CHECK_PROG(HAVE_PDFTOPS, pdftops, true, false)
126 dnl this does not yet work properly, at least on debian -- wingo
127 HAVE_PDFXMLTEX=false
128
129 dnl check for image conversion tool
130 AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
131
132 dnl The following is a hack: if fig2dev doesn't display an error message
133 dnl for the desired type, we assume it supports it.
134 HAVE_FIG2DEV_PNG=false
135 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
136   fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
137   if test "x$fig2dev_quiet" = "x" ; then
138     HAVE_FIG2DEV_PNG=true
139   fi
140 fi
141 HAVE_FIG2DEV_PDF=false
142 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
143   fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
144   if test "x$fig2dev_quiet" = "x" ; then
145     HAVE_FIG2DEV_PDF=true
146   fi
147 fi
148
149
150 dnl Set up conditionals for (target) architecture:
151 dnl ==============================================
152
153 dnl Determine CPU
154 case "x${target_cpu}" in
155   xi?86 | k?) HAVE_CPU_I386=yes
156               AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
157               dnl FIXME could use some better detection
158               dnl       (ie CPUID)
159               case "x${target_cpu}" in
160                 xi386 | xi486) ;;
161                 *)             AC_DEFINE(HAVE_RDTSC) ;;
162               esac ;;
163   xpowerpc)   HAVE_CPU_PPC=yes
164               AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
165   xalpha)     HAVE_CPU_ALPHA=yes
166               AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
167   xarm*)      HAVE_CPU_ARM=yes
168               AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
169   xsparc*)    HAVE_CPU_SPARC=yes
170               AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
171   xmips*)     HAVE_CPU_MIPS=yes
172               AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;;
173   xhppa*)     HAVE_CPU_HPPA=yes
174               AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;;
175 esac
176
177 dnl Determine endianness
178 AC_C_BIGENDIAN
179
180 dnl Check for MMX-capable compiler
181 AC_MSG_CHECKING(for MMX-capable compiler)
182 AC_TRY_RUN([
183 #include "include/mmx.h"
184
185 main()
186 { movq_r2r(mm0, mm1); return 0; }
187 ],
188 [
189 HAVE_LIBMMX="yes"
190 AC_MSG_RESULT(yes)
191 ],
192 HAVE_LIBMMX="no"
193 AC_MSG_RESULT(no)
194 ,
195 HAVE_LIBMMX="no"
196 AC_MSG_RESULT(no)
197 )
198
199 dnl
200 dnl We should really use AC_SYS_LARGEFILE, but the problem is
201 dnl many of the plugins don't include "config.h".  To assure
202 dnl binary compatibility, it is necessary that all gstreamer
203 dnl code be compiled with the same sizeof(off_t), so we use
204 dnl the following crude hack.
205 dnl
206
207 dnl
208 dnl GST_CFLAGS are split up as GST_EXT_CFLAGS and GST_INT_CFLAGS
209 dnl same for libs
210 dnl this is so we can make GST_CFLAGS for external modules available
211 dnl without mixing in internal (uninstalled) CFLAGS
212 dnl
213
214 AC_MSG_CHECKING(for large file support)
215 AC_TRY_RUN([
216 #define _LARGEFILE_SOURCE
217 #define _FILE_OFFSET_BITS 64
218 #include <sys/types.h>
219 int main () { return !(sizeof(off_t) == 8); }
220 ],
221 [
222 AC_MSG_RESULT(yes)
223 GST_EXT_CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
224 ],
225 [
226 AC_MSG_RESULT(no)
227 ],
228 [
229 AC_MSG_RESULT(no)
230 ])
231
232 dnl Check for essential libraries first:
233 dnl ====================================
234
235 dnl Check for glib2
236 translit(dnm, m, l) AM_CONDITIONAL(USE_GLIB2, true)
237 GST_CHECK_FEATURE(GLIB2, [use of glib-2.0 and GObject], , [
238   PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
239     HAVE_GLIB2=yes,HAVE_GLIB2=no)
240   GLIB_LIBS=$GLIB2_LIBS
241   GLIB_CFLAGS=$GLIB2_CFLAGS
242   AC_SUBST(GLIB_LIBS)
243   AC_SUBST(GLIB_CFLAGS)
244   # if we've gotten this far, the user has specifically asked that glib2 be
245   # used. if we have no glib2, that is an error.
246   if test "x$HAVE_GLIB2" = "xno"; then
247     AC_MSG_ERROR([no glib2 found, try --disable-glib2])
248   fi
249 ], enabled, [
250   AC_DEFINE(USE_GLIB2)
251   GST_EXT_CFLAGS="$GST_EXT_CFLAGS -DUSE_GLIB2"
252 ])
253 AC_SUBST(USE_GLIB2)
254
255 if test x$USE_GLIB2 = xno; then
256   GST_PKG_DEPS="glib >= 1.2.0, gtk+ >= 1.2.0"
257   
258   dnl Check for glib and gtk
259   AM_PATH_GLIB(1.2.0,,
260               AC_MSG_ERROR(Cannot find glib: Is glib-config in path?),
261               glib gmodule gthread)
262   AM_PATH_GTK(1.2.0,,
263               AC_MSG_ERROR(Cannot find gtk: Is gtk-config in path?))
264   HAVE_GTK=yes
265
266   GLIB_LIBS="$GLIB_LIBS $GTK_LIBS"
267   GLIB_CFLAGS="$GLIB_CFLAGS $GTK_CFLAGS"
268 else
269   GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
270   
271   if $HAVE_GTK_DOC; then  
272     AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scangobj, true, false)
273     if $HAVE_GTK_DOC; then
274       # don't you love undocumented command line options?
275       GTK_DOC_SCANOBJ="gtkdoc-scangobj --nogtkinit"
276     else
277       GTK_DOC_SCANOBJ=false
278     fi
279   fi
280 fi
281
282 AC_SUBST(GST_PKG_DEPS)
283
284 dnl Check for libxml
285 if test x$USE_GLIB2 = xno; then
286   LIBXML_PKG=', libxml >= 1.8.1'
287   AC_PATH_PROG(XML_CONFIG, xml-config, no)
288   if test x$XML_CONFIG = xno; then
289     AC_MSG_ERROR(Couldn't find xml-config -- Need version 1.8.1 or better of libxml)
290   fi
291   XML_LIBS="`xml-config --libs`"
292   XML_CFLAGS="`xml-config --cflags`"
293   AC_CHECK_LIB(xml, xmlDocGetRootElement, :,
294     [ AC_MSG_ERROR(Need version 1.8.1 or better of libxml) ],
295     $XML_LIBS)
296 else
297   LIBXML_PKG=', libxml-2.0'
298   PKG_CHECK_MODULES(XML, libxml-2.0, HAVE_LIBXML2=yes, HAVE_LIBXML2=no)
299   if test "x$HAVE_LIBXML2" = "xyes"; then
300     AC_DEFINE(HAVE_LIBXML2)
301   else
302     AC_ERROR(Need libxml2 for glib2 builds)
303   fi
304 fi
305 AC_SUBST(LIBXML_PKG)
306 AC_SUBST(XML_LIBS)
307 AC_SUBST(XML_CFLAGS)
308
309 dnl Check for atomic.h
310 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
311 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
312 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
313 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
314 if test x$HAVE_ATOMIC_H = xyes; then
315   AC_TRY_RUN([
316 #include "asm/atomic.h"
317 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
318   ],, [
319     # Not successful
320     if test x$HAVE_ATOMIC_H = xyes; then
321       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
322     fi
323     HAVE_ATOMIC_H=no
324   ], [
325     # Cross compiling
326     AC_MSG_RESULT(yes)
327     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
328   ])
329 fi
330
331
332 dnl ######################################################################
333 dnl # Check command line parameters, and set shell variables accordingly #
334 dnl ######################################################################
335
336 dnl FIXME: simplify all this down using a few m4 macros
337
338 AC_ARG_ENABLE(libmmx,
339 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
340 [case "${enableval}" in
341   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
342   no)  USE_LIBMMX=no ;;
343   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
344 esac], 
345 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
346
347 AC_ARG_ENABLE(atomic,
348 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
349 [case "${enableval}" in
350   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
351   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
352   no)  USE_ATOMIC_H=no;;
353   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
354 esac], 
355 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
356
357 AC_ARG_ENABLE(plugin-builddir,
358 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
359 [case "${enableval}" in
360   yes) PLUGINS_USE_BUILDDIR=yes ;;
361   no)  PLUGINS_USE_BUILDDIR=no ;;
362   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
363 esac], 
364 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
365
366 AC_ARG_ENABLE(debug,
367 AC_HELP_STRING([--disable-debug][disable addition of -g debugging info]),
368 [case "${enableval}" in
369   yes) USE_DEBUG=yes ;;
370   no)  USE_DEBUG=no ;;
371   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
372 esac], 
373 [USE_DEBUG=yes]) dnl Default value
374
375 AC_ARG_ENABLE(DEBUG,
376 AC_HELP_STRING([--disable-DEBUG][disables compilation of debugging messages]),
377 [case "${enableval}" in
378   yes) ENABLE_DEBUG=yes ;;
379   no)  ENABLE_DEBUG=no ;;
380   *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
381 esac], 
382 [ENABLE_DEBUG=yes]) dnl Default value
383 if test x$ENABLE_DEBUG = xyes; then
384   AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
385 fi
386
387 AC_ARG_ENABLE(INFO,
388 AC_HELP_STRING([--disable-INFO][disables compilation of informational messages]),
389 [case "${enableval}" in
390   yes) ENABLE_INFO=yes ;;
391   no)  ENABLE_INFO=no ;;
392   *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
393 esac], 
394 [ENABLE_INFO=yes]) dnl Default value
395 if test x$ENABLE_INFO = xyes; then
396   AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
397 fi
398
399 AC_ARG_ENABLE(debug-color,
400 AC_HELP_STRING([--disable-debug-color][disables color output of DEBUG and INFO output]),
401 [case "${enableval}" in
402   yes) ENABLE_DEBUG_COLOR=yes ;;
403   no)  ENABLE_DEBUG_COLOR=no ;;
404   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
405 esac], 
406 [ENABLE_DEBUG_COLOR=yes]) dnl Default value
407 if test "x$ENABLE_DEBUG_COLOR" = xyes; then
408   AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
409 fi
410
411 AC_ARG_ENABLE(profiling,
412 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
413 [case "${enableval}" in
414   yes) USE_PROFILING=yes ;;
415   no)  UES_PROFILING=no ;;
416   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
417 esac], 
418 [USE_PROFILING=no]) dnl Default value
419
420 dnl default to building registry in the source tree if we are enabling plugin build dir
421 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
422   GST_CONFIG_DIR=`pwd`
423 else
424   GST_CONFIG_DIR=/etc/gstreamer
425 fi
426 AC_ARG_WITH(configdir,
427 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
428 [case "${withval}" in
429   yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
430   no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
431   *) GST_CONFIG_DIR="${withval}" ;;
432 esac], 
433 [:]) dnl Default value
434
435 AC_ARG_ENABLE(docs-build,
436 AC_HELP_STRING([--enable-docs-build][enable building of documentation]),
437 [case "${enableval}" in
438   yes) if $HAVE_GTK_DOC; then BUILD_DOCS=yes; else AC_MSG_ERROR([you don't have gtk-doc, so don't use --docs-build]); fi; ;;
439   no)  BUILD_DOCS=no ;;
440   *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs-build) ;;
441 esac], 
442 [BUILD_DOCS=no]) dnl Default value
443
444 dnl AC_ARG_ENABLE(plugin-docs,
445 dnl [  --enable-plugin-docs         enable the building of plugin documentation
446 dnl                                (this is currently broken, so off by default)],
447 dnl [case "${enableval}" in
448 dnl   yes) BUILD_PLUGIN_DOCS=yes ;;
449 dnl   no)  BUILD_PLUGIN_DOCS=no ;;
450 dnl   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;;
451 dnl esac], 
452 dnl [BUILD_PLUGIN_DOCS=no]) dnl Default value
453 BUILD_PLUGIN_DOCS=no
454
455 AC_ARG_ENABLE(tests,
456 AC_HELP_STRING([--disable-tests][disable building test apps]),
457 [case "${enableval}" in
458   yes) BUILD_TESTS=yes ;;
459   no)  BUILD_TESTS=no ;;
460   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
461 esac], 
462 [BUILD_TESTS=yes]) dnl Default value
463
464 AC_ARG_ENABLE(examples,
465 AC_HELP_STRING([--disable-examples][disable building examples]),
466 [case "${enableval}" in
467   yes) BUILD_EXAMPLES=yes ;;
468   no)  BUILD_EXAMPLES=no ;;
469   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
470 esac], 
471 [BUILD_EXAMPLES=yes]) dnl Default value
472
473 dnl Next, check for the optional components:
474 dnl ========================================
475
476 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
477 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
478 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
479 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
480 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
481 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
482 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
483 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
484 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
485 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
486 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
487 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
488
489 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
490
491 dnl ################################################
492 dnl # Set defines according to variables set above #
493 dnl ################################################
494
495
496 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
497 dnl HAVE_ and it is likely to be easier to stick with the old name
498 if test "x$USE_LIBMMX" = xyes; then
499   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
500 fi
501
502 if test "x$USE_ATOMIC_H" = xyes; then
503   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
504 fi
505
506 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
507   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
508 fi
509
510 dnl if test "x$USE_DEBUG" = xyes; then
511 dnl   CFLAGS="$CFLAGS -g"
512 dnl fi
513
514 if test "x$USE_PROFILING" = xyes; then
515 dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
516   FOMIT_FRAME_POINTER=""
517 else
518   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
519 fi
520
521 dnl
522 dnl AC_SUBST(FOMIT_FRAME_POINTER)
523 dnl
524
525 dnl #############################
526 dnl # Set automake conditionals #
527 dnl #############################
528
529 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
530 dnl HAVE_ and it is likely to be easier to stick with the old name
531 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
532 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
533 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
534 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
535 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
536 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
537
538 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
539
540 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
541 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
542
543 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
544 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
545 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
546 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
547 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
548 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
549 AM_CONDITIONAL(HAVE_PDFXMLTEX,      $HAVE_PDFXMLTEX)
550 AM_CONDITIONAL(HAVE_PDFTOPS,        $HAVE_PDFTOPS)
551 AM_CONDITIONAL(HAVE_XSLTPROC,       $HAVE_XSLTPROC)
552 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
553 AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
554 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
555
556
557 dnl ############################
558 dnl # Set up some more defines #
559 dnl ############################
560
561 dnl Set location of configuration dir.
562 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
563 AC_SUBST(GST_CONFIG_DIR)
564
565 dnl Set location of plugin directory
566 if test "x${prefix}" = "xNONE"; then
567   PLUGINS_DIR=${ac_default_prefix}/lib/gst
568 else
569   PLUGINS_DIR=${prefix}/lib/gst
570 fi
571 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
572 AC_SUBST(PLUGINS_DIR)
573
574 dnl Set location of uninstalled plugin directory
575 PLUGINS_BUILDDIR=`pwd`
576 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
577 AC_SUBST(PLUGINS_BUILDDIR)
578
579 dnl finalize _CFLAGS and _LIBS
580 dnl add GLIB and XML if necessary to EXT_*
581 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
582 GST_EXT_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS"
583
584 dnl for pkg-config
585 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
586 GST_PKG_LIBS=$GST_EXT_LIBS
587 AC_SUBST(GST_PKG_CFLAGS)
588 AC_SUBST(GST_PKG_LIBS)
589
590 dnl Private vars for libgst only
591 LIBGST_LIBS="$GST_EXT_LIBS"
592 LIBGST_CFLAGS="$GST_EXT_CFLAGS -I\$(top_srcdir)"
593 AC_SUBST(LIBGST_LIBS)
594 AC_SUBST(LIBGST_CFLAGS)
595
596 dnl Vars for everyone else
597 GST_INT_LIBS="\$(top_builddir)/gst/libgst.la"
598 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include -I\$(top_srcdir) -Wall"
599
600 AC_SUBST(GST_CFLAGS, "$GST_EXT_CFLAGS $GST_INT_CFLAGS")
601 AC_SUBST(GST_LIBS, "$GST_EXT_LIBS $GST_INT_LIBS")
602
603 AC_CONFIG_SUBDIRS(gst/cothreads)
604
605 dnl ##################################################
606 dnl # Prepare informative messages to display at end #
607 dnl ##################################################
608
609 infomessages=
610
611 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
612   infomessages="$infomessages
613 *** Warning: You have configured using the --enable-plugin-builddir option.
614
615 This option is for development purposes only: binaries built with
616 it should be used with code in the build tree only.  To build an
617 installable version, use ./configure without the --enable-plugin-builddir
618 option.  Note that the autogen.sh script supplies the plugin builddir
619 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
620 an installable build.
621
622 "
623 fi
624
625 dnl #########################
626 dnl # Make the output files #
627 dnl #########################
628
629 AC_OUTPUT(
630 Makefile
631 include/Makefile
632 m4/Makefile
633 gst/Makefile
634 gst/gstversion.h
635 gst/types/Makefile
636 gst/elements/Makefile
637 gst/autoplug/Makefile
638 gst/schedulers/Makefile
639 libs/Makefile
640 libs/gst/Makefile
641 libs/gst/bytestream/Makefile
642 libs/gst/getbits/Makefile
643 libs/gst/putbits/Makefile
644 libs/gst/control/Makefile
645 tests/Makefile
646 tests/bufspeed/Makefile
647 tests/memchunk/Makefile
648 tests/muxing/Makefile
649 tests/sched/Makefile
650 testsuite/Makefile
651 testsuite/bytestream/Makefile
652 testsuite/caps/Makefile
653 testsuite/cleanup/Makefile
654 testsuite/plugin/Makefile
655 examples/Makefile
656 examples/autoplug/Makefile
657 examples/helloworld/Makefile
658 examples/helloworld2/Makefile
659 examples/launch/Makefile
660 examples/queue/Makefile
661 examples/queue2/Makefile
662 examples/queue3/Makefile
663 examples/queue4/Makefile
664 examples/thread/Makefile
665 examples/mixer/Makefile
666 examples/cutter/Makefile
667 examples/launch/Makefile
668 examples/xml/Makefile
669 examples/plugins/Makefile
670 examples/typefind/Makefile
671 examples/mixer/Makefile
672 tools/Makefile
673 docs/Makefile
674 docs/gst/Makefile
675 docs/gst/gstreamer.types
676 docs/libs/Makefile
677 docs/plugins/Makefile
678 docs/plugins/gstreamer-plugins.types
679 docs/manual/Makefile
680 docs/fwg/Makefile
681 docs/xsl/Makefile
682 stamp.h
683 gstreamer.pc
684 gstreamer-uninstalled.pc
685 gstreamer.spec,
686 echo "$infomessages", infomessages="$infomessages"
687 )