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