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