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