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