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