removing all plugin checks
[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=01
12
13 dnl we use the release tag during CVS development
14 GST_VERSION_RELEASE=`date +%Y%m%d`
15
16 GST_VERSION=$GST_VERSION_MAJOR.$GST_VERSION_MINOR.$GST_VERSION_MICRO
17
18 PACKAGE=gstreamer
19 VERSION=$GST_VERSION
20
21 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
22 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
23 AC_SUBST(PACKAGE)
24 AC_SUBST(VERSION)
25 AC_DEFINE_UNQUOTED(GST_VERSION_RELEASE, "$GST_VERSION_RELEASE")
26 AC_SUBST(GST_VERSION_RELEASE)
27
28 dnl libtool
29 GST_CURRENT=1
30 GST_REVISION=0
31 GST_AGE=0
32 GST_LIBVERSION=$GST_CURRENT:$GST_REVISION:$GST_AGE
33
34 AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
35 dnl Add parameters for aclocal
36 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
37 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
38
39 AC_SUBST(GST_VERSION_MAJOR)
40 AC_SUBST(GST_VERSION_MINOR)
41 AC_SUBST(GST_VERSION_MICRO)
42 AC_SUBST(GST_VERSION)
43
44 AC_SUBST(GST_CURRENT)
45 AC_SUBST(GST_REVISION)
46 AC_SUBST(GST_AGE)
47 AC_SUBST(GST_LIBVERSION)
48
49 AM_MAINTAINER_MODE
50
51 AC_PROG_CC
52 AM_PROG_CC_STDC
53 AM_PROG_AS
54 AS="${CC}"
55 AC_PROG_CXX
56 AC_PROG_CXXCPP
57 AC_ISC_POSIX
58
59 dnl We disable static building for development, for time savings
60 dnl *NOTE*: dnl this line before release, so release does static too
61 AM_DISABLE_STATIC
62 AC_LIBTOOL_DLOPEN
63 AM_PROG_LIBTOOL
64
65 AC_HEADER_STDC([])
66
67
68 dnl ##############################
69 dnl # Do automated configuration #
70 dnl ##############################
71
72 dnl Check for tools:
73 dnl ================
74
75 dnl Check for nasm
76 AC_PATH_PROG(NASM_PATH, nasm, no)
77 AC_SUBST(NASM_PATH)
78 if test x$NASM_PATH = xno; then
79   AC_MSG_WARN(Couldn't find nasm)
80   HAVE_NASM="no"
81 else
82   AC_DEFINE(HAVE_NASM, 1, [Define if NASM, the netwide assembler, is available])
83   HAVE_NASM="yes"
84 fi
85
86 dnl fix pkg-config's broken default search path
87 if test -z $PKG_CONFIG_PATH; then
88   PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
89 fi
90 export PKG_CONFIG_PATH
91
92 dnl Check for pkgconfig
93 AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, true, false)
94
95 dnl check for gtk-doc
96 AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
97
98 if test "x$with_html_dir" = "x" ; then
99   HTML_DIR='${datadir}/gst/html'
100 else
101   HTML_DIR=$with_html_dir
102 fi
103
104 AC_SUBST(HTML_DIR)
105
106 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, true, false)
107 gtk_doc_min_version=0.6
108 if $HAVE_GTK_DOC ; then 
109     gtk_doc_version=`gtkdoc-mkdb --version`
110     AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
111     if perl <<EOF ; then
112       exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
113             ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
114 EOF
115       AC_MSG_RESULT(yes)
116    else
117       AC_MSG_RESULT(no)
118       HAVE_GTK_DOC=false
119    fi
120 fi
121 GTK_DOC_SCANOBJ=gtkdoc-scanobj
122
123 AC_SUBST(HAVE_GTK_DOC)
124 AC_SUBST(GTK_DOC_SCANOBJ)
125
126 dnl check for docbook tools
127 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, true, false)
128 AC_CHECK_PROG(HAVE_PDFTOPS, pdftops, true, false)
129 dnl this does not yet work properly, at least on debain -- wingo
130 HAVE_PDFXMLTEX=false
131
132 dnl check for image conversion tool
133 AC_CHECK_PROG(HAVE_FIG2DEV, fig2dev, true, false)
134
135 dnl The following is a hack: if fig2dev doesn't display an error message
136 dnl for the desired type, we assume it supports it.
137 HAVE_FIG2DEV_PNG=false
138 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
139   fig2dev_quiet=`fig2dev -L png </dev/null 2>&1 >/dev/null`
140   if test "x$fig2dev_quiet" = "x" ; then
141     HAVE_FIG2DEV_PNG=true
142   fi
143 fi
144 HAVE_FIG2DEV_PDF=false
145 if test "x$HAVE_FIG2DEV" = "xtrue" ; then
146   fig2dev_quiet=`fig2dev -L pdf </dev/null 2>&1 >/dev/null`
147   if test "x$fig2dev_quiet" = "x" ; then
148     HAVE_FIG2DEV_PDF=true
149   fi
150 fi
151
152
153 dnl Set up conditionals for (target) architecture:
154 dnl ==============================================
155
156 dnl Determine CPU
157 case "x${target_cpu}" in
158   xi?86 | k?) HAVE_CPU_I386=yes
159               AC_DEFINE(HAVE_CPU_I386, 1, [Define if the target CPU is an x86])
160               dnl FIXME could use some better detection
161               dnl       (ie CPUID)
162               case "x${target_cpu}" in
163                 xi386 | xi486) ;;
164                 *)             AC_DEFINE(HAVE_RDTSC) ;;
165               esac ;;
166   xpowerpc)   HAVE_CPU_PPC=yes
167               AC_DEFINE(HAVE_CPU_PPC, 1, [Define if the target CPU is a PPC]) ;;
168   xalpha)     HAVE_CPU_ALPHA=yes
169               AC_DEFINE(HAVE_CPU_ALPHA, 1, [Define if the target CPU is an Alpha]) ;;
170   xarm*)      HAVE_CPU_ARM=yes
171               AC_DEFINE(HAVE_CPU_ARM, 1, [Define if the target CPU is an ARM]) ;;
172   xsparc*)    HAVE_CPU_SPARC=yes
173               AC_DEFINE(HAVE_CPU_SPARC, 1, [Define if the target CPU is a PPC]) ;;
174   xmips*)     HAVE_CPU_MIPS=yes
175               AC_DEFINE(HAVE_CPU_MIPS, 1, [Define if the target CPU is a MIPS]) ;;
176   xhppa*)     HAVE_CPU_HPPA=yes
177               AC_DEFINE(HAVE_CPU_HPPA, 1, [Define if the target CPU is a HPPA]) ;;
178 esac
179
180 dnl Determine endianness
181 AC_C_BIGENDIAN
182
183 dnl Check for MMX-capable compiler
184 AC_MSG_CHECKING(for MMX-capable compiler)
185 AC_TRY_RUN([
186 #include "include/mmx.h"
187
188 main()
189 { movq_r2r(mm0, mm1); return 0; }
190 ],
191 [
192 HAVE_LIBMMX="yes"
193 AC_MSG_RESULT(yes)
194 ],
195 HAVE_LIBMMX="no"
196 AC_MSG_RESULT(no)
197 ,
198 HAVE_LIBMMX="no"
199 AC_MSG_RESULT(no)
200 )
201
202 dnl
203 dnl We should really use AC_SYS_LARGEFILE, but the problem is
204 dnl many of the plugins don't include "config.h".  To assure
205 dnl binary compatibility, it is necessary that all gstreamer
206 dnl code be compiled with the same sizeof(off_t), so we use
207 dnl the following crude hack.
208 dnl
209
210 AC_MSG_CHECKING(for large file support)
211 AC_TRY_RUN([
212 #define _LARGEFILE_SOURCE
213 #define _FILE_OFFSET_BITS 64
214 #include <sys/types.h>
215 int main () { return !(sizeof(off_t) == 8); }
216 ],
217 [
218 AC_MSG_RESULT(yes)
219 GST_CFLAGS="$GST_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
220 ],
221 [
222 AC_MSG_RESULT(no)
223 ],
224 [
225 AC_MSG_RESULT(no)
226 ])
227
228 dnl Check for essential libraries first:
229 dnl ====================================
230
231 dnl Check for glib2
232 translit(dnm, m, l) AM_CONDITIONAL(USE_GLIB2, true)
233 GST_CHECK_FEATURE(GLIB2, [use of glib-2.0 and GObject], , [
234   PKG_CHECK_MODULES(GLIB2, glib-2.0 gobject-2.0 gthread-2.0 gmodule-2.0,
235     HAVE_GLIB2=yes,HAVE_GLIB2=no)
236   GLIB_LIBS=$GLIB2_LIBS
237   GLIB_CFLAGS=$GLIB2_CFLAGS
238   AC_SUBST(GLIB_LIBS)
239   AC_SUBST(GLIB_CFLAGS)
240 ], disabled, [
241   AC_DEFINE(USE_GLIB2)
242   GST_CFLAGS="$GST_CFLAGS -DUSE_GLIB2"
243 ])
244 AC_SUBST(USE_GLIB2)
245
246 if test x$USE_GLIB2 = xno; then
247   GST_PKG_DEPS="glib >= 1.2.0, gtk+ >= 1.2.0"
248   
249   dnl Check for glib and gtk
250   AM_PATH_GLIB(1.2.0,,
251               AC_MSG_ERROR(Cannot find glib: Is glib-config in path?),
252               glib gmodule gthread)
253   AM_PATH_GTK(1.2.0,,
254               AC_MSG_ERROR(Cannot find gtk: Is gtk-config in path?))
255   HAVE_GTK=yes
256
257   GLIB_LIBS="$GLIB_LIBS $GTK_LIBS"
258   GLIB_CFLAGS="$GLIB_CFLAGS $GTK_CFLAGS"
259 else
260   GST_PKG_DEPS="glib-2.0, gobject-2.0, gmodule-2.0, gthread-2.0"
261   
262   PKG_CHECK_MODULES(GTK2, gtk+-2.0, HAVE_GTK=yes, HAVE_GTK=no)
263
264   GTK_CFLAGS=$GTK2_CFLAGS
265   GTK_LIBS=$GTK2_LIBS
266   
267   if $HAVE_GTK_DOC; then  
268     AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-scangobj, true, false)
269     if $HAVE_GTK_DOC; then
270       GTK_DOC_SCANOBJ=gtkdoc-scangobj
271     fi;
272   fi
273
274   dnl FIXME: check for  gnome2 - this conditional is currently
275   dnl always false.
276   AM_CONDITIONAL(USE_GNOME2, test "x$USE_GNOME2" = "xyes")
277   AC_SUBST(USE_GNOME2)
278 fi
279
280 AC_SUBST(GST_PKG_DEPS)
281 AC_SUBST(GTK_LIBS)
282 AC_SUBST(GTK_CFLAGS)
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 $LIBXML_PKG)
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_PKG, XML_CONFIG=yes, XML_CONFIG=no)
299   AC_PATH_PROG(XML_CONFIG, xml-config, no)
300   AC_DEFINE(HAVE_LIBXML2)
301   GST_CFLAGS="$GST_CFLAGS -DHAVE_LIBXML2"
302 fi
303 AC_SUBST(LIBXML_PKG)
304 AC_SUBST(XML_LIBS)
305 AC_SUBST(XML_CFLAGS)
306
307 dnl Check for libgdk-pixbuf
308 dnl FIXME: not sure that this is still used anywhere.
309 dnl DELETEME
310 dnl translit(dnm, m, l) AM_CONDITIONAL(USE_GDK_PIXBUF, true)
311 dnl GST_CHECK_FEATURE(GDK_PIXBUF, [use gdk pixbuf], , [
312 dnl translit(dnm, m, l) AC_SUBST(GDK_PIXBUF_LIBS)
313 dnl translit(dnm, m, l) AC_SUBST(GDK_PIXBUF_CFLAGS)
314 dnl GST_CHECK_CONFIGPROG(GDK_PIXBUF, gdk-pixbuf-config)
315 dnl ])
316 dnl 
317
318
319 if test x$USE_GLIB2 = xyes; then
320   dnl we don't support gnome/gtk with glib2.0 yet
321   GNOME_LIBS=
322   GNOME_CFLAGS=
323   HAVE_GNOME=no
324   AC_MSG_WARN(gnome disabled for glib2.0)
325 else
326   dnl Check for libgnome
327   GST_CHECK_CONFIGPROG(GNOME, gnome-config, gnome gnomeui)
328 fi
329 AC_SUBST(GNOME_LIBS)
330 AC_SUBST(GNOME_CFLAGS)
331 AC_SUBST(HAVE_GNOME)
332
333 dnl Check for libghttp
334 translit(dnm, m, l) AM_CONDITIONAL(USE_LIBGHTTP, true)
335 GST_CHECK_FEATURE(LIBGHTTP, [libghttp plugins], gsthttpsrc, [
336   dnl FIXME: need to check for header
337   GHTTP_LIBS=
338   GST_HTTPSRC_GET_TYPE=
339   if test x$USE_GLIB2 = xyes; then
340     AC_MSG_WARN(ghttp disabled for glib2.0)
341   else
342     AC_CHECK_LIB(ghttp, ghttp_request_new,
343       [GHTTP_LIBS="-lghttp"
344        GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
345        HAVE_LIBGHTTP=yes
346       ], :, $LIBS)
347   fi
348   AC_SUBST(GHTTP_LIBS)
349   AC_SUBST(GST_HTTPSRC_GET_TYPE)
350 ])
351
352 dnl Check for libglade with gnome support; no libglade for glib2.0
353 HAVE_LIBGLADE_GNOME="no"
354 if test x$USE_GLIB2 = xyes; then
355   AC_MSG_WARN(libglade disabled for glib2.0)
356   PKG_CHECK_MODULES(LIBGLADE_GNOME, libglade-2.0 libgnomeui-2.0, HAVE_LIBGLADE_GNOME=yes, HAVE_LIBGLADE_GNOME=no)
357   if test x$HAVE_LIBGLADE_GNOME = xno; then
358     AC_MSG_WARN(Couldn't find libglade-2.0 - Can't build gstplay)
359     LIBGLADE_GNOME_LIBS=
360     LIBGLADE_GNOME_CFLAGS=
361   fi;
362 else
363   AM_PATH_LIBGLADE(HAVE_LIBGLADE_GNOME="yes", HAVE_LIBGLADE_GNOME="no", gnome)
364   if test x$HAVE_LIBGLADE_GNOME = xno; then
365     AC_MSG_WARN(Couldn't find libglade-config - Can't build gstplay)
366   else
367     LIBGLADE_GNOME_LIBS=$LIBGLADE_LIBS
368     LIBGLADE_GNOME_CFLAGS=$LIBGLADE_CFLAGS
369         AC_TRY_LINK([#include <glade/glade.h>],[glade_gnome_init();],
370                 HAVE_LIBGLADE_GNOME="yes"
371                 AC_MSG_WARN(
372         [Couldn't find gnome libraries for libglade - Can't build gstmediaplay and gsteditor])
373                )
374   fi
375 fi
376 AC_SUBST(HAVE_LIBGLADE_GNOME)
377 AC_SUBST(LIBGLADE_GNOME_LIBS)
378 AC_SUBST(LIBGLADE_GNOME_CFLAGS)
379
380 dnl Check for atomic.h
381 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
382 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
383 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
384 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
385 if test x$HAVE_ATOMIC_H = xyes; then
386   AC_TRY_RUN([
387 #include "asm/atomic.h"
388 main() { atomic_t t; atomic_set(&t,0); atomic_inc(&t); atomic_add(1,&t);return 0;}
389   ],, [
390     # Not successful
391     if test x$HAVE_ATOMIC_H = xyes; then
392       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
393     fi
394     HAVE_ATOMIC_H=no
395   ], [
396     # Cross compiling
397     AC_MSG_RESULT(yes)
398     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
399   ])
400 fi
401
402
403 dnl Check for X11 extensions
404 AC_PATH_XTRA
405 if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
406   AC_MSG_ERROR(can not find X11)
407 fi
408 AC_SUBST(X_CFLAGS)
409 AC_SUBST(X_PRE_LIBS)
410 AC_SUBST(X_EXTRA_LIBS)
411 AC_SUBST(X_LIBS)
412
413
414 dnl Check for the Xv library
415 xvsave_LIBS=${LIBS}
416 AC_CHECK_LIB(Xv, XvQueryExtension,
417   HAVE_LIBXV=yes,
418   HAVE_LIBXV=no,
419   $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS
420 )
421 LIBS=${xvsave_LIBS}
422 AC_CHECK_HEADER(X11/extensions/Xv.h, :, HAVE_LIBXV=no)
423 AC_CHECK_HEADER(X11/extensions/Xvlib.h, :, HAVE_LIBXV=no)
424
425
426 dnl ######################################################################
427 dnl # Check command line parameters, and set shell variables accordingly #
428 dnl ######################################################################
429
430 AC_ARG_ENABLE(libmmx,
431 [  --enable-libmmx              use libmmx, if available],
432 [case "${enableval}" in
433   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
434   no)  USE_LIBMMX=no ;;
435   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
436 esac], 
437 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
438
439 AC_ARG_ENABLE(atomic,
440 [  --enable-atomic              use atomic reference counting header],
441 [case "${enableval}" in
442   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
443   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
444   no)  USE_ATOMIC_H=no;;
445   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
446 esac], 
447 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
448
449 AC_ARG_ENABLE(plugin-builddir,
450 [  --enable-plugin-builddir     allow tests/demos to use non-installed plugins ],
451 [case "${enableval}" in
452   yes) PLUGINS_USE_BUILDDIR=yes ;;
453   no)  PLUGINS_USE_BUILDDIR=no ;;
454   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-builddir) ;;
455 esac], 
456 [PLUGINS_USE_BUILDDIR=no]) dnl Default value
457
458 AC_ARG_ENABLE(debug,
459 [  --enable-debug               compile with -g debugging info],
460 [case "${enableval}" in
461   yes) USE_DEBUG=yes ;;
462   no)  USE_DEBUG=no ;;
463   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
464 esac], 
465 [USE_DEBUG=no]) dnl Default value
466
467 AC_ARG_ENABLE(DEBUG,
468 [  --enable-DEBUG               compiles in a large number of debugging messages],
469 [case "${enableval}" in
470   yes) ENABLE_DEBUG=yes ;;
471   no)  ENABLE_DEBUG=no ;;
472   *) AC_MSG_ERROR(bad value ${enableval} for --enable-DEBUG) ;;
473 esac], 
474 [ENABLE_DEBUG=no]) dnl Default value
475 if test x$ENABLE_DEBUG = xyes; then
476   AC_DEFINE(GST_DEBUG_ENABLED, 1, [Define if DEBUG statements should be compiled in])
477 fi
478
479 AC_ARG_ENABLE(INFO,
480 [  --disable-INFO               disables compilation of informational messages],
481 [case "${enableval}" in
482   yes) ENABLE_INFO=yes ;;
483   no)  ENABLE_INFO=no ;;
484   *) AC_MSG_ERROR(bad value ${enableval} for --enable-INFO) ;;
485 esac], 
486 [ENABLE_INFO=yes]) dnl Default value
487 if test x$ENABLE_INFO = xyes; then
488   AC_DEFINE(GST_INFO_ENABLED, 1, [Define if INFO statements should be compiled in])
489 fi
490
491 AC_ARG_ENABLE(debug-color,
492 [  --disable-debug-color        disables color output of DEBUG and INFO output],
493 [case "${enableval}" in
494   yes) ENABLE_DEBUG_COLOR=yes ;;
495   no)  ENABLE_DEBUG_COLOR=no ;;
496   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug-color) ;;
497 esac], 
498 [ENABLE_DEBUG_COLOR=yes]) dnl Default value
499 if test "x$ENABLE_DEBUG_COLOR" = xyes; then
500   AC_DEFINE(GST_DEBUG_COLOR, 1, [Define if debugging messages should be colorized])
501 fi
502
503 AC_ARG_ENABLE(profiling,
504 [  --enable-profiling           adds -pg to compiler commandline, for profiling],
505 [case "${enableval}" in
506   yes) USE_PROFILING=yes ;;
507   no)  UES_PROFILING=no ;;
508   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
509 esac], 
510 [USE_PROFILING=no]) dnl Default value
511
512 dnl default to building registry in the source tree if we are enabling plugin build dir
513 if test "x$PLUGINS_USE_BUILDDIR"="xyes"; then
514   GST_CONFIG_DIR=`pwd`
515 else
516   GST_CONFIG_DIR=/etc/gstreamer
517 fi
518 AC_ARG_WITH(configdir,
519 [  --with-configdir             specify path to use for configdir],
520 [case "${withval}" in
521   yes) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
522   no) AC_MSG_ERROR(bad value ${withval} for --with-configdir) ;;
523   *) GST_CONFIG_DIR="${withval}" ;;
524 esac], 
525 [:]) dnl Default value
526
527 dnl Default value
528 GST_WIN32_LIBDIR="/usr/lib/win32"
529 AC_ARG_WITH(win32_libdir,
530 [  --with-win32-libdir          specify location for win32 DLLs],
531 [case "${withval}" in
532   yes) AC_MSG_ERROR(bad value ${withval} for --with-win32-libdir) ;;
533   no) AC_MSG_ERROR(bad value ${withval} for --with-win32-libdir) ;;
534   *) GST_WIN32_LIBDIR="${withval}" ;;
535 esac],
536 [:]) dnl Default value
537
538 AC_ARG_ENABLE(docs-build,
539 [  --enable-docs-build          enable building of documentation],
540 [case "${enableval}" in
541   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; ;;
542   no)  BUILD_DOCS=no ;;
543   *) AC_MSG_ERROR(bad value ${enableval} for --enable-docs-build) ;;
544 esac], 
545 [BUILD_DOCS=no]) dnl Default value
546
547 AC_ARG_ENABLE(plugin-docs,
548 [  --enable-plugin-docs         enable the building of plugin documentation
549                                (this is currently broken, so off by default)],
550 [case "${enableval}" in
551   yes) BUILD_PLUGIN_DOCS=yes ;;
552   no)  BUILD_PLUGIN_DOCS=no ;;
553   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-docs) ;;
554 esac], 
555 [BUILD_PLUGIN_DOCS=no]) dnl Default value
556
557 AC_ARG_ENABLE(tests,
558 [  --disable-tests              disable building test apps],
559 [case "${enableval}" in
560   yes) BUILD_TESTS=yes ;;
561   no)  BUILD_TESTS=no ;;
562   *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
563 esac], 
564 [BUILD_TESTS=yes]) dnl Default value
565
566 AC_ARG_ENABLE(examples,
567 [  --disable-examples           disable building examples],
568 [case "${enableval}" in
569   yes) BUILD_EXAMPLES=yes ;;
570   no)  BUILD_EXAMPLES=no ;;
571   *) AC_MSG_ERROR(bad value ${enableval} for --disable-examples) ;;
572 esac], 
573 [BUILD_EXAMPLES=yes]) dnl Default value
574
575 dnl Next, check for the optional components:
576 dnl ========================================
577
578
579 AC_DEFUN(GST_SUBSYSTEM_DISABLE,
580 [dnl
581 dnl Add a subsystem --disable flag and all the necessary symbols and substitions
582 dnl
583 AC_ARG_ENABLE(translit([$1], A-Z, a-z), 
584 [  ]builtin(format, --disable-%-17s  disable %s, translit([$1], A-Z, a-z), $2),
585 [ case "${enableval}" in
586     yes) GST_DISABLE_[$1]=no ;;
587     no) GST_DISABLE_[$1]=yes ;;
588     *) AC_MSG_ERROR(bad value ${enableval} for --enable-translit([$1], A-Z, a-z)) ;;
589   esac],
590 [GST_DISABLE_[$1]=no]) dnl Default value
591 if test x$GST_DISABLE_[$1] = xyes; then
592   AC_DEFINE(GST_DISABLE_[$1], 1, [Disable $2])
593   GST_DISABLE_[$1]_DEFINE=-DGST_DISABLE_[$1]
594 fi
595 AM_CONDITIONAL(GST_DISABLE_[$1], test x$GST_DISABLE_[$1] = xyes)
596 AC_SUBST(GST_DISABLE_[$1]_DEFINE)
597 GST_SUBSYSTEM_DISABLE_DEFINES="$GST_SUBSYTEM_DISABLE_DEFINES $GST_DISABLE_[$1]_DEFINE"
598 ])
599
600 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_LOADSAVE, true)
601 GST_SUBSYSTEM_DISABLE(LOADSAVE,[pipeline XML load/save])
602 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TYPEFIND, true)
603 GST_SUBSYSTEM_DISABLE(TYPEFIND,[typefind plugin],)
604 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_AUTOPLUG, true)
605 GST_SUBSYSTEM_DISABLE(AUTOPLUG,[autoplugger subsystem])
606 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_PARSE, true)
607 GST_SUBSYSTEM_DISABLE(PARSE,[command-line parser])
608 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_TRACE, true)
609 GST_SUBSYSTEM_DISABLE(TRACE,[tracing subsystem])
610 translit(dnm, m, l) AM_CONDITIONAL(GST_DISABLE_REGISTRY, true)
611 GST_SUBSYSTEM_DISABLE(REGISTRY,[plugin registry])
612
613 GST_CFLAGS="$GST_CFLAGS $GST_SUBSYSTEM_DISABLE_DEFINES"
614
615 dnl for pkg-config
616 GST_PKG_CFLAGS=$GST_CFLAGS
617 AC_SUBST(GST_PKG_CFLAGS)
618
619 dnl ################################################
620 dnl # Set defines according to variables set above #
621 dnl ################################################
622
623
624 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
625 dnl HAVE_ and it is likely to be easier to stick with the old name
626 if test "x$USE_LIBGHTTP" = xyes; then
627   AC_DEFINE(HAVE_LIBGHTTP, 1, [Define if ghttp library is available])
628 fi
629
630 if test "x$USE_LIBMMX" = xyes; then
631   AC_DEFINE(HAVE_LIBMMX, 1, [Define if libmmx is available])
632 fi
633
634 if test "x$USE_ATOMIC_H" = xyes; then
635   AC_DEFINE(HAVE_ATOMIC_H, 1, [Define if atomic.h header file is available])
636 fi
637
638 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
639   AC_DEFINE(PLUGINS_USE_BUILDDIR, 1, [Define if plugins should be loaded from the build tree - only developers should use this])
640 fi
641
642 dnl if test "x$USE_DEBUG" = xyes; then
643 dnl   CFLAGS="$CFLAGS -g"
644 dnl fi
645
646 if test "x$USE_PROFILING" = xyes; then
647 dnl  CFLAGS="$CFLAGS -pg -fprofile-arcs"
648   FOMIT_FRAME_POINTER=""
649 else
650   FOMIT_FRAME_POINTER="-fomit-frame-pointer"
651 fi
652
653 dnl
654 dnl AC_SUBST(FOMIT_FRAME_POINTER)
655 dnl
656
657 if test "x$HAVE_LIBXV" = xyes; then
658   AC_DEFINE(HAVE_LIBXV)
659 fi
660
661 dnl #############################
662 dnl # Set automake conditionals #
663 dnl #############################
664
665 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
666 dnl HAVE_ and it is likely to be easier to stick with the old name
667 AM_CONDITIONAL(HAVE_CPU_I386,       test "x$HAVE_CPU_I386" = "xyes")
668 AM_CONDITIONAL(HAVE_CPU_PPC,        test "x$HAVE_CPU_PPC" = "xyes")
669 AM_CONDITIONAL(HAVE_CPU_ALPHA,      test "x$HAVE_CPU_ALPHA" = "xyes")
670 AM_CONDITIONAL(HAVE_CPU_ARM,        test "x$HAVE_CPU_ARM" = "xyes")
671 AM_CONDITIONAL(HAVE_CPU_SPARC,      test "x$HAVE_CPU_SPARC" = "xyes")
672 AM_CONDITIONAL(HAVE_LIBMMX,         test "x$USE_LIBMMX" = "xyes")
673
674 AM_CONDITIONAL(HAVE_ATOMIC_H,       test "x$USE_ATOMIC_H" = "xyes")
675
676 AM_CONDITIONAL(EXPERIMENTAL,        test "$EXPERIMENTAL" = "$xyes")
677 AM_CONDITIONAL(BROKEN,              test "$BROKEN" = "$xyes")
678
679 AM_CONDITIONAL(HAVE_NASM,           test "x$HAVE_NASM" = "xyes")
680 AM_CONDITIONAL(HAVE_LIBGLADE_GNOME, test "x$HAVE_LIBGLADE_GNOME" = "xyes")
681 AM_CONDITIONAL(HAVE_GNOME,          test "x$HAVE_GNOME" = "xyes")
682 AM_CONDITIONAL(HAVE_LIBXV,          test "x$HAVE_LIBXV" = "xyes")
683 AM_CONDITIONAL(HAVE_GTK,            test "x$HAVE_GTK" = "xyes")
684 AM_CONDITIONAL(HAVE_GTK_DOC,        $HAVE_GTK_DOC)
685 AM_CONDITIONAL(BUILD_DOCS,          test "x$BUILD_DOCS" = "xyes")
686 AM_CONDITIONAL(BUILD_TESTS,         test "x$BUILD_TESTS" = "xyes")
687 AM_CONDITIONAL(BUILD_EXAMPLES,      test "x$BUILD_EXAMPLES" = "xyes")
688 AM_CONDITIONAL(BUILD_PLUGIN_DOCS,   test "x$BUILD_PLUGIN_DOCS" = "xyes")
689 AM_CONDITIONAL(HAVE_PDFXMLTEX,      $HAVE_PDFXMLTEX)
690 AM_CONDITIONAL(HAVE_PDFTOPS,        $HAVE_PDFTOPS)
691 AM_CONDITIONAL(HAVE_XSLTPROC,       $HAVE_XSLTPROC)
692 AM_CONDITIONAL(HAVE_FIG2DEV_PNG,    $HAVE_FIG2DEV_PNG)
693 AM_CONDITIONAL(HAVE_FIG2DEV_PDF,    $HAVE_FIG2DEV_PDF)
694 AM_CONDITIONAL(PLUGINS_USE_BUILDDIR,  test "x$PLUGINS_USE_BUILDDIR" = "xyes")
695
696
697 dnl ############################
698 dnl # Set up some more defines #
699 dnl ############################
700
701 dnl Set location of configuration dir.
702 AC_DEFINE_UNQUOTED(GST_CONFIG_DIR,"$GST_CONFIG_DIR")
703 AC_SUBST(GST_CONFIG_DIR)
704
705 dnl Set location of windows dll dir.
706 AC_DEFINE_UNQUOTED(GST_WIN32_LIBDIR,"$GST_WIN32_LIBDIR")
707 AC_SUBST(GST_WIN32_LIBDIR)
708
709 dnl Set location of plugin directory
710 if test "x${prefix}" = "xNONE"; then
711   PLUGINS_DIR=${ac_default_prefix}/lib/gst
712 else
713   PLUGINS_DIR=${prefix}/lib/gst
714 fi
715 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
716 AC_SUBST(PLUGINS_DIR)
717
718 dnl Set location of uninstalled plugin directory
719 PLUGINS_BUILDDIR=`pwd`
720 AC_DEFINE_UNQUOTED(PLUGINS_BUILDDIR,"$PLUGINS_BUILDDIR")
721 AC_SUBST(PLUGINS_BUILDDIR)
722
723 dnl Private vars for libgst only
724 LIBGST_LIBS="$GST_LIBS $XML_LIBS $GLIB_LIBS"
725 LIBGST_CFLAGS="$GST_CFLAGS $XML_CFLAGS $GLIB_CFLAGS"
726 AC_SUBST(LIBGST_LIBS)
727 AC_SUBST(LIBGST_CFLAGS)
728
729 dnl Vars for everyone else
730 GST_LIBS="\$(top_builddir)/gst/libgst.la $LIBGST_LIBS"
731 GST_CFLAGS="-I\$(top_srcdir) -I\$(top_srcdir)/libs -I\$(top_srcdir)/include $LIBGST_CFLAGS"
732 AC_SUBST(GST_LIBS)
733 AC_SUBST(GST_CFLAGS)
734
735 dnl ##################################################
736 dnl # Prepare informative messages to display at end #
737 dnl ##################################################
738
739 infomessages=
740
741 if test "x$PLUGINS_USE_BUILDDIR" = xyes; then
742   infomessages="$infomessages
743 *** Warning: You have configured using the --enable-plugin-builddir option.
744
745 This option is for development purposes only: binaries built with
746 it should be used with code in the build tree only.  To build an
747 installable version, use ./configure without the --enable-plugin-builddir
748 option.  Note that the autogen.sh script supplies the plugin builddir
749 option automatically - it cannot be used to configure installable builds.
750
751 "
752 fi
753
754 dnl #########################
755 dnl # Make the output files #
756 dnl #########################
757
758 dnl until ffmpeg is handled by configure plugins/ffmpeg/Makefile
759 dnl components/bonobo-gstmediaplay/Makefile
760 dnl someone should fix this test/misc/Makefile
761 dnl wtay fix this: testsuite/threads/Makefile
762 dnl testsuite/refcounting/Makefile
763 AC_OUTPUT(
764 Makefile
765 include/Makefile
766 gst/Makefile
767 gst/gstversion.h
768 gst/types/Makefile
769 gst/elements/Makefile
770 gst/autoplug/Makefile
771 gst/schedulers/Makefile
772 libs/Makefile
773 libs/gst/Makefile
774 libs/gst/bytestream/Makefile
775 libs/gst/getbits/Makefile
776 libs/gst/putbits/Makefile
777 libs/gst/control/Makefile
778 gstplay/Makefile
779 test/Makefile
780 test/xml/Makefile
781 test/bindings/Makefile
782 test/memchunk/Makefile
783 test/events/Makefile
784 tests/Makefile
785 tests/sched/Makefile
786 tests/eos/Makefile
787 tests/muxing/Makefile
788 testsuite/Makefile
789 testsuite/bytestream/Makefile
790 testsuite/capsnego/Makefile
791 testsuite/plugin/Makefile
792 testsuite/cleanup/Makefile
793 tests/nego/Makefile
794 examples/Makefile
795 examples/autoplug/Makefile
796 examples/helloworld/Makefile
797 examples/helloworld2/Makefile
798 examples/launch/Makefile
799 examples/queue/Makefile
800 examples/queue2/Makefile
801 examples/queue3/Makefile
802 examples/queue4/Makefile
803 examples/thread/Makefile
804 examples/mixer/Makefile
805 examples/cutter/Makefile
806 examples/launch/Makefile
807 examples/xml/Makefile
808 examples/plugins/Makefile
809 examples/typefind/Makefile
810 examples/mixer/Makefile
811 editor/Makefile
812 editor/pixmaps/Makefile
813 tools/Makefile
814 docs/Makefile
815 docs/gst/Makefile
816 docs/gst/gstreamer.types
817 docs/libs/Makefile
818 docs/plugins/Makefile
819 docs/plugins/gstreamer-plugins.types
820 docs/manual/Makefile
821 docs/fwg/Makefile
822 stamp.h
823 gstreamer.pc
824 gstreamer-uninstalled.pc
825 gstreamer.spec,
826 echo "$infomessages", infomessages="$infomessages"
827 )
828
829 echo -e "configure: *** Plugins that will be built : $GST_PLUGINS_YES"
830 echo
831 echo -e "configure: *** Plugins that will not be built : $GST_PLUGINS_NO"
832 echo