Update libtool lib version
[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=2
12
13 dnl we use a datestamped release tag and a fourth version ".1" number
14 dnl during CVS development
15 dnl GST_VERSION_RELEASE=`date +%Y%m%d`
16 dnl GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GST_VERSION_MICRO.3
17 dnl we use a normal release tag increased manually when releasing
18 GST_VERSION_RELEASE=1
19 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=3
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   # glib2 is now the default.  so if we don't have it here, then use glib1
246   if test "x$HAVE_GLIB2" = "xno"; then
247     AC_MSG_WARN([no glib2 found, falling back to glib1])
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 dnl ==========================================================================
332 dnl ============================= gst plugins ================================
333 dnl ==========================================================================
334 GST_PLUGIN_LDFLAGS='-module -avoid-version'
335 AC_SUBST(GST_PLUGIN_LDFLAGS)
336
337 dnl ######################################################################
338 dnl # Check command line parameters, and set shell variables accordingly #
339 dnl ######################################################################
340
341 dnl FIXME: simplify all this down using a few m4 macros
342
343 AC_ARG_ENABLE(libmmx,
344 AC_HELP_STRING([--enable-libmmx][use libmmx, if available]),
345 [case "${enableval}" in
346   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
347   no)  USE_LIBMMX=no ;;
348   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
349 esac], 
350 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
351
352 AC_ARG_ENABLE(atomic,
353 AC_HELP_STRING([--enable-atomic][use atomic reference counting header]),
354 [case "${enableval}" in
355   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
356   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
357   no)  USE_ATOMIC_H=no;;
358   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
359 esac], 
360 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
361
362 AC_ARG_ENABLE(plugin-builddir,
363 AC_HELP_STRING([--enable-plugin-builddir][allow tests/demos to use non-installed plugins]),
364 [case "${enableval}" in
365   yes) PLUGINS_USE_BUILDDIR=yes ;;
366   no)  PLUGINS_USE_BUILDDIR=no ;;
367   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
368 esac], 
369 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
370
371 AC_ARG_ENABLE(debug,
372 AC_HELP_STRING([--disable-debug][disable addition of -g debugging info]),
373 [case "${enableval}" in
374   yes) USE_DEBUG=yes ;;
375   no)  USE_DEBUG=no ;;
376   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
377 esac], 
378 [USE_DEBUG=yes]) dnl Default value
379
380 AC_ARG_ENABLE(DEBUG,
381 AC_HELP_STRING([--disable-DEBUG][disables compilation of debugging messages]),
382 [case "${enableval}" in
383   yes) ENABLE_DEBUG=yes ;;
384   no)  ENABLE_DEBUG=no ;;
385   *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
386 esac], 
387 [ENABLE_DEBUG=yes]) dnl Default value
388 if test x$ENABLE_DEBUG = xyes; then
389   AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
390 fi
391
392 AC_ARG_ENABLE(INFO,
393 AC_HELP_STRING([--disable-INFO][disables compilation of informational messages]),
394 [case "${enableval}" in
395   yes) ENABLE_INFO=yes ;;
396   no)  ENABLE_INFO=no ;;
397   *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
398 esac], 
399 [ENABLE_INFO=yes]) dnl Default value
400 if test x$ENABLE_INFO = xyes; then
401   AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
402 fi
403
404 AC_ARG_ENABLE(debug-color,
405 AC_HELP_STRING([--disable-debug-color][disables color output of DEBUG and INFO output]),
406 [case "${enableval}" in
407   yes) ENABLE_DEBUG_COLOR=yes ;;
408   no)  ENABLE_DEBUG_COLOR=no ;;
409   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
410 esac], 
411 [ENABLE_DEBUG_COLOR=yes]) dnl Default value
412 if test "x$ENABLE_DEBUG_COLOR" = xyes; then
413   AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
414 fi
415
416 AC_ARG_ENABLE(profiling,
417 AC_HELP_STRING([--enable-profiling][adds -pg to compiler commandline, for profiling]),
418 [case "${enableval}" in
419   yes) USE_PROFILING=yes ;;
420   no)  UES_PROFILING=no ;;
421   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
422 esac], 
423 [USE_PROFILING=no]) dnl Default value
424
425 dnl default to building registry in the source tree if we are enabling plugin build dir
426 if test "x$PLUGINS_USE_BUILDDIR" = "xyes"; then
427   GST_CONFIG_DIR=`pwd`
428 else
429   GST_CONFIG_DIR=/etc/gstreamer
430 fi
431 AC_ARG_WITH(configdir,
432 AC_HELP_STRING([--with-configdir][specify path to use for plugin and command completion registries]),
433 [case "${withval}" in
434   yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
435   no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
436   *) GST_CONFIG_DIR="${withval}" ;;
437 esac], 
438 [:]) dnl Default value
439
440 AC_ARG_ENABLE(docs-build,
441 AC_HELP_STRING([--enable-docs-build][enable building of documentation]),
442 [case "${enableval}" in
443   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; ;;
444   no)  BUILD_DOCS=no ;;
445   *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs-build) ;;
446 esac], 
447 [BUILD_DOCS=no]) dnl Default value
448
449 dnl AC_ARG_ENABLE(plugin-docs,
450 dnl [  --enable-plugin-docs         enable the building of plugin documentation
451 dnl                                (this is currently broken, so off by default)],
452 dnl [case "${enableval}" in
453 dnl   yes) BUILD_PLUGIN_DOCS=yes ;;
454 dnl   no)  BUILD_PLUGIN_DOCS=no ;;
455 dnl   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;;
456 dnl esac], 
457 dnl [BUILD_PLUGIN_DOCS=no]) dnl Default value
458 BUILD_PLUGIN_DOCS=no
459
460 AC_ARG_ENABLE(tests,
461 AC_HELP_STRING([--disable-tests][disable building test apps]),
462 [case "${enableval}" in
463   yes) BUILD_TESTS=yes ;;
464   no)  BUILD_TESTS=no ;;
465   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
466 esac], 
467 [BUILD_TESTS=yes]) dnl Default value
468
469 AC_ARG_ENABLE(examples,
470 AC_HELP_STRING([--disable-examples][disable building examples]),
471 [case "${enableval}" in
472   yes) BUILD_EXAMPLES=yes ;;
473   no)  BUILD_EXAMPLES=no ;;
474   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
475 esac], 
476 [BUILD_EXAMPLES=yes]) dnl Default value
477
478 dnl Next, check for the optional components:
479 dnl ========================================
480
481 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
482 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
483 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
484 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
485 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
486 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
487 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
488 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
489 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
490 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
491 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
492 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
493
494 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
495
496 dnl ################################################
497 dnl # Set defines according to variables set above #
498 dnl ################################################
499
500
501 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
502 dnl HAVE_ and it is likely to be easier to stick with the old name
503 if test "x$USE_LIBMMX" = xyes; then
504   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
505 fi
506
507 if test "x$USE_ATOMIC_H" = xyes; then
508   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
509 fi
510
511 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
512   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
513 fi
514
515 dnl if test "x$USE_DEBUG" = xyes; then
516 dnl   CFLAGS="$CFLAGS -g"
517 dnl fi
518
519 if test "x$USE_PROFILING" = xyes; then
520 dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
521   FOMIT_FRAME_POINTER=""
522 else
523   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
524 fi
525
526 dnl
527 dnl AC_SUBST(FOMIT_FRAME_POINTER)
528 dnl
529
530 dnl #############################
531 dnl # Set automake conditionals #
532 dnl #############################
533
534 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
535 dnl HAVE_ and it is likely to be easier to stick with the old name
536 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
537 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
538 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
539 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
540 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
541 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
542
543 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
544
545 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
546 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
547
548 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
549 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
550 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
551 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
552 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
553 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
554 AM_CONDITIONAL(HAVE_PDFXMLTEX,      $HAVE_PDFXMLTEX)
555 AM_CONDITIONAL(HAVE_PDFTOPS,        $HAVE_PDFTOPS)
556 AM_CONDITIONAL(HAVE_XSLTPROC,       $HAVE_XSLTPROC)
557 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
558 AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
559 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
560
561
562 dnl ############################
563 dnl # Set up some more defines #
564 dnl ############################
565
566 dnl Set location of configuration dir.
567 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
568 AC_SUBST(GST_CONFIG_DIR)
569
570 dnl Set location of plugin directory
571 if test "x${prefix}" = "xNONE"; then
572   PLUGINS_DIR=${ac_default_prefix}/lib/gst
573 else
574   PLUGINS_DIR=${prefix}/lib/gst
575 fi
576 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
577 AC_SUBST(PLUGINS_DIR)
578
579 dnl Set location of uninstalled plugin directory
580 PLUGINS_BUILDDIR=`pwd`
581 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
582 AC_SUBST(PLUGINS_BUILDDIR)
583
584 dnl finalize _CFLAGS and _LIBS
585 dnl add GLIB and XML if necessary to EXT_*
586 GST_EXT_CFLAGS="$GST_EXT_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
587 GST_EXT_LIBS="$GST_EXT_LIBS $XML_LIBS $GLIB_LIBS"
588
589 dnl for pkg-config
590 GST_PKG_CFLAGS=$GST_EXT_CFLAGS
591 GST_PKG_LIBS=$GST_EXT_LIBS
592 AC_SUBST(GST_PKG_CFLAGS)
593 AC_SUBST(GST_PKG_LIBS)
594
595 dnl Private vars for libgst only
596 LIBGST_LIBS="$GST_EXT_LIBS"
597 LIBGST_CFLAGS="$GST_EXT_CFLAGS -I\$(top_srcdir)"
598 AC_SUBST(LIBGST_LIBS)
599 AC_SUBST(LIBGST_CFLAGS)
600
601 dnl Vars for everyone else
602 GST_INT_LIBS="\$(top_builddir)/gst/libgst.la"
603 GST_INT_CFLAGS="-I\$(top_srcdir)/libs -I\$(top_srcdir)/include -I\$(top_srcdir) -Wall"
604
605 AC_SUBST(GST_CFLAGS, "$GST_EXT_CFLAGS $GST_INT_CFLAGS")
606 AC_SUBST(GST_LIBS, "$GST_EXT_LIBS $GST_INT_LIBS")
607
608 AC_CONFIG_SUBDIRS(gst/cothreads)
609
610 dnl ##################################################
611 dnl # Prepare informative messages to display at end #
612 dnl ##################################################
613
614 infomessages=
615
616 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
617   infomessages="$infomessages
618 *** Warning: You have configured using the --enable-plugin-builddir option.
619
620 This option is for development purposes only: binaries built with
621 it should be used with code in the build tree only.  To build an
622 installable version, use ./configure without the --enable-plugin-builddir
623 option.  Note that the autogen.sh script supplies the plugin builddir
624 option automatically -- run ./autogen.sh --disable-plugin-buildddir to make
625 an installable build.
626
627 "
628 fi
629
630 dnl #########################
631 dnl # Make the output files #
632 dnl #########################
633
634 AC_OUTPUT(
635 Makefile
636 include/Makefile
637 m4/Makefile
638 gst/Makefile
639 gst/gstversion.h
640 gst/types/Makefile
641 gst/elements/Makefile
642 gst/autoplug/Makefile
643 gst/schedulers/Makefile
644 libs/Makefile
645 libs/gst/Makefile
646 libs/gst/bytestream/Makefile
647 libs/gst/getbits/Makefile
648 libs/gst/putbits/Makefile
649 libs/gst/control/Makefile
650 tests/Makefile
651 tests/bufspeed/Makefile
652 tests/memchunk/Makefile
653 tests/muxing/Makefile
654 tests/sched/Makefile
655 testsuite/Makefile
656 testsuite/bytestream/Makefile
657 testsuite/caps/Makefile
658 testsuite/cleanup/Makefile
659 testsuite/elements/Makefile
660 testsuite/plugin/Makefile
661 examples/Makefile
662 examples/autoplug/Makefile
663 examples/helloworld/Makefile
664 examples/helloworld2/Makefile
665 examples/launch/Makefile
666 examples/queue/Makefile
667 examples/queue2/Makefile
668 examples/queue3/Makefile
669 examples/queue4/Makefile
670 examples/thread/Makefile
671 examples/mixer/Makefile
672 examples/cutter/Makefile
673 examples/launch/Makefile
674 examples/xml/Makefile
675 examples/plugins/Makefile
676 examples/typefind/Makefile
677 examples/mixer/Makefile
678 tools/Makefile
679 docs/Makefile
680 docs/gst/Makefile
681 docs/gst/gstreamer.types
682 docs/libs/Makefile
683 docs/plugins/Makefile
684 docs/plugins/gstreamer-plugins.types
685 docs/manual/Makefile
686 docs/fwg/Makefile
687 docs/xsl/Makefile
688 stamp.h
689 gstreamer.pc
690 gstreamer-uninstalled.pc
691 gstreamer.spec,
692 echo "$infomessages", infomessages="$infomessages"
693 )