Statistics
| Branch: | Revision:

ffmpeg / configure @ dc032f33

History | View | Annotate | Download (36.9 KB)

1 de6d9b64 Fabrice Bellard
#!/bin/sh
2 0f3cb305 Fabrice Bellard
#
3 5cbcf02c Fabrice Bellard
# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
4 0f3cb305 Fabrice Bellard
#
5 cf9d24ad Dan Christiansen
6
if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
7
cat << EOF
8
9
Usage: configure [options]
10
Options: [defaults in brackets after descriptions]
11
12
EOF
13
echo "Standard options:"
14
echo "  --help                   print this message"
15
echo "  --prefix=PREFIX          install in PREFIX [$prefix]"
16
echo "  --mandir=DIR             man documentation in DIR [PREFIX/man]"
17
echo "  --enable-mp3lame         enable mp3 encoding via libmp3lame [default=no]"
18
echo "  --enable-vorbis          enable vorbis support via libvorbisenc [default=no]"
19
echo "  --enable-faad            enable faad support via libfaad [default=no]"
20
echo "  --enable-faadbin         build faad support with runtime linking [default=no]"
21
echo "  --enable-faac            enable faac support via libfaac [default=no]"
22 1ddadfa9 Adam Thayer
echo "  --enable-xvid            enable xvid support via xvidcore [default=no]"
23 cf9d24ad Dan Christiansen
echo "  --enable-mingw32         enable mingw32 native/cross windows compile"
24
echo "  --enable-a52             enable GPL'ed A52 support [default=no]"
25
echo "  --enable-a52bin          open liba52.so.0 at runtime [default=no]"
26 23c99253 Michael Niedermayer
echo "  --enable-dts             enable GPL'ed DTS support [default=no]"
27 cf9d24ad Dan Christiansen
echo "  --enable-pp              enable GPL'ed post processing support [default=no]"
28
echo "  --enable-shared-pp       use libpostproc.so [default=no]"
29
echo "  --enable-shared          build shared libraries [default=no]"
30
echo "  --enable-amr_nb          enable amr_nb float audio codec"
31
echo "  --enable-amr_nb-fixed    use fixed point for amr-nb codec"
32 64cba748 Michael Niedermayer
echo "  --enable-amr_wb          enable amr_wb float audio codec"
33 cf9d24ad Dan Christiansen
echo "  --enable-sunmlib         use Sun medialib [default=no]"
34 9c3d33d6 Michael Niedermayer
echo "  --enable-pthreads        use pthreads [default=no]"
35 f02be79d Roman Shaposhnik
echo "  --enable-dc1394          enable IIDC-1394 grabbing using libdc1394 and libraw1394 [default=no]"
36 b2e3c528 Michael Niedermayer
echo "  --enable-gpl             allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
37 cf9d24ad Dan Christiansen
echo ""
38
echo "Advanced options (experts only):"
39
echo "  --source-path=PATH       path of source code [$source_path]"
40
echo "  --cross-prefix=PREFIX    use PREFIX for compile tools [$cross_prefix]"
41
echo "  --cc=CC                  use C compiler CC [$cc]"
42
echo "  --make=MAKE              use specified make [$make]"
43
echo "  --extra-cflags=ECFLAGS   add ECFLAGS to CFLAGS [$CFLAGS]"
44
echo "  --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
45
echo "  --extra-libs=ELIBS       add ELIBS [$ELIBS]"
46
echo "  --cpu=CPU                force cpu to CPU  [$cpu]"
47
echo "  --tune=PROCESSOR         tune code for a particular CPU (may fails or misperforms on other CPUs)"
48
echo "  --powerpc-perf-enable    enable performance report on PPC (requires enabling PMC)"
49
echo "  --disable-mmx            disable mmx usage"
50
echo "  --disable-altivec        disable AltiVec usage"
51
echo "  --disable-audio-oss      disable OSS audio support [default=no]"
52
echo "  --disable-audio-beos     disable BeOS audio support [default=no]"
53
echo "  --disable-v4l            disable video4linux grabbing [default=no]"
54
echo "  --disable-dv1394         disable DV1394 grabbing [default=no]"
55
echo "  --disable-network        disable network support [default=no]"
56
echo "  --disable-zlib           disable zlib [default=no]"
57
echo "  --disable-simple_idct    disable simple IDCT routines [default=no]"
58
echo "  --disable-vhook          disable video hooking support"
59
echo "  --enable-gprof           enable profiling with gprof [$gprof]"
60
echo "  --disable-debug          disable debugging symbols"
61
echo "  --disable-opts           disable compiler optimizations"
62
echo "  --disable-mpegaudio-hp   faster (but less accurate)"
63
echo "                           mpegaudio decoding [default=no]"
64
echo "  --disable-ffserver       disable ffserver build"
65
echo "  --disable-ffplay         disable ffplay build"
66
echo "  --disable-risky          disables patent encumbered codecs"
67
echo "  --enable-small           optimize for size instead of speed"
68 da9b170c Michael Niedermayer
echo "  --enable-memalign-hack   emulate memalign, interferes with memory debuggers"
69 65d1bea2 Michel Bardiaux
echo "  --disable-strip          disable stripping of executables and shared libraries"
70 cf9d24ad Dan Christiansen
echo ""
71
echo "NOTE: The object files are build at the place where configure is launched"
72
exit 1
73
fi
74
75 0f3cb305 Fabrice Bellard
# set temporary file name
76 57514323 Zdenek Kabelac
if test ! -z "$TMPDIR" ; then
77 0f3cb305 Fabrice Bellard
    TMPDIR1="${TMPDIR}"
78 57514323 Zdenek Kabelac
elif test ! -z "$TEMPDIR" ; then
79 0f3cb305 Fabrice Bellard
    TMPDIR1="${TEMPDIR}"
80 3d204385 Nick Kurshev
else
81 0f3cb305 Fabrice Bellard
    TMPDIR1="/tmp"
82 3d204385 Nick Kurshev
fi
83
84 0f3cb305 Fabrice Bellard
TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
85
TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
86 f3ec2d46 Slavik Gnatenko
TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
87 0f3cb305 Fabrice Bellard
TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
88
TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
89
90 de6d9b64 Fabrice Bellard
# default parameters
91
prefix="/usr/local"
92 23a65308 Fabrice Bellard
mandir=""
93 951bf3e6 Fabrice Bellard
bindir=""
94 0f3cb305 Fabrice Bellard
cross_prefix=""
95 de6d9b64 Fabrice Bellard
cc="gcc"
96
ar="ar"
97 be7109c1 Michael Niedermayer
ranlib="ranlib"
98 4a908fbc Alex Beregszaszi
make="make"
99 0f3cb305 Fabrice Bellard
strip="strip"
100 de6d9b64 Fabrice Bellard
cpu=`uname -m`
101 a4adb608 Michael Niedermayer
tune="generic"
102 e45a2872 Romain Dolbeau
powerpc_perf="no"
103 0f3cb305 Fabrice Bellard
mmx="default"
104 ab6c65f6 Brian Foley
altivec="default"
105 d46aba26 Leon van Stuivenberg
mmi="default"
106 de6d9b64 Fabrice Bellard
case "$cpu" in
107 ef0bc4c9 François Revol
  i386|i486|i586|i686|i86pc|BePC)
108 de6d9b64 Fabrice Bellard
    cpu="x86"
109
  ;;
110 053dea12 Aurelien Jacobs
  x86_64)
111
    if [ "`$cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
112
         -z "`echo $CFLAGS | grep -- -m32`"  ]; then
113
      cpu="x86_64"
114
    else
115
      cpu="x86"
116
    fi
117
  ;;
118 93caefc7 Alex Beregszaszi
  # armv4l is a subset of armv5tel
119
  armv4l|armv5tel)
120 6ed7422a Fabrice Bellard
    cpu="armv4l"
121
  ;;
122 91d1f1a4 Nick Kurshev
  alpha)
123
    cpu="alpha"
124
  ;;
125 a43bd1d7 Heliodoro Tammaro
  "Power Macintosh"|ppc)
126 90cee0c3 Michael Niedermayer
    cpu="powerpc"
127
  ;;
128 d46aba26 Leon van Stuivenberg
  mips)
129
    cpu="mips"
130
  ;;
131 bb476ff3 James Morrison
  sun4u|sparc64)
132 a7beab73 Roman Shaposhnik
    cpu="sparc64"
133
  ;;
134 bb476ff3 James Morrison
  sparc)
135
    cpu="sparc"
136
  ;;
137 bdb2e37c Alex Beregszaszi
  sh4)
138
    cpu="sh4"
139
  ;;
140 de6d9b64 Fabrice Bellard
  *)
141 0f3cb305 Fabrice Bellard
    cpu="unknown"
142 de6d9b64 Fabrice Bellard
  ;;
143
esac
144
gprof="no"
145 5cbcf02c Fabrice Bellard
v4l="yes"
146
audio_oss="yes"
147 dfdfa47c François Revol
audio_beos="no"
148 8aa3ee32 Max Krasnyansky
dv1394="yes"
149 f02be79d Roman Shaposhnik
dc1394="no"
150 5cbcf02c Fabrice Bellard
network="yes"
151 0147f198 François Revol
zlib="yes"
152 a6741398 Juanjo
mp3lame="no"
153 81e0d0b4 Mark Hills
vorbis="no"
154 0fc50e58 Zdenek Kabelac
faad="no"
155
faadbin="no"
156 29d48296 Michael Niedermayer
faac="no"
157 1ddadfa9 Adam Thayer
xvid="no"
158 ba9261e5 Michael Niedermayer
a52="no"
159 57514323 Zdenek Kabelac
a52bin="no"
160 23c99253 Michael Niedermayer
dts="no"
161 ba9261e5 Michael Niedermayer
pp="no"
162 bba9b16c Michael Niedermayer
shared_pp="no"
163 732d9245 Bill Eldridge
mingw32="no"
164 3f027ca7 Felix Bünemann
cygwin="no"
165 f3ec2d46 Slavik Gnatenko
os2="no"
166 83286d2a Zdenek Kabelac
lshared="no"
167 cddf3f45 Glenn Maynard
optimize="yes"
168
debug="yes"
169 65d1bea2 Michel Bardiaux
dostrip="yes"
170 ef0bc4c9 François Revol
extralibs="-lm"
171 c02dbee1 Michael Niedermayer
simpleidct="yes"
172 0f3cb305 Fabrice Bellard
bigendian="no"
173 7f965c1c Chris Flerackers
inttypes="yes"
174 b5c950c4 Michael Niedermayer
emu_fast_int="no"
175 a8721c09 Fabrice Bellard
vhook="default"
176 adbc0510 Philip Gladstone
dlfcn="no"
177
dlopen="no"
178 1eb2212e Fabrice Bellard
mpegaudio_hp="yes"
179 e1707f52 Michael Niedermayer
SHFLAGS=-shared
180 26b35efb François Revol
netserver="no"
181 4baca069 Philip Gladstone
need_inet_aton="no"
182 8154d2e0 Fabrice Bellard
ffserver="yes"
183 a86b921c Fabrice Bellard
ffplay="yes"
184 4baca069 Philip Gladstone
LDFLAGS=-Wl,--warn-common
185
FFSLDFLAGS=-Wl,-E
186 f3ec2d46 Slavik Gnatenko
LIBPREF="lib"
187
LIBSUF=".a"
188
SLIBPREF="lib"
189
SLIBSUF=".so"
190 951bf3e6 Fabrice Bellard
EXESUF=""
191 1d0d55da Michael Niedermayer
risky="yes"
192 891f64b3 joca@rixmail.se
amr_nb="no"
193 d663a1fd Michael Niedermayer
amr_wb="no"
194 bc634f6f Zdenek Kabelac
amr_nb_fixed="no"
195 f80f7964 Roman Shaposhnik
sunmlib="no"
196 9c3d33d6 Michael Niedermayer
pthreads="no"
197 b2e3c528 Michael Niedermayer
gpl="no"
198 da9b170c Michael Niedermayer
memalignhack="no"
199 ef0bc4c9 François Revol
200
# OS specific
201
targetos=`uname -s`
202
case $targetos in
203
BeOS)
204
prefix="/boot/home/config"
205
# helps building libavcodec
206 cddf3f45 Glenn Maynard
CFLAGS="-DPIC -fomit-frame-pointer"
207 31ba0b4d François Revol
# 3 gcc releases known for BeOS, each with ugly bugs
208 b2924696 Roman Shaposhnik
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
209 31ba0b4d François Revol
case "$gcc_version" in
210
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
211
mmx="no"
212
;;
213
*20010315*) echo "BeBits gcc"
214
CFLAGS="$CFLAGS -fno-expensive-optimizations"
215
;;
216
esac
217 e1707f52 Michael Niedermayer
SHFLAGS=-nostart
218
# disable linux things
219
audio_oss="no"
220 5cbcf02c Fabrice Bellard
v4l="no"
221 8aa3ee32 Max Krasnyansky
dv1394="no"
222 dfdfa47c François Revol
# enable beos things
223
audio_beos="yes"
224 ef0bc4c9 François Revol
# no need for libm, but the inet stuff
225
# Check for BONE
226
if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
227
extralibs="-lbind -lsocket"
228
else
229 26b35efb François Revol
netserver="yes"
230 4baca069 Philip Gladstone
need_inet_aton="yes"
231 26b35efb François Revol
extralibs="-lnet"
232 ef0bc4c9 François Revol
fi ;;
233 4baca069 Philip Gladstone
SunOS)
234
v4l="no"
235
audio_oss="no"
236 8aa3ee32 Max Krasnyansky
dv1394="no"
237 4baca069 Philip Gladstone
make="gmake"
238
LDFLAGS=""
239
FFSLDFLAGS=""
240
need_inet_aton="yes"
241
extralibs="$extralibs -lsocket -lnsl"
242
;;
243 9c938e77 Philip Gladstone
FreeBSD)
244
v4l="no"
245
audio_oss="yes"
246 8aa3ee32 Max Krasnyansky
dv1394="no"
247 9c938e77 Philip Gladstone
make="gmake"
248 12043e1d Steven M. Schultz
CFLAGS="-pthread"
249
LDFLAGS="$LDFLAGS -export-dynamic -pthread"
250 9c938e77 Philip Gladstone
;;
251 4a908fbc Alex Beregszaszi
BSD/OS)
252 5cbcf02c Fabrice Bellard
v4l="no"
253 6063bce7 Fabrice Bellard
audio_oss="yes"
254 8aa3ee32 Max Krasnyansky
dv1394="no"
255 4a908fbc Alex Beregszaszi
extralibs="-lpoll -lgnugetopt -lm"
256
make="gmake"
257
;;
258 90cee0c3 Michael Niedermayer
Darwin)
259 a43bd1d7 Heliodoro Tammaro
cc="cc"
260 90cee0c3 Michael Niedermayer
v4l="no"
261
audio_oss="no"
262 8aa3ee32 Max Krasnyansky
dv1394="no"
263 d3b15036 Steven M. Schultz
ffserver="no"
264 a43bd1d7 Heliodoro Tammaro
SHFLAGS="-dynamiclib"
265 90cee0c3 Michael Niedermayer
extralibs=""
266 a43bd1d7 Heliodoro Tammaro
darwin="yes"
267 47930f09 Philip Gladstone
strip="strip -x"
268 ad5a429c Roine Gustafsson
LDFLAGS="-Wl,-d,-search_paths_first"
269 4baca069 Philip Gladstone
FFSLDFLAGS=-Wl,-bind_at_load
270 90cee0c3 Michael Niedermayer
;;
271 732d9245 Bill Eldridge
MINGW32*)
272 951bf3e6 Fabrice Bellard
# Note: the rest of the mingw32 config is done afterwards as mingw32
273
# can be forced on command line for linux cross compilation
274 732d9245 Bill Eldridge
mingw32="yes"
275
;;
276 3f027ca7 Felix Bünemann
CYGWIN*)
277
v4l="no"
278
audio_oss="yes"
279 8aa3ee32 Max Krasnyansky
dv1394="no"
280 487c2fad Michael Niedermayer
ffserver="no"
281 3f027ca7 Felix Bünemann
extralibs=""
282
cygwin="yes"
283 487c2fad Michael Niedermayer
EXESUF=".exe"
284 3f027ca7 Felix Bünemann
test -f /usr/include/inttypes.h || \
285
test -f /usr/local/include/inttypes.h || \
286
echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
287 24689bce Michael Niedermayer
     "/usr/local/include/inttypes.h !!!"
288 3f027ca7 Felix Bünemann
;;
289 b55e4ef4 Philip Gladstone
Linux)
290 4baca069 Philip Gladstone
LDFLAGS="$LDFLAGS -rdynamic"
291 b55e4ef4 Philip Gladstone
;;
292 99614dd4 Michel Bardiaux
IRIX*)
293
ranlib="echo ignoring ranlib"
294
v4l="no"
295
audio_oss="no"
296
make="gmake"
297
;;
298 f3ec2d46 Slavik Gnatenko
OS/2)
299
TMPE=$TMPE".exe"
300 69db4e10 Slavik Gnatenko
ar="emxomfar -p64"
301
ranlib="echo ignoring ranlib"
302
strip="echo ignoring strip"
303 cddf3f45 Glenn Maynard
CFLAGS="-Zomf"
304 69db4e10 Slavik Gnatenko
LDFLAGS="-Zomf -Zstack 16384 -s"
305 f3ec2d46 Slavik Gnatenko
SHFLAGS=""
306
FFSLDFLAGS=""
307
LIBPREF=""
308
LIBSUF=".lib"
309
SLIBPREF=""
310
SLIBSUF=".dll"
311 951bf3e6 Fabrice Bellard
EXESUF=".exe"
312 f3ec2d46 Slavik Gnatenko
extralibs=""
313
v4l="no"
314
audio_oss="no"
315 8aa3ee32 Max Krasnyansky
dv1394="no"
316 f3ec2d46 Slavik Gnatenko
network="no"
317
ffserver="no"
318
os2="yes"
319
;;
320 ef0bc4c9 François Revol
*) ;;
321
esac
322 de6d9b64 Fabrice Bellard
323 6852ac95 Romain Dolbeau
# From mplayer configure. We need TARGET_OS available
324
# to the Makefile, so it can distinguish between flavors
325
# of AltiVec on PowerPC
326
TARGET_OS=`( uname -s ) 2>&1`
327
  case "$TARGET_OS" in
328 2450cff2 François Revol
  Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
329 6852ac95 Romain Dolbeau
    ;;
330
  IRIX*)
331
    TARGET_OS=IRIX
332
    ;;
333
  HP-UX*)
334
    TARGET_OS=HP-UX
335
    ;;
336
  [cC][yY][gG][wW][iI][nN]*)
337
    TARGET_OS=CYGWIN
338
    ;;
339
  *)
340
    TARGET_OS="$TARGET_OS-UNKNOWN"
341
    ;;
342
  esac
343
344 0f3cb305 Fabrice Bellard
# find source path
345
# XXX: we assume an absolute path is given when launching configure, 
346
# except in './configure' case.
347 586bc755 Roman Shaposhnik
source_path="`echo $0 | sed -e 's#/configure##'`"
348 0f3cb305 Fabrice Bellard
source_path_used="yes"
349
if test -z "$source_path" -o "$source_path" = "." ; then
350
    source_path=`pwd`
351
    source_path_used="no"
352 de6d9b64 Fabrice Bellard
fi
353
354 f255e0ab Michel Bardiaux
FFMPEG_CONFIGURATION=" "
355
for opt do
356
  FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
357
done
358
359 de6d9b64 Fabrice Bellard
for opt do
360
  case "$opt" in
361
  --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
362
  ;;
363 23a65308 Fabrice Bellard
  --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
364
  ;;
365 0f3cb305 Fabrice Bellard
  --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
366
  ;;
367
  --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
368
  ;;
369 de6d9b64 Fabrice Bellard
  --cc=*) cc=`echo $opt | cut -d '=' -f 2`
370
  ;;
371 4a908fbc Alex Beregszaszi
  --make=*) make=`echo $opt | cut -d '=' -f 2`
372
  ;;
373 f4e2c4b1 Roine Gustafsson
  --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
374 0f3cb305 Fabrice Bellard
  ;;
375 f4e2c4b1 Roine Gustafsson
  --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
376 0f3cb305 Fabrice Bellard
  ;;
377
  --extra-libs=*) extralibs=${opt#--extra-libs=}
378
  ;;
379 de6d9b64 Fabrice Bellard
  --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
380
  ;;
381 a4adb608 Michael Niedermayer
  --tune=*) tune=`echo $opt | cut -d '=' -f 2`
382
  ;;
383 e45a2872 Romain Dolbeau
  --powerpc-perf-enable) powerpc_perf="yes"
384
  ;;
385 de6d9b64 Fabrice Bellard
  --disable-mmx) mmx="no"
386
  ;;
387 ab6c65f6 Brian Foley
  --disable-altivec) altivec="no"
388
  ;;
389 de6d9b64 Fabrice Bellard
  --enable-gprof) gprof="yes"
390
  ;;
391 5cbcf02c Fabrice Bellard
  --disable-v4l) v4l="no"
392
  ;;
393
  --disable-audio-oss) audio_oss="no"
394
  ;;
395 dfdfa47c François Revol
  --disable-audio-beos) audio_beos="no"
396
  ;;
397 8aa3ee32 Max Krasnyansky
  --disable-dv1394) dv1394="no"
398
  ;;
399 ffc0ef96 Luca Abeni
  --disable-network) network="no"; ffserver="no"
400 5cbcf02c Fabrice Bellard
  ;;
401 0147f198 François Revol
  --disable-zlib) zlib="no"
402
  ;;
403 ba9261e5 Michael Niedermayer
  --enable-a52) a52="yes"
404 6ed7422a Fabrice Bellard
  ;;
405 9c938e77 Philip Gladstone
  --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
406 57514323 Zdenek Kabelac
  ;;
407 23c99253 Michael Niedermayer
  --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
408
  ;;
409 ba9261e5 Michael Niedermayer
  --enable-pp) pp="yes"
410 bba9b16c Michael Niedermayer
  ;;
411
  --enable-shared-pp) shared_pp="yes"
412
  ;;
413 a6741398 Juanjo
  --enable-mp3lame) mp3lame="yes"
414
  ;;
415 81e0d0b4 Mark Hills
  --enable-vorbis) vorbis="yes"
416
  ;;
417 445ad18d Zdenek Kabelac
  --enable-faad) faad="yes"
418
  ;;
419
  --enable-faadbin) faadbin="yes"
420
  ;;
421 29d48296 Michael Niedermayer
  --enable-faac) faac="yes"
422
  ;;
423 1ddadfa9 Adam Thayer
  --enable-xvid) xvid="yes"
424
  ;;
425 f02be79d Roman Shaposhnik
  --enable-dc1394) dc1394="yes"
426
  ;;
427 68892110 Philip Gladstone
  --disable-vhook) vhook="no"
428
  ;;
429 c02dbee1 Michael Niedermayer
  --disable-simple_idct) simpleidct="no"
430 045ed63f Zdenek Kabelac
  ;;
431 732d9245 Bill Eldridge
  --enable-mingw32) mingw32="yes"
432
  ;;
433 83286d2a Zdenek Kabelac
  --enable-shared) lshared="yes"
434 0319c531 Nick Kurshev
  ;;
435 cddf3f45 Glenn Maynard
  --disable-debug) debug="no"
436
  ;;
437
  --disable-opts) optimize="no"
438
  ;;
439 1eb2212e Fabrice Bellard
  --disable-mpegaudio-hp) mpegaudio_hp="no"
440
  ;;
441 8154d2e0 Fabrice Bellard
  --disable-ffserver) ffserver="no"
442
  ;;
443 a86b921c Fabrice Bellard
  --disable-ffplay) ffplay="no"
444
  ;;
445 1d0d55da Michael Niedermayer
  --disable-risky) risky="no"
446
  ;;
447 cddf3f45 Glenn Maynard
  --enable-small) optimize="small"
448 553a6284 Michael Niedermayer
  ;;
449 891f64b3 joca@rixmail.se
  --enable-amr_nb) amr_nb="yes"
450
  ;;
451 bc634f6f Zdenek Kabelac
  --enable-amr_nb-fixed) amr_nb_fixed="yes"
452
  ;;
453 64cba748 Michael Niedermayer
  --enable-amr_wb) amr_wb="yes"
454
  ;; 
455 f80f7964 Roman Shaposhnik
  --enable-sunmlib) sunmlib="yes"
456
  ;;
457 9c3d33d6 Michael Niedermayer
  --enable-pthreads) pthreads="yes"
458
  ;;
459 b2e3c528 Michael Niedermayer
  --enable-gpl) gpl="yes"
460
  ;;
461 da9b170c Michael Niedermayer
  --enable-memalign-hack) memalignhack="yes"
462
  ;;
463 65d1bea2 Michel Bardiaux
  --disable-strip) dostrip="no"
464
  ;;
465 de6d9b64 Fabrice Bellard
  esac
466
done
467
468 b2e3c528 Michael Niedermayer
if test "$gpl" != "yes"; then
469
    if test "$pp" != "no" -o "$shared_pp" != "no"; then
470
        echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
471
        fail="yes"
472
    fi
473
474
    if test "$a52" != "no" -o "$a52bin" != "no"; then
475
        echo "liba52 is under GPL and --enable-gpl is not specified"
476
        fail="yes"
477
    fi
478 23c99253 Michael Niedermayer
479 1ddadfa9 Adam Thayer
    if test "$xvid" != "no"; then
480
        echo "libxvidcore is under GPL and --enable-gpl is not specified"
481
        fail="yes"
482
    fi
483
484 23c99253 Michael Niedermayer
    if test "$dts" != "no"; then
485
        echo "libdts is under GPL and --enable-gpl is not specified"
486
        fail="yes"
487
    fi
488 b2e3c528 Michael Niedermayer
    
489
    if test "$faad" != "no" -o "$faadbin" != "no"; then
490
        cat > $TMPC << EOF
491
            #include <faad.h>
492
            int main( void ) { return 0; }
493
EOF
494
    
495
        if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
496
            cat > $TMPC << EOF
497
                #include <faad.h>
498
                #ifndef FAAD2_VERSION
499
                ok faad1
500
                #endif
501
                int main( void ) { return 0; }
502
EOF
503
            if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
504
                echo "faad2 is under GPL and --enable-gpl is not specified"
505
                fail="yes"
506
            fi
507
        else
508
            faad="no"
509
            faadbin="no"
510
            echo "faad test failed"
511
        fi
512
    fi
513
   
514
515 a18b5183 Michael Niedermayer
    if test "$fail" = "yes"; then
516 b2e3c528 Michael Niedermayer
        exit 1
517
    fi
518
fi
519
520 0f3cb305 Fabrice Bellard
# compute mmx state
521
if test $mmx = "default"; then
522 053dea12 Aurelien Jacobs
    if test $cpu = "x86" -o $cpu = "x86_64"; then
523 0f3cb305 Fabrice Bellard
        mmx="yes"
524
    else
525
        mmx="no"
526
    fi
527
fi
528
529 cf9d24ad Dan Christiansen
#Darwin CC versions
530 75388c74 Michael Niedermayer
needmdynamicnopic="no"
531 cf9d24ad Dan Christiansen
if test $targetos = Darwin; then
532 b2924696 Roman Shaposhnik
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
533 747a0554 Tinic Uro
	CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
534 cf9d24ad Dan Christiansen
    else
535 b2924696 Roman Shaposhnik
	gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
536 cf9d24ad Dan Christiansen
	case "$gcc_version" in
537
	    *2.95*) 
538 747a0554 Tinic Uro
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
539 cf9d24ad Dan Christiansen
		;;
540 75388c74 Michael Niedermayer
	    *3.*)
541 747a0554 Tinic Uro
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
542 75388c74 Michael Niedermayer
		if test "$lshared" = no; then
543
		   needmdynamicnopic="yes"
544
		fi
545 cf9d24ad Dan Christiansen
		;;
546
	    *)
547 747a0554 Tinic Uro
		CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
548 75388c74 Michael Niedermayer
		if test "$lshared" = no; then
549
		   needmdynamicnopic="yes"
550
		fi
551 cf9d24ad Dan Christiansen
		;;
552
	esac
553
    fi
554
fi
555
556 ab6c65f6 Brian Foley
# Can only do AltiVec on PowerPC
557
if test $altivec = "default"; then
558
    if test $cpu = "powerpc"; then
559
        altivec="yes"
560
    else
561
        altivec="no"
562
    fi
563
fi
564
565 a4adb608 Michael Niedermayer
# Add processor-specific flags
566
TUNECPU="generic"
567 9007f514 Romain Dolbeau
POWERPCMODE="32bits"
568 a4adb608 Michael Niedermayer
if test $tune != "generic"; then
569
    case $tune in
570
	601|ppc601|PowerPC601)
571
	    CFLAGS="$CFLAGS -mcpu=601"
572
	    if test $altivec = "yes"; then
573
		echo "WARNING: tuning for PPC601 but altivec enabled !";
574
	    fi
575
	    TUNECPU=ppc601
576
	;;
577
	603*|ppc603*|PowerPC603*)
578
	    CFLAGS="$CFLAGS -mcpu=603"
579
	    if test $altivec = "yes"; then
580
		echo "WARNING: tuning for PPC603 but altivec enabled !";
581
	    fi
582
	    TUNECPU=ppc603
583
	;;
584
	604*|ppc604*|PowerPC604*)
585
	    CFLAGS="$CFLAGS -mcpu=604"
586
	    if test $altivec = "yes"; then
587
		echo "WARNING: tuning for PPC604 but altivec enabled !";
588
	    fi
589
	    TUNECPU=ppc604
590
	;;
591 8d6625b6 Dan Christiansen
	G3|g3|75*|ppc75*|PowerPC75*)
592 fe0f2a97 Dan Christiansen
	    CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
593 a4adb608 Michael Niedermayer
	    if test $altivec = "yes"; then
594
		echo "WARNING: tuning for PPC75x but altivec enabled !";
595
	    fi
596
	    TUNECPU=ppc750
597
	;;
598 8d6625b6 Dan Christiansen
	G4|g4|745*|ppc745*|PowerPC745*)
599 fe0f2a97 Dan Christiansen
	    CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
600 3efd4952 Romain Dolbeau
	    if test $altivec = "no"; then
601
		echo "WARNING: tuning for PPC745x but altivec disabled !";
602
	    fi
603
	    TUNECPU=ppc7450
604
	;;
605
	74*|ppc74*|PowerPC74*)
606 fe0f2a97 Dan Christiansen
	    CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
607 a4adb608 Michael Niedermayer
	    if test $altivec = "no"; then
608
		echo "WARNING: tuning for PPC74xx but altivec disabled !";
609
	    fi
610 e45a2872 Romain Dolbeau
	    TUNECPU=ppc7400
611 a4adb608 Michael Niedermayer
	;;
612 8d6625b6 Dan Christiansen
	G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
613 9007f514 Romain Dolbeau
	    CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
614 a4adb608 Michael Niedermayer
	    if test $altivec = "no"; then
615
		echo "WARNING: tuning for PPC970 but altivec disabled !";
616
	    fi
617
	    TUNECPU=ppc970
618 9007f514 Romain Dolbeau
            POWERPCMODE="64bits"
619 a4adb608 Michael Niedermayer
	;;
620
	*)
621
	echo "WARNING: unknown CPU "$tune", ignored"
622
	;;
623
    esac
624
fi
625
626 cf9d24ad Dan Christiansen
# AltiVec flags: The FSF version of GCC differs from the Apple version 
627 b6e52719 Magnus Damm
if test $cpu = "powerpc"; then
628
    if test $altivec = "yes"; then
629 b2924696 Roman Shaposhnik
        if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
630 b6e52719 Magnus Damm
            CFLAGS="$CFLAGS -faltivec"
631
        else
632
            CFLAGS="$CFLAGS -maltivec -mabi=altivec"
633
        fi
634
    fi
635
fi
636
637 a9a07762 Michael Niedermayer
# See if we have <altivec.h>
638
cat > $TMPC << EOF
639
#include <altivec.h>
640
int main( void ) { return 0; }
641
EOF
642
643
_altivec_h="no"
644 b6e52719 Magnus Damm
if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
645 a9a07762 Michael Niedermayer
_altivec_h="yes"
646
fi
647
648 ab6c65f6 Brian Foley
# See does our compiler support Motorola AltiVec C API
649
if test $altivec = "yes"; then
650 a9a07762 Michael Niedermayer
if test $_altivec_h = "yes"; then
651 ab6c65f6 Brian Foley
cat > $TMPC << EOF
652 a9a07762 Michael Niedermayer
#include <altivec.h>
653 ab6c65f6 Brian Foley
int main(void) {
654
    vector signed int v1, v2, v3;
655
    v1 = vec_add(v2,v3);
656
    return 0;
657
}
658
EOF
659 a9a07762 Michael Niedermayer
else
660
cat > $TMPC << EOF
661
int main(void) {
662
    vector signed int v1, v2, v3;
663
    v1 = vec_add(v2,v3);
664
    return 0;
665
}
666
EOF
667
fi
668 b6e52719 Magnus Damm
$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
669 ab6c65f6 Brian Foley
fi
670
671 d46aba26 Leon van Stuivenberg
# Can only do mmi on mips
672
if test $mmi = "default"; then
673
    if test $cpu = "mips"; then
674
        mmi="yes"
675
    else
676
        mmi="no"
677
    fi
678
fi
679
680
# See does our compiler support mmi
681
if test $mmi = "yes"; then
682
cat > $TMPC << EOF
683
int main(void) {
684
    __asm__ ("lq \$2, 0(\$2)");
685
    return 0;
686
}
687
EOF
688 f3ec2d46 Slavik Gnatenko
$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
689 d46aba26 Leon van Stuivenberg
fi
690
691 732d9245 Bill Eldridge
if test "$mingw32" = "yes" ; then
692
    v4l="no"
693
    audio_oss="no"
694 8aa3ee32 Max Krasnyansky
    dv1394="no"
695 f02be79d Roman Shaposhnik
    dc1394="no"
696 951bf3e6 Fabrice Bellard
    ffserver="no"
697 732d9245 Bill Eldridge
    network="no"
698 951bf3e6 Fabrice Bellard
    LIBPREF=""
699
    LIBSUF=".lib"
700
    SLIBPREF=""
701
    SLIBSUF=".dll"
702
    EXESUF=".exe"
703
    prefix="/c/Program Files/FFmpeg"
704
    bindir="$prefix"
705 732d9245 Bill Eldridge
fi
706
707 0f3cb305 Fabrice Bellard
cc="${cross_prefix}${cc}"
708
ar="${cross_prefix}${ar}"
709 be7109c1 Michael Niedermayer
ranlib="${cross_prefix}${ranlib}"
710 0f3cb305 Fabrice Bellard
strip="${cross_prefix}${strip}"
711
712 487a54d7 Fabrice Bellard
if test -z "$cross_prefix" ; then
713
714 3d204385 Nick Kurshev
# ---
715 a3999908 Michael Niedermayer
# big/little endian test
716
cat > $TMPC << EOF
717
#include <inttypes.h>
718
int main(int argc, char ** argv){
719
	volatile uint32_t i=0x01234567;
720
	return (*((uint8_t*)(&i))) == 0x67;
721
}
722
EOF
723
724 f3ec2d46 Slavik Gnatenko
if $cc -o $TMPE $TMPC 2>/dev/null ; then
725
$TMPE && bigendian="yes"
726 a3999908 Michael Niedermayer
else
727
echo big/little test failed
728
fi
729
730 487a54d7 Fabrice Bellard
else
731
732
# if cross compiling, cannot launch a program, so make a static guess
733
if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
734
    bigendian="yes"
735
fi
736
737
fi
738
739 a3999908 Michael Niedermayer
# ---
740 7f965c1c Chris Flerackers
# *inttypes.h* test
741
cat > $TMPC << EOF
742
#include <inttypes.h>
743
int main(int argc, char ** argv){
744
    return 0;
745
}
746
EOF
747
748
$cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
749
750
# ---
751 b5c950c4 Michael Niedermayer
# *int_fast* test
752
cat > $TMPC << EOF
753
#include <inttypes.h>
754
int main(int argc, char ** argv){
755
	volatile uint_fast64_t i=0x01234567;
756
	return 0;
757
}
758
EOF
759
760
$cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
761
762
# ---
763 3d204385 Nick Kurshev
# check availability of some header files
764
765
cat > $TMPC << EOF
766
#include <malloc.h>
767
int main( void ) { return 0; }
768
EOF
769
770
_memalign=no
771
_malloc_h=no
772 f3ec2d46 Slavik Gnatenko
if $cc -o $TMPE $TMPC 2> /dev/null ; then
773 3d204385 Nick Kurshev
_malloc_h=yes
774
_memalign=yes
775
# check for memalign - atmos
776
cat > $TMPC << EOF
777 487c2fad Michael Niedermayer
#include <stdio.h>
778 3d204385 Nick Kurshev
#include <malloc.h>
779
int main ( void ) {
780
char *string = NULL;
781
string = memalign(64, sizeof(char));
782
return 0;
783
}
784
EOF
785 f3ec2d46 Slavik Gnatenko
$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
786 3d204385 Nick Kurshev
fi
787
788 8bf5d58f Michael Niedermayer
if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
789
    echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
790
    exit 1
791
fi
792
793 68892110 Philip Gladstone
cat > $TMPC << EOF
794 5e4639e2 Glenn Maynard
#include <time.h>
795
int main( void ) { localtime_r(NULL, NULL); }
796
EOF
797
798
localtime_r=no
799
if $cc -o $TMPE $TMPC 2> /dev/null ; then
800
  localtime_r=yes
801
fi
802
803 0147f198 François Revol
if test "$zlib" = "yes"; then
804
# check for zlib - mmu_man
805
cat > $TMPC << EOF
806
#include <zlib.h>
807
int main ( void ) {
808
if (zlibVersion() != ZLIB_VERSION)
809
   puts("zlib version differs !!!");
810
   return 1;
811
return 0;
812
}
813
EOF
814 16806499 Michael Niedermayer
$cc $CFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
815 f3ec2d46 Slavik Gnatenko
# $TMPE 2> /dev/null > /dev/null || zlib="no"
816 0147f198 François Revol
# XXX: more tests needed - runtime test
817
fi
818
if test "$zlib" = "yes"; then
819
extralibs="$extralibs -lz"
820
fi
821
822 95e2ce4a Michael Niedermayer
# test for lrintf in math.h
823
cat > $TMPC << EOF
824
#define _ISOC9X_SOURCE  1
825
#include <math.h>
826
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
827
EOF
828
829
have_lrintf="no"
830 f3ec2d46 Slavik Gnatenko
if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
831 95e2ce4a Michael Niedermayer
  have_lrintf="yes"
832 c2b9685e Michael Niedermayer
  # allanc@chickenandporn.com: cannot execute cross-compiled
833
  # code on the host.  Only execute if not cross-compiling.
834
  if test -z "$cross_prefix" ; then
835
    $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
836
  fi
837 95e2ce4a Michael Niedermayer
fi
838
839 c13e1abd Falk Hüffner
_restrict=
840
for restrict_keyword in restrict __restrict__ __restrict; do
841
  echo "void foo(char * $restrict_keyword p);" > $TMPC
842
  if $cc -c -o $TMPO $TMPC 2> /dev/null; then
843
    _restrict=$restrict_keyword
844
    break;
845
  fi
846
done
847
848 52b41d7f Fabrice Bellard
# test gcc version to see if vector builtins can be used
849
# currently only used on i386 for MMX builtins
850
cat > $TMPC << EOF
851 053dea12 Aurelien Jacobs
#include <xmmintrin.h>
852 52b41d7f Fabrice Bellard
int main(void) { 
853
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
854
return 0;
855
#else
856
#error no vector builtins
857
#endif
858
}
859
EOF
860
861
builtin_vector=no
862
if $cc -o $TMPO $TMPC 2> /dev/null ; then
863
  builtin_vector=yes
864 a8721c09 Fabrice Bellard
fi
865
866
# dlopen/dlfcn.h probing
867
868
cat > $TMPC << EOF
869
#include <dlfcn.h>
870
int main( void ) { return (int) dlopen("foo", 0); }
871
EOF
872
873
ldl=-ldl
874
875 cf9d24ad Dan Christiansen
if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
876 a8721c09 Fabrice Bellard
dlfcn=yes
877
dlopen=yes
878
fi
879
880 cf9d24ad Dan Christiansen
if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
881 a8721c09 Fabrice Bellard
dlfcn=yes
882
dlopen=yes
883
ldl=""
884
fi
885
886
cat > $TMPC << EOF
887
int main( void ) { return (int) dlopen("foo", 0); }
888
EOF
889
890 cf9d24ad Dan Christiansen
if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1  ; then
891 a8721c09 Fabrice Bellard
dlopen=yes
892
fi
893
894 cf9d24ad Dan Christiansen
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
895 a8721c09 Fabrice Bellard
dlopen=yes
896
ldl=""
897
fi
898
899
if test "$vhook" = "default" ; then
900
  vhook="$dlopen"
901
fi
902
903 a86b921c Fabrice Bellard
##########################################
904
# imlib probe
905
906 a8721c09 Fabrice Bellard
cat > $TMPC << EOF
907
#include <X11/Xlib.h>
908
#include <Imlib2.h>
909
int main( void ) { return (int) imlib_load_font("foo"); }
910
EOF
911
912
imlib2=no
913 7802d373 Michael Niedermayer
if $cc -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1  ; then
914 a8721c09 Fabrice Bellard
imlib2=yes
915 52b41d7f Fabrice Bellard
fi
916
917 a86b921c Fabrice Bellard
##########################################
918
# freetype probe
919
920 04511d53 Philip Gladstone
cat > $TMPC << EOF
921
#include <ft2build.h>
922
int main( void ) { return (int) FT_Init_FreeType(0); }
923
EOF
924
925
freetype2=no
926 69db4e10 Slavik Gnatenko
if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
927 e2a3cd59 Roman Shaposhnik
  if (freetype-config --version) >/dev/null 2>&1 ; then
928 cf9d24ad Dan Christiansen
    if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs`  > /dev/null 2>&1 ; then
929 dee076fc François Revol
      freetype2=yes
930 04511d53 Philip Gladstone
    fi
931 dee076fc François Revol
  fi
932 04511d53 Philip Gladstone
fi
933
934 a86b921c Fabrice Bellard
##########################################
935
# SDL probe
936
937
cat > $TMPC << EOF
938
#include <SDL.h>
939 31319a8c Fabrice Bellard
#undef main /* We don't want SDL to override our main() */
940 a86b921c Fabrice Bellard
int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
941
EOF
942
943
sdl_too_old=no
944
sdl=no
945 e2a3cd59 Roman Shaposhnik
if (sdl-config --version) >/dev/null 2>&1 ; then
946 cf9d24ad Dan Christiansen
if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs`  > /dev/null 2>&1  ; then
947 a86b921c Fabrice Bellard
_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
948
if test "$_sdlversion" -lt 121 ; then
949
sdl_too_old=yes
950
else
951
sdl=yes
952
fi
953
fi
954 c3f6b472 Michael Niedermayer
fi
955 a86b921c Fabrice Bellard
956 146ea952 Nicolas Boos
##########################################
957
# texi2html probe
958
959
texi2html=no
960 e2a3cd59 Roman Shaposhnik
if (texi2html -version) >/dev/null 2>&1; then
961 146ea952 Nicolas Boos
texi2html=yes
962
fi
963
964 7a91333f Hans Zandbelt
if test "$network" = "yes" ; then
965
##########################################
966
# IPv6 probe
967
968
cat > $TMPC << EOF
969
#include <sys/types.h>
970
#include <sys/socket.h>
971
#include <netinet/in.h>
972
#include <netdb.h>
973
int main( void ) {
974
  struct sockaddr_storage saddr;
975
  struct ipv6_mreq mreq6;
976
  getaddrinfo(0,0,0,0);
977
  getnameinfo(0,0,0,0,0,0,0);
978
  IN6_IS_ADDR_MULTICAST(0);
979
}
980
EOF
981
982
ipv6=no
983
if $cc -o $TMPE $TMPC > /dev/null 2>&1  ; then
984
ipv6=yes
985
fi
986
fi
987
988 b2924696 Roman Shaposhnik
case "`$cc -v 2>&1 | grep version`" in
989 cf9d24ad Dan Christiansen
    *gcc*)
990 2f3eca08 Michael Niedermayer
	CFLAGS="-Wall -Wno-switch $CFLAGS"
991 cf9d24ad Dan Christiansen
	;;
992
    *)
993
	;;
994
esac
995
996 94a3401e Fabrice Bellard
if test "$sdl" = "no" ; then
997
   ffplay=no
998
fi
999
1000 cddf3f45 Glenn Maynard
if test "$debug" = "yes"; then
1001 7906085f Falk Hüffner
	CFLAGS="-g $CFLAGS"
1002 cddf3f45 Glenn Maynard
fi
1003
1004
if test "$optimize" = "small"; then
1005 98ca7790 Michael Niedermayer
#  CFLAGS=${CFLAGS//-O3/-Os}
1006 553a6284 Michael Niedermayer
  CFLAGS="$CFLAGS -Os"
1007
fi
1008
1009 cddf3f45 Glenn Maynard
if test "$optimize" = "yes"; then
1010 b2924696 Roman Shaposhnik
    if test -n "`$cc -v 2>&1 | grep xlc`"; then
1011 cf9d24ad Dan Christiansen
	CFLAGS="$CFLAGS -O5"
1012
	LDFLAGS="$LDFLAGS -O5"
1013
    else
1014 7906085f Falk Hüffner
	CFLAGS="-O3 $CFLAGS"
1015 cf9d24ad Dan Christiansen
    fi
1016 cddf3f45 Glenn Maynard
fi
1017
1018 951bf3e6 Fabrice Bellard
if test x"$bindir" = x""; then
1019
bindir="${prefix}/bin"
1020
fi
1021
1022 23a65308 Fabrice Bellard
if test x"$mandir" = x""; then
1023
mandir="${prefix}/man"
1024
fi
1025
1026 de6d9b64 Fabrice Bellard
echo "Install prefix   $prefix"
1027 0f3cb305 Fabrice Bellard
echo "Source path      $source_path"
1028 de6d9b64 Fabrice Bellard
echo "C compiler       $cc"
1029 4a908fbc Alex Beregszaszi
echo "make             $make"
1030 a4adb608 Michael Niedermayer
echo "CPU              $cpu ($tune)"
1031 0f3cb305 Fabrice Bellard
echo "Big Endian       $bigendian"
1032 7f965c1c Chris Flerackers
echo "inttypes.h       $inttypes"
1033 b5c950c4 Michael Niedermayer
echo "broken inttypes.h $emu_fast_int"
1034 053dea12 Aurelien Jacobs
if test $cpu = "x86" -o $cpu = "x86_64"; then
1035 de6d9b64 Fabrice Bellard
echo "MMX enabled      $mmx"
1036 52b41d7f Fabrice Bellard
echo "Vector Builtins  $builtin_vector"
1037 e41e8342 Fabrice Bellard
fi
1038
if test $cpu = "mips"; then
1039 d46aba26 Leon van Stuivenberg
echo "MMI enabled      $mmi"
1040 e41e8342 Fabrice Bellard
fi
1041
if test $cpu = "powerpc"; then
1042 ab6c65f6 Brian Foley
echo "AltiVec enabled  $altivec"
1043 e41e8342 Fabrice Bellard
fi
1044 de6d9b64 Fabrice Bellard
echo "gprof enabled    $gprof"
1045 0147f198 François Revol
echo "zlib enabled     $zlib"
1046 a6741398 Juanjo
echo "mp3lame enabled  $mp3lame"
1047 81e0d0b4 Mark Hills
echo "vorbis enabled   $vorbis"
1048 445ad18d Zdenek Kabelac
echo "faad enabled     $faad"
1049
echo "faadbin enabled  $faadbin"
1050 29d48296 Michael Niedermayer
echo "faac enabled     $faac"
1051 1ddadfa9 Adam Thayer
echo "xvid enabled     $xvid"
1052 5cbcf02c Fabrice Bellard
echo "a52 support      $a52"
1053 57514323 Zdenek Kabelac
echo "a52 dlopened     $a52bin"
1054 23c99253 Michael Niedermayer
echo "dts support      $dts"
1055 bba9b16c Michael Niedermayer
echo "pp support       $pp"
1056 cddf3f45 Glenn Maynard
echo "debug symbols    $debug"
1057 65d1bea2 Michel Bardiaux
echo "strip symbols    $dostrip"
1058 cddf3f45 Glenn Maynard
echo "optimize         $optimize"
1059 bba9b16c Michael Niedermayer
echo "shared pp        $shared_pp"
1060 47930f09 Philip Gladstone
echo "Video hooking    $vhook"
1061 a86b921c Fabrice Bellard
echo "SDL support      $sdl"
1062
if test $sdl_too_old = "yes"; then
1063
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1064
fi
1065 1d0d55da Michael Niedermayer
echo "risky / patent encumbered codecs $risky"
1066 68892110 Philip Gladstone
1067
if test "$vhook" = "yes" ; then
1068 47930f09 Philip Gladstone
echo "Imlib2 support   $imlib2"
1069 04511d53 Philip Gladstone
echo "freetype support $freetype2"
1070 68892110 Philip Gladstone
fi
1071 f80f7964 Roman Shaposhnik
echo "Sun medialib support"  $sunmlib
1072 9c3d33d6 Michael Niedermayer
echo "pthreads support"      $pthreads
1073 bc634f6f Zdenek Kabelac
echo "AMR-NB float support"  $amr_nb
1074
echo "AMR-NB fixed support"  $amr_nb_fixed
1075 d663a1fd Michael Niedermayer
echo "AMR-WB float support"  $amr_wb
1076 7a91333f Hans Zandbelt
echo "network support      $network"
1077
if test "$network" = "yes" ; then
1078
echo "IPv6 support         $ipv6"
1079
fi
1080 b2e3c528 Michael Niedermayer
if test "$gpl" = "no" ; then
1081
echo "License: LGPL"
1082
else
1083
echo "License: GPL"
1084
fi
1085 de6d9b64 Fabrice Bellard
1086 980fc7b8 Fabrice Bellard
echo "Creating config.mak and config.h"
1087 de6d9b64 Fabrice Bellard
1088 f255e0ab Michel Bardiaux
date >> config.log
1089
echo "   $0 $FFMPEG_CONFIGURATION" >> config.log
1090 980fc7b8 Fabrice Bellard
echo "# Automatically generated by configure - do not modify" > config.mak
1091 045ed63f Zdenek Kabelac
echo "/* Automatically generated by configure - do not modify */" > $TMPH
1092 f255e0ab Michel Bardiaux
echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1093 de6d9b64 Fabrice Bellard
1094 980fc7b8 Fabrice Bellard
echo "prefix=$prefix" >> config.mak
1095 951bf3e6 Fabrice Bellard
echo "bindir=$bindir" >> config.mak
1096 23a65308 Fabrice Bellard
echo "mandir=$mandir" >> config.mak
1097 4a908fbc Alex Beregszaszi
echo "MAKE=$make" >> config.mak
1098 980fc7b8 Fabrice Bellard
echo "CC=$cc" >> config.mak
1099
echo "AR=$ar" >> config.mak
1100 be7109c1 Michael Niedermayer
echo "RANLIB=$ranlib" >> config.mak
1101 65d1bea2 Michel Bardiaux
if test "$dostrip" = "yes" ; then
1102 0f3cb305 Fabrice Bellard
echo "STRIP=$strip" >> config.mak
1103 65d1bea2 Michel Bardiaux
echo "INSTALLSTRIP=-s" >> config.mak
1104
else
1105
echo "STRIP=echo ignoring strip" >> config.mak
1106
echo "INSTALLSTRIP=" >> config.mak
1107
fi
1108 75388c74 Michael Niedermayer
1109
# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic.  Used when building 
1110
# shared modules on OS/X (vhook/Makefile).
1111
SHCFLAGS=$CFLAGS
1112
if test "$needmdynamicnopic" = yes; then
1113
   CFLAGS="$CFLAGS -mdynamic-no-pic"
1114
fi
1115
1116 a9b3f630 Nick Kurshev
echo "OPTFLAGS=$CFLAGS" >> config.mak
1117 75388c74 Michael Niedermayer
echo "SHCFLAGS=$SHCFLAGS">>config.mak
1118 0f3cb305 Fabrice Bellard
echo "LDFLAGS=$LDFLAGS" >> config.mak
1119 4baca069 Philip Gladstone
echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1120 e1707f52 Michael Niedermayer
echo "SHFLAGS=$SHFLAGS" >> config.mak
1121 f3ec2d46 Slavik Gnatenko
echo "LIBPREF=$LIBPREF" >> config.mak
1122
echo "LIBSUF=$LIBSUF" >> config.mak
1123
echo "SLIBPREF=$SLIBPREF" >> config.mak
1124
echo "SLIBSUF=$SLIBSUF" >> config.mak
1125 951bf3e6 Fabrice Bellard
echo "EXESUF=$EXESUF" >> config.mak
1126 6852ac95 Romain Dolbeau
echo "TARGET_OS=$TARGET_OS" >> config.mak
1127 57514323 Zdenek Kabelac
if test "$cpu" = "x86" ; then
1128 980fc7b8 Fabrice Bellard
  echo "TARGET_ARCH_X86=yes" >> config.mak
1129 045ed63f Zdenek Kabelac
  echo "#define ARCH_X86 1" >> $TMPH
1130 053dea12 Aurelien Jacobs
elif test "$cpu" = "x86_64" ; then
1131
  echo "TARGET_ARCH_X86_64=yes" >> config.mak
1132
  echo "#define ARCH_X86_64 1" >> $TMPH
1133 0f3cb305 Fabrice Bellard
elif test "$cpu" = "armv4l" ; then
1134 6ed7422a Fabrice Bellard
  echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1135 045ed63f Zdenek Kabelac
  echo "#define ARCH_ARMV4L 1" >> $TMPH
1136 0f3cb305 Fabrice Bellard
elif test "$cpu" = "alpha" ; then
1137 91d1f1a4 Nick Kurshev
  echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1138 045ed63f Zdenek Kabelac
  echo "#define ARCH_ALPHA 1" >> $TMPH
1139 35fedfc3 Philip Gladstone
elif test "$cpu" = "sparc64" ; then
1140
  echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1141
  echo "#define ARCH_SPARC64 1" >> $TMPH
1142 bb476ff3 James Morrison
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1143
  echo "#define ARCH_SPARC 1" >> $TMPH
1144
elif test "$cpu" = "sparc" ; then
1145
  echo "TARGET_ARCH_SPARC=yes" >> config.mak
1146
  echo "#define ARCH_SPARC 1" >> $TMPH
1147 0f3cb305 Fabrice Bellard
elif test "$cpu" = "powerpc" ; then
1148
  echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1149
  echo "#define ARCH_POWERPC 1" >> $TMPH
1150 9007f514 Romain Dolbeau
  if test $POWERPCMODE = "32bits"; then
1151
    echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1152
  else
1153
    echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1154
  fi
1155 e45a2872 Romain Dolbeau
  if test "$powerpc_perf" = "yes"; then
1156
    echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1157
  fi
1158 d46aba26 Leon van Stuivenberg
elif test "$cpu" = "mips" ; then
1159
  echo "TARGET_ARCH_MIPS=yes" >> config.mak
1160
  echo "#define ARCH_MIPS 1" >> $TMPH
1161 bdb2e37c Alex Beregszaszi
elif test "$cpu" = "sh4" ; then
1162
  echo "TARGET_ARCH_SH4=yes" >> config.mak
1163
  echo "#define ARCH_SH4 1" >> $TMPH
1164
fi
1165 a4adb608 Michael Niedermayer
echo "#define TUNECPU $TUNECPU" >> $TMPH
1166 0f3cb305 Fabrice Bellard
if test "$bigendian" = "yes" ; then
1167
  echo "WORDS_BIGENDIAN=yes" >> config.mak
1168
  echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1169 91d1f1a4 Nick Kurshev
fi
1170 d2a9bddd Michael Niedermayer
if test "$inttypes" != "yes" ; then
1171
  echo "#define EMULATE_INTTYPES 1" >> $TMPH
1172 7f965c1c Chris Flerackers
fi
1173 b5c950c4 Michael Niedermayer
if test "$emu_fast_int" = "yes" ; then
1174 19d053c5 Roman Shaposhnik
  echo "#define EMULATE_FAST_INT 1" >> $TMPH
1175 b5c950c4 Michael Niedermayer
fi
1176 57514323 Zdenek Kabelac
if test "$mmx" = "yes" ; then
1177 980fc7b8 Fabrice Bellard
  echo "TARGET_MMX=yes" >> config.mak
1178 045ed63f Zdenek Kabelac
  echo "#define HAVE_MMX 1" >> $TMPH
1179 e82c5a8c Michael Niedermayer
  echo "#define __CPU__ 586" >> $TMPH
1180 de6d9b64 Fabrice Bellard
fi
1181 52b41d7f Fabrice Bellard
if test "$builtin_vector" = "yes" ; then
1182
  echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1183
  echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1184
fi
1185 d46aba26 Leon van Stuivenberg
if test "$mmi" = "yes" ; then
1186
  echo "TARGET_MMI=yes" >> config.mak
1187
  echo "#define HAVE_MMI 1" >> $TMPH
1188
fi
1189 ab6c65f6 Brian Foley
if test "$altivec" = "yes" ; then
1190
  echo "TARGET_ALTIVEC=yes" >> config.mak
1191
  echo "#define HAVE_ALTIVEC 1" >> $TMPH
1192 db40a39a Michael Niedermayer
  echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1193
  echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1194 a9a07762 Michael Niedermayer
  if test "$_altivec_h" = "yes" ; then
1195
    echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1196
  else
1197 e67e14d5 Alex Beregszaszi
    echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1198 a9a07762 Michael Niedermayer
  fi
1199 ab6c65f6 Brian Foley
fi
1200 57514323 Zdenek Kabelac
if test "$gprof" = "yes" ; then
1201 980fc7b8 Fabrice Bellard
  echo "TARGET_GPROF=yes" >> config.mak
1202 045ed63f Zdenek Kabelac
  echo "#define HAVE_GPROF 1" >> $TMPH
1203 de6d9b64 Fabrice Bellard
fi
1204 5e4639e2 Glenn Maynard
if test "$localtime_r" = "yes" ; then
1205
  echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1206
fi
1207 68892110 Philip Gladstone
if test "$imlib2" = "yes" ; then
1208
  echo "HAVE_IMLIB2=yes" >> config.mak
1209
fi
1210 04511d53 Philip Gladstone
if test "$freetype2" = "yes" ; then
1211
  echo "HAVE_FREETYPE2=yes" >> config.mak
1212
fi
1213 f80f7964 Roman Shaposhnik
if test "$sunmlib" = "yes" ; then
1214
  echo "HAVE_MLIB=yes" >> config.mak
1215
  echo "#define HAVE_MLIB 1" >> $TMPH
1216
  extralibs="$extralibs -lmlib"
1217
fi
1218 9c3d33d6 Michael Niedermayer
if test "$pthreads" = "yes" ; then
1219
  echo "HAVE_PTHREADS=yes" >> config.mak
1220
  echo "#define HAVE_PTHREADS 1" >> $TMPH
1221 2450cff2 François Revol
  echo "#define HAVE_THREADS 1" >> $TMPH
1222 0abd6916 Michael Niedermayer
  if test $targetos != FreeBSD; then
1223 12043e1d Steven M. Schultz
     extralibs="$extralibs -lpthread"
1224
  fi
1225 9c3d33d6 Michael Niedermayer
fi
1226 a86b921c Fabrice Bellard
if test "$sdl" = "yes" ; then
1227
  echo "CONFIG_SDL=yes" >> config.mak
1228
  echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1229
  echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1230
fi
1231 146ea952 Nicolas Boos
if test "$texi2html" = "yes"; then
1232
  echo "BUILD_DOC=yes" >> config.mak
1233
fi
1234 95e2ce4a Michael Niedermayer
if test "$have_lrintf" = "yes" ; then
1235
  echo "#define HAVE_LRINTF 1" >> $TMPH
1236
fi
1237 68892110 Philip Gladstone
if test "$vhook" = "yes" ; then
1238
  echo "BUILD_VHOOK=yes" >> config.mak
1239
  echo "#define HAVE_VHOOK 1" >> $TMPH
1240 9c938e77 Philip Gladstone
  extralibs="$extralibs $ldl"
1241 68892110 Philip Gladstone
fi
1242 57514323 Zdenek Kabelac
if test "$lshared" = "yes" ; then
1243 0319c531 Nick Kurshev
  echo "BUILD_SHARED=yes" >> config.mak
1244 5cbcf02c Fabrice Bellard
  echo "PIC=-fPIC" >> config.mak
1245 0319c531 Nick Kurshev
fi
1246 ef0bc4c9 François Revol
echo "EXTRALIBS=$extralibs" >> config.mak
1247 281a74da Michael Niedermayer
version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
1248 258207b7 Fabrice Bellard
 cut -d '"' -f 2`
1249
echo "VERSION=$version" >>config.mak
1250 d771bcae Fabrice Bellard
# if you do not want to use encoders, disable that.
1251 045ed63f Zdenek Kabelac
echo "#define CONFIG_ENCODERS 1" >> $TMPH
1252 d771bcae Fabrice Bellard
echo "CONFIG_ENCODERS=yes" >> config.mak
1253
1254
# if you do not want to use decoders, disable that.
1255 045ed63f Zdenek Kabelac
echo "#define CONFIG_DECODERS 1" >> $TMPH
1256 d771bcae Fabrice Bellard
echo "CONFIG_DECODERS=yes" >> config.mak
1257
1258 5cbcf02c Fabrice Bellard
# AC3
1259
if test "$a52" = "yes" ; then
1260
  echo "#define CONFIG_AC3 1" >> $TMPH
1261
  echo "CONFIG_AC3=yes" >> config.mak
1262 d771bcae Fabrice Bellard
1263 5cbcf02c Fabrice Bellard
  if test "$a52bin" = "yes" ; then
1264
    echo "#define CONFIG_A52BIN 1" >> $TMPH
1265
    echo "CONFIG_A52BIN=yes" >> config.mak
1266
  fi
1267
fi
1268
1269 23c99253 Michael Niedermayer
# DTS
1270
if test "$dts" = "yes" ; then
1271
  echo "#define CONFIG_DTS 1" >> $TMPH
1272
  echo "CONFIG_DTS=yes" >> config.mak
1273
fi
1274
1275 bba9b16c Michael Niedermayer
# PP
1276
if test "$pp" = "yes" ; then
1277
  echo "#define CONFIG_PP 1" >> $TMPH
1278
  echo "CONFIG_PP=yes" >> config.mak
1279
1280
  if test "$shared_pp" = "yes" ; then
1281
    echo "#define SHARED_PP 1" >> $TMPH
1282
    echo "SHARED_PP=yes" >> config.mak
1283
  fi
1284
fi
1285
1286 1eb2212e Fabrice Bellard
# mpeg audio high precision mode
1287
if test "$mpegaudio_hp" = "yes" ; then
1288
  echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1289
fi
1290
1291 5cbcf02c Fabrice Bellard
if test "$v4l" = "yes" ; then
1292
  echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1293
  echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1294
fi
1295
1296 8aa3ee32 Max Krasnyansky
if test "$dv1394" = "yes" ; then
1297
  echo "#define CONFIG_DV1394 1" >> $TMPH
1298
  echo "CONFIG_DV1394=yes" >> config.mak
1299
fi
1300
1301 f02be79d Roman Shaposhnik
if test "$dc1394" = "yes" ; then
1302
  echo "#define CONFIG_DC1394 1" >> $TMPH
1303
  echo "CONFIG_DC1394=yes" >> config.mak
1304
fi
1305
1306 adbc0510 Philip Gladstone
if test "$dlopen" = "yes" ; then
1307
  echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1308
fi
1309
1310
if test "$dlfcn" = "yes" ; then
1311
  echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1312
fi
1313
1314 5cbcf02c Fabrice Bellard
if test "$audio_oss" = "yes" ; then
1315
  echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1316
  echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1317 57514323 Zdenek Kabelac
fi
1318
1319 dfdfa47c François Revol
if test "$audio_beos" = "yes" ; then
1320
  echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1321
  echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1322
fi
1323
1324 5cbcf02c Fabrice Bellard
if test "$network" = "yes" ; then
1325
  echo "#define CONFIG_NETWORK 1" >> $TMPH
1326
  echo "CONFIG_NETWORK=yes" >> config.mak
1327 6ed7422a Fabrice Bellard
fi
1328 daf8e955 Fabrice Bellard
1329 7a91333f Hans Zandbelt
if test "$ipv6" = "yes" ; then
1330
  echo "#define CONFIG_IPV6 1" >> $TMPH
1331
fi
1332
1333 0147f198 François Revol
if test "$zlib" = "yes" ; then
1334
  echo "#define CONFIG_ZLIB 1" >> $TMPH
1335
  echo "CONFIG_ZLIB=yes" >> config.mak
1336
fi
1337
1338 57514323 Zdenek Kabelac
if test "$mp3lame" = "yes" ; then
1339 045ed63f Zdenek Kabelac
  echo "#define CONFIG_MP3LAME 1" >> $TMPH
1340 a6741398 Juanjo
  echo "CONFIG_MP3LAME=yes" >> config.mak
1341
fi
1342
1343 81e0d0b4 Mark Hills
if test "$vorbis" = "yes" ; then
1344
  echo "#define CONFIG_VORBIS 1" >> $TMPH
1345
  echo "CONFIG_VORBIS=yes" >> config.mak
1346
fi
1347
1348 0fc50e58 Zdenek Kabelac
if test "$faad" = "yes" ; then
1349
  echo "#define CONFIG_FAAD 1" >> $TMPH
1350
  echo "CONFIG_FAAD=yes" >> config.mak
1351
fi
1352
1353
if test "$faadbin" = "yes" ; then
1354
  echo "#define CONFIG_FAADBIN 1" >> $TMPH
1355 445ad18d Zdenek Kabelac
  echo "CONFIG_FAADBIN=yes" >> config.mak
1356 0fc50e58 Zdenek Kabelac
fi
1357
1358 29d48296 Michael Niedermayer
if test "$faac" = "yes" ; then
1359
  echo "#define CONFIG_FAAC 1" >> $TMPH
1360
  echo "CONFIG_FAAC=yes" >> config.mak
1361
fi
1362
1363 1ddadfa9 Adam Thayer
if test "$xvid" = "yes" ; then
1364
  echo "#define CONFIG_XVID 1" >> $TMPH
1365
  echo "CONFIG_XVID=yes" >> config.mak
1366
fi
1367
1368 732d9245 Bill Eldridge
if test "$mingw32" = "yes" ; then
1369
  echo "#define CONFIG_WIN32 1" >> $TMPH
1370
  echo "CONFIG_WIN32=yes" >> config.mak
1371 16806499 Michael Niedermayer
  echo "HAVE_W32THREADS=yes" >> config.mak
1372
  echo "#define HAVE_W32THREADS 1" >> $TMPH
1373 2450cff2 François Revol
  echo "#define HAVE_THREADS 1" >> $TMPH
1374 7eea5766 Fabrice Bellard
  echo "#ifndef __MINGW32__" >> $TMPH
1375 732d9245 Bill Eldridge
  echo "#define __MINGW32__ 1" >> $TMPH
1376 7eea5766 Fabrice Bellard
  echo "#endif" >> $TMPH
1377 3f027ca7 Felix Bünemann
fi
1378
1379 f3ec2d46 Slavik Gnatenko
if test "$os2" = "yes" ; then
1380
  echo "#define CONFIG_OS2 1" >> $TMPH
1381
  echo "CONFIG_OS2=yes" >> config.mak
1382
fi
1383
1384 6e023978 Roman Shaposhnik
if test "$TARGET_OS" = "SunOS" ; then
1385
  echo "#define CONFIG_SUNOS 1" >> $TMPH
1386
fi
1387
1388 2450cff2 François Revol
if test "$TARGET_OS" = "BeOS" ; then
1389
  echo "HAVE_BEOSTHREADS=yes" >> config.mak
1390
  echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1391
  echo "#define HAVE_THREADS 1" >> $TMPH
1392
fi
1393
1394 90cee0c3 Michael Niedermayer
if test "$darwin" = "yes"; then
1395
  echo "#define CONFIG_DARWIN 1"  >> $TMPH
1396
  echo "CONFIG_DARWIN=yes" >> config.mak
1397
fi
1398
1399 57514323 Zdenek Kabelac
if test "$_malloc_h" = "yes" ; then
1400 045ed63f Zdenek Kabelac
  echo "#define HAVE_MALLOC_H 1" >> $TMPH
1401 3d204385 Nick Kurshev
else
1402 045ed63f Zdenek Kabelac
  echo "#undef  HAVE_MALLOC_H" >> $TMPH
1403 3d204385 Nick Kurshev
fi
1404
1405 57514323 Zdenek Kabelac
if test "$_memalign" = "yes" ; then
1406 045ed63f Zdenek Kabelac
  echo "#define HAVE_MEMALIGN 1" >> $TMPH
1407
else
1408
  echo "#undef  HAVE_MEMALIGN" >> $TMPH
1409
fi
1410
1411 da9b170c Michael Niedermayer
if test "$memalignhack" = "yes" ; then
1412
  echo "#define MEMALIGN_HACK 1" >> $TMPH
1413
fi
1414
1415
1416 26b35efb François Revol
if test "$netserver" = "yes" ; then
1417
  echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1418
  echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1419
fi
1420
1421 4baca069 Philip Gladstone
if test "$need_inet_aton" = "yes" ; then
1422
  echo "NEED_INET_ATON=yes" >> config.mak
1423
fi
1424
1425 57514323 Zdenek Kabelac
if test "$simpleidct" = "yes" ; then
1426 045ed63f Zdenek Kabelac
  echo "#define SIMPLE_IDCT 1" >> $TMPH
1427
fi
1428
1429 8154d2e0 Fabrice Bellard
if test "$ffserver" = "yes" ; then
1430
  echo "#define CONFIG_FFSERVER 1" >> $TMPH
1431
  echo "CONFIG_FFSERVER=yes" >> config.mak
1432
fi
1433
1434 a86b921c Fabrice Bellard
if test "$ffplay" = "yes" ; then
1435
  echo "CONFIG_FFPLAY=yes" >> config.mak
1436
fi
1437
1438 1d0d55da Michael Niedermayer
if test "$risky" = "yes" ; then
1439
  echo "#define CONFIG_RISKY 1" >> $TMPH
1440
  echo "CONFIG_RISKY=yes" >> config.mak
1441
fi
1442
1443 b2e3c528 Michael Niedermayer
if test "$gpl" = "yes" ; then
1444
  echo "#define CONFIG_GPL 1" >> $TMPH
1445
  echo "CONFIG_GPL=yes" >> config.mak
1446
fi
1447
1448 c13e1abd Falk Hüffner
echo "#define restrict $_restrict" >> $TMPH
1449
1450 bb801c97 Michael Niedermayer
if test "$optimize" = "small"; then
1451
  echo "#define always_inline"  >> $TMPH
1452
fi
1453
1454 0f3cb305 Fabrice Bellard
# build tree in object directory if source path is different from current one
1455
if test "$source_path_used" = "yes" ; then
1456 8b8e1c55 Philipp Matthias Hahn
    DIRS="doc libavformat libavcodec libavcodec/alpha libavcodec/armv4l \
1457
          libavcodec/i386 libavcodec/sparc libavcodec/mlib \
1458
          libavcodec/ppc libavcodec/liba52 libavcodec/libpostproc tests vhook"
1459
    FILES="Makefile libavformat/Makefile libavcodec/Makefile \
1460
          libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile \
1461
          doc/Makefile doc/texi2pod.pl"
1462 0f3cb305 Fabrice Bellard
    for dir in $DIRS ; do
1463
            mkdir -p $dir
1464
    done
1465
    for f in $FILES ; do
1466 281a74da Michael Niedermayer
        ln -sf "$source_path/$f" $f
1467 0f3cb305 Fabrice Bellard
    done
1468 8b8e1c55 Philipp Matthias Hahn
    echo "SRC_PATH=$source_path" >> config.mak
1469
else
1470
    echo "SRC_PATH='$source_path'" >> config.mak
1471 0f3cb305 Fabrice Bellard
fi
1472
1473 d663a1fd Michael Niedermayer
if test "$amr_wb" = "yes" ; then
1474
  echo "#define AMR_WB 1" >> $TMPH
1475
  echo "AMR_WB=yes" >> config.mak
1476
  echo
1477
  echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1478
  echo "V5.1.0 from "
1479
  echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1480
  echo "and extracted the source to libavcodec/amrwb_float"
1481
  echo
1482
fi
1483
1484 891f64b3 joca@rixmail.se
if test "$amr_nb" = "yes" ; then
1485
  echo "#define AMR_NB 1" >> $TMPH
1486
  echo "AMR_NB=yes" >> config.mak
1487
  echo
1488 bc634f6f Zdenek Kabelac
if test "$amr_nb_fixed" = "yes" ; then
1489
  echo "AMR_NB_FIXED=yes" >> config.mak
1490
  echo "#define AMR_NB_FIXED 1" >> $TMPH
1491
  echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1492
  echo "REL-5 version 5.1.0 from "
1493 184582de Michael Niedermayer
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1494 891f64b3 joca@rixmail.se
  echo "and extracted src to libavcodec/amr"
1495 bc634f6f Zdenek Kabelac
  echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1496
  echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1497
  echo
1498
else
1499
  echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1500
  echo "REL-5 V5.1.0 from "
1501 184582de Michael Niedermayer
  echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1502 bc634f6f Zdenek Kabelac
  echo "and extracted the source to libavcodec/amr_float"
1503 821e46f4 Michael Niedermayer
  echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1504 891f64b3 joca@rixmail.se
  echo
1505
fi
1506
1507 bc634f6f Zdenek Kabelac
fi
1508
1509 a7c02e25 Zdenek Kabelac
diff $TMPH config.h >/dev/null 2>&1
1510 045ed63f Zdenek Kabelac
if test $? -ne 0 ; then
1511
	mv -f $TMPH config.h
1512 3d204385 Nick Kurshev
else
1513 045ed63f Zdenek Kabelac
	echo "config.h is unchanged"
1514 3d204385 Nick Kurshev
fi
1515
1516 f3ec2d46 Slavik Gnatenko
rm -f $TMPO $TMPC $TMPE $TMPS $TMPH