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