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