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