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