Commit | Line | Data |
---|---|---|
de6d9b64 | 1 | #!/bin/sh |
0f3cb305 | 2 | # |
5cbcf02c | 3 | # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard |
0f3cb305 | 4 | # |
cf9d24ad | 5 | |
74c53c2d MR |
6 | show_help(){ |
7 | echo "Usage: configure [options]" | |
8 | echo "Options: [defaults in brackets after descriptions]" | |
9 | echo | |
10 | echo "Standard options:" | |
11 | echo " --help print this message" | |
57bd82d4 | 12 | echo " --log log tests and output to config.err" |
74c53c2d MR |
13 | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
14 | echo " --libdir=DIR install libs in DIR [PREFIX/lib]" | |
15 | echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]" | |
16 | echo " --mandir=DIR install man page in DIR [PREFIX/man]" | |
17 | echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]" | |
18 | echo " --enable-libogg enable Ogg support via libogg [default=no]" | |
19 | echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]" | |
20 | echo " --enable-theora enable Theora support via libtheora [default=no]" | |
21 | echo " --enable-faad enable FAAD support via libfaad [default=no]" | |
22 | echo " --enable-faadbin build FAAD support with runtime linking [default=no]" | |
23 | echo " --enable-faac enable FAAC support via libfaac [default=no]" | |
24 | echo " --enable-libgsm enable GSM support via libgsm [default=no]" | |
25 | echo " --enable-xvid enable XviD support via xvidcore [default=no]" | |
26 | echo " --enable-x264 enable H.264 encoding via x264 [default=no]" | |
27 | echo " --enable-mingw32 enable MinGW native/cross Windows compile" | |
28 | echo " --enable-mingwce enable MinGW native/cross WinCE compile" | |
29 | echo " --enable-a52 enable GPLed A52 support [default=no]" | |
30 | echo " --enable-a52bin open liba52.so.0 at runtime [default=no]" | |
31 | echo " --enable-dts enable GPLed DTS support [default=no]" | |
32 | echo " --enable-pp enable GPLed postprocessing support [default=no]" | |
33 | echo " --enable-static build static libraries [default=yes]" | |
34 | echo " --disable-static do not build static libraries [default=no]" | |
35 | echo " --enable-shared build shared libraries [default=no]" | |
36 | echo " --disable-shared do not build shared libraries [default=yes]" | |
37 | echo " --enable-amr_nb enable amr_nb float audio codec" | |
38 | echo " --enable-amr_nb-fixed use fixed point for amr-nb codec" | |
39 | echo " --enable-amr_wb enable amr_wb float audio codec" | |
40 | echo " --enable-amr_if2 enable amr_wb IF2 audio codec" | |
41 | echo " --enable-sunmlib use Sun medialib [default=no]" | |
42 | echo " --enable-pthreads use pthreads [default=no]" | |
43 | echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394" | |
44 | echo " and libraw1394 [default=no]" | |
45 | echo " --enable-gpl allow use of GPL code, the resulting libav*" | |
46 | echo " and ffmpeg will be under GPL [default=no]" | |
47 | echo "" | |
48 | echo "Advanced options (experts only):" | |
49 | echo " --source-path=PATH path to source code [$source_path]" | |
50 | echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" | |
51 | echo " --cc=CC use C compiler CC [$cc]" | |
52 | echo " --make=MAKE use specified make [$make]" | |
53 | echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]" | |
54 | echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]" | |
55 | echo " --extra-libs=ELIBS add ELIBS [$ELIBS]" | |
56 | echo " --build-suffix=SUFFIX suffix for application specific build []" | |
57 | echo " --cpu=CPU force cpu to CPU [$cpu]" | |
58 | echo " --tune=CPU tune code for a particular CPU" | |
59 | echo " (may fail or perform badly on other CPUs)" | |
60 | echo " --powerpc-perf-enable enable performance report on PPC" | |
61 | echo " (requires enabling PMC)" | |
62 | echo " --disable-mmx disable MMX usage" | |
63 | echo " --disable-iwmmxt disable iwmmxt usage" | |
64 | echo " --disable-altivec disable AltiVec usage" | |
65 | echo " --disable-audio-oss disable OSS audio support [default=no]" | |
66 | echo " --disable-audio-beos disable BeOS audio support [default=no]" | |
67 | echo " --disable-v4l disable video4linux grabbing [default=no]" | |
68 | echo " --disable-v4l2 disable video4linux2 grabbing [default=no]" | |
69 | echo " --disable-bktr disable bktr video grabbing [default=no]" | |
70 | echo " --disable-dv1394 disable DV1394 grabbing [default=no]" | |
71 | echo " --disable-network disable network support [default=no]" | |
72 | echo " --disable-zlib disable zlib [default=no]" | |
73 | echo " --disable-lzo disable lzo [default=no]" | |
74 | echo " --disable-simple_idct disable simple IDCT routines [default=no]" | |
75 | echo " --disable-vhook disable video hooking support" | |
76 | echo " --enable-gprof enable profiling with gprof [$gprof]" | |
77 | echo " --disable-debug disable debugging symbols" | |
78 | echo " --disable-opts disable compiler optimizations" | |
79 | echo " --disable-mpegaudio-hp faster (but less accurate)" | |
80 | echo " MPEG audio decoding [default=no]" | |
81 | echo " --disable-protocols disable I/O protocols support [default=no]" | |
82 | echo " --disable-ffserver disable ffserver build" | |
83 | echo " --disable-ffplay disable ffplay build" | |
84 | echo " --enable-small optimize for size instead of speed" | |
85 | echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers" | |
86 | echo " --disable-strip disable stripping of executables and shared libraries" | |
87 | echo " --disable-encoder=NAME disables encoder NAME" | |
88 | echo " --enable-encoder=NAME enables encoder NAME" | |
89 | echo " --disable-decoder=NAME disables decoder NAME" | |
90 | echo " --enable-decoder=NAME enables decoder NAME" | |
91 | echo " --disable-encoders disables all encoders" | |
92 | echo " --disable-decoders disables all decoders" | |
93 | echo " --disable-muxers disables all muxers" | |
94 | echo " --disable-demuxers disables all demuxers" | |
95 | echo "" | |
96 | echo "NOTE: Object files are built at the place where configure is launched." | |
97 | exit 1 | |
98 | } | |
cf9d24ad | 99 | |
57bd82d4 MR |
100 | log(){ |
101 | echo "$@" >>$logfile | |
102 | } | |
103 | ||
c8e9f801 MR |
104 | logfile(){ |
105 | log BEGIN $1 | |
106 | cat -n $1 >>$logfile | |
107 | log END $1 | |
108 | } | |
109 | ||
57bd82d4 | 110 | die(){ |
c8e9f801 | 111 | log "$@" |
57bd82d4 MR |
112 | echo "$@" |
113 | rm -f $TMPC $TMPO $TMPE $TMPS $TMPH | |
114 | exit 1 | |
115 | } | |
116 | ||
117 | enabled(){ | |
118 | eval test "\$$1" = "yes" | |
119 | } | |
120 | ||
121 | flags_saved(){ | |
122 | (: ${SAVE_CFLAGS?}) 2>/dev/null | |
123 | } | |
124 | ||
dcd479c0 | 125 | save_flags(){ |
57bd82d4 | 126 | flags_saved && return |
dcd479c0 MR |
127 | SAVE_CFLAGS="$CFLAGS" |
128 | SAVE_LDFLAGS="$LDFLAGS" | |
129 | SAVE_extralibs="$extralibs" | |
130 | } | |
131 | ||
132 | restore_flags(){ | |
133 | CFLAGS="$SAVE_CFLAGS" | |
134 | LDFLAGS="$SAVE_LDFLAGS" | |
135 | extralibs="$SAVE_extralibs" | |
136 | unset SAVE_CFLAGS | |
137 | unset SAVE_LDFLAGS | |
138 | unset SAVE_extralibs | |
139 | } | |
140 | ||
141 | temp_cflags(){ | |
142 | save_flags | |
143 | CFLAGS="$CFLAGS $*" | |
144 | } | |
145 | ||
146 | temp_ldflags(){ | |
147 | save_flags | |
148 | LDFLAGS="$LDFLAGS $*" | |
149 | } | |
150 | ||
151 | temp_extralibs(){ | |
152 | save_flags | |
153 | extralibs="$extralibs $*" | |
154 | } | |
155 | ||
57bd82d4 MR |
156 | append(){ |
157 | var=$1 | |
158 | shift | |
159 | flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\"" | |
160 | eval "$var=\"\$$var $*\"" | |
161 | } | |
162 | ||
163 | add_cflags(){ | |
164 | append CFLAGS "$@" | |
165 | } | |
166 | ||
167 | add_ldflags(){ | |
168 | append LDFLAGS "$@" | |
169 | } | |
170 | ||
171 | add_extralibs(){ | |
172 | append extralibs "$@" | |
173 | } | |
174 | ||
dcd479c0 | 175 | check_cc(){ |
57bd82d4 MR |
176 | log check_cc "$@" |
177 | cat >$TMPC | |
c8e9f801 | 178 | logfile $TMPC |
57bd82d4 MR |
179 | log $cc $CFLAGS "$@" -c -o $TMPO $TMPC |
180 | $cc $CFLAGS "$@" -c -o $TMPO $TMPC >>$logfile 2>&1 | |
181 | } | |
182 | ||
183 | check_cpp(){ | |
184 | log check_cpp "$@" | |
dcd479c0 | 185 | cat >$TMPC |
c8e9f801 | 186 | logfile $TMPC |
57bd82d4 MR |
187 | log $cc $CFLAGS "$@" -E -o $TMPO $TMPC |
188 | $cc $CFLAGS "$@" -E -o $TMPO $TMPC >>$logfile 2>&1 | |
dcd479c0 MR |
189 | } |
190 | ||
191 | check_ld(){ | |
57bd82d4 | 192 | log check_ld "$@" |
dcd479c0 | 193 | cat >$TMPC |
c8e9f801 | 194 | logfile $TMPC |
57bd82d4 | 195 | log $cc $CFLAGS $LDFLAGS "$@" -o $TMPE $TMPC $extralibs |
c8e9f801 | 196 | $cc $CFLAGS $LDFLAGS "$@" -o $TMPE $TMPC $extralibs >>$logfile 2>&1 |
dcd479c0 MR |
197 | } |
198 | ||
199 | check_cflags(){ | |
57bd82d4 MR |
200 | log check_cflags "$@" |
201 | check_cc "$@" <<EOF && add_cflags "$@" | |
dcd479c0 MR |
202 | int x; |
203 | EOF | |
204 | } | |
205 | ||
206 | check_ldflags(){ | |
57bd82d4 MR |
207 | log check_ldflags "$@" |
208 | check_ld "$@" <<EOF && add_ldflags "$@" | |
209 | int main(){ | |
210 | return 0; | |
211 | } | |
dcd479c0 MR |
212 | EOF |
213 | } | |
214 | ||
215 | check_header(){ | |
57bd82d4 | 216 | log check_header "$@" |
dcd479c0 MR |
217 | header=$1 |
218 | shift | |
57bd82d4 | 219 | check_cpp "$@" <<EOF |
dcd479c0 MR |
220 | #include <$header> |
221 | int x; | |
222 | EOF | |
223 | } | |
224 | ||
225 | check_func(){ | |
57bd82d4 | 226 | log check_func "$@" |
dcd479c0 MR |
227 | func=$1 |
228 | shift | |
229 | check_ld "$@" <<EOF | |
230 | extern int $func(); | |
231 | int main(){ | |
232 | $func(); | |
233 | } | |
234 | EOF | |
235 | } | |
236 | ||
57bd82d4 MR |
237 | check_lib(){ |
238 | log check_lib "$@" | |
239 | header="$1" | |
240 | func="$2" | |
241 | shift 2 | |
242 | temp_extralibs "$@" | |
243 | check_header $header && check_func $func && add_extralibs "$@" | |
244 | err=$? | |
245 | restore_flags | |
246 | return $err | |
247 | } | |
248 | ||
dcd479c0 | 249 | check_exec(){ |
57bd82d4 MR |
250 | check_ld "$@" && { test -n "$cross_prefix" || $TMPE; } |
251 | } | |
252 | ||
253 | require(){ | |
254 | name="$1" | |
255 | header="$2" | |
256 | func="$3" | |
257 | shift 3 | |
258 | check_lib $header $func "$@" || die "ERROR: $name not found" | |
dcd479c0 MR |
259 | } |
260 | ||
74c53c2d MR |
261 | if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
262 | show_help | |
cf9d24ad DC |
263 | fi |
264 | ||
0f3cb305 | 265 | # set temporary file name |
57514323 | 266 | if test ! -z "$TMPDIR" ; then |
0f3cb305 | 267 | TMPDIR1="${TMPDIR}" |
57514323 | 268 | elif test ! -z "$TEMPDIR" ; then |
0f3cb305 | 269 | TMPDIR1="${TEMPDIR}" |
3d204385 | 270 | else |
0f3cb305 | 271 | TMPDIR1="/tmp" |
3d204385 NK |
272 | fi |
273 | ||
0f3cb305 FB |
274 | TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c" |
275 | TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o" | |
f3ec2d46 | 276 | TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}" |
0f3cb305 FB |
277 | TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S" |
278 | TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h" | |
279 | ||
de6d9b64 | 280 | # default parameters |
57bd82d4 MR |
281 | log="no" |
282 | logfile="/dev/null" | |
de6d9b64 | 283 | prefix="/usr/local" |
cc973ecb | 284 | libdir="" |
1d67a1d4 | 285 | incdir="" |
23a65308 | 286 | mandir="" |
951bf3e6 | 287 | bindir="" |
0f3cb305 | 288 | cross_prefix="" |
de6d9b64 FB |
289 | cc="gcc" |
290 | ar="ar" | |
be7109c1 | 291 | ranlib="ranlib" |
4a908fbc | 292 | make="make" |
0f3cb305 | 293 | strip="strip" |
de6d9b64 | 294 | cpu=`uname -m` |
a4adb608 | 295 | tune="generic" |
e45a2872 | 296 | powerpc_perf="no" |
0f3cb305 | 297 | mmx="default" |
eba9ae3c | 298 | iwmmxt="default" |
ab6c65f6 | 299 | altivec="default" |
d46aba26 | 300 | mmi="default" |
de6d9b64 | 301 | case "$cpu" in |
ef0bc4c9 | 302 | i386|i486|i586|i686|i86pc|BePC) |
de6d9b64 | 303 | cpu="x86" |
de6d9b64 | 304 | ;; |
7bf9648e JM |
305 | x86_64|amd64) |
306 | cpu="x86" | |
307 | canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`" | |
308 | if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then | |
309 | if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then | |
310 | cpu="x86_64" | |
311 | fi | |
053dea12 AJ |
312 | fi |
313 | ;; | |
93caefc7 AB |
314 | # armv4l is a subset of armv5tel |
315 | armv4l|armv5tel) | |
6ed7422a | 316 | cpu="armv4l" |
6ed7422a | 317 | ;; |
91d1f1a4 NK |
318 | alpha) |
319 | cpu="alpha" | |
91d1f1a4 | 320 | ;; |
90448512 | 321 | "Power Macintosh"|ppc|powerpc) |
90cee0c3 MN |
322 | cpu="powerpc" |
323 | ;; | |
67860b26 | 324 | mips|mipsel) |
d46aba26 LS |
325 | cpu="mips" |
326 | ;; | |
bb476ff3 | 327 | sun4u|sparc64) |
a7beab73 RS |
328 | cpu="sparc64" |
329 | ;; | |
bb476ff3 JM |
330 | sparc) |
331 | cpu="sparc" | |
332 | ;; | |
bdb2e37c AB |
333 | sh4) |
334 | cpu="sh4" | |
335 | ;; | |
67860b26 SH |
336 | parisc|parisc64) |
337 | cpu="parisc" | |
338 | ;; | |
339 | s390|s390x) | |
340 | cpu="s390" | |
341 | ;; | |
342 | m68k) | |
343 | cpu="m68k" | |
344 | ;; | |
345 | ia64) | |
346 | cpu="ia64" | |
347 | ;; | |
de6d9b64 | 348 | *) |
0f3cb305 | 349 | cpu="unknown" |
de6d9b64 FB |
350 | ;; |
351 | esac | |
352 | gprof="no" | |
5cbcf02c | 353 | v4l="yes" |
0a7b514f | 354 | v4l2="yes" |
6beefa40 | 355 | bktr="no" |
5cbcf02c | 356 | audio_oss="yes" |
dfdfa47c | 357 | audio_beos="no" |
8aa3ee32 | 358 | dv1394="yes" |
f02be79d | 359 | dc1394="no" |
5cbcf02c | 360 | network="yes" |
0147f198 | 361 | zlib="yes" |
e0f80bd7 | 362 | lzo="yes" |
bb4c2140 | 363 | libgsm="no" |
a6741398 | 364 | mp3lame="no" |
9146ca37 | 365 | libogg="no" |
81e0d0b4 | 366 | vorbis="no" |
5c5dea3f | 367 | theora="no" |
0fc50e58 ZK |
368 | faad="no" |
369 | faadbin="no" | |
29d48296 | 370 | faac="no" |
1ddadfa9 | 371 | xvid="no" |
6662ec29 | 372 | x264="no" |
ba9261e5 | 373 | a52="no" |
57514323 | 374 | a52bin="no" |
23c99253 | 375 | dts="no" |
ba9261e5 | 376 | pp="no" |
732d9245 | 377 | mingw32="no" |
ac44871c | 378 | mingwce="no" |
3f027ca7 | 379 | cygwin="no" |
f3ec2d46 | 380 | os2="no" |
320d060a | 381 | lstatic="yes" |
83286d2a | 382 | lshared="no" |
cddf3f45 GM |
383 | optimize="yes" |
384 | debug="yes" | |
65d1bea2 | 385 | dostrip="yes" |
da186ae2 | 386 | installstrip="-s" |
ef0bc4c9 | 387 | extralibs="-lm" |
c02dbee1 | 388 | simpleidct="yes" |
0f3cb305 | 389 | bigendian="no" |
7f965c1c | 390 | inttypes="yes" |
b5c950c4 | 391 | emu_fast_int="no" |
a8721c09 | 392 | vhook="default" |
adbc0510 PG |
393 | dlfcn="no" |
394 | dlopen="no" | |
1eb2212e | 395 | mpegaudio_hp="yes" |
baa3a937 | 396 | SHFLAGS='-shared -Wl,-soname,$@' |
26b35efb | 397 | netserver="no" |
4baca069 | 398 | need_inet_aton="no" |
04f46ced | 399 | protocols="yes" |
8154d2e0 | 400 | ffserver="yes" |
a86b921c | 401 | ffplay="yes" |
80581e98 | 402 | LIBOBJFLAGS="" |
e89b8b0a | 403 | FFLDFLAGS=-Wl,--warn-common |
4baca069 | 404 | FFSLDFLAGS=-Wl,-E |
f39e56a8 | 405 | LDCONFIG="ldconfig" |
f3ec2d46 SG |
406 | LIBPREF="lib" |
407 | LIBSUF=".a" | |
4bdd05e7 | 408 | LIB='$(LIBPREF)$(NAME)$(LIBSUF)' |
f3ec2d46 SG |
409 | SLIBPREF="lib" |
410 | SLIBSUF=".so" | |
4bdd05e7 | 411 | SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)' |
b29bddab DB |
412 | SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)' |
413 | SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)' | |
951bf3e6 | 414 | EXESUF="" |
eb94aca9 | 415 | BUILDSUF="" |
891f64b3 | 416 | amr_nb="no" |
d663a1fd | 417 | amr_wb="no" |
bc634f6f | 418 | amr_nb_fixed="no" |
2a515c08 | 419 | amr_if2="no" |
f80f7964 | 420 | sunmlib="no" |
9c3d33d6 | 421 | pthreads="no" |
b2e3c528 | 422 | gpl="no" |
da9b170c | 423 | memalignhack="no" |
a9e35095 DB |
424 | muxers="yes" |
425 | demuxers="yes" | |
ef0bc4c9 FR |
426 | |
427 | # OS specific | |
428 | targetos=`uname -s` | |
429 | case $targetos in | |
430 | BeOS) | |
431 | prefix="/boot/home/config" | |
432 | # helps building libavcodec | |
04f40508 | 433 | CFLAGS="$CFLAGS -DPIC -fomit-frame-pointer" |
31ba0b4d | 434 | # 3 gcc releases known for BeOS, each with ugly bugs |
b2924696 | 435 | gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`" |
31ba0b4d FR |
436 | case "$gcc_version" in |
437 | 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc" | |
438 | mmx="no" | |
439 | ;; | |
440 | *20010315*) echo "BeBits gcc" | |
441 | CFLAGS="$CFLAGS -fno-expensive-optimizations" | |
442 | ;; | |
443 | esac | |
e1707f52 | 444 | SHFLAGS=-nostart |
29799f8b | 445 | # disable Linux things |
e1707f52 | 446 | audio_oss="no" |
5cbcf02c | 447 | v4l="no" |
0a7b514f | 448 | v4l2="no" |
8aa3ee32 | 449 | dv1394="no" |
29799f8b | 450 | # enable BeOS things |
dfdfa47c | 451 | audio_beos="yes" |
ef0bc4c9 FR |
452 | # no need for libm, but the inet stuff |
453 | # Check for BONE | |
454 | if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then | |
455 | extralibs="-lbind -lsocket" | |
456 | else | |
26b35efb | 457 | netserver="yes" |
4baca069 | 458 | need_inet_aton="yes" |
26b35efb | 459 | extralibs="-lnet" |
ef0bc4c9 | 460 | fi ;; |
4baca069 PG |
461 | SunOS) |
462 | v4l="no" | |
0a7b514f | 463 | v4l2="no" |
4baca069 | 464 | audio_oss="no" |
8aa3ee32 | 465 | dv1394="no" |
4baca069 | 466 | make="gmake" |
e89b8b0a | 467 | FFLDFLAGS="" |
4baca069 PG |
468 | FFSLDFLAGS="" |
469 | need_inet_aton="yes" | |
470 | extralibs="$extralibs -lsocket -lnsl" | |
471 | ;; | |
b7aa4a59 SS |
472 | NetBSD) |
473 | v4l="no" | |
0a7b514f | 474 | v4l2="no" |
6beefa40 | 475 | bktr="yes" |
b7aa4a59 SS |
476 | audio_oss="yes" |
477 | dv1394="no" | |
478 | make="gmake" | |
e89b8b0a | 479 | FFLDFLAGS="$FFLDFLAGS -export-dynamic" |
08706ab9 | 480 | extralibs="$extralibs -lossaudio" |
b7aa4a59 | 481 | ;; |
8c802695 JM |
482 | OpenBSD) |
483 | v4l="no" | |
0a7b514f | 484 | v4l2="no" |
6beefa40 | 485 | bktr="yes" |
8c802695 JM |
486 | audio_oss="yes" |
487 | dv1394="no" | |
488 | make="gmake" | |
80581e98 | 489 | LIBOBJFLAGS="\$(PIC)" |
e89b8b0a | 490 | FFLDFLAGS="$FFLDFLAGS -export-dynamic -pthread" |
f39e56a8 | 491 | LDCONFIG="ldconfig -m \$(libdir)" |
8c802695 JM |
492 | extralibs="$extralibs -lossaudio" |
493 | ;; | |
9c938e77 PG |
494 | FreeBSD) |
495 | v4l="no" | |
0a7b514f | 496 | v4l2="no" |
6beefa40 | 497 | bktr="yes" |
9c938e77 | 498 | audio_oss="yes" |
8aa3ee32 | 499 | dv1394="no" |
9c938e77 | 500 | make="gmake" |
04f40508 | 501 | CFLAGS="$CFLAGS -pthread" |
e89b8b0a | 502 | FFLDFLAGS="$FFLDFLAGS -export-dynamic -pthread" |
9c938e77 | 503 | ;; |
38f0d3ce DB |
504 | GNU/kFreeBSD) |
505 | v4l="no" | |
506 | v4l2="no" | |
507 | bktr="yes" | |
508 | audio_oss="yes" | |
509 | dv1394="no" | |
510 | CFLAGS="$CFLAGS -pthread" | |
511 | LDFLAGS="$LDFLAGS -rdynamic" | |
512 | ;; | |
4a908fbc | 513 | BSD/OS) |
5cbcf02c | 514 | v4l="no" |
0a7b514f | 515 | v4l2="no" |
6beefa40 | 516 | bktr="yes" |
6063bce7 | 517 | audio_oss="yes" |
8aa3ee32 | 518 | dv1394="no" |
4a908fbc AB |
519 | extralibs="-lpoll -lgnugetopt -lm" |
520 | make="gmake" | |
1db68540 SS |
521 | strip="strip -d" |
522 | installstrip="" | |
4a908fbc | 523 | ;; |
90cee0c3 | 524 | Darwin) |
a43bd1d7 | 525 | cc="cc" |
90cee0c3 | 526 | v4l="no" |
0a7b514f | 527 | v4l2="no" |
90cee0c3 | 528 | audio_oss="no" |
8aa3ee32 | 529 | dv1394="no" |
fb3d46da | 530 | SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(libdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)" |
90cee0c3 | 531 | extralibs="" |
a43bd1d7 | 532 | darwin="yes" |
47930f09 | 533 | strip="strip -x" |
da186ae2 | 534 | installstrip="" |
e89b8b0a | 535 | FFLDFLAGS="-Wl,-dynamic,-search_paths_first" |
4e159595 | 536 | SLIBSUF=".dylib" |
f3b60109 DB |
537 | SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)' |
538 | SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)' | |
4baca069 | 539 | FFSLDFLAGS=-Wl,-bind_at_load |
90cee0c3 | 540 | ;; |
732d9245 | 541 | MINGW32*) |
951bf3e6 | 542 | # Note: the rest of the mingw32 config is done afterwards as mingw32 |
29799f8b | 543 | # can be forced on the command line for Linux cross compilation. |
732d9245 BE |
544 | mingw32="yes" |
545 | ;; | |
3f027ca7 FB |
546 | CYGWIN*) |
547 | v4l="no" | |
0a7b514f | 548 | v4l2="no" |
3f027ca7 | 549 | audio_oss="yes" |
8aa3ee32 | 550 | dv1394="no" |
50827fcf | 551 | vhook="no" |
3f027ca7 FB |
552 | extralibs="" |
553 | cygwin="yes" | |
487c2fad | 554 | EXESUF=".exe" |
3f027ca7 | 555 | ;; |
b55e4ef4 | 556 | Linux) |
57bd82d4 | 557 | FFLDFLAGS="$FFLDFLAGS -rdynamic" |
b55e4ef4 | 558 | ;; |
99614dd4 MB |
559 | IRIX*) |
560 | ranlib="echo ignoring ranlib" | |
561 | v4l="no" | |
0a7b514f | 562 | v4l2="no" |
99614dd4 MB |
563 | audio_oss="no" |
564 | make="gmake" | |
565 | ;; | |
f3ec2d46 SG |
566 | OS/2) |
567 | TMPE=$TMPE".exe" | |
3ca4b654 | 568 | ar="emxomfar -p128" |
69db4e10 SG |
569 | ranlib="echo ignoring ranlib" |
570 | strip="echo ignoring strip" | |
04f40508 | 571 | CFLAGS="$CFLAGS -Zomf" |
e89b8b0a | 572 | FFLDFLAGS="-Zomf -Zstack 16384 -s" |
3ca4b654 | 573 | SHFLAGS="-Zdll -Zomf" |
f3ec2d46 SG |
574 | FFSLDFLAGS="" |
575 | LIBPREF="" | |
576 | LIBSUF=".lib" | |
577 | SLIBPREF="" | |
578 | SLIBSUF=".dll" | |
951bf3e6 | 579 | EXESUF=".exe" |
f3ec2d46 | 580 | extralibs="" |
c99dd233 | 581 | pkg_requires="" |
f3ec2d46 | 582 | v4l="no" |
0a7b514f | 583 | v4l2="no" |
f3ec2d46 | 584 | audio_oss="no" |
8aa3ee32 | 585 | dv1394="no" |
f3ec2d46 | 586 | ffserver="no" |
3ca4b654 | 587 | vhook="no" |
f3ec2d46 | 588 | os2="yes" |
3ca4b654 | 589 | |
f3ec2d46 | 590 | ;; |
ef0bc4c9 FR |
591 | *) ;; |
592 | esac | |
de6d9b64 | 593 | |
29799f8b | 594 | # From MPlayer configure. We need TARGET_OS available |
6852ac95 | 595 | # to the Makefile, so it can distinguish between flavors |
29799f8b | 596 | # of AltiVec on PowerPC. |
6852ac95 RD |
597 | TARGET_OS=`( uname -s ) 2>&1` |
598 | case "$TARGET_OS" in | |
90448512 | 599 | Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS|MorphOS) |
6852ac95 RD |
600 | ;; |
601 | IRIX*) | |
602 | TARGET_OS=IRIX | |
603 | ;; | |
604 | HP-UX*) | |
605 | TARGET_OS=HP-UX | |
606 | ;; | |
607 | [cC][yY][gG][wW][iI][nN]*) | |
608 | TARGET_OS=CYGWIN | |
609 | ;; | |
610 | *) | |
611 | TARGET_OS="$TARGET_OS-UNKNOWN" | |
612 | ;; | |
613 | esac | |
614 | ||
0f3cb305 | 615 | # find source path |
6942d002 | 616 | source_path="`dirname $0`" |
0f3cb305 FB |
617 | source_path_used="yes" |
618 | if test -z "$source_path" -o "$source_path" = "." ; then | |
619 | source_path=`pwd` | |
620 | source_path_used="no" | |
e7a4dafb MR |
621 | else |
622 | source_path="`cd \"$source_path\"; pwd`" | |
de6d9b64 FB |
623 | fi |
624 | ||
f255e0ab MB |
625 | FFMPEG_CONFIGURATION=" " |
626 | for opt do | |
627 | FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt " | |
628 | done | |
629 | ||
24a9ad7e | 630 | CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'` |
009cf97d | 631 | |
de6d9b64 FB |
632 | for opt do |
633 | case "$opt" in | |
57bd82d4 MR |
634 | --log) log=yes |
635 | ;; | |
eba9ae3c | 636 | --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes |
de6d9b64 | 637 | ;; |
eba9ae3c | 638 | --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes |
cc973ecb | 639 | ;; |
1d67a1d4 DB |
640 | --incdir=*) incdir=`echo $opt | cut -d '=' -f 2`; |
641 | ;; | |
23a65308 FB |
642 | --mandir=*) mandir=`echo $opt | cut -d '=' -f 2` |
643 | ;; | |
0f3cb305 FB |
644 | --source-path=*) source_path=`echo $opt | cut -d '=' -f 2` |
645 | ;; | |
646 | --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` | |
647 | ;; | |
eba9ae3c | 648 | --cc=*) cc=`echo $opt | cut -d '=' -f 2-` |
de6d9b64 | 649 | ;; |
4a908fbc AB |
650 | --make=*) make=`echo $opt | cut -d '=' -f 2` |
651 | ;; | |
f4e2c4b1 | 652 | --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}" |
0f3cb305 | 653 | ;; |
e89b8b0a | 654 | --extra-ldflags=*) FFLDFLAGS="$FFLDFLAGS ${opt#--extra-ldflags=}" |
0f3cb305 FB |
655 | ;; |
656 | --extra-libs=*) extralibs=${opt#--extra-libs=} | |
657 | ;; | |
eb94aca9 CY |
658 | --build-suffix=*) BUILDSUF=${opt#--build-suffix=} |
659 | ;; | |
de6d9b64 FB |
660 | --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` |
661 | ;; | |
a4adb608 MN |
662 | --tune=*) tune=`echo $opt | cut -d '=' -f 2` |
663 | ;; | |
e45a2872 RD |
664 | --powerpc-perf-enable) powerpc_perf="yes" |
665 | ;; | |
de6d9b64 FB |
666 | --disable-mmx) mmx="no" |
667 | ;; | |
eba9ae3c GB |
668 | --disable-iwmmxt) iwmmxt="no" |
669 | ;; | |
ab6c65f6 BF |
670 | --disable-altivec) altivec="no" |
671 | ;; | |
de6d9b64 FB |
672 | --enable-gprof) gprof="yes" |
673 | ;; | |
5cbcf02c FB |
674 | --disable-v4l) v4l="no" |
675 | ;; | |
0a7b514f LA |
676 | --disable-v4l2) v4l2="no" |
677 | ;; | |
6beefa40 MN |
678 | --disable-bktr) bktr="no" |
679 | ;; | |
5cbcf02c FB |
680 | --disable-audio-oss) audio_oss="no" |
681 | ;; | |
dfdfa47c FR |
682 | --disable-audio-beos) audio_beos="no" |
683 | ;; | |
8aa3ee32 MK |
684 | --disable-dv1394) dv1394="no" |
685 | ;; | |
ffc0ef96 | 686 | --disable-network) network="no"; ffserver="no" |
5cbcf02c | 687 | ;; |
0147f198 FR |
688 | --disable-zlib) zlib="no" |
689 | ;; | |
e0f80bd7 RD |
690 | --disable-lzo) lzo="no" |
691 | ;; | |
ba9261e5 | 692 | --enable-a52) a52="yes" |
6ed7422a | 693 | ;; |
bfd2edeb | 694 | --enable-a52bin) a52bin="yes" |
57514323 | 695 | ;; |
c99dd233 | 696 | --enable-dts) dts="yes" |
23c99253 | 697 | ;; |
ba9261e5 | 698 | --enable-pp) pp="yes" |
bba9b16c | 699 | ;; |
bb4c2140 MN |
700 | --enable-libgsm) libgsm="yes" |
701 | ;; | |
c99dd233 | 702 | --enable-mp3lame) mp3lame="yes" |
a6741398 | 703 | ;; |
9146ca37 | 704 | --enable-libogg) libogg="yes" |
c99dd233 | 705 | pkg_requires="$pkg_requires ogg >= 1.1" |
5c5dea3f | 706 | ;; |
81e0d0b4 | 707 | --enable-vorbis) vorbis="yes" |
c99dd233 | 708 | pkg_requires="$pkg_requires vorbis vorbisenc" |
81e0d0b4 | 709 | ;; |
5c5dea3f | 710 | --enable-theora) theora="yes" |
c99dd233 | 711 | pkg_requires="$pkg_requires theora" |
5c5dea3f | 712 | ;; |
445ad18d ZK |
713 | --enable-faad) faad="yes" |
714 | ;; | |
715 | --enable-faadbin) faadbin="yes" | |
716 | ;; | |
c99dd233 | 717 | --enable-faac) faac="yes" |
29d48296 | 718 | ;; |
1ddadfa9 AT |
719 | --enable-xvid) xvid="yes" |
720 | ;; | |
c99dd233 | 721 | --enable-x264) x264="yes" |
6662ec29 | 722 | ;; |
f02be79d | 723 | --enable-dc1394) dc1394="yes" |
c99dd233 | 724 | pkg_requires="$pkg_requires libraw1394" |
f02be79d | 725 | ;; |
68892110 PG |
726 | --disable-vhook) vhook="no" |
727 | ;; | |
c02dbee1 | 728 | --disable-simple_idct) simpleidct="no" |
045ed63f | 729 | ;; |
732d9245 BE |
730 | --enable-mingw32) mingw32="yes" |
731 | ;; | |
ac44871c GB |
732 | --enable-mingwce) mingwce="yes" |
733 | ;; | |
320d060a DB |
734 | --enable-static) lstatic="yes" |
735 | ;; | |
736 | --disable-static) lstatic="no" | |
737 | ;; | |
83286d2a | 738 | --enable-shared) lshared="yes" |
0319c531 | 739 | ;; |
320d060a DB |
740 | --disable-shared) lshared="no" |
741 | ;; | |
cddf3f45 GM |
742 | --disable-debug) debug="no" |
743 | ;; | |
744 | --disable-opts) optimize="no" | |
745 | ;; | |
1eb2212e FB |
746 | --disable-mpegaudio-hp) mpegaudio_hp="no" |
747 | ;; | |
04f46ced GB |
748 | --disable-protocols) protocols="no"; network="no"; ffserver="no" |
749 | ;; | |
8154d2e0 FB |
750 | --disable-ffserver) ffserver="no" |
751 | ;; | |
a86b921c FB |
752 | --disable-ffplay) ffplay="no" |
753 | ;; | |
cddf3f45 | 754 | --enable-small) optimize="small" |
553a6284 | 755 | ;; |
60827a1a | 756 | --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no" |
891f64b3 | 757 | ;; |
60827a1a | 758 | --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no" |
bc634f6f | 759 | ;; |
60827a1a | 760 | --enable-amr_wb) amr="yes"; amr_wb="yes" |
115329f1 | 761 | ;; |
60827a1a | 762 | --enable-amr_if2) amr="yes"; amr_if2="yes" |
2a515c08 | 763 | ;; |
f80f7964 RS |
764 | --enable-sunmlib) sunmlib="yes" |
765 | ;; | |
9c3d33d6 MN |
766 | --enable-pthreads) pthreads="yes" |
767 | ;; | |
b2e3c528 MN |
768 | --enable-gpl) gpl="yes" |
769 | ;; | |
da9b170c MN |
770 | --enable-memalign-hack) memalignhack="yes" |
771 | ;; | |
65d1bea2 MB |
772 | --disable-strip) dostrip="no" |
773 | ;; | |
f593b273 | 774 | --enable-encoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-encoder=}_encoder" |
009cf97d | 775 | ;; |
f593b273 DB |
776 | --enable-decoder=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-decoder=}_decoder" |
777 | ;; | |
778 | --disable-encoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-encoder=}_encoder##\"`" | |
779 | ;; | |
780 | --disable-decoder=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-decoder=}_decoder##\"`" | |
009cf97d MN |
781 | ;; |
782 | --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`" | |
783 | ;; | |
b4cad537 EP |
784 | --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`" |
785 | ;; | |
04f46ced | 786 | --disable-muxers) muxers="no"; ffserver="no" |
a9e35095 DB |
787 | ;; |
788 | --disable-demuxers) demuxers="no" | |
789 | ;; | |
74c53c2d MR |
790 | --help) show_help |
791 | ;; | |
b34c63f7 DB |
792 | *) |
793 | echo "Unknown option \"$opt\"." | |
794 | echo "See $0 --help for available options." | |
795 | exit 1 | |
796 | ;; | |
de6d9b64 FB |
797 | esac |
798 | done | |
799 | ||
57bd82d4 MR |
800 | if enabled log; then |
801 | logfile=config.err | |
802 | echo "# $0 $@" >$logfile | |
803 | set >>$logfile | |
804 | fi | |
e89b8b0a DB |
805 | |
806 | # Combine FFLDFLAGS and the LDFLAGS environment variable | |
807 | LDFLAGS="$FFLDFLAGS $LDFLAGS" | |
808 | ||
1ea46bed MR |
809 | cc="${cross_prefix}${cc}" |
810 | ar="${cross_prefix}${ar}" | |
811 | ranlib="${cross_prefix}${ranlib}" | |
812 | strip="${cross_prefix}${strip}" | |
813 | ||
320d060a DB |
814 | # we need to build at least one lib type |
815 | if test "$lstatic" = "no" && test "$lshared" = "no" ; then | |
816 | cat <<EOF | |
817 | At least one library type must be built. | |
818 | Specify --enable-static to build the static libraries or --enable-shared to | |
819 | build the shared libraries as well. To only build the shared libraries specify | |
820 | --disable-static in addition to --enable-shared. | |
821 | EOF | |
822 | exit 1; | |
823 | fi | |
824 | ||
5c5dea3f | 825 | if test "$theora" = "yes" ; then |
9146ca37 | 826 | if test "$libogg" = "no"; then |
29799f8b | 827 | echo "libogg must be enabled to enable Theora." |
5c5dea3f NB |
828 | fail="yes" |
829 | theora="no" | |
830 | fi | |
831 | fi | |
832 | ||
833 | if test "$vorbis" = "yes" ; then | |
9146ca37 | 834 | if test "$libogg" = "no"; then |
29799f8b | 835 | echo "libogg must be enabled to enable Vorbis." |
5c5dea3f NB |
836 | fail="yes" |
837 | vorbis="no" | |
838 | fi | |
839 | fi | |
840 | ||
b2e3c528 | 841 | if test "$gpl" != "yes"; then |
ba64106a | 842 | if test "$pp" != "no"; then |
29799f8b | 843 | echo "The Postprocessing code is under GPL and --enable-gpl is not specified." |
b2e3c528 MN |
844 | fail="yes" |
845 | fi | |
846 | ||
847 | if test "$a52" != "no" -o "$a52bin" != "no"; then | |
29799f8b | 848 | echo "liba52 is under GPL and --enable-gpl is not specified." |
b2e3c528 MN |
849 | fail="yes" |
850 | fi | |
23c99253 | 851 | |
1ddadfa9 | 852 | if test "$xvid" != "no"; then |
29799f8b | 853 | echo "libxvidcore is under GPL and --enable-gpl is not specified." |
1ddadfa9 AT |
854 | fail="yes" |
855 | fi | |
856 | ||
6662ec29 | 857 | if test "$x264" != "no"; then |
29799f8b | 858 | echo "x264 is under GPL and --enable-gpl is not specified." |
6662ec29 MN |
859 | fail="yes" |
860 | fi | |
861 | ||
23c99253 | 862 | if test "$dts" != "no"; then |
29799f8b | 863 | echo "libdts is under GPL and --enable-gpl is not specified." |
23c99253 MN |
864 | fail="yes" |
865 | fi | |
115329f1 | 866 | |
b2e3c528 | 867 | if test "$faad" != "no" -o "$faadbin" != "no"; then |
dcd479c0 MR |
868 | if check_header faad.h; then |
869 | check_cc << EOF | |
b2e3c528 MN |
870 | #include <faad.h> |
871 | #ifndef FAAD2_VERSION | |
872 | ok faad1 | |
873 | #endif | |
874 | int main( void ) { return 0; } | |
875 | EOF | |
dcd479c0 | 876 | if test $? = 0 ; then |
29799f8b | 877 | echo "FAAD2 is under GPL and --enable-gpl is not specified." |
b2e3c528 MN |
878 | fail="yes" |
879 | fi | |
880 | else | |
881 | faad="no" | |
882 | faadbin="no" | |
29799f8b | 883 | echo "FAAD test failed." |
b2e3c528 MN |
884 | fi |
885 | fi | |
115329f1 | 886 | |
b2e3c528 | 887 | |
a18b5183 | 888 | if test "$fail" = "yes"; then |
b2e3c528 MN |
889 | exit 1 |
890 | fi | |
891 | fi | |
892 | ||
29799f8b | 893 | # compute MMX state |
0f3cb305 | 894 | if test $mmx = "default"; then |
053dea12 | 895 | if test $cpu = "x86" -o $cpu = "x86_64"; then |
0f3cb305 FB |
896 | mmx="yes" |
897 | else | |
898 | mmx="no" | |
899 | fi | |
900 | fi | |
901 | ||
eba9ae3c GB |
902 | # check iwmmxt support |
903 | if test $iwmmxt = "default" -a $cpu = "armv4l"; then | |
dcd479c0 MR |
904 | iwmmxt=no |
905 | check_cc <<EOF && iwmmxt=yes | |
115329f1 | 906 | int main(void) { |
eba9ae3c GB |
907 | __asm__ __volatile__ ("wunpckelub wr6, wr4"); |
908 | } | |
909 | EOF | |
eba9ae3c GB |
910 | fi |
911 | ||
cf9d24ad | 912 | #Darwin CC versions |
75388c74 | 913 | needmdynamicnopic="no" |
cf9d24ad | 914 | if test $targetos = Darwin; then |
b2924696 | 915 | if test -n "`$cc -v 2>&1 | grep xlc`"; then |
bb270c08 | 916 | CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto" |
cf9d24ad | 917 | else |
bb270c08 DB |
918 | gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`" |
919 | case "$gcc_version" in | |
920 | *2.95*) | |
921 | CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer" | |
922 | ;; | |
923 | *[34].*) | |
924 | CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare" | |
925 | if test "$lshared" = no; then | |
926 | needmdynamicnopic="yes" | |
927 | fi | |
928 | ;; | |
929 | *) | |
930 | CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer" | |
931 | if test "$lshared" = no; then | |
932 | needmdynamicnopic="yes" | |
933 | fi | |
934 | ;; | |
935 | esac | |
cf9d24ad DC |
936 | fi |
937 | fi | |
938 | ||
ab6c65f6 BF |
939 | # Can only do AltiVec on PowerPC |
940 | if test $altivec = "default"; then | |
941 | if test $cpu = "powerpc"; then | |
942 | altivec="yes" | |
943 | else | |
944 | altivec="no" | |
945 | fi | |
946 | fi | |
947 | ||
a4adb608 MN |
948 | # Add processor-specific flags |
949 | TUNECPU="generic" | |
9007f514 | 950 | POWERPCMODE="32bits" |
a4adb608 MN |
951 | if test $tune != "generic"; then |
952 | case $tune in | |
bb270c08 DB |
953 | 601|ppc601|PowerPC601) |
954 | CFLAGS="$CFLAGS -mcpu=601" | |
955 | if test $altivec = "yes"; then | |
956 | echo "WARNING: Tuning for PPC601 but AltiVec enabled!"; | |
957 | fi | |
958 | TUNECPU=ppc601 | |
959 | ;; | |
960 | 603*|ppc603*|PowerPC603*) | |
961 | CFLAGS="$CFLAGS -mcpu=603" | |
962 | if test $altivec = "yes"; then | |
963 | echo "WARNING: Tuning for PPC603 but AltiVec enabled!"; | |
964 | fi | |
965 | TUNECPU=ppc603 | |
966 | ;; | |
967 | 604*|ppc604*|PowerPC604*) | |
968 | CFLAGS="$CFLAGS -mcpu=604" | |
969 | if test $altivec = "yes"; then | |
970 | echo "WARNING: Tuning for PPC604 but AltiVec enabled!"; | |
971 | fi | |
972 | TUNECPU=ppc604 | |
973 | ;; | |
974 | G3|g3|75*|ppc75*|PowerPC75*) | |
975 | CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt" | |
976 | if test $altivec = "yes"; then | |
977 | echo "WARNING: Tuning for PPC75x but AltiVec enabled!"; | |
978 | fi | |
979 | TUNECPU=ppc750 | |
980 | ;; | |
981 | G4|g4|745*|ppc745*|PowerPC745*) | |
982 | CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt" | |
983 | if test $altivec = "no"; then | |
984 | echo "WARNING: Tuning for PPC745x but AltiVec disabled!"; | |
985 | fi | |
986 | TUNECPU=ppc7450 | |
987 | ;; | |
988 | 74*|ppc74*|PowerPC74*) | |
989 | CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt" | |
990 | if test $altivec = "no"; then | |
991 | echo "WARNING: Tuning for PPC74xx but AltiVec disabled!"; | |
992 | fi | |
993 | TUNECPU=ppc7400 | |
994 | ;; | |
995 | G5|g5|970|ppc970|PowerPC970|power4*|Power4*) | |
996 | CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64" | |
997 | if test $altivec = "no"; then | |
998 | echo "WARNING: Tuning for PPC970 but AltiVec disabled!"; | |
999 | fi | |
1000 | TUNECPU=ppc970 | |
9007f514 | 1001 | POWERPCMODE="64bits" |
bb270c08 DB |
1002 | ;; |
1003 | i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx) | |
1004 | CFLAGS="$CFLAGS -march=$tune" | |
1005 | ;; | |
1006 | *) | |
1007 | echo "WARNING: Unknown CPU \"$tune\", ignored." | |
1008 | ;; | |
a4adb608 MN |
1009 | esac |
1010 | fi | |
1011 | ||
57bd82d4 MR |
1012 | # check for SIMD availability |
1013 | ||
115329f1 | 1014 | # AltiVec flags: The FSF version of GCC differs from the Apple version |
b6e52719 MD |
1015 | if test $cpu = "powerpc"; then |
1016 | if test $altivec = "yes"; then | |
b2924696 | 1017 | if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then |
49f1a349 | 1018 | CFLAGS="$CFLAGS -faltivec" |
b6e52719 MD |
1019 | else |
1020 | CFLAGS="$CFLAGS -maltivec -mabi=altivec" | |
1021 | fi | |
1022 | fi | |
1023 | fi | |
1024 | ||
dcd479c0 | 1025 | check_header altivec.h && _altivec_h=yes || _altivec_h=no |
a9a07762 | 1026 | |
29799f8b | 1027 | # check if our compiler supports Motorola AltiVec C API |
ab6c65f6 | 1028 | if test $altivec = "yes"; then |
f25fc9b1 MR |
1029 | if test $_altivec_h = "yes"; then |
1030 | inc_altivec_h="#include <altivec.h>" | |
1031 | else | |
1032 | inc_altivec_h= | |
1033 | fi | |
1034 | check_cc <<EOF || altivec=no | |
dcd479c0 | 1035 | $inc_altivec_h |
a9a07762 MN |
1036 | int main(void) { |
1037 | vector signed int v1, v2, v3; | |
1038 | v1 = vec_add(v2,v3); | |
1039 | return 0; | |
1040 | } | |
1041 | EOF | |
1042 | fi | |
ab6c65f6 | 1043 | |
29799f8b | 1044 | # mmi only available on mips |
d46aba26 LS |
1045 | if test $mmi = "default"; then |
1046 | if test $cpu = "mips"; then | |
1047 | mmi="yes" | |
1048 | else | |
1049 | mmi="no" | |
1050 | fi | |
1051 | fi | |
1052 | ||
29799f8b | 1053 | # check if our compiler supports mmi |
57bd82d4 | 1054 | enabled mmi && check_cc <<EOF || mmi="no" |
d46aba26 LS |
1055 | int main(void) { |
1056 | __asm__ ("lq \$2, 0(\$2)"); | |
1057 | return 0; | |
1058 | } | |
1059 | EOF | |
57bd82d4 MR |
1060 | |
1061 | # test gcc version to see if vector builtins can be used | |
1062 | # currently only used on i386 for MMX builtins | |
1063 | check_cc -msse <<EOF && builtin_vector=yes || builtin_vector=no | |
1064 | #include <xmmintrin.h> | |
1065 | int main(void) { | |
1066 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) | |
1067 | return 0; | |
1068 | #else | |
1069 | #error no vector builtins | |
1070 | #endif | |
1071 | } | |
1072 | EOF | |
1073 | ||
1074 | # test for mm3dnow.h | |
1075 | test "$cpu" = "x86_64" && march=k8 || march=athlon | |
1076 | check_cc -march=$march <<EOF && mm3dnow=yes || mm3dnow=no | |
1077 | #include <mm3dnow.h> | |
1078 | int main(void) { | |
1079 | __m64 b1; | |
1080 | b1 = _m_pswapd(b1); | |
1081 | _m_femms(); | |
1082 | return 0; | |
1083 | } | |
1084 | EOF | |
d46aba26 | 1085 | |
ac44871c | 1086 | if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then |
320d060a DB |
1087 | if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then |
1088 | cat <<EOF | |
1089 | You can only build one library type at once on MinGW. | |
1090 | Specify --disable-static --enable-shared to only build | |
1091 | the shared libraries. To build only the static libraries | |
65f51a41 | 1092 | you do not need to pass additional options. |
320d060a DB |
1093 | EOF |
1094 | exit 1 | |
1095 | fi | |
732d9245 | 1096 | v4l="no" |
0a7b514f | 1097 | v4l2="no" |
6beefa40 | 1098 | bktr="no" |
732d9245 | 1099 | audio_oss="no" |
8aa3ee32 | 1100 | dv1394="no" |
f02be79d | 1101 | dc1394="no" |
951bf3e6 | 1102 | ffserver="no" |
732d9245 | 1103 | network="no" |
f25fc9b1 MR |
1104 | if test "$mingwce" = "yes"; then |
1105 | protocols="no" | |
1106 | fi | |
951bf3e6 FB |
1107 | SLIBPREF="" |
1108 | SLIBSUF=".dll" | |
1109 | EXESUF=".exe" | |
eba9ae3c GB |
1110 | if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi |
1111 | if test "$force_libdir" != yes; then bindir="$prefix"; fi | |
732d9245 BE |
1112 | fi |
1113 | ||
57bd82d4 MR |
1114 | # --- |
1115 | # big/little-endian test | |
487a54d7 | 1116 | if test -z "$cross_prefix" ; then |
57bd82d4 | 1117 | check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes" |
a3999908 MN |
1118 | #include <inttypes.h> |
1119 | int main(int argc, char ** argv){ | |
bb270c08 DB |
1120 | volatile uint32_t i=0x01234567; |
1121 | return (*((uint8_t*)(&i))) == 0x67; | |
a3999908 MN |
1122 | } |
1123 | EOF | |
487a54d7 | 1124 | else |
f25fc9b1 MR |
1125 | # programs cannot be launched if cross compiling, so make a static guess |
1126 | if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then | |
1127 | bigendian="yes" | |
1128 | fi | |
487a54d7 FB |
1129 | fi |
1130 | ||
a3999908 | 1131 | # --- |
7f965c1c | 1132 | # *inttypes.h* test |
dcd479c0 | 1133 | check_header inttypes.h || inttypes=no |
7f965c1c CF |
1134 | |
1135 | # --- | |
b5c950c4 | 1136 | # *int_fast* test |
dcd479c0 | 1137 | check_cc <<EOF || emu_fast_int=yes |
b5c950c4 MN |
1138 | #include <inttypes.h> |
1139 | int main(int argc, char ** argv){ | |
bb270c08 DB |
1140 | volatile uint_fast64_t i=0x01234567; |
1141 | return 0; | |
b5c950c4 MN |
1142 | } |
1143 | EOF | |
1144 | ||
b5c950c4 | 1145 | # --- |
3d204385 NK |
1146 | # check availability of some header files |
1147 | ||
3d204385 NK |
1148 | _memalign=no |
1149 | _malloc_h=no | |
dcd479c0 MR |
1150 | if check_header malloc.h; then |
1151 | _malloc_h=yes | |
1152 | _memalign=yes | |
1153 | check_func memalign || _memalign="no" | |
3d204385 NK |
1154 | fi |
1155 | ||
8bf5d58f | 1156 | if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then |
57bd82d4 | 1157 | die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack." |
8bf5d58f MN |
1158 | fi |
1159 | ||
dcd479c0 | 1160 | check_func localtime_r && localtime_r=yes || localtime_r=no |
57bd82d4 MR |
1161 | enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no" |
1162 | enabled lzo && enabled gpl && check_lib lzo1x.h lzo_version -llzo || lzo="no" | |
1163 | ||
1164 | # check for some common methods of building with pthread support | |
1165 | # do this before the optional library checks as some of them require pthreads | |
1166 | if enabled pthreads; then | |
1167 | { check_cflags -pthread && check_ldflags -pthread; } || | |
1168 | { check_cflags -pthreads && check_ldflags -pthreads; } || | |
1169 | check_lib pthread.h pthread_create -lpthread || | |
1170 | check_func pthread_create || | |
1171 | die "ERROR: can't find pthreads library" | |
1172 | fi | |
1173 | ||
1174 | # these are off by default, so fail if requested and not available | |
1175 | enabled dts && require libdts dts.h dts_init -ldts | |
1176 | enabled libgsm && require libgsm gsm.h gsm_create -lgsm | |
1177 | enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame | |
1178 | enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg | |
1179 | enabled vorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc | |
1180 | enabled theora && require libtheora theora/theora.h theora_info_init -ltheora | |
57bd82d4 MR |
1181 | enabled xvid && require XviD xvid.h xvid_global -lxvidcore |
1182 | enabled x264 && require x264 x264.h x264_encoder_open -lx264 | |
1183 | enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 | |
1184 | enabled sunmlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib | |
e0f80bd7 | 1185 | |
3b9bee88 MR |
1186 | # Ugh, faac uses stdcall calling convention on win32 so we can't use |
1187 | # the generic test functions | |
1188 | if enabled faac; then | |
1189 | save_flags | |
1190 | temp_extralibs -lfaac | |
1191 | check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found" | |
1192 | #include <stdint.h> | |
1193 | #include <faac.h> | |
1194 | int main(){ | |
1195 | char *id, *cpr; | |
1196 | faacEncGetVersion(&id, &cpr); | |
1197 | return 0; | |
1198 | } | |
1199 | EOF | |
1200 | restore_flags | |
1201 | fi | |
1202 | ||
87f1c97e MR |
1203 | # Ugh, recent faad2 versions have renamed all functions and #define the |
1204 | # old names in faad.h. Generic tests won't work. | |
1205 | if enabled faad; then | |
1206 | save_flags | |
1207 | temp_extralibs -lfaad | |
1208 | check_ld <<EOF && add_extralibs -lfaad || die "ERROR: libfaad not found" | |
1209 | #include <faad.h> | |
1210 | int main(){ | |
1211 | faacDecOpen(); | |
1212 | return 0; | |
1213 | } | |
1214 | EOF | |
1215 | restore_flags | |
1216 | fi | |
1217 | ||
95e2ce4a | 1218 | # test for lrintf in math.h |
dcd479c0 | 1219 | check_exec <<EOF && have_lrintf=yes || have_lrintf=no |
95e2ce4a MN |
1220 | #define _ISOC9X_SOURCE 1 |
1221 | #include <math.h> | |
1222 | int main( void ) { return (lrintf(3.999f) > 0)?0:1; } | |
1223 | EOF | |
1224 | ||
c13e1abd FH |
1225 | _restrict= |
1226 | for restrict_keyword in restrict __restrict__ __restrict; do | |
57bd82d4 | 1227 | check_cc <<EOF && _restrict=$restrict_keyword && break |
dcd479c0 MR |
1228 | void foo(char * $restrict_keyword p); |
1229 | EOF | |
c13e1abd FH |
1230 | done |
1231 | ||
a8721c09 FB |
1232 | # dlopen/dlfcn.h probing |
1233 | ||
dcd479c0 | 1234 | check_header dlfcn.h && dlfcn=yes |
a8721c09 | 1235 | |
dcd479c0 MR |
1236 | temp_extralibs -ldl |
1237 | if check_func dlopen; then | |
1238 | dlopen=yes | |
1239 | ldl=-ldl | |
a8721c09 | 1240 | fi |
dcd479c0 | 1241 | restore_flags |
a8721c09 | 1242 | |
dcd479c0 MR |
1243 | if check_func dlopen; then |
1244 | dlopen=yes | |
1245 | ldl= | |
a8721c09 FB |
1246 | fi |
1247 | ||
f25fc9b1 MR |
1248 | if test "$vhook" = "default"; then |
1249 | vhook="$dlopen" | |
a8721c09 FB |
1250 | fi |
1251 | ||
bfd2edeb | 1252 | if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then |
57bd82d4 | 1253 | add_extralibs $ldl |
bfd2edeb MN |
1254 | fi |
1255 | ||
1256 | ||
a86b921c | 1257 | ########################################## |
29799f8b | 1258 | # imlib check |
a86b921c | 1259 | |
dcd479c0 MR |
1260 | temp_extralibs -lImlib2 |
1261 | check_ld <<EOF && imlib2=yes || imlib2=no | |
a8721c09 FB |
1262 | #include <X11/Xlib.h> |
1263 | #include <Imlib2.h> | |
1264 | int main( void ) { return (int) imlib_load_font("foo"); } | |
1265 | EOF | |
dcd479c0 | 1266 | restore_flags |
52b41d7f | 1267 | |
a86b921c | 1268 | ########################################## |
29799f8b | 1269 | # FreeType check |
a86b921c | 1270 | |
04511d53 | 1271 | freetype2=no |
e2a5fd20 | 1272 | if test "x$targetos" != "xBeOS"; then |
e2a3cd59 | 1273 | if (freetype-config --version) >/dev/null 2>&1 ; then |
dcd479c0 MR |
1274 | temp_cflags `freetype-config --cflags` |
1275 | temp_extralibs `freetype-config --libs` | |
1276 | check_ld <<EOF && freetype2=yes | |
1277 | #include <ft2build.h> | |
1278 | int main( void ) { return (int) FT_Init_FreeType(0); } | |
1279 | EOF | |
1280 | restore_flags | |
dee076fc | 1281 | fi |
04511d53 PG |
1282 | fi |
1283 | ||
a86b921c | 1284 | ########################################## |
29799f8b | 1285 | # SDL check |
a86b921c | 1286 | |
a86b921c FB |
1287 | sdl_too_old=no |
1288 | sdl=no | |
6a1a892f FD |
1289 | SDL_CONFIG="${cross_prefix}sdl-config" |
1290 | if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then | |
dcd479c0 MR |
1291 | temp_cflags `"${SDL_CONFIG}" --cflags` |
1292 | temp_extralibs `"${SDL_CONFIG}" --libs` | |
1293 | check_ld <<EOF | |
1294 | #include <SDL.h> | |
1295 | #undef main /* We don't want SDL to override our main() */ | |
1296 | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } | |
1297 | EOF | |
dcd479c0 MR |
1298 | if test $? = 0; then |
1299 | _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'` | |
29f3b38a | 1300 | if test "$_sdlversion" -lt 121 ; then |
dcd479c0 MR |
1301 | sdl_too_old=yes |
1302 | else | |
1303 | sdl=yes | |
29f3b38a MR |
1304 | check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no |
1305 | #include <SDL.h> | |
1306 | int main(void){ | |
1307 | const SDL_VideoInfo *vi = SDL_GetVideoInfo(); | |
1308 | int w = vi->current_w; | |
1309 | return 0; | |
1310 | } | |
1311 | EOF | |
dcd479c0 MR |
1312 | fi |
1313 | fi | |
29f3b38a | 1314 | restore_flags |
c3f6b472 | 1315 | fi |
a86b921c | 1316 | |
57bd82d4 MR |
1317 | enabled sdl || ffplay=no |
1318 | ||
146ea952 | 1319 | ########################################## |
29799f8b | 1320 | # texi2html check |
146ea952 NB |
1321 | |
1322 | texi2html=no | |
e2a3cd59 | 1323 | if (texi2html -version) >/dev/null 2>&1; then |
146ea952 NB |
1324 | texi2html=yes |
1325 | fi | |
1326 | ||
7a91333f | 1327 | ########################################## |
29799f8b | 1328 | # IPv6 check |
7a91333f | 1329 | |
57bd82d4 | 1330 | enabled network && check_ld <<EOF && ipv6=yes || ipv6=no |
7a91333f HZ |
1331 | #include <sys/types.h> |
1332 | #include <sys/socket.h> | |
1333 | #include <netinet/in.h> | |
1334 | #include <netdb.h> | |
1335 | int main( void ) { | |
1336 | struct sockaddr_storage saddr; | |
1337 | struct ipv6_mreq mreq6; | |
1338 | getaddrinfo(0,0,0,0); | |
1339 | getnameinfo(0,0,0,0,0,0,0); | |
12fe88b4 | 1340 | IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0); |
7a91333f HZ |
1341 | } |
1342 | EOF | |
1343 | ||
47f38850 | 1344 | # check for video4linux2 --- V4L2_PIX_FMT_YUV420 |
57bd82d4 | 1345 | enabled v4l2 && check_cc <<EOF || v4l2="no" |
84fe9963 | 1346 | #include <sys/time.h> |
f743a062 LA |
1347 | #include <asm/types.h> |
1348 | #include <linux/videodev2.h> | |
47f38850 | 1349 | int dummy = V4L2_PIX_FMT_YUV420; |
490c189b | 1350 | struct v4l2_buffer dummy1; |
47f38850 | 1351 | EOF |
47f38850 | 1352 | |
57bd82d4 MR |
1353 | enabled debug && add_cflags -g |
1354 | ||
1355 | # add some useful compiler flags if supported | |
1356 | check_cflags -Wdeclaration-after-statement | |
dcd479c0 MR |
1357 | check_cflags -Wall |
1358 | check_cflags -Wno-switch | |
cf9d24ad | 1359 | |
57bd82d4 MR |
1360 | # add some linker flags |
1361 | check_ldflags '-Wl,--as-needed' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavformat' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavutil' | |
94a3401e | 1362 | |
57bd82d4 MR |
1363 | # not all compilers support -Os |
1364 | test "$optimize" = "small" && check_cflags -Os | |
cddf3f45 | 1365 | |
57bd82d4 | 1366 | if enabled optimize; then |
b2924696 | 1367 | if test -n "`$cc -v 2>&1 | grep xlc`"; then |
bb270c08 DB |
1368 | CFLAGS="$CFLAGS -O5" |
1369 | LDFLAGS="$LDFLAGS -O5" | |
cf9d24ad | 1370 | else |
bb270c08 | 1371 | CFLAGS="-O3 $CFLAGS" |
cf9d24ad | 1372 | fi |
cddf3f45 GM |
1373 | fi |
1374 | ||
80581e98 MN |
1375 | # PIC flags for shared library objects where they are needed |
1376 | if test "$lshared" = "yes" ; then | |
f25fc9b1 MR |
1377 | # LIBOBJFLAGS may have already been set in the OS configuration |
1378 | if test -z "$LIBOBJFLAGS" ; then | |
1379 | if test "$cpu" = "x86_64" -o "$cpu" = "ia64" -o "$cpu" = "alpha" ; then | |
1380 | LIBOBJFLAGS="\$(PIC)" | |
1381 | fi | |
80581e98 | 1382 | fi |
80581e98 MN |
1383 | fi |
1384 | ||
951bf3e6 | 1385 | if test x"$bindir" = x""; then |
f25fc9b1 | 1386 | bindir="${prefix}/bin" |
951bf3e6 FB |
1387 | fi |
1388 | ||
cc973ecb | 1389 | if test x"$libdir" = x""; then |
f25fc9b1 | 1390 | libdir="${prefix}/lib" |
cc973ecb LB |
1391 | fi |
1392 | ||
1d67a1d4 | 1393 | if test x"$incdir" = x""; then |
f25fc9b1 | 1394 | incdir="${prefix}/include/ffmpeg" |
1d67a1d4 DB |
1395 | fi |
1396 | ||
23a65308 | 1397 | if test x"$mandir" = x""; then |
f25fc9b1 | 1398 | mandir="${prefix}/man" |
23a65308 FB |
1399 | fi |
1400 | ||
29799f8b DB |
1401 | echo "install prefix $prefix" |
1402 | echo "source path $source_path" | |
de6d9b64 | 1403 | echo "C compiler $cc" |
4a908fbc | 1404 | echo "make $make" |
a4adb608 | 1405 | echo "CPU $cpu ($tune)" |
eb94aca9 | 1406 | if test "$BUILDSUF" != ""; then |
f25fc9b1 | 1407 | echo "build suffix $BUILDSUF" |
eb94aca9 | 1408 | fi |
29799f8b | 1409 | echo "big-endian $bigendian" |
7f965c1c | 1410 | echo "inttypes.h $inttypes" |
b5c950c4 | 1411 | echo "broken inttypes.h $emu_fast_int" |
053dea12 | 1412 | if test $cpu = "x86" -o $cpu = "x86_64"; then |
f25fc9b1 MR |
1413 | echo "MMX enabled $mmx" |
1414 | echo "Vector Builtins $builtin_vector" | |
1415 | echo "3DNow! Builtins $mm3dnow" | |
e41e8342 | 1416 | fi |
eba9ae3c | 1417 | if test $cpu = "armv4l"; then |
f25fc9b1 | 1418 | echo "IWMMXT enabled $iwmmxt" |
eba9ae3c | 1419 | fi |
e41e8342 | 1420 | if test $cpu = "mips"; then |
f25fc9b1 | 1421 | echo "MMI enabled $mmi" |
e41e8342 FB |
1422 | fi |
1423 | if test $cpu = "powerpc"; then | |
f25fc9b1 | 1424 | echo "AltiVec enabled $altivec" |
e41e8342 | 1425 | fi |
de6d9b64 | 1426 | echo "gprof enabled $gprof" |
0147f198 | 1427 | echo "zlib enabled $zlib" |
e0f80bd7 | 1428 | echo "lzo enabled $lzo" |
bb4c2140 | 1429 | echo "libgsm enabled $libgsm" |
a6741398 | 1430 | echo "mp3lame enabled $mp3lame" |
9146ca37 | 1431 | echo "libogg enabled $libogg" |
29799f8b DB |
1432 | echo "Vorbis enabled $vorbis" |
1433 | echo "Theora enabled $theora" | |
1434 | echo "FAAD enabled $faad" | |
445ad18d | 1435 | echo "faadbin enabled $faadbin" |
29799f8b DB |
1436 | echo "FAAC enabled $faac" |
1437 | echo "XviD enabled $xvid" | |
6662ec29 | 1438 | echo "x264 enabled $x264" |
5cbcf02c | 1439 | echo "a52 support $a52" |
57514323 | 1440 | echo "a52 dlopened $a52bin" |
29799f8b | 1441 | echo "DTS support $dts" |
bba9b16c | 1442 | echo "pp support $pp" |
cddf3f45 | 1443 | echo "debug symbols $debug" |
65d1bea2 | 1444 | echo "strip symbols $dostrip" |
cddf3f45 | 1445 | echo "optimize $optimize" |
320d060a | 1446 | echo "static $lstatic" |
1ddf5ba1 | 1447 | echo "shared $lshared" |
29799f8b | 1448 | echo "video hooking $vhook" |
a86b921c FB |
1449 | echo "SDL support $sdl" |
1450 | if test $sdl_too_old = "yes"; then | |
f25fc9b1 | 1451 | echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support." |
a86b921c | 1452 | fi |
68892110 | 1453 | |
f25fc9b1 MR |
1454 | if test "$vhook" = "yes"; then |
1455 | echo "Imlib2 support $imlib2" | |
1456 | echo "FreeType support $freetype2" | |
68892110 | 1457 | fi |
f80f7964 | 1458 | echo "Sun medialib support" $sunmlib |
9c3d33d6 | 1459 | echo "pthreads support" $pthreads |
bc634f6f ZK |
1460 | echo "AMR-NB float support" $amr_nb |
1461 | echo "AMR-NB fixed support" $amr_nb_fixed | |
d663a1fd | 1462 | echo "AMR-WB float support" $amr_wb |
2a515c08 | 1463 | echo "AMR-WB IF2 support" $amr_if2 |
7a91333f HZ |
1464 | echo "network support $network" |
1465 | if test "$network" = "yes" ; then | |
f25fc9b1 | 1466 | echo "IPv6 support $ipv6" |
7a91333f | 1467 | fi |
b2e3c528 | 1468 | if test "$gpl" = "no" ; then |
f25fc9b1 | 1469 | echo "License: LGPL" |
b2e3c528 | 1470 | else |
f25fc9b1 | 1471 | echo "License: GPL" |
b2e3c528 | 1472 | fi |
de6d9b64 | 1473 | |
29799f8b | 1474 | echo "Creating config.mak and config.h..." |
de6d9b64 | 1475 | |
f255e0ab MB |
1476 | date >> config.log |
1477 | echo " $0 $FFMPEG_CONFIGURATION" >> config.log | |
29799f8b DB |
1478 | echo "# Automatically generated by configure - do not modify!" > config.mak |
1479 | echo "/* Automatically generated by configure - do not modify! */" > $TMPH | |
f255e0ab | 1480 | echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH |
de6d9b64 | 1481 | |
9a695e98 DB |
1482 | echo "prefix=\$(DESTDIR)$prefix" >> config.mak |
1483 | echo "libdir=\$(DESTDIR)$libdir" >> config.mak | |
1d67a1d4 | 1484 | echo "incdir=\$(DESTDIR)$incdir" >> config.mak |
9a695e98 DB |
1485 | echo "bindir=\$(DESTDIR)$bindir" >> config.mak |
1486 | echo "mandir=\$(DESTDIR)$mandir" >> config.mak | |
4a908fbc | 1487 | echo "MAKE=$make" >> config.mak |
980fc7b8 FB |
1488 | echo "CC=$cc" >> config.mak |
1489 | echo "AR=$ar" >> config.mak | |
be7109c1 | 1490 | echo "RANLIB=$ranlib" >> config.mak |
65d1bea2 | 1491 | if test "$dostrip" = "yes" ; then |
f25fc9b1 MR |
1492 | echo "STRIP=$strip" >> config.mak |
1493 | echo "INSTALLSTRIP=$installstrip" >> config.mak | |
65d1bea2 | 1494 | else |
f25fc9b1 MR |
1495 | echo "STRIP=echo ignoring strip" >> config.mak |
1496 | echo "INSTALLSTRIP=" >> config.mak | |
65d1bea2 | 1497 | fi |
75388c74 | 1498 | |
29799f8b | 1499 | # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building |
75388c74 | 1500 | # shared modules on OS/X (vhook/Makefile). |
57bd82d4 MR |
1501 | SHCFLAGS="$CFLAGS" |
1502 | test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic | |
75388c74 | 1503 | |
a9b3f630 | 1504 | echo "OPTFLAGS=$CFLAGS" >> config.mak |
75388c74 | 1505 | echo "SHCFLAGS=$SHCFLAGS">>config.mak |
0f3cb305 | 1506 | echo "LDFLAGS=$LDFLAGS" >> config.mak |
f39e56a8 | 1507 | echo "LDCONFIG=$LDCONFIG" >> config.mak |
4baca069 | 1508 | echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak |
e1707f52 | 1509 | echo "SHFLAGS=$SHFLAGS" >> config.mak |
80581e98 | 1510 | echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak |
b12f8273 | 1511 | echo "BUILD_STATIC=$lstatic" >> config.mak |
eb94aca9 | 1512 | echo "BUILDSUF=$BUILDSUF" >> config.mak |
f3ec2d46 | 1513 | echo "LIBPREF=$LIBPREF" >> config.mak |
eb94aca9 | 1514 | echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak |
320d060a DB |
1515 | if test "$lstatic" = "yes" ; then |
1516 | echo "LIB=$LIB" >> config.mak | |
1a44a8b6 AS |
1517 | else # Some Make complain if this variable does not exist. |
1518 | echo "LIB=" >> config.mak | |
320d060a | 1519 | fi |
f3ec2d46 | 1520 | echo "SLIBPREF=$SLIBPREF" >> config.mak |
eb94aca9 CY |
1521 | echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak |
1522 | echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak | |
6852ac95 | 1523 | echo "TARGET_OS=$TARGET_OS" >> config.mak |
57514323 | 1524 | if test "$cpu" = "x86" ; then |
980fc7b8 | 1525 | echo "TARGET_ARCH_X86=yes" >> config.mak |
045ed63f | 1526 | echo "#define ARCH_X86 1" >> $TMPH |
053dea12 AJ |
1527 | elif test "$cpu" = "x86_64" ; then |
1528 | echo "TARGET_ARCH_X86_64=yes" >> config.mak | |
1529 | echo "#define ARCH_X86_64 1" >> $TMPH | |
0f3cb305 | 1530 | elif test "$cpu" = "armv4l" ; then |
6ed7422a | 1531 | echo "TARGET_ARCH_ARMV4L=yes" >> config.mak |
045ed63f | 1532 | echo "#define ARCH_ARMV4L 1" >> $TMPH |
0f3cb305 | 1533 | elif test "$cpu" = "alpha" ; then |
91d1f1a4 | 1534 | echo "TARGET_ARCH_ALPHA=yes" >> config.mak |
045ed63f | 1535 | echo "#define ARCH_ALPHA 1" >> $TMPH |
35fedfc3 PG |
1536 | elif test "$cpu" = "sparc64" ; then |
1537 | echo "TARGET_ARCH_SPARC64=yes" >> config.mak | |
1538 | echo "#define ARCH_SPARC64 1" >> $TMPH | |
bb476ff3 JM |
1539 | echo "TARGET_ARCH_SPARC=yes" >> config.mak |
1540 | echo "#define ARCH_SPARC 1" >> $TMPH | |
1541 | elif test "$cpu" = "sparc" ; then | |
1542 | echo "TARGET_ARCH_SPARC=yes" >> config.mak | |
1543 | echo "#define ARCH_SPARC 1" >> $TMPH | |
0f3cb305 FB |
1544 | elif test "$cpu" = "powerpc" ; then |
1545 | echo "TARGET_ARCH_POWERPC=yes" >> config.mak | |
1546 | echo "#define ARCH_POWERPC 1" >> $TMPH | |
9007f514 RD |
1547 | if test $POWERPCMODE = "32bits"; then |
1548 | echo "#define POWERPC_MODE_32BITS 1" >> $TMPH | |
1549 | else | |
1550 | echo "#define POWERPC_MODE_64BITS 1" >> $TMPH | |
1551 | fi | |
e45a2872 RD |
1552 | if test "$powerpc_perf" = "yes"; then |
1553 | echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH | |
1554 | fi | |
d46aba26 LS |
1555 | elif test "$cpu" = "mips" ; then |
1556 | echo "TARGET_ARCH_MIPS=yes" >> config.mak | |
1557 | echo "#define ARCH_MIPS 1" >> $TMPH | |
bdb2e37c AB |
1558 | elif test "$cpu" = "sh4" ; then |
1559 | echo "TARGET_ARCH_SH4=yes" >> config.mak | |
1560 | echo "#define ARCH_SH4 1" >> $TMPH | |
67860b26 SH |
1561 | elif test "$cpu" = "parisc" ; then |
1562 | echo "TARGET_ARCH_PARISC=yes" >> config.mak | |
1563 | echo "#define ARCH_PARISC 1" >> $TMPH | |
1564 | elif test "$cpu" = "s390" ; then | |
1565 | echo "TARGET_ARCH_S390=yes" >> config.mak | |
1566 | echo "#define ARCH_S390 1" >> $TMPH | |
1567 | elif test "$cpu" = "m68k" ; then | |
1568 | echo "TARGET_ARCH_M68K=yes" >> config.mak | |
1569 | echo "#define ARCH_M68K 1" >> $TMPH | |
1570 | elif test "$cpu" = "ia64" ; then | |
1571 | echo "TARGET_ARCH_IA64=yes" >> config.mak | |
1572 | echo "#define ARCH_IA64 1" >> $TMPH | |
bdb2e37c | 1573 | fi |
a4adb608 | 1574 | echo "#define TUNECPU $TUNECPU" >> $TMPH |
0f3cb305 FB |
1575 | if test "$bigendian" = "yes" ; then |
1576 | echo "WORDS_BIGENDIAN=yes" >> config.mak | |
1577 | echo "#define WORDS_BIGENDIAN 1" >> $TMPH | |
91d1f1a4 | 1578 | fi |
d2a9bddd MN |
1579 | if test "$inttypes" != "yes" ; then |
1580 | echo "#define EMULATE_INTTYPES 1" >> $TMPH | |
7f965c1c | 1581 | fi |
b5c950c4 | 1582 | if test "$emu_fast_int" = "yes" ; then |
19d053c5 | 1583 | echo "#define EMULATE_FAST_INT 1" >> $TMPH |
b5c950c4 | 1584 | fi |
57514323 | 1585 | if test "$mmx" = "yes" ; then |
980fc7b8 | 1586 | echo "TARGET_MMX=yes" >> config.mak |
045ed63f | 1587 | echo "#define HAVE_MMX 1" >> $TMPH |
e82c5a8c | 1588 | echo "#define __CPU__ 586" >> $TMPH |
de6d9b64 | 1589 | fi |
52b41d7f FB |
1590 | if test "$builtin_vector" = "yes" ; then |
1591 | echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak | |
1592 | echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH | |
1593 | fi | |
82eb4b0f ZM |
1594 | if test "$mm3dnow" = "yes" ; then |
1595 | echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak | |
1596 | echo "#define HAVE_MM3DNOW 1" >> $TMPH | |
1597 | fi | |
eba9ae3c GB |
1598 | if test "$iwmmxt" = "yes" ; then |
1599 | echo "TARGET_IWMMXT=yes" >> config.mak | |
1600 | echo "#define HAVE_IWMMXT 1" >> $TMPH | |
1601 | fi | |
d46aba26 LS |
1602 | if test "$mmi" = "yes" ; then |
1603 | echo "TARGET_MMI=yes" >> config.mak | |
1604 | echo "#define HAVE_MMI 1" >> $TMPH | |
1605 | fi | |
ab6c65f6 BF |
1606 | if test "$altivec" = "yes" ; then |
1607 | echo "TARGET_ALTIVEC=yes" >> config.mak | |
1608 | echo "#define HAVE_ALTIVEC 1" >> $TMPH | |
db40a39a MN |
1609 | echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH |
1610 | echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH | |
a9a07762 MN |
1611 | if test "$_altivec_h" = "yes" ; then |
1612 | echo "#define HAVE_ALTIVEC_H 1" >> $TMPH | |
1613 | else | |
e67e14d5 | 1614 | echo "#undef HAVE_ALTIVEC_H" >> $TMPH |
a9a07762 | 1615 | fi |
ab6c65f6 | 1616 | fi |
57514323 | 1617 | if test "$gprof" = "yes" ; then |
980fc7b8 | 1618 | echo "TARGET_GPROF=yes" >> config.mak |
045ed63f | 1619 | echo "#define HAVE_GPROF 1" >> $TMPH |
de6d9b64 | 1620 | fi |
5e4639e2 GM |
1621 | if test "$localtime_r" = "yes" ; then |
1622 | echo "#define HAVE_LOCALTIME_R 1" >> $TMPH | |
5e4639e2 | 1623 | fi |
68892110 PG |
1624 | if test "$imlib2" = "yes" ; then |
1625 | echo "HAVE_IMLIB2=yes" >> config.mak | |
1626 | fi | |
04511d53 PG |
1627 | if test "$freetype2" = "yes" ; then |
1628 | echo "HAVE_FREETYPE2=yes" >> config.mak | |
1629 | fi | |
f80f7964 RS |
1630 | if test "$sunmlib" = "yes" ; then |
1631 | echo "HAVE_MLIB=yes" >> config.mak | |
1632 | echo "#define HAVE_MLIB 1" >> $TMPH | |
f80f7964 | 1633 | fi |
9c3d33d6 MN |
1634 | if test "$pthreads" = "yes" ; then |
1635 | echo "HAVE_PTHREADS=yes" >> config.mak | |
1636 | echo "#define HAVE_PTHREADS 1" >> $TMPH | |
2450cff2 | 1637 | echo "#define HAVE_THREADS 1" >> $TMPH |
9c3d33d6 | 1638 | fi |
a86b921c FB |
1639 | if test "$sdl" = "yes" ; then |
1640 | echo "CONFIG_SDL=yes" >> config.mak | |
6a1a892f FD |
1641 | echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak |
1642 | echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak | |
29f3b38a MR |
1643 | if test "$sdl_video_size" = "yes"; then |
1644 | echo "#define HAVE_SDL_VIDEO_SIZE 1" >> $TMPH | |
1645 | fi | |
a86b921c | 1646 | fi |
146ea952 NB |
1647 | if test "$texi2html" = "yes"; then |
1648 | echo "BUILD_DOC=yes" >> config.mak | |
1649 | fi | |
95e2ce4a MN |
1650 | if test "$have_lrintf" = "yes" ; then |
1651 | echo "#define HAVE_LRINTF 1" >> $TMPH | |
1652 | fi | |
68892110 PG |
1653 | if test "$vhook" = "yes" ; then |
1654 | echo "BUILD_VHOOK=yes" >> config.mak | |
1655 | echo "#define HAVE_VHOOK 1" >> $TMPH | |
68892110 | 1656 | fi |
5a872801 | 1657 | |
6d9a2421 | 1658 | pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'` |
5a872801 LB |
1659 | lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'` |
1660 | lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'` | |
1661 | lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'` | |
1662 | ||
1663 | ||
1664 | ||
57514323 | 1665 | if test "$lshared" = "yes" ; then |
320d060a | 1666 | echo "#define BUILD_SHARED_AV 1" >> $TMPH |
0319c531 | 1667 | echo "BUILD_SHARED=yes" >> config.mak |
97006039 | 1668 | echo "PIC=-fPIC -DPIC" >> config.mak |
39503a27 | 1669 | echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak |
5a872801 | 1670 | echo "SPPVERSION=$lavc_version" >> config.mak |
39503a27 | 1671 | echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak |
5a872801 | 1672 | echo "LAVCVERSION=$lavc_version" >> config.mak |
39503a27 | 1673 | echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak |
5a872801 | 1674 | echo "LAVFVERSION=$lavf_version" >> config.mak |
39503a27 | 1675 | echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak |
5a872801 | 1676 | echo "LAVUVERSION=$lavu_version" >> config.mak |
4bdd05e7 | 1677 | echo "SLIBNAME=${SLIBNAME}" >> config.mak |
f3b60109 DB |
1678 | echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak |
1679 | echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak | |
0319c531 | 1680 | fi |
ef0bc4c9 | 1681 | echo "EXTRALIBS=$extralibs" >> config.mak |
d2845d68 | 1682 | |
29799f8b | 1683 | # If you do not want to use encoders, disable them. |
045ed63f | 1684 | echo "#define CONFIG_ENCODERS 1" >> $TMPH |
d771bcae FB |
1685 | echo "CONFIG_ENCODERS=yes" >> config.mak |
1686 | ||
29799f8b | 1687 | # If you do not want to use decoders, disable them. |
045ed63f | 1688 | echo "#define CONFIG_DECODERS 1" >> $TMPH |
d771bcae FB |
1689 | echo "CONFIG_DECODERS=yes" >> config.mak |
1690 | ||
a9e35095 DB |
1691 | # muxers |
1692 | if test "$muxers" = "yes" ; then | |
1693 | echo "#define CONFIG_MUXERS 1" >> $TMPH | |
1694 | echo "CONFIG_MUXERS=yes" >> config.mak | |
1695 | fi | |
1696 | ||
1697 | # demuxers | |
1698 | if test "$demuxers" = "yes" ; then | |
1699 | echo "#define CONFIG_DEMUXERS 1" >> $TMPH | |
1700 | echo "CONFIG_DEMUXERS=yes" >> config.mak | |
1701 | fi | |
1702 | ||
5cbcf02c FB |
1703 | # AC3 |
1704 | if test "$a52" = "yes" ; then | |
1705 | echo "#define CONFIG_AC3 1" >> $TMPH | |
1706 | echo "CONFIG_AC3=yes" >> config.mak | |
d771bcae | 1707 | |
5cbcf02c FB |
1708 | if test "$a52bin" = "yes" ; then |
1709 | echo "#define CONFIG_A52BIN 1" >> $TMPH | |
1710 | echo "CONFIG_A52BIN=yes" >> config.mak | |
1711 | fi | |
1712 | fi | |
1713 | ||
23c99253 MN |
1714 | # DTS |
1715 | if test "$dts" = "yes" ; then | |
1716 | echo "#define CONFIG_DTS 1" >> $TMPH | |
1717 | echo "CONFIG_DTS=yes" >> config.mak | |
1718 | fi | |
1719 | ||
bba9b16c MN |
1720 | # PP |
1721 | if test "$pp" = "yes" ; then | |
1722 | echo "#define CONFIG_PP 1" >> $TMPH | |
1723 | echo "CONFIG_PP=yes" >> config.mak | |
bba9b16c MN |
1724 | fi |
1725 | ||
29799f8b | 1726 | # MPEG audio high precision mode |
1eb2212e FB |
1727 | if test "$mpegaudio_hp" = "yes" ; then |
1728 | echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH | |
1729 | fi | |
1730 | ||
5cbcf02c FB |
1731 | if test "$v4l" = "yes" ; then |
1732 | echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH | |
1733 | echo "CONFIG_VIDEO4LINUX=yes" >> config.mak | |
1734 | fi | |
1735 | ||
0a7b514f LA |
1736 | if test "$v4l2" = "yes" ; then |
1737 | echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH | |
1738 | echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak | |
1739 | fi | |
1740 | ||
6beefa40 MN |
1741 | if test "$bktr" = "yes" ; then |
1742 | echo "#define CONFIG_BKTR 1" >> $TMPH | |
1743 | echo "CONFIG_BKTR=yes" >> config.mak | |
1744 | fi | |
1745 | ||
8aa3ee32 MK |
1746 | if test "$dv1394" = "yes" ; then |
1747 | echo "#define CONFIG_DV1394 1" >> $TMPH | |
1748 | echo "CONFIG_DV1394=yes" >> config.mak | |
1749 | fi | |
1750 | ||
f02be79d RS |
1751 | if test "$dc1394" = "yes" ; then |
1752 | echo "#define CONFIG_DC1394 1" >> $TMPH | |
1753 | echo "CONFIG_DC1394=yes" >> config.mak | |
1754 | fi | |
1755 | ||
adbc0510 PG |
1756 | if test "$dlopen" = "yes" ; then |
1757 | echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH | |
1758 | fi | |
1759 | ||
1760 | if test "$dlfcn" = "yes" ; then | |
1761 | echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH | |
1762 | fi | |
1763 | ||
5cbcf02c FB |
1764 | if test "$audio_oss" = "yes" ; then |
1765 | echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH | |
1766 | echo "CONFIG_AUDIO_OSS=yes" >> config.mak | |
57514323 ZK |
1767 | fi |
1768 | ||
dfdfa47c FR |
1769 | if test "$audio_beos" = "yes" ; then |
1770 | echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH | |
1771 | echo "CONFIG_AUDIO_BEOS=yes" >> config.mak | |
1772 | fi | |
1773 | ||
5cbcf02c FB |
1774 | if test "$network" = "yes" ; then |
1775 | echo "#define CONFIG_NETWORK 1" >> $TMPH | |
1776 | echo "CONFIG_NETWORK=yes" >> config.mak | |
6ed7422a | 1777 | fi |
daf8e955 | 1778 | |
7a91333f HZ |
1779 | if test "$ipv6" = "yes" ; then |
1780 | echo "#define CONFIG_IPV6 1" >> $TMPH | |
1781 | fi | |
1782 | ||
0147f198 FR |
1783 | if test "$zlib" = "yes" ; then |
1784 | echo "#define CONFIG_ZLIB 1" >> $TMPH | |
1785 | echo "CONFIG_ZLIB=yes" >> config.mak | |
1786 | fi | |
1787 | ||
e0f80bd7 RD |
1788 | if test "$lzo" = "yes" ; then |
1789 | echo "#define CONFIG_LZO 1" >> $TMPH | |
1790 | echo "CONFIG_LZO=yes" >> config.mak | |
1791 | fi | |
1792 | ||
bb4c2140 MN |
1793 | if test "$libgsm" = "yes" ; then |
1794 | echo "#define CONFIG_LIBGSM 1" >> $TMPH | |
1795 | echo "CONFIG_LIBGSM=yes" >> config.mak | |
1796 | fi | |
1797 | ||
57514323 | 1798 | if test "$mp3lame" = "yes" ; then |
045ed63f | 1799 | echo "#define CONFIG_MP3LAME 1" >> $TMPH |
a6741398 J |
1800 | echo "CONFIG_MP3LAME=yes" >> config.mak |
1801 | fi | |
1802 | ||
9146ca37 | 1803 | if test "$libogg" = "yes" ; then |
5c5dea3f NB |
1804 | echo "#define CONFIG_LIBOGG 1" >> $TMPH |
1805 | echo "CONFIG_LIBOGG=yes" >> config.mak | |
1806 | fi | |
1807 | ||
81e0d0b4 | 1808 | if test "$vorbis" = "yes" ; then |
5c5dea3f NB |
1809 | echo "#define CONFIG_LIBVORBIS 1" >> $TMPH |
1810 | echo "CONFIG_LIBVORBIS=yes" >> config.mak | |
1811 | fi | |
1812 | ||
1813 | if test "$theora" = "yes" ; then | |
1814 | echo "#define CONFIG_LIBTHEORA 1" >> $TMPH | |
1815 | echo "CONFIG_LIBTHEORA=yes" >> config.mak | |
81e0d0b4 MH |
1816 | fi |
1817 | ||
0fc50e58 ZK |
1818 | if test "$faad" = "yes" ; then |
1819 | echo "#define CONFIG_FAAD 1" >> $TMPH | |
1820 | echo "CONFIG_FAAD=yes" >> config.mak | |
1821 | fi | |
1822 | ||
1823 | if test "$faadbin" = "yes" ; then | |
1824 | echo "#define CONFIG_FAADBIN 1" >> $TMPH | |
445ad18d | 1825 | echo "CONFIG_FAADBIN=yes" >> config.mak |
0fc50e58 ZK |
1826 | fi |
1827 | ||
29d48296 MN |
1828 | if test "$faac" = "yes" ; then |
1829 | echo "#define CONFIG_FAAC 1" >> $TMPH | |
1830 | echo "CONFIG_FAAC=yes" >> config.mak | |
1831 | fi | |
1832 | ||
1ddadfa9 AT |
1833 | if test "$xvid" = "yes" ; then |
1834 | echo "#define CONFIG_XVID 1" >> $TMPH | |
1835 | echo "CONFIG_XVID=yes" >> config.mak | |
1836 | fi | |
1837 | ||
6662ec29 MN |
1838 | if test "$x264" = "yes" ; then |
1839 | echo "#define CONFIG_X264 1" >> $TMPH | |
1840 | echo "CONFIG_X264=yes" >> config.mak | |
1841 | fi | |
1842 | ||
732d9245 BE |
1843 | if test "$mingw32" = "yes" ; then |
1844 | echo "#define CONFIG_WIN32 1" >> $TMPH | |
1845 | echo "CONFIG_WIN32=yes" >> config.mak | |
16806499 MN |
1846 | echo "HAVE_W32THREADS=yes" >> config.mak |
1847 | echo "#define HAVE_W32THREADS 1" >> $TMPH | |
2450cff2 | 1848 | echo "#define HAVE_THREADS 1" >> $TMPH |
7eea5766 | 1849 | echo "#ifndef __MINGW32__" >> $TMPH |
732d9245 | 1850 | echo "#define __MINGW32__ 1" >> $TMPH |
7eea5766 | 1851 | echo "#endif" >> $TMPH |
3f027ca7 FB |
1852 | fi |
1853 | ||
ac44871c GB |
1854 | if test "$mingwce" = "yes" ; then |
1855 | echo "#define CONFIG_WIN32 1" >> $TMPH | |
1856 | echo "CONFIG_WIN32=yes" >> config.mak | |
1857 | echo "#define CONFIG_WINCE 1" >> $TMPH | |
1858 | echo "CONFIG_WINCE=yes" >> config.mak | |
1859 | echo "#ifndef __MINGW32__" >> $TMPH | |
1860 | echo "#define __MINGW32__ 1" >> $TMPH | |
1861 | echo "#endif" >> $TMPH | |
1862 | fi | |
1863 | ||
f3ec2d46 SG |
1864 | if test "$os2" = "yes" ; then |
1865 | echo "#define CONFIG_OS2 1" >> $TMPH | |
1866 | echo "CONFIG_OS2=yes" >> config.mak | |
e2a5fd20 MN |
1867 | echo "HAVE_OS2THREADS=yes" >> config.mak |
1868 | echo "#define HAVE_OS2THREADS 1" >> $TMPH | |
1869 | echo "#define HAVE_THREADS 1" >> $TMPH | |
f3ec2d46 SG |
1870 | fi |
1871 | ||
6e023978 RS |
1872 | if test "$TARGET_OS" = "SunOS" ; then |
1873 | echo "#define CONFIG_SUNOS 1" >> $TMPH | |
1874 | fi | |
1875 | ||
2450cff2 FR |
1876 | if test "$TARGET_OS" = "BeOS" ; then |
1877 | echo "HAVE_BEOSTHREADS=yes" >> config.mak | |
1878 | echo "#define HAVE_BEOSTHREADS 1" >> $TMPH | |
1879 | echo "#define HAVE_THREADS 1" >> $TMPH | |
1880 | fi | |
1881 | ||
90cee0c3 MN |
1882 | if test "$darwin" = "yes"; then |
1883 | echo "#define CONFIG_DARWIN 1" >> $TMPH | |
1884 | echo "CONFIG_DARWIN=yes" >> config.mak | |
1885 | fi | |
1886 | ||
57514323 | 1887 | if test "$_malloc_h" = "yes" ; then |
045ed63f | 1888 | echo "#define HAVE_MALLOC_H 1" >> $TMPH |
3d204385 | 1889 | else |
045ed63f | 1890 | echo "#undef HAVE_MALLOC_H" >> $TMPH |
3d204385 NK |
1891 | fi |
1892 | ||
57514323 | 1893 | if test "$_memalign" = "yes" ; then |
045ed63f ZK |
1894 | echo "#define HAVE_MEMALIGN 1" >> $TMPH |
1895 | else | |
1896 | echo "#undef HAVE_MEMALIGN" >> $TMPH | |
1897 | fi | |
1898 | ||
da9b170c MN |
1899 | if test "$memalignhack" = "yes" ; then |
1900 | echo "#define MEMALIGN_HACK 1" >> $TMPH | |
1901 | fi | |
1902 | ||
1903 | ||
26b35efb FR |
1904 | if test "$netserver" = "yes" ; then |
1905 | echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH | |
1906 | echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak | |
1907 | fi | |
1908 | ||
4baca069 PG |
1909 | if test "$need_inet_aton" = "yes" ; then |
1910 | echo "NEED_INET_ATON=yes" >> config.mak | |
1911 | fi | |
1912 | ||
57514323 | 1913 | if test "$simpleidct" = "yes" ; then |
045ed63f ZK |
1914 | echo "#define SIMPLE_IDCT 1" >> $TMPH |
1915 | fi | |
1916 | ||
04f46ced GB |
1917 | if test "$protocols" = "yes" ; then |
1918 | echo "#define CONFIG_PROTOCOLS 1" >> $TMPH | |
1919 | echo "CONFIG_PROTOCOLS=yes" >> config.mak | |
1920 | fi | |
1921 | ||
8154d2e0 FB |
1922 | if test "$ffserver" = "yes" ; then |
1923 | echo "#define CONFIG_FFSERVER 1" >> $TMPH | |
1924 | echo "CONFIG_FFSERVER=yes" >> config.mak | |
1925 | fi | |
1926 | ||
a86b921c FB |
1927 | if test "$ffplay" = "yes" ; then |
1928 | echo "CONFIG_FFPLAY=yes" >> config.mak | |
1929 | fi | |
1930 | ||
b2e3c528 MN |
1931 | if test "$gpl" = "yes" ; then |
1932 | echo "#define CONFIG_GPL 1" >> $TMPH | |
1933 | echo "CONFIG_GPL=yes" >> config.mak | |
1934 | fi | |
1935 | ||
c13e1abd FH |
1936 | echo "#define restrict $_restrict" >> $TMPH |
1937 | ||
bb801c97 MN |
1938 | if test "$optimize" = "small"; then |
1939 | echo "#define always_inline" >> $TMPH | |
1940 | fi | |
1941 | ||
0f3cb305 FB |
1942 | # build tree in object directory if source path is different from current one |
1943 | if test "$source_path_used" = "yes" ; then | |
2a4e872b AS |
1944 | DIRS="\ |
1945 | doc \ | |
1946 | libavformat \ | |
1947 | libavcodec \ | |
1948 | libavcodec/alpha \ | |
1949 | libavcodec/armv4l \ | |
1950 | libavcodec/i386 \ | |
1951 | libavcodec/sparc \ | |
1952 | libavcodec/mlib \ | |
1953 | libavcodec/ppc \ | |
1954 | libavcodec/liba52 \ | |
6d9a2421 | 1955 | libpostproc \ |
2a4e872b AS |
1956 | libavutil \ |
1957 | tests \ | |
1958 | vhook \ | |
1959 | " | |
1960 | FILES="\ | |
1961 | Makefile \ | |
1962 | libavformat/Makefile \ | |
1963 | libavcodec/Makefile \ | |
6d9a2421 | 1964 | libpostproc/Makefile \ |
2a4e872b AS |
1965 | libavutil/Makefile \ |
1966 | tests/Makefile \ | |
1967 | vhook/Makefile \ | |
1968 | doc/Makefile \ | |
1969 | doc/texi2pod.pl \ | |
1970 | " | |
0f3cb305 FB |
1971 | for dir in $DIRS ; do |
1972 | mkdir -p $dir | |
1973 | done | |
1974 | for f in $FILES ; do | |
281a74da | 1975 | ln -sf "$source_path/$f" $f |
0f3cb305 FB |
1976 | done |
1977 | fi | |
8e955b13 | 1978 | echo "SRC_PATH=$source_path" >> config.mak |
8b2121e3 | 1979 | echo "BUILD_ROOT=$PWD" >> config.mak |
0f3cb305 | 1980 | |
60827a1a DB |
1981 | if test "$amr" = "yes" ; then |
1982 | echo "#define AMR 1" >> $TMPH | |
1983 | echo "AMR=yes" >> config.mak | |
1984 | fi | |
1985 | ||
d663a1fd MN |
1986 | if test "$amr_wb" = "yes" ; then |
1987 | echo "#define AMR_WB 1" >> $TMPH | |
1988 | echo "AMR_WB=yes" >> config.mak | |
1989 | echo | |
1990 | echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204" | |
1991 | echo "V5.1.0 from " | |
1992 | echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip" | |
1993 | echo "and extracted the source to libavcodec/amrwb_float" | |
d663a1fd MN |
1994 | fi |
1995 | ||
891f64b3 | 1996 | if test "$amr_nb" = "yes" ; then |
1997 | echo "#define AMR_NB 1" >> $TMPH | |
1998 | echo "AMR_NB=yes" >> config.mak | |
1999 | echo | |
6eb07e73 DB |
2000 | echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104" |
2001 | echo "REL-5 V5.1.0 from " | |
c51c4fa0 | 2002 | echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip" |
6eb07e73 DB |
2003 | echo "and extracted the source to libavcodec/amr_float" |
2004 | echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h" | |
2005 | fi | |
2006 | ||
bc634f6f | 2007 | if test "$amr_nb_fixed" = "yes" ; then |
bc634f6f | 2008 | echo "#define AMR_NB_FIXED 1" >> $TMPH |
28fff4c8 | 2009 | echo "AMR_NB_FIXED=yes" >> config.mak |
b9ca6d47 | 2010 | echo |
bc634f6f ZK |
2011 | echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 " |
2012 | echo "REL-5 version 5.1.0 from " | |
c51c4fa0 | 2013 | echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip" |
891f64b3 | 2014 | echo "and extracted src to libavcodec/amr" |
bc634f6f ZK |
2015 | echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile." |
2016 | echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO" | |
891f64b3 | 2017 | fi |
2018 | ||
2a515c08 TM |
2019 | if test "$amr_if2" = "yes" ; then |
2020 | echo "AMR_CFLAGS=-DIF2=1" >> config.mak | |
2021 | fi | |
2022 | ||
bc634f6f | 2023 | |
009cf97d | 2024 | for codec in $CODEC_LIST ; do |
ce869f59 MN |
2025 | echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH |
2026 | echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak | |
009cf97d MN |
2027 | done |
2028 | ||
9cb2cf10 DB |
2029 | # Do not overwrite config.h if unchanged to avoid superfluous rebuilds. |
2030 | diff $TMPH config.h >/dev/null 2>&1 | |
214c5f26 | 2031 | if test "$?" != "0" ; then |
9cb2cf10 DB |
2032 | mv -f $TMPH config.h |
2033 | else | |
2034 | echo "config.h is unchanged" | |
2035 | fi | |
3d204385 | 2036 | |
f3ec2d46 | 2037 | rm -f $TMPO $TMPC $TMPE $TMPS $TMPH |
def4272a AJ |
2038 | |
2039 | ||
29799f8b | 2040 | # build pkg-config files libav*.pc and libpostproc.pc |
31abdc45 | 2041 | # libavutil.pc |
2042 | cat <<EOF >libavutil.pc | |
2043 | prefix=$prefix | |
2044 | exec_prefix=\${prefix} | |
2045 | libdir=\${exec_prefix}/lib | |
2046 | includedir=\${prefix}/include | |
2047 | ||
2048 | Name: libavutil | |
2049 | Description: FFmpeg utility library | |
2050 | Version: $lavu_version | |
115329f1 | 2051 | Requires: |
31abdc45 | 2052 | Conflicts: |
2053 | Libs: -L\${libdir} -lavutil | |
2054 | Cflags: -I\${includedir} -I\${includedir}/ffmpeg | |
2055 | EOF | |
2056 | ||
2057 | cat <<EOF >libavutil-uninstalled.pc | |
2058 | prefix= | |
2059 | exec_prefix= | |
2060 | libdir=\${pcfiledir}/libavutil | |
2061 | includedir=\${pcfiledir}/libavutil | |
2062 | ||
2063 | Name: libavutil | |
2064 | Description: FFmpeg utility library | |
2065 | Version: $lavu_version | |
115329f1 | 2066 | Requires: |
31abdc45 | 2067 | Conflicts: |
2068 | Libs: \${libdir}/${LIBPREF}avutil${LIBSUF} | |
2069 | Cflags: -I\${includedir} | |
2070 | EOF | |
def4272a AJ |
2071 | |
2072 | # libavcodec.pc | |
2073 | cat <<EOF >libavcodec.pc | |
2074 | prefix=$prefix | |
2075 | exec_prefix=\${prefix} | |
2076 | libdir=\${exec_prefix}/lib | |
2077 | includedir=\${prefix}/include | |
2078 | ||
2079 | Name: libavcodec | |
2080 | Description: FFmpeg codec library | |
31abdc45 | 2081 | Version: $lavc_version |
c99dd233 | 2082 | Requires: $pkg_requires libavutil = $lavu_version |
def4272a AJ |
2083 | Conflicts: |
2084 | Libs: -L\${libdir} -lavcodec $extralibs | |
2085 | Cflags: -I\${includedir} -I\${includedir}/ffmpeg | |
2086 | EOF | |
2087 | ||
2088 | cat <<EOF >libavcodec-uninstalled.pc | |
2089 | prefix= | |
2090 | exec_prefix= | |
2091 | libdir=\${pcfiledir}/libavcodec | |
2092 | includedir=\${pcfiledir}/libavcodec | |
2093 | ||
2094 | Name: libavcodec | |
2095 | Description: FFmpeg codec library | |
31abdc45 | 2096 | Version: $lavc_version |
c99dd233 | 2097 | Requires: $pkg_requires libavutil = $lavu_version |
def4272a AJ |
2098 | Conflicts: |
2099 | Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs | |
2100 | Cflags: -I\${includedir} | |
2101 | EOF | |
2102 | ||
2103 | # libavformat.pc | |
2104 | cat <<EOF >libavformat.pc | |
2105 | prefix=$prefix | |
2106 | exec_prefix=\${prefix} | |
2107 | libdir=\${exec_prefix}/lib | |
2108 | includedir=\${prefix}/include | |
2109 | ||
2110 | Name: libavformat | |
2111 | Description: FFmpeg container format library | |
31abdc45 | 2112 | Version: $lavf_version |
c99dd233 | 2113 | Requires: $pkg_requires libavcodec = $lavc_version |
def4272a AJ |
2114 | Conflicts: |
2115 | Libs: -L\${libdir} -lavformat $extralibs | |
2116 | Cflags: -I\${includedir} -I\${includedir}/ffmpeg | |
2117 | EOF | |
2118 | ||
2119 | cat <<EOF >libavformat-uninstalled.pc | |
2120 | prefix= | |
2121 | exec_prefix= | |
2122 | libdir=\${pcfiledir}/libavformat | |
2123 | includedir=\${pcfiledir}/libavformat | |
2124 | ||
2125 | Name: libavformat | |
2126 | Description: FFmpeg container format library | |
31abdc45 | 2127 | Version: $lavf_version |
c99dd233 | 2128 | Requires: $pkg_requires libavcodec = $lavc_version |
def4272a AJ |
2129 | Conflicts: |
2130 | Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs | |
2131 | Cflags: -I\${includedir} | |
2132 | EOF | |
2133 | ||
2134 | ||
2135 | # libpostproc.pc | |
2136 | cat <<EOF >libpostproc.pc | |
2137 | prefix=$prefix | |
2138 | exec_prefix=\${prefix} | |
2139 | libdir=\${exec_prefix}/lib | |
2140 | includedir=\${prefix}/include | |
2141 | ||
2142 | Name: libpostproc | |
2143 | Description: FFmpeg post processing library | |
31abdc45 | 2144 | Version: $lavc_version |
115329f1 | 2145 | Requires: |
def4272a AJ |
2146 | Conflicts: |
2147 | Libs: -L\${libdir} -lpostproc | |
2148 | Cflags: -I\${includedir} -I\${includedir}/postproc | |
2149 | EOF | |
2150 | ||
2151 | cat <<EOF >libpostproc-uninstalled.pc | |
2152 | prefix= | |
2153 | exec_prefix= | |
6d9a2421 DB |
2154 | libdir=\${pcfiledir}/libpostproc |
2155 | includedir=\${pcfiledir}/libpostproc | |
def4272a AJ |
2156 | |
2157 | Name: libpostproc | |
2158 | Description: FFmpeg post processing library | |
31abdc45 | 2159 | Version: $lavc_version |
115329f1 | 2160 | Requires: |
def4272a AJ |
2161 | Conflicts: |
2162 | Libs: \${libdir}/${LIBPREF}postproc${LIBSUF} | |
2163 | Cflags: -I\${includedir} | |
2164 | EOF |