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