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