a27c3e87b0e46532e2bdd32990842467c66c5935
[platform/upstream/gstreamer.git] / configure.in
1 AC_INIT(gst/gstobject.h)
2
3 AM_CONFIG_HEADER(config.h)
4
5 STREAMER_MAJOR_VERSION=0
6 STREAMER_MINOR_VERSION=0
7 STREAMER_MICRO_VERSION=9.2
8 STREAMER_VERSION=$STREAMER_MAJOR_VERSION.$STREAMER_MINOR_VERSION.$STREAMER_MICRO_VERSION
9
10 dnl libtool
11 STREAMER_CURRENT=0
12 STREAMER_REVISION=0
13 STREAMER_AGE=0
14
15 AM_INIT_AUTOMAKE(gstreamer, $STREAMER_VERSION)
16 dnl Add parameters for aclocal
17 dnl (This must come after AM_INIT_AUTOMAKE, since it modifies ACLOCAL)
18 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
19
20 AC_SUBST(STREAMER_MAJOR_VERSION)
21 AC_SUBST(STREAMER_MINOR_VERSION)
22 AC_SUBST(STREAMER_MICRO_VERSION)
23 AC_SUBST(STREAMER_VERSION)
24
25 AC_SUBST(STREAMER_CURRENT)
26 AC_SUBST(STREAMER_REVISION)
27 AC_SUBST(STREAMER_AGE)
28
29
30 AM_MAINTAINER_MODE
31
32 AC_ISC_POSIX
33 AC_PROG_CC
34 AC_STDC_HEADERS
35 AC_ARG_PROGRAM
36
37 AM_DISABLE_STATIC
38 AC_LIBTOOL_DLOPEN
39 AM_PROG_LIBTOOL
40
41 dnl ##############################
42 dnl # Do automated configuration #
43 dnl ##############################
44
45 dnl Check for essential libraries first:
46 dnl ====================================
47
48 dnl Check for glib
49 AM_PATH_GLIB(1.2.0,,
50             AC_MSG_ERROR(Cannot find glib: Is glib-config in path?),
51             glib gmodule gthread)
52 dnl Put the glib flags into $LIBS and $CFLAGS since we always use them
53 LIBS="$LIBS $GLIB_LIBS"
54 CFLAGS="$FLAGS $GLIB_CFLAGS"
55
56 dnl Check for libxml
57 AC_PATH_PROG(XML_CONFIG, xml-config, no)
58 if test x$XML_CONFIG = xno; then
59   AC_MSG_ERROR(Couldn't find xml-config)
60 fi
61 XML_LIBS=`xml-config --libs`
62 XML_CFLAGS=`xml-config --cflags`
63 AC_SUBST(XML_LIBS)
64 AC_SUBST(XML_CFLAGS)
65
66
67 dnl Next, check for the optional libraries:
68 dnl =======================================
69
70 dnl Check for libgdk-pixbuf
71 AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
72 if test x$GDK_PIXBUF_CONFIG = xno; then
73   AC_MSG_WARN(Couldn't find gdk-pixbuf-config)
74   GDK_PIXBUF_LIBS=
75   GDK_PIXBUF_CFLAGS=
76   HAVE_GDK_PIXBUF=no
77 else
78   GDK_PIXBUF_LIBS=`gdk-pixbuf-config --libs`
79   GDK_PIXBUF_CFLAGS=`gdk-pixbuf-config --cflags`
80   HAVE_GDK_PIXBUF=yes
81 fi
82 AC_SUBST(GDK_PIXBUF_LIBS)
83 AC_SUBST(GDK_PIXBUF_CFLAGS)
84
85
86 dnl Check for gtk
87 AM_PATH_GTK(1.2.0)
88
89 dnl Check for libghttp
90 AC_CHECK_LIB(ghttp, ghttp_request_new,
91   [GHTTP_LIBS="-lghttp"
92    GST_HTTPSRC_GET_TYPE="gst_httpsrc_get_type"
93    HAVE_LIBGHTTP=yes
94   ],
95   [AC_MSG_WARN(Cannot find libghttp: can't build gsthttpsrc)
96    GHTTP_LIBS=
97    GST_HTTPSRC_GET_TYPE=
98    HAVE_LIBGHTTP=no
99   ],
100   $LIBS)
101 AC_SUBST(GHTTP_LIBS)
102 AC_SUBST(GST_HTTPSRC_GET_TYPE)
103
104 dnl Check for atomic.h
105 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
106 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
107 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
108 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
109 if test x$HAVE_ATOMIC_H = xyes; then
110   AC_TRY_RUN([
111 #include "asm/atomic.h"
112 main() { atomic_t t; atomic_set(&t,0); return 0;}
113   ],, [
114     # Not successful
115     if test x$HAVE_ATOMIC_H = xyes; then
116       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
117     fi
118     HAVE_ATOMIC_H=no
119   ], [
120     # Cross compiling
121     AC_MSG_RESULT(yes)
122     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
123   ])
124 fi
125
126 dnl Check for MMX capable compiler
127 AC_MSG_CHECKING(Checking MMX compilation)
128 AC_TRY_RUN([
129 #include "include/mmx.h"
130
131 main()
132 { movq_r2r(mm0, mm1); return 0; }
133 ],
134 [
135 HAVE_LIBMMX="yes"
136 AC_MSG_RESULT(yes)
137 ],
138 HAVE_LIBMMX="no"
139 AC_MSG_RESULT(no)
140 ,
141 HAVE_LIBMMX="no"
142 AC_MSG_RESULT(no)
143 )
144
145 dnl Check for X11 extensions
146 AC_PATH_XTRA
147 if test "-DX_DISPLAY_MISSING" = "$X_CFLAGS"; then
148   AC_MSG_ERROR(can not find X11)
149 fi
150 AC_SUBST(X_CFLAGS)
151 AC_SUBST(X_PRE_LIBS)
152 AC_SUBST(X_EXTRA_LIBS)
153 AC_SUBST(X_LIBS)
154
155 AC_CHECK_LIB(Xv, XvQueryExtension,,,
156     $X_LIBS $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS)
157
158 dnl Check for xaudio
159 AC_CHECK_HEADER(xaudio/decoder.h,[
160   AC_DEFINE(HAVE_XAUDIO) 
161   HAVE_XAUDIO="yes", []
162 ])
163
164 dnl Set location of plugin directory
165 if test "x${prefix}" = "xNONE"; then
166   PLUGINS_DIR=${ac_default_prefix}/lib/gst
167 else
168   PLUGINS_DIR=${prefix}/lib/gst
169 fi
170 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
171 AC_SUBST(PLUGINS_DIR)
172
173 dnl Set location of uninstalled plugin directory
174 PLUGINS_SRCDIR=`pwd`/$srcdir
175 AC_DEFINE_UNQUOTED(PLUGINS_SRCDIR,"$PLUGINS_SRCDIR")
176 AC_SUBST(PLUGINS_SRCDIR)
177
178 dnl check if css.c exists (FIXME)
179 AC_MSG_CHECKING(DVD CSS code)
180 if test -f plugins/dvdsrc/css.c
181 then
182   AC_MSG_RESULT(yes)
183   HAVE_CSSAUTH="yes"
184 else
185   AC_MSG_RESULT(no)
186   HAVE_CSSAUTH="no"
187 fi
188
189 dnl check for gtkdoc
190 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, true, false)
191
192
193 dnl ######################################################################
194 dnl # Check command line parameters, and set shell variables accordingly #
195 dnl ######################################################################
196
197 AC_ARG_ENABLE(gdk-pixbuf,
198 [  --enable-gdk-pixbuf          use gdk pixbuf, if available],
199 [case "${enableval}" in
200   yes) USE_GDK_PIXBUF=$HAVE_GDK_PIXBUF ;;
201   no)  USE_GDK_PIXBUF=no ;;
202   *) AC_MSG_ERROR(bad value ${enableval} for --enable-gdk-pixbuf) ;;
203 esac], 
204 [USE_GDK_PIXBUF=$HAVE_GDK_PIXBUF]) dnl Default value
205
206 AC_ARG_ENABLE(libghttp,
207 [  --enable-libghttp            use the ghttp library, if available],
208 [case "${enableval}" in
209   yes) USE_LIBGHTTP=$HAVE_LIBGHTTP ;;
210   no)  USE_LIBGHTTP=no ;;
211   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libghttp) ;;
212 esac], 
213 [USE_LIBGHTTP=$HAVE_LIBGHTTP]) dnl Default value
214
215 AC_ARG_ENABLE(libmmx,
216 [  --enable-libmmx              use libmmx, if available],
217 [case "${enableval}" in
218   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
219   no)  USE_LIBMMX=no ;;
220   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
221 esac], 
222 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
223
224 AC_ARG_ENABLE(atomic,
225 [  --enable-atomic              use atomic reference counting header],
226 [case "${enableval}" in
227   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
228   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
229   no)  USE_ATOMIC_H=no;;
230   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
231 esac], 
232 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
233
234 AC_ARG_ENABLE(plugin-srcdir,
235 [  --enable-plugin-srcdir       allow tests/demos to use non-installed plugins ],
236 [case "${enableval}" in
237   yes) PLUGINS_USE_SRCDIR=yes ;;
238   no)  PLUGINS_USE_SRCDIR=no ;;
239   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-srcdir) ;;
240 esac], 
241 [PLUGINS_USE_SRCDIR=yes]) dnl Default value
242
243 AC_ARG_ENABLE(debug,
244 [  --enable-debug               spews lots of useless info at runtime],
245 [case "${enableval}" in
246   yes) USE_DEBUG=yes ;;
247   no)  USE_DEBUG=no ;;
248   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
249 esac], 
250 [USE_DEBUG=no]) dnl Default value
251
252 AC_ARG_ENABLE(profiling,
253 [  --enable-profiling           adds -pg to compiler commandline, for profiling],
254 [case "${enableval}" in
255   yes) USE_PROFILING=yes ;;
256   no)  UES_PROFILING=no ;;
257   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
258 esac], 
259 [USE_PROFILING=no]) dnl Default value
260
261
262 dnl ################################################
263 dnl # Set defines according to variables set above #
264 dnl ################################################
265
266 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
267 dnl HAVE_ and it is likely to be easier to stick with the old name
268 if test "x$USE_GDK_PIXBUF" = xyes; then
269   AC_DEFINE(HAVE_GDK_PIXBUF)
270 fi
271
272 if test "x$USE_LIBGHTTP" = xyes; then
273   AC_DEFINE(HAVE_LIBGHTTP)
274 fi
275
276 if test "x$USE_LIBMMX" = xyes; then
277   AC_DEFINE(HAVE_LIBMMX)
278 fi
279
280 if test "x$USE_ATOMIC_H" = xyes; then
281   AC_DEFINE(HAVE_ATOMIC_H)
282 fi
283
284 if test "x$PLUGINS_USE_SRCDIR" = xyes; then
285   AC_DEFINE(PLUGINS_USE_SRCDIR)
286 fi
287
288 if test "x$USE_DEBUG" = xyes; then
289   AC_DEFINE(DEBUG_ENABLED)
290 fi
291
292 if test "x$USE_PROFILING" = xyes; then
293   CFLAGS="$CFLAGS -pg"
294 fi
295
296
297 dnl #############################
298 dnl # Set automake conditionals #
299 dnl #############################
300
301 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
302 dnl HAVE_ and it is likely to be easier to stick with the old name
303 AM_CONDITIONAL(HAVE_GDK_PIXBUF, test "x$USE_GDK_PIXBUF" = "xyes")
304 AM_CONDITIONAL(HAVE_LIBGHTTP,   test "x$USE_LIBGHTTP" = "xyes")
305 AM_CONDITIONAL(HAVE_LIBMMX,     test "x$USE_LIBMMX" = "xyes")
306 AM_CONDITIONAL(HAVE_ATOMIC_H,   test "x$USE_ATOMIC_H" = "xyes")
307 AM_CONDITIONAL(HAVE_XAUDIO,     test "x$HAVE_XAUDIO" = "xyes")
308 AM_CONDITIONAL(HAVE_CSSAUTH,    test "x$HAVE_CSSAUTH" = "xyes")
309 AM_CONDITIONAL(HAVE_GTK_DOC,    $HAVE_GTK_DOC)
310
311
312 dnl FIXME: having to AC_SUBST these is messy.  Not sure if CPPFLAGS and LDFLAGS
313 dnl need it, either.
314 AC_SUBST(CFLAGS)
315 AC_SUBST(CPPFLAGS)
316 AC_SUBST(LDFLAGS)
317
318
319 dnl #############################
320 dnl # Configure the subpackages #
321 dnl #############################
322
323 AC_CONFIG_SUBDIRS(gist)
324 AC_CONFIG_SUBDIRS(plugins/mp3decode/xing/libxing)
325
326
327 dnl #########################
328 dnl # Make the output files #
329 dnl #########################
330
331 AC_OUTPUT([Makefile
332 gst/Makefile
333 gst/types/Makefile
334 gst/meta/Makefile
335 gst/elements/Makefile
336 gst/xml/Makefile
337 libs/Makefile
338 libs/riff/Makefile
339 libs/colorspace/Makefile
340 libs/videoscale/Makefile
341 libs/getbits/Makefile
342 libs/putbits/Makefile
343 plugins/Makefile
344 plugins/au/Makefile
345 plugins/wav/Makefile
346 plugins/avi/Makefile
347 plugins/jpeg/Makefile
348 plugins/mp3decode/Makefile
349 plugins/mp3decode/xa/Makefile
350 plugins/mp3decode/xing/Makefile
351 plugins/mp3decode/mpg123/Makefile
352 plugins/mp3decode/parse/Makefile
353 plugins/mpeg2/Makefile
354 plugins/mpeg2/parse/Makefile
355 plugins/mpeg2/ac3parse/Makefile
356 plugins/mpeg2/ac3dec/Makefile
357 plugins/mpeg2/video/Makefile
358 plugins/mpeg2/mpeg2enc/Makefile
359 plugins/mpeg1/Makefile
360 plugins/mpeg1/mpeg_play/Makefile
361 plugins/mpeg1/mpegaudio/Makefile
362 plugins/mpeg1/parse/Makefile
363 plugins/mpeg1/system_encode/Makefile
364 plugins/mpeg1/mpeg1encoder/Makefile
365 plugins/mpeg1video/Makefile
366 plugins/mpeg1video/parse/Makefile
367 plugins/filters/Makefile
368 plugins/filters/smooth/Makefile
369 plugins/filters/median/Makefile
370 plugins/effects/Makefile
371 plugins/effects/stereo/Makefile
372 plugins/effects/volume/Makefile
373 plugins/visualization/Makefile
374 plugins/visualization/spectrum/Makefile
375 plugins/visualization/vumeter/Makefile
376 plugins/visualization/synaesthesia/Makefile
377 plugins/visualization/smoothwave/Makefile
378 plugins/videosink/Makefile
379 plugins/videoscale/Makefile
380 plugins/audioscale/Makefile
381 plugins/dvdsrc/Makefile
382 plugins/vcdsrc/Makefile
383 plugins/cobin/Makefile
384 plugins/rtjpeg/Makefile
385 plugins/capture/Makefile
386 plugins/capture/v4l/Makefile
387 gstplay/Makefile
388 test/Makefile
389 test/xml/Makefile
390 test/bindings/Makefile
391 test/cothreads/Makefile
392 editor/Makefile
393 tools/Makefile
394 docs/Makefile
395 docs/gst/Makefile
396 docs/gst/gstreamer.types
397 stamp.h
398 gstreamer-config
399 gstreamer.spec])
400 AC_OUTPUT_COMMANDS([chmod +x gstreamer-config])