Makefile.am fixes
[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 dnl Check for libgdb-pixbuf
67 AC_PATH_PROG(GDK_PIXBUF_CONFIG, gdk-pixbuf-config, no)
68 if test x$GDK_PIXBUF_CONFIG = xno; then
69   AC_MSG_ERROR(Couldn't find gdk-pixbuf-config)
70 fi
71 GDK_PIXBUF_LIBS=`gdk-pixbuf-config --libs`
72 GDK_PIXBUF_CFLAGS=`gdk-pixbuf-config --cflags`
73 AC_SUBST(GDK_PIXBUF_LIBS)
74 AC_SUBST(GDK_PIXBUF_CFLAGS)
75
76
77 dnl Next, check for the optional libraries:
78 dnl =======================================
79
80 dnl Check for gtk
81 AM_PATH_GTK(1.2.0)
82
83 dnl Check for libghttp
84 AC_CHECK_LIB(ghttp, ghttp_request_new,
85   [GHTTP_LIBS="-lghttp"
86    HAVE_LIBGHTTP=yes
87   ],
88   [AC_MSG_WARN(Cannot find libghttp: can't build gsthttpsrc)
89    GHTTP_LIBS=
90    HAVE_LIBGHTTP=no
91   ],
92   $LIBS)
93 AC_SUBST(GHTTP_LIBS)
94
95 dnl Check for atomic.h
96 dnl Note: use AC_CHECK_HEADER not AC_CHECK_HEADERS, because the latter
97 dnl defines the wrong default symbol as well (HAVE_ASM_ATOMIC_H)
98 AC_CHECK_HEADER(asm/atomic.h, HAVE_ATOMIC_H=yes, HAVE_ATOMIC_H=no)
99 dnl Do a compile to check that it has atomic_set (eg, linux 2.0 didn't)
100 if test x$HAVE_ATOMIC_H = xyes; then
101   AC_TRY_RUN([
102 #include "asm/atomic.h"
103 main() { atomic_t t; atomic_set(&t,0); return 0;}
104   ],, [
105     # Not successful
106     if test x$HAVE_ATOMIC_H = xyes; then
107       AC_MSG_WARN(Atomic reference counting is out of date: doing without.)
108     fi
109     HAVE_ATOMIC_H=no
110   ], [
111     # Cross compiling
112     AC_MSG_RESULT(yes)
113     AC_MSG_WARN(Can't check properly for atomic reference counting.  Assuming OK.)
114   ])
115 fi
116
117 dnl Check for MMX capable compiler
118 AC_MSG_CHECKING(Checking MMX compilation)
119 AC_TRY_RUN([
120 #include "include/mmx.h"
121
122 main()
123 { movq_r2r(mm0, mm1); return 0; }
124 ],
125 [
126 HAVE_LIBMMX="yes"
127 AC_MSG_RESULT(yes)
128 ],
129 HAVE_LIBMMX="no"
130 AC_MSG_RESULT(no)
131 ,
132 HAVE_LIBMMX="no"
133 AC_MSG_RESULT(no)
134 )
135
136 dnl Check for xaudio
137 AC_CHECK_HEADER(xaudio/decoder.h,[
138   AC_DEFINE(HAVE_XAUDIO) 
139   HAVE_XAUDIO="yes", []
140 ])
141
142 dnl Set location of plugin directory
143 if test "x${prefix}" = "xNONE"; then
144   PLUGINS_DIR=${ac_default_prefix}/lib/gst
145 else
146   PLUGINS_DIR=${prefix}/lib/gst
147 fi
148 AC_DEFINE_UNQUOTED(PLUGINS_DIR,"$PLUGINS_DIR")
149 AC_SUBST(PLUGINS_DIR)
150
151 dnl Set location of uninstalled plugin directory
152 PLUGINS_SRCDIR=`pwd`/$srcdir
153 AC_DEFINE_UNQUOTED(PLUGINS_SRCDIR,"$PLUGINS_SRCDIR")
154 AC_SUBST(PLUGINS_SRCDIR)
155
156 dnl check if css.c exists (FIXME)
157 AC_MSG_CHECKING(DVD CSS code)
158 if test -f plugins/dvdsrc/css.c
159 then
160   AC_MSG_RESULT(yes)
161   HAVE_CSSAUTH="yes"
162 else
163   AC_MSG_RESULT(no)
164   HAVE_CSSAUTH="no"
165 fi
166
167 dnl check for gtkdoc
168 AC_CHECK_PROG(HAVE_GTK_DOC, gtkdoc-mkdb, true, false)
169
170
171 dnl ######################################################################
172 dnl # Check command line parameters, and set shell variables accordingly #
173 dnl ######################################################################
174
175 AC_ARG_ENABLE(libghttp,
176 [  --enable-libghttp            use the ghttp library, if available],
177 [case "${enableval}" in
178   yes) USE_LIBGHTTP=$HAVE_LIBGHTTP ;;
179   no)  USE_LIBGHTTP=no ;;
180   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libghttp) ;;
181 esac], 
182 [USE_LIBGHTTP=$HAVE_LIBGHTTP]) dnl Default value
183
184 AC_ARG_ENABLE(libmmx,
185 [  --enable-libmmx              use libmmx, if available],
186 [case "${enableval}" in
187   yes) USE_LIBMMX=$HAVE_LIBMMX ;;
188   no)  USE_LIBMMX=no ;;
189   *) AC_MSG_ERROR(bad value ${enableval} for --enable-libmmx) ;;
190 esac], 
191 [USE_LIBMMX=$HAVE_LIBMMX]) dnl Default value
192
193 AC_ARG_ENABLE(atomic,
194 [  --enable-atomic              use atomic reference counting header],
195 [case "${enableval}" in
196   yes) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
197   noset) USE_ATOMIC_H=$HAVE_ATOMIC_H;;
198   no)  USE_ATOMIC_H=no;;
199   *) AC_MSG_ERROR(bad value ${enableval} for --enable-atomic) ;;
200 esac], 
201 [USE_ATOMIC_H=$HAVE_ATOMIC_H]) dnl Default value
202
203 AC_ARG_ENABLE(plugin-srcdir,
204 [  --enable-plugin-srcdir       allow tests/demos to use non-installed plugins ],
205 [case "${enableval}" in
206   yes) PLUGINS_USE_SRCDIR=yes ;;
207   no)  PLUGINS_USE_SRCDIR=no ;;
208   *) AC_MSG_ERROR(bad value ${enableval} for --enable-plugin-srcdir) ;;
209 esac], 
210 [PLUGINS_USE_SRCDIR=yes]) dnl Default value
211
212 AC_ARG_ENABLE(debug,
213 [  --enable-debug               spews lots of useless info at runtime],
214 [case "${enableval}" in
215   yes) USE_DEBUG=yes ;;
216   no)  USE_DEBUG=no ;;
217   *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
218 esac], 
219 [USE_DEBUG=no]) dnl Default value
220
221 AC_ARG_ENABLE(profiling,
222 [  --enable-profiling           adds -pg to compiler commandline, for profiling],
223 [case "${enableval}" in
224   yes) USE_PROFILING=yes ;;
225   no)  UES_PROFILING=no ;;
226   *) AC_MSG_ERROR(bad value ${enableval} for --enable-profiling) ;;
227 esac], 
228 [USE_PROFILING=no]) dnl Default value
229
230
231 dnl ################################################
232 dnl # Set defines according to variables set above #
233 dnl ################################################
234
235 dnl These should be "USE_*" instead of "HAVE_*", but some packages expect
236 dnl HAVE_ and it is likely to be easier to stick with the old name
237 if test "x$USE_LIBGHTTP" = xyes; then
238   AC_DEFINE(HAVE_LIBGHTTP)
239 fi
240
241 if test "x$USE_LIBMMX" = xyes; then
242   AC_DEFINE(HAVE_LIBMMX)
243 fi
244
245 if test "x$USE_ATOMIC_H" = xyes; then
246   AC_DEFINE(HAVE_ATOMIC_H)
247 fi
248
249 if test "x$PLUGINS_USE_SRCDIR" = xyes; then
250   AC_DEFINE(PLUGINS_USE_SRCDIR)
251 fi
252
253 if test "x$USE_DEBUG" = xyes; then
254   AC_DEFINE(DEBUG_ENABLED)
255 fi
256
257 if test "x$USE_PROFILING" = xyes; then
258   CFLAGS="$CFLAGS -pg"
259 fi
260
261
262 dnl #############################
263 dnl # Set automake conditionals #
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 AM_CONDITIONAL(HAVE_LIBGHTTP,   test "x$USE_LIBGHTTP" = "xyes")
269 AM_CONDITIONAL(HAVE_LIBMMX,     test "x$USE_LIBMMX" = "xyes")
270 AM_CONDITIONAL(HAVE_ATOMIC_H,   test "x$USE_ATOMIC_H" = "xyes")
271 AM_CONDITIONAL(HAVE_XAUDIO,     test "x$HAVE_XAUDIO" = "xyes")
272 AM_CONDITIONAL(HAVE_CSSAUTH,    test "x$HAVE_CSSAUTH" = "xyes")
273 AM_CONDITIONAL(HAVE_GTK_DOC,    $HAVE_GTK_DOC)
274
275
276 dnl FIXME: having to AC_SUBST these is messy.  Not sure if CPPFLAGS and LDFLAGS
277 dnl need it, either.
278 AC_SUBST(CFLAGS)
279 AC_SUBST(CPPFLAGS)
280 AC_SUBST(LDFLAGS)
281
282
283 dnl #############################
284 dnl # Configure the subpackages #
285 dnl #############################
286
287 AC_CONFIG_SUBDIRS(gist)
288 AC_CONFIG_SUBDIRS(plugins/mp3decode/xing/libxing)
289
290
291 dnl #########################
292 dnl # Make the output files #
293 dnl #########################
294
295 AC_OUTPUT([Makefile
296 gst/Makefile
297 gst/types/Makefile
298 gst/meta/Makefile
299 gst/elements/Makefile
300 gst/xml/Makefile
301 libs/Makefile
302 libs/riff/Makefile
303 libs/colorspace/Makefile
304 plugins/Makefile
305 plugins/au/Makefile
306 plugins/wav/Makefile
307 plugins/avi/Makefile
308 plugins/jpeg/Makefile
309 plugins/mp3decode/Makefile
310 plugins/mp3decode/xa/Makefile
311 plugins/mp3decode/xing/Makefile
312 plugins/mp3decode/mpg123/Makefile
313 plugins/mp3decode/parse/Makefile
314 plugins/mpeg2/Makefile
315 plugins/mpeg2/parse/Makefile
316 plugins/mpeg2/ac3parse/Makefile
317 plugins/mpeg2/ac3dec/Makefile
318 plugins/mpeg1/Makefile
319 plugins/mpeg1/mpeg_play/Makefile
320 plugins/mpeg1/parse/Makefile
321 plugins/mpeg1video/Makefile
322 plugins/mpeg1video/parse/Makefile
323 plugins/effects/Makefile
324 plugins/effects/stereo/Makefile
325 plugins/effects/volume/Makefile
326 plugins/visualization/Makefile
327 plugins/visualization/spectrum/Makefile
328 plugins/visualization/vumeter/Makefile
329 plugins/visualization/synaesthesia/Makefile
330 plugins/visualization/smoothwave/Makefile
331 plugins/videosink/Makefile
332 plugins/dvdsrc/Makefile
333 plugins/vcdsrc/Makefile
334 plugins/cobin/Makefile
335 plugins/rtjpeg/Makefile
336 plugins/capture/Makefile
337 plugins/capture/v4l/Makefile
338 test/Makefile
339 test/xml/Makefile
340 test/bindings/Makefile
341 test/cothreads/Makefile
342 editor/Makefile
343 tools/Makefile
344 docs/Makefile
345 docs/gst/Makefile
346 stamp.h
347 gstreamer-config
348 gstreamer.spec])
349 AC_OUTPUT_COMMANDS([chmod +x gstreamer-config])