find all codecs, even the ones with numbers
[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
fc4b254d
MR
665ENCODER_LIST=`grep 'register_avcodec(&[a-z0-9]*_encoder)' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
666DECODER_LIST=`grep 'register_avcodec(&[a-z0-9]*_decoder)' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
af9e7d18 667PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
ff70e601
MR
668MUXER_LIST=`grep 'av_register_output_format(&[a-z]' $source_path/libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
669DEMUXER_LIST=`grep 'av_register_input_format(&[a-z]' $source_path/libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
009cf97d 670
de6d9b64
FB
671for opt do
672 case "$opt" in
2ba042a7
MR
673 --log)
674 ;;
720c69da 675 --log=*) logging="${opt#*=}"
57bd82d4 676 ;;
eba9ae3c 677 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
de6d9b64 678 ;;
eba9ae3c 679 --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
cc973ecb 680 ;;
1d67a1d4
DB
681 --incdir=*) incdir=`echo $opt | cut -d '=' -f 2`;
682 ;;
23a65308
FB
683 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
684 ;;
0f3cb305
FB
685 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
686 ;;
687 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
688 ;;
fac252f9
MR
689 --cross-compile) cross_compile=yes
690 ;;
eba9ae3c 691 --cc=*) cc=`echo $opt | cut -d '=' -f 2-`
de6d9b64 692 ;;
4a908fbc
AB
693 --make=*) make=`echo $opt | cut -d '=' -f 2`
694 ;;
f4e2c4b1 695 --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
0f3cb305 696 ;;
e89b8b0a 697 --extra-ldflags=*) FFLDFLAGS="$FFLDFLAGS ${opt#--extra-ldflags=}"
0f3cb305
FB
698 ;;
699 --extra-libs=*) extralibs=${opt#--extra-libs=}
700 ;;
eb94aca9
CY
701 --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
702 ;;
de6d9b64
FB
703 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
704 ;;
a4adb608
MN
705 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
706 ;;
e45a2872
RD
707 --powerpc-perf-enable) powerpc_perf="yes"
708 ;;
de6d9b64
FB
709 --disable-mmx) mmx="no"
710 ;;
eba9ae3c
GB
711 --disable-iwmmxt) iwmmxt="no"
712 ;;
ab6c65f6
BF
713 --disable-altivec) altivec="no"
714 ;;
de6d9b64
FB
715 --enable-gprof) gprof="yes"
716 ;;
5cbcf02c
FB
717 --disable-v4l) v4l="no"
718 ;;
0a7b514f
LA
719 --disable-v4l2) v4l2="no"
720 ;;
6beefa40
MN
721 --disable-bktr) bktr="no"
722 ;;
5cbcf02c
FB
723 --disable-audio-oss) audio_oss="no"
724 ;;
dfdfa47c
FR
725 --disable-audio-beos) audio_beos="no"
726 ;;
8aa3ee32
MK
727 --disable-dv1394) dv1394="no"
728 ;;
ffc0ef96 729 --disable-network) network="no"; ffserver="no"
5cbcf02c 730 ;;
0147f198
FR
731 --disable-zlib) zlib="no"
732 ;;
ba9261e5 733 --enable-a52) a52="yes"
6ed7422a 734 ;;
bfd2edeb 735 --enable-a52bin) a52bin="yes"
57514323 736 ;;
c99dd233 737 --enable-dts) dts="yes"
23c99253 738 ;;
ba9261e5 739 --enable-pp) pp="yes"
bba9b16c 740 ;;
bb4c2140
MN
741 --enable-libgsm) libgsm="yes"
742 ;;
c99dd233 743 --enable-mp3lame) mp3lame="yes"
a6741398 744 ;;
9146ca37 745 --enable-libogg) libogg="yes"
c99dd233 746 pkg_requires="$pkg_requires ogg >= 1.1"
5c5dea3f 747 ;;
81e0d0b4 748 --enable-vorbis) vorbis="yes"
c99dd233 749 pkg_requires="$pkg_requires vorbis vorbisenc"
81e0d0b4 750 ;;
5c5dea3f 751 --enable-theora) theora="yes"
c99dd233 752 pkg_requires="$pkg_requires theora"
5c5dea3f 753 ;;
445ad18d
ZK
754 --enable-faad) faad="yes"
755 ;;
756 --enable-faadbin) faadbin="yes"
757 ;;
c99dd233 758 --enable-faac) faac="yes"
29d48296 759 ;;
1ddadfa9
AT
760 --enable-xvid) xvid="yes"
761 ;;
c99dd233 762 --enable-x264) x264="yes"
6662ec29 763 ;;
f02be79d 764 --enable-dc1394) dc1394="yes"
c99dd233 765 pkg_requires="$pkg_requires libraw1394"
f02be79d 766 ;;
68892110
PG
767 --disable-vhook) vhook="no"
768 ;;
c02dbee1 769 --disable-simple_idct) simpleidct="no"
045ed63f 770 ;;
732d9245
BE
771 --enable-mingw32) mingw32="yes"
772 ;;
ac44871c
GB
773 --enable-mingwce) mingwce="yes"
774 ;;
320d060a
DB
775 --enable-static) lstatic="yes"
776 ;;
777 --disable-static) lstatic="no"
778 ;;
83286d2a 779 --enable-shared) lshared="yes"
0319c531 780 ;;
320d060a
DB
781 --disable-shared) lshared="no"
782 ;;
cddf3f45
GM
783 --disable-debug) debug="no"
784 ;;
785 --disable-opts) optimize="no"
786 ;;
1eb2212e
FB
787 --disable-mpegaudio-hp) mpegaudio_hp="no"
788 ;;
04f46ced
GB
789 --disable-protocols) protocols="no"; network="no"; ffserver="no"
790 ;;
8154d2e0
FB
791 --disable-ffserver) ffserver="no"
792 ;;
a86b921c
FB
793 --disable-ffplay) ffplay="no"
794 ;;
cddf3f45 795 --enable-small) optimize="small"
553a6284 796 ;;
60827a1a 797 --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
891f64b3 798 ;;
60827a1a 799 --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
bc634f6f 800 ;;
60827a1a 801 --enable-amr_wb) amr="yes"; amr_wb="yes"
115329f1 802 ;;
60827a1a 803 --enable-amr_if2) amr="yes"; amr_if2="yes"
2a515c08 804 ;;
f80f7964
RS
805 --enable-sunmlib) sunmlib="yes"
806 ;;
9c3d33d6
MN
807 --enable-pthreads) pthreads="yes"
808 ;;
b2e3c528
MN
809 --enable-gpl) gpl="yes"
810 ;;
da9b170c
MN
811 --enable-memalign-hack) memalignhack="yes"
812 ;;
65d1bea2
MB
813 --disable-strip) dostrip="no"
814 ;;
55006fc0 815 --enable-encoder=*) ENCODER_LIST="$ENCODER_LIST ${opt#--enable-encoder=}_encoder"
009cf97d 816 ;;
55006fc0 817 --enable-decoder=*) DECODER_LIST="$DECODER_LIST ${opt#--enable-decoder=}_decoder"
f593b273 818 ;;
55006fc0 819 --disable-encoder=*) ENCODER_LIST="`echo $ENCODER_LIST | sed -e \"s#${opt#--disable-encoder=}_encoder##\"`"
f593b273 820 ;;
55006fc0 821 --disable-decoder=*) DECODER_LIST="`echo $DECODER_LIST | sed -e \"s#${opt#--disable-decoder=}_decoder##\"`"
009cf97d 822 ;;
55006fc0 823 --disable-encoders) ENCODER_LIST=""
009cf97d 824 ;;
55006fc0 825 --disable-decoders) DECODER_LIST=""
b4cad537 826 ;;
ff70e601 827 --enable-muxer=*) MUXER_LIST="$MUXER_LIST ${opt#*=}_muxer"
a9e35095 828 ;;
ff70e601
MR
829 --disable-muxer=*) MUXER_LIST="`echo $MUXER_LIST | sed -e \"s#${opt#*=}_muxer##\"`"
830 ;;
831 --disable-muxers) MUXER_LIST=""; ffserver="no"
832 ;;
833 --enable-demuxer=*) DEMUXER_LIST="$DEMUXER_LIST ${opt#*=}_demuxer"
834 ;;
835 --disable-demuxer=*) DEMUXER_LIST="`echo $DEMUXER_LIST | sed -e \"s#${opt#*=}_demuxer##\"`"
836 ;;
837 --disable-demuxers) DEMUXER_LIST=""
a9e35095 838 ;;
af9e7d18
MR
839 --enable-parser=*) PARSER_LIST="$PARSER_LIST ${opt#*=}_parser"
840 ;;
841 --disable-parser=*) PARSER_LIST="`echo $PARSER_LIST | sed -e \"s#${opt#*=}_parser##\"`"
842 ;;
843 --disable-parsers) PARSER_LIST=""
844 ;;
74c53c2d
MR
845 --help) show_help
846 ;;
b34c63f7
DB
847 *)
848 echo "Unknown option \"$opt\"."
849 echo "See $0 --help for available options."
850 exit 1
851 ;;
de6d9b64
FB
852 esac
853done
854
720c69da
MR
855if test "$logging" != no; then
856 test "$logging" = yes || logfile="$logging"
57bd82d4
MR
857 echo "# $0 $@" >$logfile
858 set >>$logfile
2ba042a7
MR
859else
860 logfile=/dev/null
57bd82d4 861fi
e89b8b0a 862
e67bcdd9
DB
863if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
864 if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
865 cat <<EOF
866You can only build one library type at once on MinGW.
867Specify --disable-static --enable-shared to only build
868the shared libraries. To build only the static libraries
869you do not need to pass additional options.
870EOF
871 exit 1
872 fi
873 v4l="no"
874 v4l2="no"
875 bktr="no"
876 audio_oss="no"
877 dv1394="no"
878 dc1394="no"
879 ffserver="no"
880 network="no"
881 if test "$mingwce" = "yes"; then
882 protocols="no"
883 fi
4874eef4 884 #FIXME: This ignores --extra-ldflags.
1a5f0dbe 885 FFLDFLAGS='-Wl,--output-def,$(@:.dll=.def),--out-implib,lib$(SLIBNAME:$(SLIBSUF)=.dll.a)'
e67bcdd9
DB
886 SLIBPREF=""
887 SLIBSUF=".dll"
888 EXESUF=".exe"
889 if test "$force_prefix" != yes; then prefix="$PROGRAMFILES/FFmpeg"; fi
890 if test "$force_libdir" != yes; then bindir="$prefix"; fi
891fi
892
e89b8b0a
DB
893# Combine FFLDFLAGS and the LDFLAGS environment variable
894LDFLAGS="$FFLDFLAGS $LDFLAGS"
895
fac252f9 896test -n "$cross_prefix" && cross_compile=yes
1ea46bed
MR
897cc="${cross_prefix}${cc}"
898ar="${cross_prefix}${ar}"
899ranlib="${cross_prefix}${ranlib}"
900strip="${cross_prefix}${strip}"
901
320d060a
DB
902# we need to build at least one lib type
903if test "$lstatic" = "no" && test "$lshared" = "no" ; then
904 cat <<EOF
905At least one library type must be built.
906Specify --enable-static to build the static libraries or --enable-shared to
907build the shared libraries as well. To only build the shared libraries specify
908--disable-static in addition to --enable-shared.
909EOF
910 exit 1;
911fi
912
5c5dea3f 913if test "$theora" = "yes" ; then
9146ca37 914 if test "$libogg" = "no"; then
29799f8b 915 echo "libogg must be enabled to enable Theora."
5c5dea3f
NB
916 fail="yes"
917 theora="no"
918 fi
919fi
920
921if test "$vorbis" = "yes" ; then
9146ca37 922 if test "$libogg" = "no"; then
29799f8b 923 echo "libogg must be enabled to enable Vorbis."
5c5dea3f
NB
924 fail="yes"
925 vorbis="no"
926 fi
927fi
928
b2e3c528 929if test "$gpl" != "yes"; then
ba64106a 930 if test "$pp" != "no"; then
29799f8b 931 echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
b2e3c528
MN
932 fail="yes"
933 fi
934
935 if test "$a52" != "no" -o "$a52bin" != "no"; then
29799f8b 936 echo "liba52 is under GPL and --enable-gpl is not specified."
b2e3c528
MN
937 fail="yes"
938 fi
23c99253 939
1ddadfa9 940 if test "$xvid" != "no"; then
29799f8b 941 echo "libxvidcore is under GPL and --enable-gpl is not specified."
1ddadfa9
AT
942 fail="yes"
943 fi
944
6662ec29 945 if test "$x264" != "no"; then
29799f8b 946 echo "x264 is under GPL and --enable-gpl is not specified."
6662ec29
MN
947 fail="yes"
948 fi
949
23c99253 950 if test "$dts" != "no"; then
29799f8b 951 echo "libdts is under GPL and --enable-gpl is not specified."
23c99253
MN
952 fail="yes"
953 fi
115329f1 954
b2e3c528 955 if test "$faad" != "no" -o "$faadbin" != "no"; then
dcd479c0
MR
956 if check_header faad.h; then
957 check_cc << EOF
b2e3c528
MN
958 #include <faad.h>
959 #ifndef FAAD2_VERSION
960 ok faad1
961 #endif
962 int main( void ) { return 0; }
963EOF
dcd479c0 964 if test $? = 0 ; then
29799f8b 965 echo "FAAD2 is under GPL and --enable-gpl is not specified."
b2e3c528
MN
966 fail="yes"
967 fi
968 else
969 faad="no"
970 faadbin="no"
29799f8b 971 echo "FAAD test failed."
b2e3c528
MN
972 fi
973 fi
115329f1 974
b2e3c528 975
a18b5183 976 if test "$fail" = "yes"; then
b2e3c528
MN
977 exit 1
978 fi
979fi
980
29799f8b 981# compute MMX state
0f3cb305 982if test $mmx = "default"; then
053dea12 983 if test $cpu = "x86" -o $cpu = "x86_64"; then
0f3cb305
FB
984 mmx="yes"
985 else
986 mmx="no"
987 fi
988fi
989
eba9ae3c
GB
990# check iwmmxt support
991if test $iwmmxt = "default" -a $cpu = "armv4l"; then
dcd479c0
MR
992 iwmmxt=no
993 check_cc <<EOF && iwmmxt=yes
115329f1 994 int main(void) {
eba9ae3c
GB
995 __asm__ __volatile__ ("wunpckelub wr6, wr4");
996 }
997EOF
eba9ae3c
GB
998fi
999
cf9d24ad 1000#Darwin CC versions
75388c74 1001needmdynamicnopic="no"
cf9d24ad 1002if test $targetos = Darwin; then
b2924696 1003 if test -n "`$cc -v 2>&1 | grep xlc`"; then
bb270c08 1004 CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
cf9d24ad 1005 else
bb270c08
DB
1006 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
1007 case "$gcc_version" in
1008 *2.95*)
1009 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
1010 ;;
1011 *[34].*)
1012 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
1013 if test "$lshared" = no; then
1014 needmdynamicnopic="yes"
1015 fi
1016 ;;
1017 *)
1018 CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
1019 if test "$lshared" = no; then
1020 needmdynamicnopic="yes"
1021 fi
1022 ;;
1023 esac
cf9d24ad
DC
1024 fi
1025fi
1026
ab6c65f6
BF
1027# Can only do AltiVec on PowerPC
1028if test $altivec = "default"; then
1029 if test $cpu = "powerpc"; then
1030 altivec="yes"
1031 else
1032 altivec="no"
1033 fi
1034fi
1035
a4adb608
MN
1036# Add processor-specific flags
1037TUNECPU="generic"
9007f514 1038POWERPCMODE="32bits"
a4adb608
MN
1039if test $tune != "generic"; then
1040 case $tune in
bb270c08
DB
1041 601|ppc601|PowerPC601)
1042 CFLAGS="$CFLAGS -mcpu=601"
1043 if test $altivec = "yes"; then
1044 echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
1045 fi
1046 TUNECPU=ppc601
1047 ;;
1048 603*|ppc603*|PowerPC603*)
1049 CFLAGS="$CFLAGS -mcpu=603"
1050 if test $altivec = "yes"; then
1051 echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
1052 fi
1053 TUNECPU=ppc603
1054 ;;
1055 604*|ppc604*|PowerPC604*)
1056 CFLAGS="$CFLAGS -mcpu=604"
1057 if test $altivec = "yes"; then
1058 echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
1059 fi
1060 TUNECPU=ppc604
1061 ;;
1062 G3|g3|75*|ppc75*|PowerPC75*)
1063 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
1064 if test $altivec = "yes"; then
1065 echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
1066 fi
1067 TUNECPU=ppc750
1068 ;;
1069 G4|g4|745*|ppc745*|PowerPC745*)
1070 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
1071 if test $altivec = "no"; then
1072 echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
1073 fi
1074 TUNECPU=ppc7450
1075 ;;
1076 74*|ppc74*|PowerPC74*)
1077 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
1078 if test $altivec = "no"; then
1079 echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
1080 fi
1081 TUNECPU=ppc7400
1082 ;;
1083 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
1084 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
1085 if test $altivec = "no"; then
1086 echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
1087 fi
1088 TUNECPU=ppc970
9007f514 1089 POWERPCMODE="64bits"
bb270c08
DB
1090 ;;
1091 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)
1092 CFLAGS="$CFLAGS -march=$tune"
1093 ;;
d7b34d08 1094 sparc64)
4cac0d55 1095 CFLAGS="$CFLAGS -mcpu=v9 -mtune=v9"
d7b34d08 1096 ;;
bb270c08
DB
1097 *)
1098 echo "WARNING: Unknown CPU \"$tune\", ignored."
1099 ;;
a4adb608
MN
1100 esac
1101fi
1102
1a268acc
MR
1103# compiler sanity check
1104check_exec <<EOF
1105int main(){
1106 return 0;
1107}
1108EOF
1109if test "$?" != 0; then
1110 echo "$cc is unable to create an executable file."
1111 if test -z "$cross_prefix" -a "$cross_compile" = no; then
1112 echo "If $cc is a cross-compiler, use the --cross-compile option."
1113 fi
1114 die "C compiler test failed."
1115fi
1116
57bd82d4
MR
1117# check for SIMD availability
1118
115329f1 1119# AltiVec flags: The FSF version of GCC differs from the Apple version
b6e52719
MD
1120if test $cpu = "powerpc"; then
1121 if test $altivec = "yes"; then
b2924696 1122 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
49f1a349 1123 CFLAGS="$CFLAGS -faltivec"
b6e52719
MD
1124 else
1125 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
1126 fi
1127 fi
1128fi
1129
dcd479c0 1130check_header altivec.h && _altivec_h=yes || _altivec_h=no
a9a07762 1131
29799f8b 1132# check if our compiler supports Motorola AltiVec C API
ab6c65f6 1133if test $altivec = "yes"; then
f25fc9b1
MR
1134 if test $_altivec_h = "yes"; then
1135 inc_altivec_h="#include <altivec.h>"
1136 else
1137 inc_altivec_h=
1138 fi
1139 check_cc <<EOF || altivec=no
dcd479c0 1140$inc_altivec_h
a9a07762
MN
1141int main(void) {
1142 vector signed int v1, v2, v3;
1143 v1 = vec_add(v2,v3);
1144 return 0;
1145}
1146EOF
1147fi
ab6c65f6 1148
29799f8b 1149# mmi only available on mips
d46aba26
LS
1150if test $mmi = "default"; then
1151 if test $cpu = "mips"; then
1152 mmi="yes"
1153 else
1154 mmi="no"
1155 fi
1156fi
1157
29799f8b 1158# check if our compiler supports mmi
57bd82d4 1159enabled mmi && check_cc <<EOF || mmi="no"
d46aba26
LS
1160int main(void) {
1161 __asm__ ("lq \$2, 0(\$2)");
1162 return 0;
1163}
1164EOF
57bd82d4
MR
1165
1166# test gcc version to see if vector builtins can be used
1167# currently only used on i386 for MMX builtins
1168check_cc -msse <<EOF && builtin_vector=yes || builtin_vector=no
1169#include <xmmintrin.h>
1170int main(void) {
1171#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
1172return 0;
1173#else
1174#error no vector builtins
1175#endif
1176}
1177EOF
1178
1179# test for mm3dnow.h
1180test "$cpu" = "x86_64" && march=k8 || march=athlon
1181check_cc -march=$march <<EOF && mm3dnow=yes || mm3dnow=no
1182#include <mm3dnow.h>
1183int main(void) {
1184__m64 b1;
1185b1 = _m_pswapd(b1);
1186_m_femms();
1187return 0;
1188}
1189EOF
d46aba26 1190
57bd82d4
MR
1191# ---
1192# big/little-endian test
fac252f9 1193if test "$cross_compile" = "no"; then
57bd82d4 1194 check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
a3999908
MN
1195#include <inttypes.h>
1196int main(int argc, char ** argv){
bb270c08
DB
1197 volatile uint32_t i=0x01234567;
1198 return (*((uint8_t*)(&i))) == 0x67;
a3999908
MN
1199}
1200EOF
487a54d7 1201else
f25fc9b1
MR
1202 # programs cannot be launched if cross compiling, so make a static guess
1203 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
1204 bigendian="yes"
1205 fi
487a54d7
FB
1206fi
1207
a3999908 1208# ---
7f965c1c 1209# *inttypes.h* test
dcd479c0 1210check_header inttypes.h || inttypes=no
7f965c1c
CF
1211
1212# ---
b5c950c4 1213# *int_fast* test
dcd479c0 1214check_cc <<EOF || emu_fast_int=yes
b5c950c4
MN
1215#include <inttypes.h>
1216int main(int argc, char ** argv){
bb270c08
DB
1217 volatile uint_fast64_t i=0x01234567;
1218 return 0;
b5c950c4
MN
1219}
1220EOF
1221
b5c950c4 1222# ---
3d204385
NK
1223# check availability of some header files
1224
3d204385
NK
1225_memalign=no
1226_malloc_h=no
dcd479c0
MR
1227if check_header malloc.h; then
1228 _malloc_h=yes
1229 _memalign=yes
1230 check_func memalign || _memalign="no"
3d204385
NK
1231fi
1232
8bf5d58f 1233if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
57bd82d4 1234 die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
8bf5d58f
MN
1235fi
1236
dcd479c0 1237check_func localtime_r && localtime_r=yes || localtime_r=no
57bd82d4 1238enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
57bd82d4
MR
1239
1240# check for some common methods of building with pthread support
1241# do this before the optional library checks as some of them require pthreads
1242if enabled pthreads; then
1243 { check_cflags -pthread && check_ldflags -pthread; } ||
1244 { check_cflags -pthreads && check_ldflags -pthreads; } ||
1245 check_lib pthread.h pthread_create -lpthread ||
1246 check_func pthread_create ||
1247 die "ERROR: can't find pthreads library"
1248fi
1249
1250# these are off by default, so fail if requested and not available
1251enabled dts && require libdts dts.h dts_init -ldts
1252enabled libgsm && require libgsm gsm.h gsm_create -lgsm
1253enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame
57bd82d4 1254enabled vorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc
aedf11f8 1255enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
57bd82d4 1256enabled theora && require libtheora theora/theora.h theora_info_init -ltheora
57bd82d4
MR
1257enabled xvid && require XviD xvid.h xvid_global -lxvidcore
1258enabled x264 && require x264 x264.h x264_encoder_open -lx264
1259enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
1260enabled sunmlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
e0f80bd7 1261
3b9bee88
MR
1262# Ugh, faac uses stdcall calling convention on win32 so we can't use
1263# the generic test functions
1264if enabled faac; then
1265 save_flags
1266 temp_extralibs -lfaac
1267 check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found"
1268#include <stdint.h>
1269#include <faac.h>
1270int main(){
1271 char *id, *cpr;
1272 faacEncGetVersion(&id, &cpr);
1273 return 0;
1274}
1275EOF
1276 restore_flags
1277fi
1278
87f1c97e
MR
1279# Ugh, recent faad2 versions have renamed all functions and #define the
1280# old names in faad.h. Generic tests won't work.
1281if enabled faad; then
1282 save_flags
1283 temp_extralibs -lfaad
1284 check_ld <<EOF && add_extralibs -lfaad || die "ERROR: libfaad not found"
1285#include <faad.h>
1286int main(){
1287 faacDecOpen();
1288 return 0;
1289}
1290EOF
1291 restore_flags
1292fi
1293
95e2ce4a 1294# test for lrintf in math.h
dcd479c0 1295check_exec <<EOF && have_lrintf=yes || have_lrintf=no
95e2ce4a
MN
1296#define _ISOC9X_SOURCE 1
1297#include <math.h>
1298int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
1299EOF
1300
c13e1abd
FH
1301_restrict=
1302for restrict_keyword in restrict __restrict__ __restrict; do
57bd82d4 1303 check_cc <<EOF && _restrict=$restrict_keyword && break
dcd479c0
MR
1304void foo(char * $restrict_keyword p);
1305EOF
c13e1abd
FH
1306done
1307
a8721c09
FB
1308# dlopen/dlfcn.h probing
1309
dcd479c0 1310check_header dlfcn.h && dlfcn=yes
a8721c09 1311
dcd479c0
MR
1312temp_extralibs -ldl
1313if check_func dlopen; then
1314 dlopen=yes
1315 ldl=-ldl
a8721c09 1316fi
dcd479c0 1317restore_flags
a8721c09 1318
dcd479c0
MR
1319if check_func dlopen; then
1320 dlopen=yes
1321 ldl=
a8721c09
FB
1322fi
1323
f25fc9b1
MR
1324if test "$vhook" = "default"; then
1325 vhook="$dlopen"
a8721c09
FB
1326fi
1327
bfd2edeb 1328if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
57bd82d4 1329 add_extralibs $ldl
bfd2edeb
MN
1330fi
1331
8d923001
MR
1332if enabled vhook; then
1333 check_ldflags -rdynamic
1334 check_ldflags -export-dynamic
1335fi
bfd2edeb 1336
a86b921c 1337##########################################
29799f8b 1338# imlib check
a86b921c 1339
dcd479c0
MR
1340temp_extralibs -lImlib2
1341check_ld <<EOF && imlib2=yes || imlib2=no
a8721c09
FB
1342#include <X11/Xlib.h>
1343#include <Imlib2.h>
1344int main( void ) { return (int) imlib_load_font("foo"); }
1345EOF
dcd479c0 1346restore_flags
52b41d7f 1347
a86b921c 1348##########################################
29799f8b 1349# FreeType check
a86b921c 1350
04511d53 1351freetype2=no
e2a5fd20 1352if test "x$targetos" != "xBeOS"; then
e2a3cd59 1353 if (freetype-config --version) >/dev/null 2>&1 ; then
dcd479c0
MR
1354 temp_cflags `freetype-config --cflags`
1355 temp_extralibs `freetype-config --libs`
1356 check_ld <<EOF && freetype2=yes
1357#include <ft2build.h>
1358int main( void ) { return (int) FT_Init_FreeType(0); }
1359EOF
1360 restore_flags
dee076fc 1361 fi
04511d53
PG
1362fi
1363
a86b921c 1364##########################################
29799f8b 1365# SDL check
a86b921c 1366
a86b921c
FB
1367sdl_too_old=no
1368sdl=no
6a1a892f
FD
1369SDL_CONFIG="${cross_prefix}sdl-config"
1370if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
dcd479c0
MR
1371 temp_cflags `"${SDL_CONFIG}" --cflags`
1372 temp_extralibs `"${SDL_CONFIG}" --libs`
1373 check_ld <<EOF
1374#include <SDL.h>
1375#undef main /* We don't want SDL to override our main() */
1376int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
1377EOF
dcd479c0
MR
1378 if test $? = 0; then
1379 _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
29f3b38a 1380 if test "$_sdlversion" -lt 121 ; then
dcd479c0
MR
1381 sdl_too_old=yes
1382 else
1383 sdl=yes
29f3b38a
MR
1384 check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no
1385#include <SDL.h>
1386int main(void){
1387 const SDL_VideoInfo *vi = SDL_GetVideoInfo();
1388 int w = vi->current_w;
1389 return 0;
1390}
1391EOF
dcd479c0
MR
1392 fi
1393 fi
29f3b38a 1394 restore_flags
c3f6b472 1395fi
a86b921c 1396
57bd82d4
MR
1397enabled sdl || ffplay=no
1398
146ea952 1399##########################################
29799f8b 1400# texi2html check
146ea952
NB
1401
1402texi2html=no
e2a3cd59 1403if (texi2html -version) >/dev/null 2>&1; then
146ea952
NB
1404texi2html=yes
1405fi
1406
7a91333f 1407##########################################
29799f8b 1408# IPv6 check
7a91333f 1409
57bd82d4 1410enabled network && check_ld <<EOF && ipv6=yes || ipv6=no
7a91333f
HZ
1411#include <sys/types.h>
1412#include <sys/socket.h>
1413#include <netinet/in.h>
1414#include <netdb.h>
1415int main( void ) {
1416 struct sockaddr_storage saddr;
1417 struct ipv6_mreq mreq6;
1418 getaddrinfo(0,0,0,0);
1419 getnameinfo(0,0,0,0,0,0,0);
12fe88b4 1420 IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
7a91333f
HZ
1421}
1422EOF
1423
47f38850 1424# check for video4linux2 --- V4L2_PIX_FMT_YUV420
57bd82d4 1425enabled v4l2 && check_cc <<EOF || v4l2="no"
84fe9963 1426#include <sys/time.h>
f743a062
LA
1427#include <asm/types.h>
1428#include <linux/videodev2.h>
47f38850 1429int dummy = V4L2_PIX_FMT_YUV420;
490c189b 1430struct v4l2_buffer dummy1;
47f38850 1431EOF
47f38850 1432
57bd82d4
MR
1433enabled debug && add_cflags -g
1434
1435# add some useful compiler flags if supported
1436check_cflags -Wdeclaration-after-statement
dcd479c0
MR
1437check_cflags -Wall
1438check_cflags -Wno-switch
cf9d24ad 1439
57bd82d4
MR
1440# add some linker flags
1441check_ldflags '-Wl,--as-needed' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavformat' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
94a3401e 1442
57bd82d4
MR
1443# not all compilers support -Os
1444test "$optimize" = "small" && check_cflags -Os
cddf3f45 1445
57bd82d4 1446if enabled optimize; then
b2924696 1447 if test -n "`$cc -v 2>&1 | grep xlc`"; then
bb270c08
DB
1448 CFLAGS="$CFLAGS -O5"
1449 LDFLAGS="$LDFLAGS -O5"
cf9d24ad 1450 else
bb270c08 1451 CFLAGS="-O3 $CFLAGS"
cf9d24ad 1452 fi
cddf3f45
GM
1453fi
1454
80581e98
MN
1455# PIC flags for shared library objects where they are needed
1456if test "$lshared" = "yes" ; then
f25fc9b1
MR
1457 # LIBOBJFLAGS may have already been set in the OS configuration
1458 if test -z "$LIBOBJFLAGS" ; then
813457e5
MR
1459 case "$cpu" in
1460 x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;;
1461 esac
80581e98 1462 fi
80581e98
MN
1463fi
1464
1db54e20
DB
1465if test "$gprof" = "yes" ; then
1466 CFLAGS="$CFLAGS -p"
1467 LDFLAGS="$LDFLAGS -p"
1468fi
1469
951bf3e6 1470if test x"$bindir" = x""; then
f25fc9b1 1471 bindir="${prefix}/bin"
951bf3e6
FB
1472fi
1473
cc973ecb 1474if test x"$libdir" = x""; then
f25fc9b1 1475 libdir="${prefix}/lib"
cc973ecb
LB
1476fi
1477
1d67a1d4 1478if test x"$incdir" = x""; then
f25fc9b1 1479 incdir="${prefix}/include/ffmpeg"
1d67a1d4
DB
1480fi
1481
23a65308 1482if test x"$mandir" = x""; then
f25fc9b1 1483 mandir="${prefix}/man"
23a65308
FB
1484fi
1485
29799f8b
DB
1486echo "install prefix $prefix"
1487echo "source path $source_path"
de6d9b64 1488echo "C compiler $cc"
4a908fbc 1489echo "make $make"
a4adb608 1490echo "CPU $cpu ($tune)"
eb94aca9 1491if test "$BUILDSUF" != ""; then
f25fc9b1 1492 echo "build suffix $BUILDSUF"
eb94aca9 1493fi
29799f8b 1494echo "big-endian $bigendian"
7f965c1c 1495echo "inttypes.h $inttypes"
b5c950c4 1496echo "broken inttypes.h $emu_fast_int"
053dea12 1497if test $cpu = "x86" -o $cpu = "x86_64"; then
f25fc9b1
MR
1498 echo "MMX enabled $mmx"
1499 echo "Vector Builtins $builtin_vector"
1500 echo "3DNow! Builtins $mm3dnow"
e41e8342 1501fi
eba9ae3c 1502if test $cpu = "armv4l"; then
f25fc9b1 1503 echo "IWMMXT enabled $iwmmxt"
eba9ae3c 1504fi
e41e8342 1505if test $cpu = "mips"; then
f25fc9b1 1506 echo "MMI enabled $mmi"
e41e8342
FB
1507fi
1508if test $cpu = "powerpc"; then
f25fc9b1 1509 echo "AltiVec enabled $altivec"
e41e8342 1510fi
de6d9b64 1511echo "gprof enabled $gprof"
0147f198 1512echo "zlib enabled $zlib"
bb4c2140 1513echo "libgsm enabled $libgsm"
a6741398 1514echo "mp3lame enabled $mp3lame"
9146ca37 1515echo "libogg enabled $libogg"
29799f8b
DB
1516echo "Vorbis enabled $vorbis"
1517echo "Theora enabled $theora"
1518echo "FAAD enabled $faad"
445ad18d 1519echo "faadbin enabled $faadbin"
29799f8b
DB
1520echo "FAAC enabled $faac"
1521echo "XviD enabled $xvid"
6662ec29 1522echo "x264 enabled $x264"
5cbcf02c 1523echo "a52 support $a52"
57514323 1524echo "a52 dlopened $a52bin"
29799f8b 1525echo "DTS support $dts"
bba9b16c 1526echo "pp support $pp"
cddf3f45 1527echo "debug symbols $debug"
65d1bea2 1528echo "strip symbols $dostrip"
cddf3f45 1529echo "optimize $optimize"
320d060a 1530echo "static $lstatic"
1ddf5ba1 1531echo "shared $lshared"
29799f8b 1532echo "video hooking $vhook"
a86b921c
FB
1533echo "SDL support $sdl"
1534if test $sdl_too_old = "yes"; then
f25fc9b1 1535 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
a86b921c 1536fi
68892110 1537
f25fc9b1
MR
1538if test "$vhook" = "yes"; then
1539 echo "Imlib2 support $imlib2"
1540 echo "FreeType support $freetype2"
68892110 1541fi
f80f7964 1542echo "Sun medialib support" $sunmlib
9c3d33d6 1543echo "pthreads support" $pthreads
bc634f6f
ZK
1544echo "AMR-NB float support" $amr_nb
1545echo "AMR-NB fixed support" $amr_nb_fixed
d663a1fd 1546echo "AMR-WB float support" $amr_wb
2a515c08 1547echo "AMR-WB IF2 support" $amr_if2
7a91333f
HZ
1548echo "network support $network"
1549if test "$network" = "yes" ; then
f25fc9b1 1550 echo "IPv6 support $ipv6"
7a91333f 1551fi
b2e3c528 1552if test "$gpl" = "no" ; then
f25fc9b1 1553 echo "License: LGPL"
b2e3c528 1554else
f25fc9b1 1555 echo "License: GPL"
b2e3c528 1556fi
de6d9b64 1557
29799f8b 1558echo "Creating config.mak and config.h..."
de6d9b64 1559
f255e0ab
MB
1560date >> config.log
1561echo " $0 $FFMPEG_CONFIGURATION" >> config.log
29799f8b
DB
1562echo "# Automatically generated by configure - do not modify!" > config.mak
1563echo "/* Automatically generated by configure - do not modify! */" > $TMPH
f255e0ab 1564echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
de6d9b64 1565
9a695e98
DB
1566echo "prefix=\$(DESTDIR)$prefix" >> config.mak
1567echo "libdir=\$(DESTDIR)$libdir" >> config.mak
1d67a1d4 1568echo "incdir=\$(DESTDIR)$incdir" >> config.mak
9a695e98
DB
1569echo "bindir=\$(DESTDIR)$bindir" >> config.mak
1570echo "mandir=\$(DESTDIR)$mandir" >> config.mak
4a908fbc 1571echo "MAKE=$make" >> config.mak
980fc7b8
FB
1572echo "CC=$cc" >> config.mak
1573echo "AR=$ar" >> config.mak
be7109c1 1574echo "RANLIB=$ranlib" >> config.mak
65d1bea2 1575if test "$dostrip" = "yes" ; then
f25fc9b1
MR
1576 echo "STRIP=$strip" >> config.mak
1577 echo "INSTALLSTRIP=$installstrip" >> config.mak
65d1bea2 1578else
f25fc9b1
MR
1579 echo "STRIP=echo ignoring strip" >> config.mak
1580 echo "INSTALLSTRIP=" >> config.mak
65d1bea2 1581fi
75388c74 1582
29799f8b 1583# SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
75388c74 1584# shared modules on OS/X (vhook/Makefile).
57bd82d4
MR
1585SHCFLAGS="$CFLAGS"
1586test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
75388c74 1587
a9b3f630 1588echo "OPTFLAGS=$CFLAGS" >> config.mak
75388c74 1589echo "SHCFLAGS=$SHCFLAGS">>config.mak
0f3cb305 1590echo "LDFLAGS=$LDFLAGS" >> config.mak
f39e56a8 1591echo "LDCONFIG=$LDCONFIG" >> config.mak
4baca069 1592echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 1593echo "SHFLAGS=$SHFLAGS" >> config.mak
80581e98 1594echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
b12f8273 1595echo "BUILD_STATIC=$lstatic" >> config.mak
eb94aca9 1596echo "BUILDSUF=$BUILDSUF" >> config.mak
f3ec2d46 1597echo "LIBPREF=$LIBPREF" >> config.mak
eb94aca9 1598echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
320d060a
DB
1599if test "$lstatic" = "yes" ; then
1600 echo "LIB=$LIB" >> config.mak
1a44a8b6
AS
1601else # Some Make complain if this variable does not exist.
1602 echo "LIB=" >> config.mak
320d060a 1603fi
f3ec2d46 1604echo "SLIBPREF=$SLIBPREF" >> config.mak
eb94aca9
CY
1605echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
1606echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
6852ac95 1607echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 1608if test "$cpu" = "x86" ; then
980fc7b8 1609 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 1610 echo "#define ARCH_X86 1" >> $TMPH
053dea12
AJ
1611elif test "$cpu" = "x86_64" ; then
1612 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1613 echo "#define ARCH_X86_64 1" >> $TMPH
0f3cb305 1614elif test "$cpu" = "armv4l" ; then
6ed7422a 1615 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 1616 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 1617elif test "$cpu" = "alpha" ; then
91d1f1a4 1618 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 1619 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
1620elif test "$cpu" = "sparc64" ; then
1621 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1622 echo "#define ARCH_SPARC64 1" >> $TMPH
bb476ff3
JM
1623 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1624 echo "#define ARCH_SPARC 1" >> $TMPH
1625elif test "$cpu" = "sparc" ; then
1626 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1627 echo "#define ARCH_SPARC 1" >> $TMPH
0f3cb305
FB
1628elif test "$cpu" = "powerpc" ; then
1629 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1630 echo "#define ARCH_POWERPC 1" >> $TMPH
9007f514
RD
1631 if test $POWERPCMODE = "32bits"; then
1632 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1633 else
1634 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1635 fi
e45a2872
RD
1636 if test "$powerpc_perf" = "yes"; then
1637 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1638 fi
d46aba26
LS
1639elif test "$cpu" = "mips" ; then
1640 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1641 echo "#define ARCH_MIPS 1" >> $TMPH
bdb2e37c
AB
1642elif test "$cpu" = "sh4" ; then
1643 echo "TARGET_ARCH_SH4=yes" >> config.mak
1644 echo "#define ARCH_SH4 1" >> $TMPH
67860b26
SH
1645elif test "$cpu" = "parisc" ; then
1646 echo "TARGET_ARCH_PARISC=yes" >> config.mak
1647 echo "#define ARCH_PARISC 1" >> $TMPH
1648elif test "$cpu" = "s390" ; then
1649 echo "TARGET_ARCH_S390=yes" >> config.mak
1650 echo "#define ARCH_S390 1" >> $TMPH
1651elif test "$cpu" = "m68k" ; then
1652 echo "TARGET_ARCH_M68K=yes" >> config.mak
1653 echo "#define ARCH_M68K 1" >> $TMPH
1654elif test "$cpu" = "ia64" ; then
1655 echo "TARGET_ARCH_IA64=yes" >> config.mak
1656 echo "#define ARCH_IA64 1" >> $TMPH
bdb2e37c 1657fi
a4adb608 1658echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
1659if test "$bigendian" = "yes" ; then
1660 echo "WORDS_BIGENDIAN=yes" >> config.mak
1661 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 1662fi
d2a9bddd
MN
1663if test "$inttypes" != "yes" ; then
1664 echo "#define EMULATE_INTTYPES 1" >> $TMPH
7f965c1c 1665fi
b5c950c4 1666if test "$emu_fast_int" = "yes" ; then
19d053c5 1667 echo "#define EMULATE_FAST_INT 1" >> $TMPH
b5c950c4 1668fi
57514323 1669if test "$mmx" = "yes" ; then
980fc7b8 1670 echo "TARGET_MMX=yes" >> config.mak
045ed63f 1671 echo "#define HAVE_MMX 1" >> $TMPH
e82c5a8c 1672 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 1673fi
52b41d7f
FB
1674if test "$builtin_vector" = "yes" ; then
1675 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1676 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1677fi
82eb4b0f
ZM
1678if test "$mm3dnow" = "yes" ; then
1679 echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak
1680 echo "#define HAVE_MM3DNOW 1" >> $TMPH
1681fi
eba9ae3c
GB
1682if test "$iwmmxt" = "yes" ; then
1683 echo "TARGET_IWMMXT=yes" >> config.mak
1684 echo "#define HAVE_IWMMXT 1" >> $TMPH
1685fi
d46aba26
LS
1686if test "$mmi" = "yes" ; then
1687 echo "TARGET_MMI=yes" >> config.mak
1688 echo "#define HAVE_MMI 1" >> $TMPH
1689fi
ab6c65f6
BF
1690if test "$altivec" = "yes" ; then
1691 echo "TARGET_ALTIVEC=yes" >> config.mak
1692 echo "#define HAVE_ALTIVEC 1" >> $TMPH
db40a39a
MN
1693 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1694 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
a9a07762
MN
1695 if test "$_altivec_h" = "yes" ; then
1696 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1697 else
e67e14d5 1698 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
a9a07762 1699 fi
ab6c65f6 1700fi
57514323 1701if test "$gprof" = "yes" ; then
045ed63f 1702 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 1703fi
5e4639e2
GM
1704if test "$localtime_r" = "yes" ; then
1705 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
5e4639e2 1706fi
68892110
PG
1707if test "$imlib2" = "yes" ; then
1708 echo "HAVE_IMLIB2=yes" >> config.mak
1709fi
04511d53
PG
1710if test "$freetype2" = "yes" ; then
1711 echo "HAVE_FREETYPE2=yes" >> config.mak
1712fi
f80f7964
RS
1713if test "$sunmlib" = "yes" ; then
1714 echo "HAVE_MLIB=yes" >> config.mak
1715 echo "#define HAVE_MLIB 1" >> $TMPH
f80f7964 1716fi
9c3d33d6
MN
1717if test "$pthreads" = "yes" ; then
1718 echo "HAVE_PTHREADS=yes" >> config.mak
1719 echo "#define HAVE_PTHREADS 1" >> $TMPH
2450cff2 1720 echo "#define HAVE_THREADS 1" >> $TMPH
9c3d33d6 1721fi
a86b921c
FB
1722if test "$sdl" = "yes" ; then
1723 echo "CONFIG_SDL=yes" >> config.mak
6a1a892f
FD
1724 echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
1725 echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
29f3b38a
MR
1726 if test "$sdl_video_size" = "yes"; then
1727 echo "#define HAVE_SDL_VIDEO_SIZE 1" >> $TMPH
1728 fi
a86b921c 1729fi
146ea952
NB
1730if test "$texi2html" = "yes"; then
1731 echo "BUILD_DOC=yes" >> config.mak
1732fi
95e2ce4a
MN
1733if test "$have_lrintf" = "yes" ; then
1734 echo "#define HAVE_LRINTF 1" >> $TMPH
1735fi
68892110
PG
1736if test "$vhook" = "yes" ; then
1737 echo "BUILD_VHOOK=yes" >> config.mak
1738 echo "#define HAVE_VHOOK 1" >> $TMPH
68892110 1739fi
5a872801 1740
6d9a2421 1741pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
5a872801
LB
1742lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
1743lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
1744lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
1745
1746
1747
57514323 1748if test "$lshared" = "yes" ; then
320d060a 1749 echo "#define BUILD_SHARED_AV 1" >> $TMPH
0319c531 1750 echo "BUILD_SHARED=yes" >> config.mak
97006039 1751 echo "PIC=-fPIC -DPIC" >> config.mak
39503a27 1752 echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
5a872801 1753 echo "SPPVERSION=$lavc_version" >> config.mak
39503a27 1754 echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
5a872801 1755 echo "LAVCVERSION=$lavc_version" >> config.mak
39503a27 1756 echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
5a872801 1757 echo "LAVFVERSION=$lavf_version" >> config.mak
39503a27 1758 echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
5a872801 1759 echo "LAVUVERSION=$lavu_version" >> config.mak
4bdd05e7 1760 echo "SLIBNAME=${SLIBNAME}" >> config.mak
f3b60109
DB
1761 echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
1762 echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
0319c531 1763fi
ef0bc4c9 1764echo "EXTRALIBS=$extralibs" >> config.mak
d2845d68 1765
29799f8b 1766# If you do not want to use encoders, disable them.
55006fc0 1767if echo "$ENCODER_LIST" | grep -q encoder; then
6eefb6fd
MR
1768 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1769 echo "CONFIG_ENCODERS=yes" >> config.mak
1770fi
d771bcae 1771
29799f8b 1772# If you do not want to use decoders, disable them.
55006fc0 1773if echo "$DECODER_LIST" | grep -q decoder; then
6eefb6fd
MR
1774 echo "#define CONFIG_DECODERS 1" >> $TMPH
1775 echo "CONFIG_DECODERS=yes" >> config.mak
1776fi
d771bcae 1777
a9e35095 1778# muxers
ff70e601 1779if echo "$MUXER_LIST" | grep -q muxer; then
a9e35095
DB
1780 echo "#define CONFIG_MUXERS 1" >> $TMPH
1781 echo "CONFIG_MUXERS=yes" >> config.mak
1782fi
1783
1784# demuxers
ff70e601 1785if echo "$DEMUXER_LIST" | grep -q demuxer; then
a9e35095
DB
1786 echo "#define CONFIG_DEMUXERS 1" >> $TMPH
1787 echo "CONFIG_DEMUXERS=yes" >> config.mak
1788fi
1789
5cbcf02c
FB
1790# AC3
1791if test "$a52" = "yes" ; then
1792 echo "#define CONFIG_AC3 1" >> $TMPH
1793 echo "CONFIG_AC3=yes" >> config.mak
d771bcae 1794
5cbcf02c
FB
1795 if test "$a52bin" = "yes" ; then
1796 echo "#define CONFIG_A52BIN 1" >> $TMPH
1797 echo "CONFIG_A52BIN=yes" >> config.mak
1798 fi
1799fi
1800
23c99253
MN
1801# DTS
1802if test "$dts" = "yes" ; then
1803 echo "#define CONFIG_DTS 1" >> $TMPH
1804 echo "CONFIG_DTS=yes" >> config.mak
1805fi
1806
bba9b16c
MN
1807# PP
1808if test "$pp" = "yes" ; then
1809 echo "#define CONFIG_PP 1" >> $TMPH
1810 echo "CONFIG_PP=yes" >> config.mak
bba9b16c
MN
1811fi
1812
29799f8b 1813# MPEG audio high precision mode
1eb2212e
FB
1814if test "$mpegaudio_hp" = "yes" ; then
1815 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1816fi
1817
5cbcf02c
FB
1818if test "$v4l" = "yes" ; then
1819 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1820 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1821fi
1822
0a7b514f
LA
1823if test "$v4l2" = "yes" ; then
1824 echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
1825 echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
1826fi
1827
6beefa40
MN
1828if test "$bktr" = "yes" ; then
1829 echo "#define CONFIG_BKTR 1" >> $TMPH
1830 echo "CONFIG_BKTR=yes" >> config.mak
1831fi
1832
8aa3ee32
MK
1833if test "$dv1394" = "yes" ; then
1834 echo "#define CONFIG_DV1394 1" >> $TMPH
1835 echo "CONFIG_DV1394=yes" >> config.mak
1836fi
1837
f02be79d
RS
1838if test "$dc1394" = "yes" ; then
1839 echo "#define CONFIG_DC1394 1" >> $TMPH
1840 echo "CONFIG_DC1394=yes" >> config.mak
1841fi
1842
adbc0510
PG
1843if test "$dlopen" = "yes" ; then
1844 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1845fi
1846
1847if test "$dlfcn" = "yes" ; then
1848 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1849fi
1850
5cbcf02c
FB
1851if test "$audio_oss" = "yes" ; then
1852 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1853 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
1854fi
1855
dfdfa47c
FR
1856if test "$audio_beos" = "yes" ; then
1857 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1858 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1859fi
1860
5cbcf02c
FB
1861if test "$network" = "yes" ; then
1862 echo "#define CONFIG_NETWORK 1" >> $TMPH
1863 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 1864fi
daf8e955 1865
7a91333f
HZ
1866if test "$ipv6" = "yes" ; then
1867 echo "#define CONFIG_IPV6 1" >> $TMPH
1868fi
1869
0147f198
FR
1870if test "$zlib" = "yes" ; then
1871 echo "#define CONFIG_ZLIB 1" >> $TMPH
1872 echo "CONFIG_ZLIB=yes" >> config.mak
1873fi
1874
bb4c2140
MN
1875if test "$libgsm" = "yes" ; then
1876 echo "#define CONFIG_LIBGSM 1" >> $TMPH
1877 echo "CONFIG_LIBGSM=yes" >> config.mak
1878fi
1879
57514323 1880if test "$mp3lame" = "yes" ; then
045ed63f 1881 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
1882 echo "CONFIG_MP3LAME=yes" >> config.mak
1883fi
1884
9146ca37 1885if test "$libogg" = "yes" ; then
5c5dea3f
NB
1886 echo "#define CONFIG_LIBOGG 1" >> $TMPH
1887 echo "CONFIG_LIBOGG=yes" >> config.mak
1888fi
1889
81e0d0b4 1890if test "$vorbis" = "yes" ; then
5c5dea3f
NB
1891 echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
1892 echo "CONFIG_LIBVORBIS=yes" >> config.mak
1893fi
1894
1895if test "$theora" = "yes" ; then
1896 echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
1897 echo "CONFIG_LIBTHEORA=yes" >> config.mak
81e0d0b4
MH
1898fi
1899
0fc50e58
ZK
1900if test "$faad" = "yes" ; then
1901 echo "#define CONFIG_FAAD 1" >> $TMPH
1902 echo "CONFIG_FAAD=yes" >> config.mak
1903fi
1904
1905if test "$faadbin" = "yes" ; then
1906 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 1907 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
1908fi
1909
29d48296
MN
1910if test "$faac" = "yes" ; then
1911 echo "#define CONFIG_FAAC 1" >> $TMPH
1912 echo "CONFIG_FAAC=yes" >> config.mak
1913fi
1914
1ddadfa9
AT
1915if test "$xvid" = "yes" ; then
1916 echo "#define CONFIG_XVID 1" >> $TMPH
1917 echo "CONFIG_XVID=yes" >> config.mak
1918fi
1919
6662ec29
MN
1920if test "$x264" = "yes" ; then
1921 echo "#define CONFIG_X264 1" >> $TMPH
1922 echo "CONFIG_X264=yes" >> config.mak
1923fi
1924
732d9245
BE
1925if test "$mingw32" = "yes" ; then
1926 echo "#define CONFIG_WIN32 1" >> $TMPH
1927 echo "CONFIG_WIN32=yes" >> config.mak
16806499
MN
1928 echo "HAVE_W32THREADS=yes" >> config.mak
1929 echo "#define HAVE_W32THREADS 1" >> $TMPH
2450cff2 1930 echo "#define HAVE_THREADS 1" >> $TMPH
7eea5766 1931 echo "#ifndef __MINGW32__" >> $TMPH
732d9245 1932 echo "#define __MINGW32__ 1" >> $TMPH
7eea5766 1933 echo "#endif" >> $TMPH
3f027ca7
FB
1934fi
1935
ac44871c
GB
1936if test "$mingwce" = "yes" ; then
1937 echo "#define CONFIG_WIN32 1" >> $TMPH
1938 echo "CONFIG_WIN32=yes" >> config.mak
1939 echo "#define CONFIG_WINCE 1" >> $TMPH
1940 echo "CONFIG_WINCE=yes" >> config.mak
1941 echo "#ifndef __MINGW32__" >> $TMPH
1942 echo "#define __MINGW32__ 1" >> $TMPH
1943 echo "#endif" >> $TMPH
1944fi
1945
f3ec2d46
SG
1946if test "$os2" = "yes" ; then
1947 echo "#define CONFIG_OS2 1" >> $TMPH
1948 echo "CONFIG_OS2=yes" >> config.mak
e2a5fd20
MN
1949 echo "HAVE_OS2THREADS=yes" >> config.mak
1950 echo "#define HAVE_OS2THREADS 1" >> $TMPH
1951 echo "#define HAVE_THREADS 1" >> $TMPH
f3ec2d46
SG
1952fi
1953
6e023978
RS
1954if test "$TARGET_OS" = "SunOS" ; then
1955 echo "#define CONFIG_SUNOS 1" >> $TMPH
1956fi
1957
2450cff2
FR
1958if test "$TARGET_OS" = "BeOS" ; then
1959 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1960 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1961 echo "#define HAVE_THREADS 1" >> $TMPH
1962fi
1963
90cee0c3
MN
1964if test "$darwin" = "yes"; then
1965 echo "#define CONFIG_DARWIN 1" >> $TMPH
1966 echo "CONFIG_DARWIN=yes" >> config.mak
1967fi
1968
57514323 1969if test "$_malloc_h" = "yes" ; then
045ed63f 1970 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 1971else
045ed63f 1972 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
1973fi
1974
57514323 1975if test "$_memalign" = "yes" ; then
045ed63f
ZK
1976 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1977else
1978 echo "#undef HAVE_MEMALIGN" >> $TMPH
1979fi
1980
da9b170c
MN
1981if test "$memalignhack" = "yes" ; then
1982 echo "#define MEMALIGN_HACK 1" >> $TMPH
1983fi
1984
1985
26b35efb
FR
1986if test "$netserver" = "yes" ; then
1987 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1988 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1989fi
1990
4baca069
PG
1991if test "$need_inet_aton" = "yes" ; then
1992 echo "NEED_INET_ATON=yes" >> config.mak
1993fi
1994
57514323 1995if test "$simpleidct" = "yes" ; then
045ed63f
ZK
1996 echo "#define SIMPLE_IDCT 1" >> $TMPH
1997fi
1998
04f46ced
GB
1999if test "$protocols" = "yes" ; then
2000 echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
2001 echo "CONFIG_PROTOCOLS=yes" >> config.mak
2002fi
2003
8154d2e0
FB
2004if test "$ffserver" = "yes" ; then
2005 echo "#define CONFIG_FFSERVER 1" >> $TMPH
2006 echo "CONFIG_FFSERVER=yes" >> config.mak
2007fi
2008
a86b921c
FB
2009if test "$ffplay" = "yes" ; then
2010 echo "CONFIG_FFPLAY=yes" >> config.mak
2011fi
2012
b2e3c528
MN
2013if test "$gpl" = "yes" ; then
2014 echo "#define CONFIG_GPL 1" >> $TMPH
2015 echo "CONFIG_GPL=yes" >> config.mak
2016fi
2017
c13e1abd
FH
2018echo "#define restrict $_restrict" >> $TMPH
2019
bb801c97
MN
2020if test "$optimize" = "small"; then
2021 echo "#define always_inline" >> $TMPH
e5f28e8f 2022 echo "#define CONFIG_SMALL 1" >> $TMPH
bb801c97
MN
2023fi
2024
0f3cb305
FB
2025# build tree in object directory if source path is different from current one
2026if test "$source_path_used" = "yes" ; then
2a4e872b
AS
2027 DIRS="\
2028 doc \
2029 libavformat \
2030 libavcodec \
2031 libavcodec/alpha \
2032 libavcodec/armv4l \
2033 libavcodec/i386 \
2034 libavcodec/sparc \
2035 libavcodec/mlib \
2036 libavcodec/ppc \
2037 libavcodec/liba52 \
6d9a2421 2038 libpostproc \
2a4e872b
AS
2039 libavutil \
2040 tests \
2041 vhook \
2042 "
2043 FILES="\
2044 Makefile \
2045 libavformat/Makefile \
2046 libavcodec/Makefile \
6d9a2421 2047 libpostproc/Makefile \
2a4e872b
AS
2048 libavutil/Makefile \
2049 tests/Makefile \
2050 vhook/Makefile \
2051 doc/Makefile \
2052 doc/texi2pod.pl \
2053 "
0f3cb305
FB
2054 for dir in $DIRS ; do
2055 mkdir -p $dir
2056 done
2057 for f in $FILES ; do
281a74da 2058 ln -sf "$source_path/$f" $f
0f3cb305
FB
2059 done
2060fi
8e955b13 2061echo "SRC_PATH=$source_path" >> config.mak
8b2121e3 2062echo "BUILD_ROOT=$PWD" >> config.mak
0f3cb305 2063
60827a1a
DB
2064if test "$amr" = "yes" ; then
2065 echo "#define AMR 1" >> $TMPH
2066 echo "AMR=yes" >> config.mak
2067fi
2068
d663a1fd
MN
2069if test "$amr_wb" = "yes" ; then
2070 echo "#define AMR_WB 1" >> $TMPH
2071 echo "AMR_WB=yes" >> config.mak
2072 echo
2073 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
2074 echo "V5.1.0 from "
2075 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
2076 echo "and extracted the source to libavcodec/amrwb_float"
d663a1fd
MN
2077fi
2078
891f64b3 2079if test "$amr_nb" = "yes" ; then
2080 echo "#define AMR_NB 1" >> $TMPH
2081 echo "AMR_NB=yes" >> config.mak
2082 echo
6eb07e73
DB
2083 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
2084 echo "REL-5 V5.1.0 from "
c51c4fa0 2085 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip"
6eb07e73
DB
2086 echo "and extracted the source to libavcodec/amr_float"
2087 echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
2088fi
2089
bc634f6f 2090if test "$amr_nb_fixed" = "yes" ; then
bc634f6f 2091 echo "#define AMR_NB_FIXED 1" >> $TMPH
28fff4c8 2092 echo "AMR_NB_FIXED=yes" >> config.mak
b9ca6d47 2093 echo
bc634f6f
ZK
2094 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
2095 echo "REL-5 version 5.1.0 from "
c51c4fa0 2096 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip"
891f64b3 2097 echo "and extracted src to libavcodec/amr"
bc634f6f
ZK
2098 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
2099 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
891f64b3 2100fi
2101
2a515c08
TM
2102if test "$amr_if2" = "yes" ; then
2103 echo "AMR_CFLAGS=-DIF2=1" >> config.mak
2104fi
2105
bc634f6f 2106
55006fc0 2107for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do
ce869f59
MN
2108 echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
2109 echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
009cf97d
MN
2110done
2111
9cb2cf10
DB
2112# Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
2113diff $TMPH config.h >/dev/null 2>&1
214c5f26 2114if test "$?" != "0" ; then
9cb2cf10
DB
2115 mv -f $TMPH config.h
2116else
2117 echo "config.h is unchanged"
2118fi
3d204385 2119
f3ec2d46 2120rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
def4272a
AJ
2121
2122
29799f8b 2123# build pkg-config files libav*.pc and libpostproc.pc
31abdc45 2124# libavutil.pc
2125cat <<EOF >libavutil.pc
2126prefix=$prefix
2127exec_prefix=\${prefix}
2128libdir=\${exec_prefix}/lib
2129includedir=\${prefix}/include
2130
2131Name: libavutil
2132Description: FFmpeg utility library
2133Version: $lavu_version
115329f1 2134Requires:
31abdc45 2135Conflicts:
2136Libs: -L\${libdir} -lavutil
2137Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2138EOF
2139
2140cat <<EOF >libavutil-uninstalled.pc
2141prefix=
2142exec_prefix=
2143libdir=\${pcfiledir}/libavutil
2144includedir=\${pcfiledir}/libavutil
2145
2146Name: libavutil
2147Description: FFmpeg utility library
2148Version: $lavu_version
115329f1 2149Requires:
31abdc45 2150Conflicts:
2151Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
2152Cflags: -I\${includedir}
2153EOF
def4272a
AJ
2154
2155# libavcodec.pc
2156cat <<EOF >libavcodec.pc
2157prefix=$prefix
2158exec_prefix=\${prefix}
2159libdir=\${exec_prefix}/lib
2160includedir=\${prefix}/include
2161
2162Name: libavcodec
2163Description: FFmpeg codec library
31abdc45 2164Version: $lavc_version
c99dd233 2165Requires: $pkg_requires libavutil = $lavu_version
def4272a
AJ
2166Conflicts:
2167Libs: -L\${libdir} -lavcodec $extralibs
2168Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2169EOF
2170
2171cat <<EOF >libavcodec-uninstalled.pc
2172prefix=
2173exec_prefix=
2174libdir=\${pcfiledir}/libavcodec
2175includedir=\${pcfiledir}/libavcodec
2176
2177Name: libavcodec
2178Description: FFmpeg codec library
31abdc45 2179Version: $lavc_version
c99dd233 2180Requires: $pkg_requires libavutil = $lavu_version
def4272a
AJ
2181Conflicts:
2182Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
2183Cflags: -I\${includedir}
2184EOF
2185
2186# libavformat.pc
2187cat <<EOF >libavformat.pc
2188prefix=$prefix
2189exec_prefix=\${prefix}
2190libdir=\${exec_prefix}/lib
2191includedir=\${prefix}/include
2192
2193Name: libavformat
2194Description: FFmpeg container format library
31abdc45 2195Version: $lavf_version
c99dd233 2196Requires: $pkg_requires libavcodec = $lavc_version
def4272a
AJ
2197Conflicts:
2198Libs: -L\${libdir} -lavformat $extralibs
2199Cflags: -I\${includedir} -I\${includedir}/ffmpeg
2200EOF
2201
2202cat <<EOF >libavformat-uninstalled.pc
2203prefix=
2204exec_prefix=
2205libdir=\${pcfiledir}/libavformat
2206includedir=\${pcfiledir}/libavformat
2207
2208Name: libavformat
2209Description: FFmpeg container format library
31abdc45 2210Version: $lavf_version
c99dd233 2211Requires: $pkg_requires libavcodec = $lavc_version
def4272a
AJ
2212Conflicts:
2213Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
2214Cflags: -I\${includedir}
2215EOF
2216
2217
2218# libpostproc.pc
2219cat <<EOF >libpostproc.pc
2220prefix=$prefix
2221exec_prefix=\${prefix}
2222libdir=\${exec_prefix}/lib
2223includedir=\${prefix}/include
2224
2225Name: libpostproc
2226Description: FFmpeg post processing library
31abdc45 2227Version: $lavc_version
115329f1 2228Requires:
def4272a
AJ
2229Conflicts:
2230Libs: -L\${libdir} -lpostproc
2231Cflags: -I\${includedir} -I\${includedir}/postproc
2232EOF
2233
2234cat <<EOF >libpostproc-uninstalled.pc
2235prefix=
2236exec_prefix=
6d9a2421
DB
2237libdir=\${pcfiledir}/libpostproc
2238includedir=\${pcfiledir}/libpostproc
def4272a
AJ
2239
2240Name: libpostproc
2241Description: FFmpeg post processing library
31abdc45 2242Version: $lavc_version
115329f1 2243Requires:
def4272a
AJ
2244Conflicts:
2245Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
2246Cflags: -I\${includedir}
2247EOF