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