aeb29222 |
#!/bin/sh |
0f3cb305 |
# |
f57620d5 |
# FFmpeg configure script
# |
949906ea |
# Copyright (c) 2000-2002 Fabrice Bellard
# Copyright (c) 2005-2008 Diego Biurrun
# Copyright (c) 2005-2008 Mans Rullgard |
0f3cb305 |
# |
cf9d24ad |
|
31e647f8 |
# Prevent locale nonsense from breaking basic text processing. |
79ab96ba |
LC_ALL=C
export LC_ALL |
31e647f8 |
|
cde2d79a |
# make sure we are running under a compatible shell |
c21d6325 |
# try to make this part work with most shells
try_exec(){ |
0dbe81bb |
echo "Trying shell $1" |
2270b4b2 |
type "$1" > /dev/null 2>&1 && exec "$@" |
c21d6325 |
}
|
5237ce67 |
unset foo |
2270b4b2 |
(: ${foo%%bar}) 2> /dev/null |
0dbe81bb |
E1="$?"
|
2270b4b2 |
(: ${foo?}) 2> /dev/null |
0dbe81bb |
E2="$?"
if test "$E1" != 0 || test "$E2" = 0; then
echo "Broken shell detected. Trying alternatives." |
c21d6325 |
export FF_CONF_EXEC
if test "0$FF_CONF_EXEC" -lt 1; then
FF_CONF_EXEC=1
try_exec bash "$0" "$@"
fi
if test "0$FF_CONF_EXEC" -lt 2; then
FF_CONF_EXEC=2
try_exec ksh "$0" "$@"
fi
if test "0$FF_CONF_EXEC" -lt 3; then
FF_CONF_EXEC=3
try_exec /usr/xpg4/bin/sh "$0" "$@" |
cde2d79a |
fi
echo "No compatible shell script interpreter found." |
fc53da20 |
echo "This configure script requires a POSIX-compatible shell" |
c21d6325 |
echo "such as bash or ksh." |
505dfb09 |
echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH."
echo "Instead, install a working POSIX-compatible shell."
echo "Disabling this configure test will create a broken FFmpeg." |
c21d6325 |
if test "$BASH_VERSION" = '2.04.0(1)-release'; then
echo "This bash version ($BASH_VERSION) is broken on your platform."
echo "Upgrade to a later version if available."
fi |
cde2d79a |
exit 1
fi
|
74c53c2d |
show_help(){
echo "Usage: configure [options]"
echo "Options: [defaults in brackets after descriptions]"
echo
echo "Standard options:"
echo " --help print this message" |
8c6afa4d |
echo " --logfile=FILE log tests and output to FILE [config.err]"
echo " --disable-logging do not log configure debug information" |
3e89171a |
echo " --prefix=PREFIX install in PREFIX [$prefix]" |
d156bede |
echo " --bindir=DIR install binaries in DIR [PREFIX/bin]" |
14a8acf1 |
echo " --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]" |
74c53c2d |
echo " --libdir=DIR install libs in DIR [PREFIX/lib]" |
84c22efd |
echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]" |
5341d856 |
echo " --incdir=DIR install includes in DIR [PREFIX/include]" |
4ca5ece5 |
echo " --mandir=DIR install man page in DIR [PREFIX/share/man]" |
62560865 |
echo
echo "Configuration options:" |
e6b9d588 |
echo " --disable-static do not build static libraries [no]"
echo " --enable-shared build shared libraries [no]" |
0a23c0bb |
echo " --enable-gpl allow use of GPL code, the resulting libs"
echo " and binaries will be under GPL [no]" |
dd2089df |
echo " --enable-version3 upgrade (L)GPL to version 3 [no]" |
0a23c0bb |
echo " --enable-nonfree allow use of nonfree code, the resulting libs"
echo " and binaries will be unredistributable [no]" |
62560865 |
echo " --disable-ffmpeg disable ffmpeg build"
echo " --disable-ffplay disable ffplay build"
echo " --disable-ffserver disable ffserver build" |
e6b9d588 |
echo " --enable-postproc enable GPLed postprocessing support [no]" |
fe95afe1 |
echo " --enable-swscale enable software scaler support [no]" |
e6b9d588 |
echo " --enable-avfilter video filter support (replaces vhook) [no]" |
0a23c0bb |
echo " --enable-avfilter-lavf video filters dependent on avformat [no]" |
4f50c3d5 |
echo " --disable-vhook disable video hooking support" |
e6b9d588 |
echo " --enable-beosthreads use BeOS threads [no]"
echo " --enable-os2threads use OS/2 threads [no]"
echo " --enable-pthreads use pthreads [no]"
echo " --enable-w32threads use Win32 threads [no]"
echo " --enable-x11grab enable X11 grabbing [no]" |
732c9a34 |
echo " --enable-vdpau enable VDPAU support [no]" |
62560865 |
echo " --disable-network disable network support [no]"
echo " --disable-ipv6 disable IPv6 support [no]"
echo " --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]"
echo " --enable-gray enable full grayscale support (slower color)" |
242e2270 |
echo " --enable-fastdiv enable table-based division" |
62560865 |
echo " --enable-small optimize for size instead of speed"
echo " --disable-aandct disable AAN DCT code"
echo " --disable-fft disable FFT code"
echo " --disable-golomb disable Golomb code"
echo " --disable-mdct disable MDCT code" |
68602540 |
echo " --disable-rdft disable RDFT code" |
478394ba |
echo " --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)" |
62560865 |
echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation"
echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
echo " --enable-beos-netserver enable BeOS netserver"
echo " --disable-encoder=NAME disable encoder NAME"
echo " --enable-encoder=NAME enable encoder NAME"
echo " --disable-encoders disable all encoders"
echo " --disable-decoder=NAME disable decoder NAME"
echo " --enable-decoder=NAME enable decoder NAME"
echo " --disable-decoders disable all decoders"
echo " --disable-muxer=NAME disable muxer NAME"
echo " --enable-muxer=NAME enable muxer NAME"
echo " --disable-muxers disable all muxers"
echo " --disable-demuxer=NAME disable demuxer NAME"
echo " --enable-demuxer=NAME enable demuxer NAME"
echo " --disable-demuxers disable all demuxers"
echo " --enable-parser=NAME enable parser NAME"
echo " --disable-parser=NAME disable parser NAME"
echo " --disable-parsers disable all parsers"
echo " --enable-bsf=NAME enable bitstream filter NAME"
echo " --disable-bsf=NAME disable bitstream filter NAME"
echo " --disable-bsfs disable all bitstream filters"
echo " --enable-protocol=NAME enable protocol NAME"
echo " --disable-protocol=NAME disable protocol NAME"
echo " --disable-protocols disable all protocols"
echo " --disable-indevs disable input devices"
echo " --disable-outdevs disable output devices"
echo " --disable-devices disable all devices"
echo " --enable-filter=NAME enable filter NAME"
echo " --disable-filter=NAME disable filter NAME"
echo " --disable-filters disable all filters"
echo " --list-decoders show all available decoders"
echo " --list-encoders show all available encoders"
echo " --list-muxers show all available muxers"
echo " --list-demuxers show all available demuxers"
echo " --list-parsers show all available parsers"
echo " --list-protocols show all available protocols"
echo " --list-bsfs show all available bitstream filters"
echo " --list-indevs show all available input devices"
echo " --list-outdevs show all available output devices"
echo " --list-filters show all available filters" |
0a622b98 |
echo
echo "External library support:" |
0a23c0bb |
echo " --enable-avisynth enable reading of AVISynth script files [no]" |
27cb5cbc |
echo " --enable-bzlib enable bzlib [autodetect]"
echo " --enable-libamr-nb enable libamr-nb floating point audio codec [no]"
echo " --enable-libamr-wb enable libamr-wb floating point audio codec [no]" |
9ad437ea |
echo " --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]"
echo " --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]" |
f7b8bffe |
echo " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394" |
e6b9d588 |
echo " and libraw1394 [no]"
echo " --enable-libdirac enable Dirac support via libdirac [no]"
echo " --enable-libfaac enable FAAC support via libfaac [no]"
echo " --enable-libfaad enable FAAD support via libfaad [no]"
echo " --enable-libfaadbin open libfaad.so.0 at runtime [no]"
echo " --enable-libgsm enable GSM support via libgsm [no]"
echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [no]" |
31235134 |
echo " --enable-libnut enable NUT (de)muxing via libnut," |
0a23c0bb |
echo " native (de)muxer exists [no]" |
9a77d59a |
echo " --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]" |
e6b9d588 |
echo " --enable-libschroedinger enable Dirac support via libschroedinger [no]"
echo " --enable-libspeex enable Speex decoding via libspeex [no]"
echo " --enable-libtheora enable Theora encoding via libtheora [no]" |
f9def9cc |
echo " --enable-libvorbis enable Vorbis encoding via libvorbis," |
e6b9d588 |
echo " native implementation exists [no]"
echo " --enable-libx264 enable H.264 encoding via x264 [no]" |
1cc60c47 |
echo " --enable-libxvid enable Xvid encoding via xvidcore," |
e6b9d588 |
echo " native MPEG-4/Xvid encoder exists [no]" |
732c9a34 |
echo " --enable-mlib enable Sun medialib [no]" |
27cb5cbc |
echo " --enable-zlib enable zlib [autodetect]" |
74c53c2d |
echo ""
echo "Advanced options (experts only):"
echo " --source-path=PATH path to source code [$source_path]"
echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" |
db6107b6 |
echo " --enable-cross-compile assume a cross-compiler is used" |
c5200f17 |
echo " --sysroot=PATH root of cross-build tree"
echo " --sysinclude=PATH location of cross-build system headers" |
4f854758 |
echo " --target-os=OS compiler targets OS [$target_os]" |
a7ada2ba |
echo " --target-exec=CMD command to run executables on target"
echo " --target-path=DIR path to view of build directory on target" |
89641463 |
echo " --nm=NM use nm tool" |
15396d5c |
echo " --cc=CC use C compiler CC [$cc_default]" |
9da6609f |
echo " --host-cc=HOSTCC use host C compiler HOSTCC"
echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host"
echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host"
echo " --host-libs=HLIBS use libs HLIBS when linking for host" |
74c53c2d |
echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
echo " --extra-libs=ELIBS add ELIBS [$ELIBS]" |
ac63af34 |
echo " --extra-version=STRING version string suffix []" |
0a23c0bb |
echo " --build-suffix=SUFFIX library name suffix []"
echo " --arch=ARCH select architecture [$arch]"
echo " --cpu=CPU select the minimum required CPU (affects" |
7c758d33 |
echo " instruction selection, may crash on older CPUs)" |
2b4c3615 |
echo " --enable-powerpc-perf enable performance report on PPC" |
74c53c2d |
echo " (requires enabling PMC)" |
4f50c3d5 |
echo " --disable-altivec disable AltiVec optimizations" |
3bf96eec |
echo " --disable-amd3dnow disable 3DNow! optimizations" |
a1ef9f08 |
echo " --disable-amd3dnowext disable 3DNow! extended optimizations" |
0a23c0bb |
echo " --disable-mmx disable MMX optimizations"
echo " --disable-mmx2 disable MMX2 optimizations" |
1bb04d5a |
echo " --disable-sse disable SSE optimizations" |
0a23c0bb |
echo " --disable-ssse3 disable SSSE3 optimizations"
echo " --disable-armv5te disable armv5te optimizations"
echo " --disable-armv6 disable armv6 optimizations" |
26c7aa17 |
echo " --disable-armv6t2 disable armv6t2 optimizations" |
3bbcba32 |
echo " --disable-armvfp disable ARM VFP optimizations" |
0a23c0bb |
echo " --disable-iwmmxt disable iwmmxt optimizations" |
49276307 |
echo " --disable-mmi disable MMI optimizations"
echo " --disable-neon disable neon optimizations"
echo " --disable-vis disable VIS optimizations" |
7595a5e4 |
echo " --disable-yasm disable use of yasm assembler" |
0a622b98 |
echo
echo "Developer options (useful when working on FFmpeg itself):" |
9c56a1f9 |
echo " --disable-debug disable debugging symbols" |
b7d49373 |
echo " --enable-debug=LEVEL set the debug level [$debuglevel]" |
0a622b98 |
echo " --enable-gprof enable profiling with gprof [$gprof]" |
d2bbb2f7 |
echo " --disable-optimizations disable compiler optimizations" |
0a622b98 |
echo " --enable-extra-warnings enable more compiler warnings" |
87a0fb62 |
echo " --disable-stripping disable stripping of executables and shared libraries" |
74c53c2d |
echo ""
echo "NOTE: Object files are built at the place where configure is launched." |
60e8bc13 |
exit 0 |
74c53c2d |
} |
cf9d24ad |
|
57bd82d4 |
log(){ |
2270b4b2 |
echo "$@" >> $logfile |
57bd82d4 |
}
|
720c69da |
log_file(){ |
c8e9f801 |
log BEGIN $1 |
2270b4b2 |
pr -n -t $1 >> $logfile |
c8e9f801 |
log END $1
}
|
2ba042a7 |
echolog(){ |
c8e9f801 |
log "$@" |
57bd82d4 |
echo "$@" |
2ba042a7 |
}
die(){
echolog "$@"
cat <<EOF
If you think configure made a mistake, make sure you are using the latest
version from SVN. If the latest version fails, report the problem to the |
e5d8ccd7 |
ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net. |
2ba042a7 |
EOF |
e155a21a |
if disabled logging; then |
2ba042a7 |
cat <<EOF |
e155a21a |
Rerun configure with logging enabled (do not use --disable-logging), and
include the log this produces with your report. |
2ba042a7 |
EOF
else
cat <<EOF |
e155a21a |
Include the log file "$logfile" produced by configure as this will help
solving the problem. |
2ba042a7 |
EOF
fi |
57bd82d4 |
exit 1
}
|
6c6007d6 |
# Avoid locale weirdness, besides we really just want to translate ASCII. |
44161118 |
toupper(){ |
6c6007d6 |
echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ |
44161118 |
}
|
4a5444db |
tolower(){ |
6c6007d6 |
echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz |
4a5444db |
}
|
14a8acf1 |
c_escape(){
echo "$*" | sed 's/["\\]/\\\0/g'
}
|
a8d04fba |
set_all(){
value=$1
shift
for var in $*; do
eval $var=$value
done
}
|
72a43668 |
set_weak(){
value=$1
shift
for var; do
eval : \${$var:=$value}
done
}
|
799c9e9b |
pushvar(){
for var in $*; do
eval level=\${${var}_level:=0}
eval ${var}_${level}="\$$var"
eval ${var}_level=$(($level+1))
done
}
popvar(){
for var in $*; do
eval level=\${${var}_level:-0}
test $level = 0 && continue
eval level=$(($level-1))
eval $var="\${${var}_${level}}"
eval ${var}_level=$level
eval unset ${var}_${level}
done
}
|
a8d04fba |
enable(){
set_all yes $*
}
disable(){
set_all no $*
}
|
72a43668 |
enable_weak(){
set_weak yes $*
}
disable_weak(){
set_weak no $*
}
|
72702705 |
enable_safe(){
enable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
}
disable_safe(){
disable $(echo "$*" | sed 's/[^A-Za-z0-9_ ]/_/g')
}
|
f9d328da |
do_enable_deep(){
for var; do
enabled $var && continue
eval sel="\$${var}_select" |
c510c7b5 |
eval sgs="\$${var}_suggest"
pushvar var sgs |
f9d328da |
enable_deep $sel |
c510c7b5 |
popvar sgs
enable_deep_weak $sgs |
f9d328da |
popvar var
done
}
enable_deep(){
do_enable_deep $*
enable $*
}
|
72a43668 |
enable_deep_weak(){
do_enable_deep $*
enable_weak $*
}
|
57bd82d4 |
enabled(){ |
3250003c |
test "${1#!}" = "$1" && op== || op=!=
eval test "x\$${1#!}" $op "xyes" |
44161118 |
}
|
37970ebf |
disabled(){ |
3250003c |
test "${1#!}" = "$1" && op== || op=!=
eval test "x\$${1#!}" $op "xno" |
37970ebf |
}
|
44161118 |
enabled_all(){
for opt; do
enabled $opt || return 1
done
}
|
85bca2c5 |
disabled_all(){
for opt; do
disabled $opt || return 1
done
}
|
44161118 |
enabled_any(){
for opt; do
enabled $opt && return 0
done
}
|
85bca2c5 |
disabled_any(){
for opt; do
disabled $opt && return 0
done |
f7b230a7 |
return 1 |
85bca2c5 |
}
|
c9d19248 |
set_default(){
for opt; do |
88268e94 |
eval : \${$opt:=\$${opt}_default} |
c9d19248 |
done
}
|
4a0d6686 |
is_in(){
value=$1
shift
for var in $*; do
[ $var = $value ] && return 0
done
return 1
}
|
30fd06be |
check_deps(){
for cfg; do |
3250003c |
cfg="${cfg#!}" |
799c9e9b |
enabled ${cfg}_checking && die "Circular dependency for $cfg."
disabled ${cfg}_checking && continue
enable ${cfg}_checking
|
30fd06be |
eval dep_all="\$${cfg}_deps"
eval dep_any="\$${cfg}_deps_any" |
7ef3425f |
eval dep_sel="\$${cfg}_select" |
c510c7b5 |
eval dep_sgs="\$${cfg}_suggest" |
799c9e9b |
|
c510c7b5 |
pushvar cfg dep_all dep_any dep_sel dep_sgs
check_deps $dep_all $dep_any $dep_sel $dep_sgs
popvar cfg dep_all dep_any dep_sel dep_sgs |
799c9e9b |
|
6a702d4c |
enabled_all $dep_all || disable $cfg
enabled_any $dep_any || disable $cfg |
7ef3425f |
disabled_any $dep_sel && disable $cfg |
799c9e9b |
|
4ec45764 |
if enabled $cfg; then
eval dep_extralibs="\$${cfg}_extralibs"
test -n "$dep_extralibs" && add_extralibs $dep_extralibs |
f9d328da |
enable_deep $dep_sel |
c510c7b5 |
enable_deep_weak $dep_sgs |
4ec45764 |
fi
|
799c9e9b |
disable ${cfg}_checking |
30fd06be |
done
}
|
44161118 |
print_config(){
pfx=$1
header=$2
makefile=$3
shift 3
for cfg; do |
3d907e22 |
ucname="`toupper $cfg`" |
44161118 |
if enabled $cfg; then |
3d907e22 |
echo "#define ${pfx}${ucname} 1" >> $header
echo "${pfx}${ucname}=yes" >> $makefile
else |
b250f9c6 |
echo "#define ${pfx}${ucname} 0" >> $header |
44161118 |
fi
done |
57bd82d4 |
}
flags_saved(){ |
2270b4b2 |
(: ${SAVE_CFLAGS?}) 2> /dev/null |
57bd82d4 |
}
|
dcd479c0 |
save_flags(){ |
57bd82d4 |
flags_saved && return |
dcd479c0 |
SAVE_CFLAGS="$CFLAGS"
SAVE_LDFLAGS="$LDFLAGS"
SAVE_extralibs="$extralibs"
}
restore_flags(){ |
f5d28d10 |
flags_saved || return |
dcd479c0 |
CFLAGS="$SAVE_CFLAGS"
LDFLAGS="$SAVE_LDFLAGS"
extralibs="$SAVE_extralibs"
unset SAVE_CFLAGS
unset SAVE_LDFLAGS
unset SAVE_extralibs
}
temp_cflags(){
save_flags
CFLAGS="$CFLAGS $*"
}
temp_ldflags(){
save_flags
LDFLAGS="$LDFLAGS $*"
}
temp_extralibs(){
save_flags
extralibs="$extralibs $*"
}
|
57bd82d4 |
append(){
var=$1
shift
flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
eval "$var=\"\$$var $*\""
}
add_cflags(){
append CFLAGS "$@"
}
add_ldflags(){
append LDFLAGS "$@"
}
add_extralibs(){
append extralibs "$@"
}
|
b0cfb663 |
check_cmd(){ |
b3cb5d51 |
log "$@" |
2270b4b2 |
"$@" >> $logfile 2>&1 |
b0cfb663 |
}
|
dcd479c0 |
check_cc(){ |
57bd82d4 |
log check_cc "$@" |
2270b4b2 |
cat > $TMPC |
720c69da |
log_file $TMPC |
b0cfb663 |
check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC |
57bd82d4 |
}
check_cpp(){
log check_cpp "$@" |
2270b4b2 |
cat > $TMPC |
720c69da |
log_file $TMPC |
b0cfb663 |
check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC |
dcd479c0 |
}
|
940f335a |
check_asm(){
log check_asm "$@"
name="$1"
asm="$2"
shift 2
check_cc "$@" <<EOF && enable $name || disable $name |
124c21d7 |
void foo(void){ __asm__ volatile($asm); } |
940f335a |
EOF
}
|
304d586d |
check_yasm(){
log check_yasm "$@"
echo "$1" > $TMPS
log_file $TMPS
shift 1
check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
}
|
dcd479c0 |
check_ld(){ |
57bd82d4 |
log check_ld "$@" |
0607887f |
check_cc || return |
3155a644 |
flags=''
libs=''
for f; do
test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
done
check_cmd $cc $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs |
dcd479c0 |
}
check_cflags(){ |
57bd82d4 |
log check_cflags "$@"
check_cc "$@" <<EOF && add_cflags "$@" |
dcd479c0 |
int x;
EOF
}
|
a9785f58 |
test_ldflags(){
log test_ldflags "$@"
check_ld "$@" <<EOF |
c23a0ac8 |
int main(void){ return 0; } |
dcd479c0 |
EOF
}
|
a9785f58 |
check_ldflags(){
log check_ldflags "$@"
test_ldflags "$@" && add_ldflags "$@"
}
|
dcd479c0 |
check_header(){ |
57bd82d4 |
log check_header "$@" |
dcd479c0 |
header=$1
shift |
b77df637 |
disable_safe $header
check_cpp "$@" <<EOF && enable_safe $header |
dcd479c0 |
#include <$header>
int x;
EOF
}
check_func(){ |
57bd82d4 |
log check_func "$@" |
dcd479c0 |
func=$1
shift |
d8bc5f06 |
disable $func
check_ld "$@" <<EOF && enable $func |
dcd479c0 |
extern int $func(); |
c23a0ac8 |
int main(void){ $func(); } |
dcd479c0 |
EOF
}
|
2446d3d6 |
check_func_headers(){
log check_func_headers "$@" |
f8d7b072 |
headers=$1
func=$2
shift 2
disable $func
incs=""
for hdr in $headers; do
incs="$incs
#include <$hdr>"
done |
cd0d9a9d |
check_ld "$@" <<EOF && enable $func && enable_safe $headers |
f8d7b072 |
$incs |
d6773f56 |
int main(int argc, char **argv){ |
f8d7b072 |
(void) $func;
return 0;
}
EOF
}
|
a5344cf7 |
check_cpp_condition(){
log check_cpp_condition "$@"
header=$1
condition=$2
check_cpp <<EOF
#include <$header>
#if !($condition)
#error "unsatisfied condition: $condition"
#endif
EOF
}
|
57bd82d4 |
check_lib(){
log check_lib "$@"
header="$1"
func="$2"
shift 2 |
fcfcde17 |
temp_extralibs "$@"
check_header $header && check_func $func && add_extralibs "$@"
err=$?
restore_flags
return $err |
57bd82d4 |
}
|
f8d7b072 |
check_lib2(){
log check_lib2 "$@"
headers="$1"
func="$2"
shift 2
temp_extralibs "$@" |
2446d3d6 |
check_func_headers "$headers" $func && add_extralibs "$@" |
f8d7b072 |
err=$?
restore_flags
return $err
}
|
dcd479c0 |
check_exec(){ |
2270b4b2 |
check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; } |
57bd82d4 |
}
|
7dfef245 |
check_exec_crash(){
code=`cat`
# exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
# are safe but may not be available everywhere. Thus we use
# raise(SIGTERM) instead. The check is run in a subshell so we
# can redirect the "Terminated" message from the shell. SIGBUS
# is not defined by standard C so it is used conditionally.
|
2270b4b2 |
(check_exec "$@") >> $logfile 2>&1 <<EOF |
7dfef245 |
#include <signal.h>
static void sighandler(int sig){
raise(SIGTERM);
} |
e5af4a11 |
int main(void){ |
7dfef245 |
signal(SIGILL, sighandler);
signal(SIGFPE, sighandler);
signal(SIGSEGV, sighandler);
#ifdef SIGBUS
signal(SIGBUS, sighandler);
#endif
{ $code }
}
EOF
}
|
72be9e73 |
check_type(){
log check_type "$@"
headers=$1
type=$2
shift 2
disable $type
incs=""
for hdr in $headers; do
incs="$incs
#include <$hdr>"
done
check_cc "$@" <<EOF && enable $type
$incs
$type v;
EOF
}
|
57bd82d4 |
require(){
name="$1"
header="$2"
func="$3"
shift 3
check_lib $header $func "$@" || die "ERROR: $name not found" |
dcd479c0 |
}
|
f8d7b072 |
require2(){
name="$1"
headers="$2"
func="$3"
shift 3
check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
}
|
eea50282 |
check_foo_config(){
cfg=$1
pkg=$2
header=$3
func=$4
shift 4
disable $cfg
check_cmd ${pkg}-config --version
err=$?
if test "$err" = 0; then
temp_cflags `${pkg}-config --cflags`
temp_extralibs `${pkg}-config --libs`
check_lib "$@" $header $func && enable $cfg
fi
return $err
}
|
c505dd31 |
apply(){
file=$1
shift
"$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
}
|
dcd61286 |
# CONFIG_LIST contains configurable options, while HAVE_LIST is for
# system-dependent things.
|
4a0d6686 |
COMPONENT_LIST="
bsfs
decoders
demuxers
encoders |
3cde40aa |
filters |
c552605c |
indevs |
4a0d6686 |
muxers |
c552605c |
outdevs |
4a0d6686 |
parsers
protocols
"
CONFIG_LIST="
$COMPONENT_LIST |
e8ed9b7a |
aandct |
f7679c54 |
avfilter
avfilter_lavf |
c88f5d72 |
avisynth
beos_netserver |
f402916e |
bzlib |
27a9466b |
fastdiv |
c88f5d72 |
ffmpeg
ffplay
ffserver |
1848f7d9 |
fft |
4f034993 |
golomb |
c88f5d72 |
gpl |
ecfc4f44 |
gprof |
d8d0d0b2 |
gray |
3abe5fbd |
hardcoded_tables |
c88f5d72 |
ipv6 |
f5a756ef |
libamr_nb
libamr_wb |
f7b8bffe |
libdc1394 |
690bfceb |
libdirac |
2eed5a46 |
libfaac
libfaad
libfaadbin |
c88f5d72 |
libgsm |
6ebe07fb |
libmp3lame |
c88f5d72 |
libnut |
9ad437ea |
libopencore_amrnb
libopencore_amrwb |
9a77d59a |
libopenjpeg |
f7cd9eed |
libschroedinger |
ae14f311 |
libspeex |
150d2772 |
libtheora |
c88f5d72 |
libvorbis |
1cc60c47 |
libx264
libxvid |
47a158cb |
mdct |
c88f5d72 |
memalign_hack |
a8150374 |
mlib |
c88f5d72 |
mpegaudio_hp
network |
3fe142e2 |
nonfree |
4a24ab64 |
postproc |
2b4c3615 |
powerpc_perf |
68602540 |
rdft |
478394ba |
runtime_cpudetect |
2e35e684 |
shared |
bd2216e4 |
small |
2e35e684 |
static |
13ca50f3 |
swscale |
272081b0 |
vdpau |
c88f5d72 |
vhook |
dd2089df |
version3 |
56a059ac |
x11grab |
c88f5d72 |
zlib |
4a0d6686 |
" |
c88f5d72 |
|
8eee7025 |
THREADS_LIST='
beosthreads |
d22e8442 |
os2threads |
8eee7025 |
pthreads
w32threads
'
|
3f5b56e5 |
ARCH_LIST='
alpha |
a2fc0f6a |
arm |
3f5b56e5 |
bfin
ia64
m68k
mips
parisc |
79cb09b2 |
ppc |
3f5b56e5 |
s390
sh4
sparc
sparc64
x86
x86_32
x86_64
'
ARCH_EXT_LIST=' |
1ac9331a |
altivec |
3bf96eec |
amd3dnow |
a1ef9f08 |
amd3dnowext |
1ac9331a |
armv5te |
edab3048 |
armv6 |
ab5cb084 |
armv6t2 |
f55b299a |
armvfp |
3f5b56e5 |
iwmmxt
mmi
mmx |
d7f0920b |
mmx2 |
6b18d278 |
neon |
799fde37 |
ppc4xx |
1bb04d5a |
sse |
9eeed841 |
ssse3 |
bd9d34a0 |
vis |
3f5b56e5 |
'
HAVE_LIST="
$ARCH_EXT_LIST
$THREADS_LIST |
35fd8122 |
alsa_asoundlib_h |
3f5b56e5 |
altivec_h |
c9fdab0d |
arpa_inet_h |
6bd859d6 |
bswap |
ecf97f22 |
closesocket |
1ac9331a |
cmov |
e16e49ac |
conio_h |
c88f5d72 |
dcbzl |
f8aa696f |
dev_bktr_ioctl_bt848_h
dev_bktr_ioctl_meteor_h
dev_ic_bt8xx_h
dev_video_meteor_ioctl_meteor_h
dev_video_bktr_ioctl_bt848_h |
18b67ae5 |
dlfcn_h |
c88f5d72 |
dlopen |
bc574408 |
dos_paths |
245626d0 |
ebp_available
ebx_available |
c2a29455 |
fast_64bit |
7073e9fc |
fast_cmov |
7b829d2a |
fast_unaligned |
9d99cc5a |
fork |
c88f5d72 |
freetype2 |
da9e86f8 |
gethrtime |
4e68cb8a |
GetProcessTimes |
66be5b45 |
getrusage |
c88f5d72 |
imlib2 |
2e1913b1 |
inet_aton |
61d251db |
inline_asm |
0b4a1821 |
libdc1394_1
libdc1394_2 |
a33cab3a |
llrint
lrint |
c88f5d72 |
lrintf |
f8aa696f |
machine_ioctl_bt848_h
machine_ioctl_meteor_h |
c88f5d72 |
malloc_h
memalign |
6ffa87d3 |
mkstemp |
b4e806b2 |
pld |
1f91cdce |
posix_memalign |
9cafbd6c |
ppc64 |
a33cab3a |
round
roundf |
c88f5d72 |
sdl
sdl_video_size |
b507ebd1 |
setmode |
72be9e73 |
socklen_t |
deb29777 |
soundcard_h |
f8cda19e |
poll_h |
b58412f1 |
sys_mman_h |
b091aa44 |
sys_resource_h |
81644c2e |
sys_select_h |
deb29777 |
sys_soundcard_h |
1b6e8b73 |
sys_videoio_h |
d3a4b4e0 |
ten_operands |
e16e49ac |
termios_h |
b265431e |
threads |
7b04b8a0 |
truncf |
6ff3f3e7 |
winsock2_h |
304d586d |
yasm |
0cb78cef |
" |
44161118 |
|
b6bb00b0 |
# options emitted with CONFIG_ prefix but not available on command line
CONFIG_EXTRA=" |
dd2089df |
gplv3
lgplv3 |
40b509b3 |
oldscaler |
b6bb00b0 |
"
|
520cc7f1 |
CMDLINE_SELECT=" |
3f5b56e5 |
$ARCH_EXT_LIST |
520cc7f1 |
$CONFIG_LIST |
8eee7025 |
$THREADS_LIST |
db6107b6 |
cross_compile |
520cc7f1 |
debug
extra_warnings |
8c6afa4d |
logging |
d2bbb2f7 |
optimizations |
87a0fb62 |
stripping |
7595a5e4 |
yasm |
520cc7f1 |
" |
426be5dc |
PATHS_LIST=' |
d156bede |
bindir |
14a8acf1 |
datadir |
26759c44 |
incdir
libdir
mandir
prefix
shlibdir |
426be5dc |
'
CMDLINE_SET="
$PATHS_LIST
arch
build_suffix
cc
cpu
cross_prefix |
ac63af34 |
extra_version |
9da6609f |
host_cc
host_cflags
host_ldflags
host_libs |
426be5dc |
logfile |
89641463 |
nm |
26759c44 |
source_path |
c5200f17 |
sysinclude
sysroot |
a7ada2ba |
target_exec |
26759c44 |
target_os |
a7ada2ba |
target_path |
426be5dc |
" |
520cc7f1 |
|
912f3148 |
# code dependency declarations
|
9eeed841 |
# architecture extensions |
79cb09b2 |
altivec_deps="ppc" |
3bf96eec |
amd3dnow_deps="mmx" |
a1ef9f08 |
amd3dnowext_deps="amd3dnow" |
a2fc0f6a |
armv5te_deps="arm"
armv6_deps="arm" |
ab5cb084 |
armv6t2_deps="arm" |
a2fc0f6a |
armvfp_deps="arm"
iwmmxt_deps="arm" |
e241ba14 |
mmi_deps="mips" |
9eeed841 |
mmx_deps="x86" |
75aa95a6 |
mmx2_deps="mmx" |
a2fc0f6a |
neon_deps="arm" |
799fde37 |
ppc4xx_deps="ppc" |
75aa95a6 |
sse_deps="mmx"
ssse3_deps="sse" |
bd9d34a0 |
vis_deps="sparc" |
9eeed841 |
|
b6bb00b0 |
# common features |
40b509b3 |
oldscaler_deps="!swscale" |
b6bb00b0 |
|
912f3148 |
# decoders / encoders |
47a158cb |
aac_decoder_select="fft mdct"
ac3_decoder_select="fft mdct"
atrac3_decoder_select="fft mdct" |
4f034993 |
cavs_decoder_select="golomb" |
47a158cb |
cook_decoder_select="fft mdct" |
2eef7c62 |
cscd_decoder_suggest="zlib" |
47a158cb |
dca_decoder_select="fft mdct" |
e8ed9b7a |
dnxhd_encoder_select="aandct" |
2eef7c62 |
dxa_decoder_select="zlib" |
47a158cb |
eac3_decoder_select="fft mdct" |
e8ed9b7a |
eatgq_decoder_select="aandct" |
d52b39c7 |
eatqi_decoder_select="aandct" |
4f034993 |
ffv1_decoder_select="golomb"
flac_decoder_select="golomb"
flac_encoder_select="golomb" |
2eef7c62 |
flashsv_decoder_select="zlib"
flashsv_encoder_select="zlib" |
e8ed9b7a |
flv_encoder_select="aandct"
h261_encoder_select="aandct"
h263_encoder_select="aandct"
h263p_encoder_select="aandct" |
4f034993 |
h264_decoder_select="golomb" |
369122dd |
h264_vdpau_decoder_deps="vdpau" |
47a158cb |
imc_decoder_select="fft mdct" |
4f034993 |
jpegls_decoder_select="golomb"
jpegls_encoder_select="golomb" |
e8ed9b7a |
ljpeg_encoder_select="aandct" |
4f034993 |
loco_decoder_select="golomb" |
e8ed9b7a |
mjpeg_encoder_select="aandct"
mpeg1video_encoder_select="aandct"
mpeg2video_encoder_select="aandct"
mpeg4_encoder_select="aandct" |
d37edddc |
mpeg_vdpau_decoder_deps="vdpau" |
2b324225 |
mpeg1_vdpau_decoder_deps="vdpau" |
8f6f050a |
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" |
e8ed9b7a |
msmpeg4v1_encoder_select="aandct"
msmpeg4v2_encoder_select="aandct"
msmpeg4v3_encoder_select="aandct" |
47a158cb |
nellymoser_decoder_select="fft mdct"
nellymoser_encoder_select="fft mdct" |
2eef7c62 |
png_decoder_select="zlib"
png_encoder_select="zlib" |
63cae55d |
qdm2_decoder_select="fft mdct rdft" |
e8ed9b7a |
rv10_encoder_select="aandct"
rv20_encoder_select="aandct" |
d52b39c7 |
rv30_decoder_select="golomb"
rv40_decoder_select="golomb" |
4f034993 |
shorten_decoder_select="golomb"
sonic_decoder_select="golomb"
sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb"
svq3_decoder_select="golomb" |
bee2eac5 |
svq3_decoder_suggest="zlib" |
2eef7c62 |
tiff_decoder_suggest="zlib"
tiff_encoder_suggest="zlib"
tscc_decoder_select="zlib" |
c5b42f4a |
vc1_vdpau_decoder_deps="vdpau" |
47a158cb |
vorbis_decoder_select="fft mdct"
vorbis_encoder_select="fft mdct"
wmav1_decoder_select="fft mdct"
wmav1_encoder_select="fft mdct"
wmav2_decoder_select="fft mdct"
wmav2_encoder_select="fft mdct" |
e8ed9b7a |
wmv1_encoder_select="aandct"
wmv2_encoder_select="aandct" |
c5b42f4a |
wmv3_vdpau_decoder_deps="vdpau" |
2eef7c62 |
zlib_decoder_select="zlib"
zlib_encoder_select="zlib"
zmbv_decoder_select="zlib"
zmbv_encoder_select="zlib" |
30fd06be |
|
912f3148 |
# external libraries |
f5a756ef |
libamr_nb_decoder_deps="libamr_nb"
libamr_nb_encoder_deps="libamr_nb"
libamr_wb_decoder_deps="libamr_wb"
libamr_wb_encoder_deps="libamr_wb" |
1b71f045 |
libdirac_decoder_deps="libdirac !libschroedinger" |
690bfceb |
libdirac_encoder_deps="libdirac" |
c9171a83 |
libfaac_encoder_deps="libfaac" |
69ddbd1d |
libfaad_decoder_deps="libfaad" |
4ec45764 |
libfaadbin_decoder_extralibs='$ldl' |
299c77d5 |
libgsm_decoder_deps="libgsm"
libgsm_encoder_deps="libgsm" |
8ffed8d8 |
libgsm_ms_decoder_deps="libgsm"
libgsm_ms_encoder_deps="libgsm" |
1cc60c47 |
libmp3lame_encoder_deps="libmp3lame" |
9ad437ea |
libopencore_amrnb_decoder_deps="libopencore_amrnb"
libopencore_amrnb_encoder_deps="libopencore_amrnb"
libopencore_amrwb_decoder_deps="libopencore_amrwb" |
9a77d59a |
libopenjpeg_decoder_deps="libopenjpeg" |
f7cd9eed |
libschroedinger_decoder_deps="libschroedinger"
libschroedinger_encoder_deps="libschroedinger" |
ae14f311 |
libspeex_decoder_deps="libspeex" |
150d2772 |
libtheora_encoder_deps="libtheora" |
b0caf888 |
libvorbis_encoder_deps="libvorbis" |
1cc60c47 |
libx264_encoder_deps="libx264"
libxvid_encoder_deps="libxvid" |
13566c31 |
mpeg4aac_decoder_deps="libfaad" |
272081b0 |
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" |
30fd06be |
|
912f3148 |
# demuxers / muxers |
03a76ba9 |
ac3_demuxer_deps="ac3_parser" |
35fd8122 |
alsa_demuxer_deps="alsa_asoundlib_h snd_pcm_htimestamp"
alsa_demuxer_extralibs="-lasound"
alsa_muxer_deps="alsa_asoundlib_h"
alsa_muxer_extralibs="-lasound" |
50383e88 |
audio_beos_demuxer_deps="audio_beos" |
4ec45764 |
audio_beos_demuxer_extralibs="-lmedia -lbe" |
50383e88 |
audio_beos_muxer_deps="audio_beos" |
4ec45764 |
audio_beos_muxer_extralibs="-lmedia -lbe" |
53b73365 |
avisynth_demuxer_deps="avisynth" |
73483024 |
bktr_demuxer_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h" |
17ac9f1c |
dirac_demuxer_deps="dirac_parser" |
fe9bb347 |
dv1394_demuxer_deps="dv1394 dv_demuxer" |
f7b8bffe |
libdc1394_demuxer_deps="libdc1394" |
d7c59247 |
libnut_demuxer_deps="libnut"
libnut_muxer_deps="libnut" |
2eef7c62 |
matroska_demuxer_suggest="zlib bzlib"
mov_demuxer_suggest="zlib" |
4bd8e17c |
mp3_demuxer_deps="mpegaudio_parser" |
c7682de0 |
oss_demuxer_deps_any="soundcard_h sys_soundcard_h"
oss_muxer_deps_any="soundcard_h sys_soundcard_h" |
30fd06be |
redir_demuxer_deps="network" |
8eb793c4 |
rtp_muxer_deps="network rtp_protocol" |
95c21842 |
rtsp_demuxer_deps="sdp_demuxer"
sdp_demuxer_deps="rtp_protocol mpegts_demuxer" |
06e31011 |
v4l_demuxer_deps="linux_videodev_h" |
1b6e8b73 |
v4l2_demuxer_deps_any="linux_videodev2_h sys_videoio_h" |
c2345207 |
vfwcap_demuxer_deps="capCreateCaptureWindow"
vfwcap_demuxer_extralibs="-lvfw32" |
06eab4ba |
x11_grab_device_demuxer_deps="x11grab XShmCreateImage" |
4ec45764 |
x11_grab_device_demuxer_extralibs="-lX11 -lXext" |
30fd06be |
|
912f3148 |
# protocols |
3fff6382 |
gopher_protocol_deps="network" |
c08fb000 |
http_protocol_deps="network"
rtp_protocol_deps="udp_protocol"
tcp_protocol_deps="network"
udp_protocol_deps="network"
|
f7679c54 |
# filters |
81124ba0 |
movie_filter_deps="avfilter_lavf" |
f7679c54 |
|
912f3148 |
# programs |
fa859b4d |
ffplay_deps="sdl" |
6ad42348 |
ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer" |
4ec45764 |
ffserver_extralibs='$ldl'
vhook_extralibs='$ldl' |
a2830dca |
|
912f3148 |
|
de6d9b64 |
# default parameters |
8a608357 |
|
2ba042a7 |
logfile="config.err" |
8a608357 |
# installation paths |
c9d19248 |
prefix_default="/usr/local"
bindir_default='${prefix}/bin' |
14a8acf1 |
datadir_default='${prefix}/share/ffmpeg' |
c9d19248 |
incdir_default='${prefix}/include'
libdir_default='${prefix}/lib'
mandir_default='${prefix}/share/man'
shlibdir_default="$libdir_default" |
8a608357 |
# toolchain |
11e6d03a |
ar="ar" |
13c7df3d |
cc_default="gcc" |
9da6609f |
host_cc_default="gcc" |
11e6d03a |
ln_s="ln -sf" |
89641463 |
nm_default="nm" |
11e6d03a |
objformat="elf" |
be7109c1 |
ranlib="ranlib" |
0f3cb305 |
strip="strip" |
11e6d03a |
yasmexe="yasm" |
8a608357 |
# machine |
cc6a90dd |
arch=`uname -m` |
38d0a8aa |
cpu="generic" |
8a608357 |
# OS |
4f854758 |
target_os=$(tolower $(uname -s)) |
8a608357 |
# configurable options |
497237c7 |
enable debug
enable ffmpeg
enable ffplay
enable ffserver
enable ipv6
enable mpegaudio_hp
enable network |
40b509b3 |
enable oldscaler |
8400d6b8 |
enable optimizations |
497237c7 |
enable protocols |
530dc538 |
enable static |
87a0fb62 |
enable stripping |
8a608357 |
vhook="default"
# build settings |
11a9d3e8 |
add_cflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 |
9987769a |
SHFLAGS='-shared -Wl,-soname,$$(@F)' |
49549033 |
VHOOKSHFLAGS='-shared -Wl,-soname,$$(@F)' |
c536cb09 |
FFSERVERLDFLAGS=-Wl,-E |
f3ec2d46 |
LIBPREF="lib"
LIBSUF=".a" |
c5f14466 |
FULLNAME='$(NAME)$(BUILDSUF)'
LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)' |
f3ec2d46 |
SLIBPREF="lib"
SLIBSUF=".so" |
c5f14466 |
SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)' |
b29bddab |
SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)' |
24743a76 |
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' |
ef0bc4c9 |
|
9da6609f |
host_cflags='-O3 -g -Wall'
host_libs='-lm'
|
a7ada2ba |
target_path='.'
|
0d7dca36 |
# gcc stupidly only outputs the basename of targets with -MM, but we need the
# full relative path for objects in subdirectories for non-recursive Make. |
333d5374 |
DEPEND_CMD='$(CC) $(CFLAGS) -MM $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"' |
315c741d |
|
c597172e |
# find source path
source_path="`dirname \"$0\"`" |
497237c7 |
enable source_path_used |
c597172e |
if test -z "$source_path" -o "$source_path" = "." ; then
source_path="`pwd`" |
497237c7 |
disable source_path_used |
c597172e |
else
source_path="`cd \"$source_path\"; pwd`"
echo "$source_path" | grep -q '[[:blank:]]' && |
7483e694 |
die "Out of tree builds are impossible with whitespace in source path." |
c597172e |
fi
FFMPEG_CONFIGURATION="$@"
|
73ef8980 |
find_things(){
thing=$1
pattern=$2
file=$source_path/$3 |
932ccf39 |
sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file" |
73ef8980 |
}
ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
OUTDEV_LIST=$(find_things muxer _MUX libavdevice/alldevices.c)
INDEV_LIST=$(find_things demuxer DEMUX libavdevice/alldevices.c)
PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c) |
81124ba0 |
FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c) |
c597172e |
|
7483e694 |
enable $ARCH_EXT_LIST \
$DECODER_LIST \
$ENCODER_LIST \
$PARSER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \ |
f7679c54 |
$FILTER_LIST \ |
7483e694 |
$PROTOCOL_LIST \
$INDEV_LIST \
$OUTDEV_LIST \ |
c597172e |
die_unknown(){
echo "Unknown option \"$1\"."
echo "See $0 --help for available options."
exit 1
}
|
794f8e97 |
show_list() { |
bf0c4afa |
suffix=_$1
shift
echo $* | sed s/$suffix//g | tr ' ' '\n' | sort |
794f8e97 |
exit 0
}
|
c597172e |
for opt do |
7483e694 |
optval="${opt#*=}"
case "$opt" in |
0f010b2f |
--extra-cflags=*) add_cflags $optval |
7483e694 |
;; |
0f010b2f |
--extra-ldflags=*) add_ldflags $optval |
7483e694 |
;; |
0f010b2f |
--extra-libs=*) add_extralibs $optval |
7483e694 |
;; |
8fb1cb58 |
--disable-devices) disable $INDEV_LIST $OUTDEV_LIST |
9aa8ed9d |
;; |
40bcf4c7 |
--enable-debug=*) debuglevel="$optval"
;; |
7483e694 |
--enable-*=*|--disable-*=*)
eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'`
case "$thing" in |
81124ba0 |
encoder|decoder|muxer|demuxer|parser|bsf|protocol|filter) $action ${optval}_${thing} ;; |
7483e694 |
*) die_unknown "$opt" ;;
esac
;;
--enable-?*|--disable-?*)
eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'` |
e3773a55 |
if is_in $option $COMPONENT_LIST; then
eval $action \$$(toupper ${option%s})_LIST
elif is_in $option $CMDLINE_SELECT; then
$action $option
else
die_unknown $opt
fi |
7483e694 |
;;
--list-*)
NAME="${opt#--list-}"
is_in $NAME $COMPONENT_LIST || die_unknown $opt
NAME=${NAME%s}
eval show_list $NAME \$$(toupper $NAME)_LIST
;;
--help|-h) show_help
;;
*) |
884a36a7 |
optname="${opt%%=*}" |
26759c44 |
optname="${optname#--}"
optname=$(echo "$optname" | sed 's/-/_/g')
is_in $optname $CMDLINE_SET || die_unknown $opt
eval $optname='$optval' |
7483e694 |
;;
esac |
c597172e |
done
|
bcea99bb |
disabled logging && logfile=/dev/null
echo "# $0 $@" > $logfile
set >> $logfile
|
9da6609f |
test -n "$cross_prefix" && enable cross_compile
|
adb2b908 |
ar="${cross_prefix}${ar}" |
11e6d03a |
cc_default="${cross_prefix}${cc_default}" |
20e0ed95 |
nm_default="${cross_prefix}${nm_default}" |
adb2b908 |
ranlib="${cross_prefix}${ranlib}"
strip="${cross_prefix}${strip}"
|
c5200f17 |
sysinclude_default="${sysroot}/usr/include"
set_default cc nm sysinclude |
9da6609f |
enabled cross_compile || host_cc_default=$cc
set_default host_cc |
13c7df3d |
|
c0f5b7f1 |
case $target_os in
mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) EXESUF=.exe ;;
esac
|
e4e69e0b |
# set temporary file name |
a49d42c2 |
: ${TMPDIR:=$TEMPDIR} |
c51fafa1 |
: ${TMPDIR:=$TMP} |
a49d42c2 |
: ${TMPDIR:=/tmp} |
e4e69e0b |
|
fc038df3 |
if ! check_cmd type mktemp; then
# simple replacement for missing mktemp
# NOT SAFE FOR GENERAL USE
mktemp(){
echo "${2%XXX*}.${HOSTNAME}.${UID}.$$"
}
fi
tmpfile(){
tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
(set -C; exec > $tmp) 2>/dev/null ||
die "Unable to create temoporary file in $TMPDIR."
append TMPFILES $tmp
eval $1=$tmp
}
trap 'rm -f -- $TMPFILES' EXIT
trap exit HUP INT TERM
tmpfile TMPC .c
tmpfile TMPE $EXESUF
tmpfile TMPH .h
tmpfile TMPO .o
tmpfile TMPS .S
tmpfile TMPV .ver
tmpfile TMPSH .sh
unset -f mktemp |
e4e69e0b |
|
993f2d0f |
# make sure we can execute files in $TMPDIR
cat > $TMPSH 2>> $logfile <<EOF
#! /bin/sh
EOF
chmod +x $TMPSH >> $logfile 2>&1
if ! $TMPSH >> $logfile 2>&1; then
cat <<EOF
Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
variable to another directory and make sure that it is not mounted noexec.
EOF
die "Sanity test failed."
fi
|
3a636b6f |
if $cc --version 2>/dev/null | grep -qi gcc; then |
629687f6 |
cc_type=gcc
elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc
elif $cc -v 2>&1 | grep -q xlc; then
cc_type=xlc |
df442a8d |
elif $cc -V 2>/dev/null | grep -q Compaq; then
cc_type=ccc
DEPEND_CMD='$(CC) $(CFLAGS) -M $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
add_ldflags -Wl,-z,now # calls to libots crash without this |
629687f6 |
fi
test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
|
154d432c |
if test -n "$sysroot"; then
case "$cc_type" in
gcc)
add_cflags --sysroot="$sysroot"
add_ldflags --sysroot="$sysroot"
;;
esac
fi
|
993f2d0f |
# compiler sanity check
check_exec <<EOF
int main(void){ return 0; }
EOF
if test "$?" != 0; then
echo "$cc is unable to create an executable file."
if test -z "$cross_prefix" && ! enabled cross_compile ; then
echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
echo "Only do this if you know what cross compiling means."
fi
die "C compiler test failed."
fi
|
e9b9a2f8 |
check_cflags -std=c99
|
b24dbcbd |
case "$arch" in
alpha)
arch="alpha"
enable fast_64bit |
c0a02a3e |
check_cflags -mieee |
b24dbcbd |
;; |
cfdb6148 |
arm|armv[4567]*l)
arch="arm" |
b24dbcbd |
;; |
f4870943 |
avr32)
;; |
cfdb6148 |
bfin)
arch="bfin"
;;
ia64)
arch="ia64" |
b24dbcbd |
enable fast_64bit |
cfdb6148 |
;;
m68k)
arch="m68k" |
b24dbcbd |
;; |
de3a1240 |
mips|mipsel|IP*) |
b24dbcbd |
arch="mips"
;; |
de3a1240 |
mips64)
arch="mips"
enable fast_64bit
;; |
61597a98 |
parisc|hppa) |
b24dbcbd |
arch="parisc"
;; |
61597a98 |
parisc64|hppa64) |
b24dbcbd |
arch="parisc"
enable fast_64bit
;; |
cfdb6148 |
"Power Macintosh"|ppc|powerpc)
arch="ppc"
enable fast_unaligned
;;
ppc64)
arch="ppc"
enable fast_64bit
enable fast_unaligned
;; |
b24dbcbd |
s390|s390x)
arch="s390"
;; |
cfdb6148 |
sh4|sh)
arch="sh4" |
b24dbcbd |
;; |
cfdb6148 |
sparc)
arch="sparc"
;;
sun4u|sparc64)
arch="sparc"
subarch="sparc64" |
b24dbcbd |
enable fast_64bit
;; |
cfdb6148 |
i386|i486|i586|i686|i86pc|BePC)
arch="x86"
subarch="x86_32"
enable fast_unaligned
;;
x86_64|amd64)
arch="x86"
subarch="x86_32"
enable cmov
enable fast_cmov
enable fast_unaligned
check_cc <<EOF && enable fast_64bit && subarch="x86_64"
int test[sizeof(char*) - 7];
EOF |
b24dbcbd |
;;
*)
arch="unknown"
;;
esac
|
62045d48 |
enable $arch $subarch |
b24dbcbd |
|
7483e694 |
# OS specific |
4f854758 |
case $target_os in |
7483e694 |
beos|haiku|zeta) |
c9d19248 |
prefix_default="$HOME/config" |
7483e694 |
# helps building libavcodec |
0f010b2f |
add_cflags -DPIC -fomit-frame-pointer |
7483e694 |
# 3 gcc releases known for BeOS, each with ugly bugs
gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
case "$gcc_version" in
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
disable mmx
;;
*20010315*) echo "BeBits gcc" |
0f010b2f |
add_cflags -fno-expensive-optimizations |
7483e694 |
;;
esac
SHFLAGS=-nostart
# enable BeOS things
enable audio_beos
# no need for libm, but the inet stuff
# Check for BONE
# XXX: actually should check for NOT net_server |
78fe7631 |
if echo $BEINCLUDES | grep -q 'headers/be/bone'; then |
7483e694 |
network_extralibs="-lbind -lsocket"
else
enable beos_netserver
network_extralibs="-lnet"
fi ;;
sunos)
FFSERVERLDFLAGS="" |
9987769a |
SHFLAGS='-shared -Wl,-h,$$(@F)' |
7483e694 |
network_extralibs="-lsocket -lnsl" |
e193c74e |
add_cflags -D__EXTENSIONS__ |
7483e694 |
;;
netbsd)
oss_demuxer_extralibs="-lossaudio"
oss_muxer_extralibs="-lossaudio"
;;
openbsd)
disable need_memalign
LIBOBJFLAGS='$(PIC)'
SHFLAGS='-shared'
oss_demuxer_extralibs="-lossaudio"
oss_muxer_extralibs="-lossaudio"
;;
freebsd)
disable need_memalign
;;
bsd/os)
osextralibs="-lpoll -lgnugetopt"
strip="strip -d"
;;
darwin)
disable need_memalign |
0138c54e |
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress' |
9987769a |
VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$$(@F)' |
7483e694 |
strip="strip -x"
FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
SLIBSUF=".dylib"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
FFSERVERLDFLAGS=-Wl,-bind_at_load |
304d586d |
objformat="macho" |
1b0f6fb8 |
enabled x86_64 && objformat="macho64" |
7483e694 |
;;
mingw32*) |
4f854758 |
target_os=mingw32 |
dcc01c06 |
LIBTARGET=i386 |
1fc9fb8a |
if enabled x86_64; then |
dcc01c06 |
disable need_memalign
LIBTARGET=x64
fi |
fbd971a4 |
shlibdir_default="$bindir_default" |
7483e694 |
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)' |
13ca50f3 |
if enabled swscale; then |
7483e694 |
VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
fi
disable ffserver
SLIBPREF=""
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)' |
7056dd76 |
SLIB_EXTRA_CMD='-lib /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)' |
4c25d159 |
SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"' |
7483e694 |
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"' |
7056dd76 |
SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base' |
304d586d |
objformat="win32" |
bc574408 |
enable dos_paths |
8d003e22 |
check_cflags -fno-common |
b1549d61 |
if ! enabled x86_64; then |
f7ad5aa2 |
check_cpp_condition _mingw.h "(__MINGW32_MAJOR_VERSION > 3) || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
die "ERROR: MinGW runtime version must be >= 3.15."
enabled_any avisynth vfwcap_demuxer &&
{ check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 13)" ||
die "ERROR: avisynth and vfwcap_demuxer require w32api version 3.13 or later."; }
fi |
7483e694 |
;;
cygwin*) |
4f854758 |
target_os=cygwin |
fbd971a4 |
shlibdir_default="$bindir_default" |
7483e694 |
VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)' |
13ca50f3 |
if enabled swscale; then |
7483e694 |
VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
fi
SLIBPREF="cyg"
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SHFLAGS='-shared -Wl,--enable-auto-image-base' |
304d586d |
objformat="win32" |
bc574408 |
enable dos_paths |
8d003e22 |
check_cflags -fno-common |
7483e694 |
;; |
4f365f37 |
*-dos|freedos|opendos)
disable ffplay ffserver vhook
disable $INDEV_LIST $OUTDEV_LIST
network_extralibs="-lsocket" |
ff1c015d |
objformat="coff" |
bc574408 |
enable dos_paths |
4f365f37 |
;; |
7483e694 |
linux)
enable dv1394
;;
irix*) |
4f854758 |
target_os=irix |
7483e694 |
ranlib="echo ignoring ranlib"
;; |
d22e8442 |
os/2*)
strip="lxlite"
ln_s="cp -f"
FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap" |
71c61f62 |
SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf' |
d22e8442 |
FFSERVERLDFLAGS="" |
287d3b13 |
LIBSUF="_s.a" |
d22e8442 |
SLIBPREF=""
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)' |
71c61f62 |
SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
echo PROTMODE >> $(SUBDIR)$(NAME).def; \
echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
echo EXPORTS >> $(SUBDIR)$(NAME).def; \
emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"' |
d22e8442 |
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib' |
c6eed369 |
disable vhook |
bc574408 |
enable dos_paths |
d22e8442 |
;; |
269820f1 |
interix)
disable vhook
;; |
b18806f8 |
gnu/kfreebsd)
;; |
775aa5f3 |
gnu)
disable dv1394
;; |
d22e8442 |
|
7483e694 |
*) |
4f924f9a |
die "Unknown OS '$target_os'." |
7483e694 |
;;
esac
|
c9d19248 |
set_default $PATHS_LIST
|
c597172e |
add_extralibs $osextralibs |
de6d9b64 |
|
28d8e661 |
# Combine FFLDFLAGS and the LDFLAGS environment variable.
LDFLAGS="$FFLDFLAGS $LDFLAGS" |
e89b8b0a |
|
320d060a |
# we need to build at least one lib type |
93b3c083 |
if ! enabled_any static shared; then |
320d060a |
cat <<EOF
At least one library type must be built.
Specify --enable-static to build the static libraries or --enable-shared to
build the shared libraries as well. To only build the shared libraries specify
--disable-static in addition to --enable-shared.
EOF
exit 1;
fi
|
abc4e572 |
disabled static && LIBNAME="" |
2a320695 |
|
a2234ceb |
if enabled_any libfaad libfaadbin ; then
if check_header faad.h; then |
295b8c70 |
check_cc <<EOF |
a2234ceb |
#include <faad.h>
#ifndef FAAD2_VERSION
ok faad1
#endif |
db817cf3 |
int main(void) { return 0; } |
a2234ceb |
EOF
test $? = 0 && enable libfaad2
else |
ff3dac65 |
die "FAAD test failed." |
a2234ceb |
fi
fi
|
d8ef2218 |
die_license_disabled() { |
3499f0f3 |
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; } |
d8ef2218 |
}
die_license_disabled gpl libfaad2
die_license_disabled gpl libx264
die_license_disabled gpl libxvid
die_license_disabled gpl postproc
die_license_disabled gpl x11grab
die_license_disabled nonfree libamr_nb
die_license_disabled nonfree libamr_wb |
4f3ce007 |
die_license_disabled nonfree libfaac |
b2e3c528 |
|
9ad437ea |
die_license_disabled version3 libopencore_amrnb
die_license_disabled version3 libopencore_amrwb
|
dd2089df |
enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; } |
3fe142e2 |
|
9eeed841 |
check_deps $ARCH_EXT_LIST |
0f3cb305 |
|
5d323602 |
test -z "$need_memalign" && need_memalign="$mmx"
|
cf9d24ad |
#Darwin CC versions |
4f854758 |
if test $target_os = darwin; then |
629687f6 |
if enabled xlc; then |
0f010b2f |
add_cflags -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto |
cf9d24ad |
else |
0f010b2f |
add_cflags -pipe
check_cflags -force_cpusubtype_ALL
check_cflags -Wno-sign-compare |
f946a9a4 |
enabled shared || check_cflags -mdynamic-no-pic |
cf9d24ad |
fi |
2a1a6b64 |
fi
|
40617a6d |
disabled optimizations || check_cflags -fomit-frame-pointer |
cf9d24ad |
|
a4adb608 |
# Add processor-specific flags |
38d0a8aa |
if test $cpu != "generic"; then |
bc8ec47b |
warn_altivec(){
$1 altivec && echo "WARNING: Tuning for $2 but AltiVec $1."; |
1658bc4f |
} |
38d0a8aa |
case $cpu in |
bb270c08 |
601|ppc601|PowerPC601) |
0f010b2f |
add_cflags -mcpu=601 |
bc8ec47b |
warn_altivec enabled PPC601 |
bb270c08 |
;;
603*|ppc603*|PowerPC603*) |
0f010b2f |
add_cflags -mcpu=603 |
bc8ec47b |
warn_altivec enabled PPC603 |
bb270c08 |
;;
604*|ppc604*|PowerPC604*) |
0f010b2f |
add_cflags -mcpu=604 |
bc8ec47b |
warn_altivec enabled PPC604 |
bb270c08 |
;;
G3|g3|75*|ppc75*|PowerPC75*) |
0f010b2f |
add_cflags -mcpu=750 -mpowerpc-gfxopt |
bc8ec47b |
warn_altivec enabled PPC75x |
bb270c08 |
;;
G4|g4|745*|ppc745*|PowerPC745*) |
0f010b2f |
add_cflags -mcpu=7450 -mpowerpc-gfxopt |
bc8ec47b |
warn_altivec disabled PPC745x |
bb270c08 |
;;
74*|ppc74*|PowerPC74*) |
0f010b2f |
add_cflags -mcpu=7400 -mpowerpc-gfxopt |
bc8ec47b |
warn_altivec disabled PPC74xx |
bb270c08 |
;;
G5|g5|970|ppc970|PowerPC970|power4*|Power4*) |
0f010b2f |
add_cflags -mcpu=970 -mpowerpc-gfxopt -mpowerpc64 |
bc8ec47b |
warn_altivec disabled PPC970 |
9cafbd6c |
enable ppc64 |
bb270c08 |
;; |
e07e357d |
Cell|CELL|cell) |
0f010b2f |
add_cflags -mcpu=cell |
e07e357d |
warn_altivec disabled Cell |
9cafbd6c |
enable ppc64 |
e07e357d |
;; |
e7768fc5 |
# targets that do NOT support conditional mov (cmov)
i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) |
0f010b2f |
add_cflags -march=$cpu |
497237c7 |
disable cmov |
e7768fc5 |
;;
# targets that do support conditional mov (cmov) |
416519dd |
i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2) |
0f010b2f |
add_cflags -march=$cpu |
497237c7 |
enable cmov
enable fast_cmov |
94e4c3a3 |
;;
# targets that do support conditional mov but on which it's slow |
800a5a19 |
pentium4|pentium4m|prescott|nocona) |
0f010b2f |
add_cflags -march=$cpu |
497237c7 |
enable cmov
disable fast_cmov |
bb270c08 |
;; |
d7b34d08 |
sparc64) |
0f010b2f |
add_cflags -mcpu=v9 |
d7b34d08 |
;; |
f2e49553 |
arm11*|cortex*) |
0f010b2f |
add_cflags -mcpu=$cpu |
f2e49553 |
enable fast_unaligned
;; |
0223bd6f |
armv*) |
0f010b2f |
add_cflags -march=$cpu |
0223bd6f |
;; |
f2e49553 |
arm*) |
0f010b2f |
add_cflags -mcpu=$cpu |
6b19786b |
;; |
1cd11856 |
ev4|ev45|ev5|ev56|pca56|ev6|ev67) |
df442a8d |
enabled ccc && add_cflags -arch $cpu || add_cflags -mcpu=$cpu |
1cd11856 |
;; |
bb270c08 |
*) |
7483e694 |
echo "WARNING: Unknown CPU \"$cpu\", ignored." |
bb270c08 |
;; |
a4adb608 |
esac
fi
|
b4d96ba2 |
check_cc <<EOF || die "Symbol mangling check failed."
int ff_extern;
EOF |
2f05d9c1 |
sym=$($nm -P -g $TMPO | grep ff_extern) |
b4d96ba2 |
extern_prefix=${sym%%ff_extern*}
|
61d251db |
check_asm inline_asm '""'
|
9eeed841 |
if enabled x86; then |
44965991 |
# check whether EBP is available on x86
# As 'i' is stored on the stack, this program will crash
# if the base pointer is used to access it because the
# base pointer is cleared in the inline assembly code. |
7dfef245 |
check_exec_crash <<EOF && enable ebp_available |
44965991 |
volatile int i=0; |
be449fca |
__asm__ volatile ( |
44965991 |
"xorl %%ebp, %%ebp"
::: "%ebp");
return i;
EOF
# check wether EBX is available on x86 |
940f335a |
check_asm ebx_available '"":::"%ebx"' |
8e380710 |
|
d3a4b4e0 |
# check whether more than 10 operands are supported
check_cc <<EOF && enable ten_operands
int main(void) {
int x=0;
__asm__ volatile(
""
:"+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x), "+&rm"(x)
);
return 0;
}
EOF
|
d7f0920b |
# check whether binutils is new enough to compile SSSE3/MMX2 |
940f335a |
enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"' |
d7f0920b |
enabled mmx2 && check_asm mmx2 '"movss %xmm0, %xmm0"' |
6bd859d6 |
check_asm bswap '"bswap %%eax" ::: "%eax"' |
304d586d |
|
d52481b9 |
YASMFLAGS="-f $objformat -DARCH_$(toupper $subarch)" |
304d586d |
enabled x86_64 && append YASMFLAGS "-m amd64"
enabled_all x86_64 shared && append YASMFLAGS "-DPIC"
case "$objformat" in
elf) enabled debug && append YASMFLAGS "-g dwarf2" ;; |
1b0f6fb8 |
macho64) append YASMFLAGS "-DPIC -DPREFIX" ;; |
304d586d |
*) append YASMFLAGS "-DPREFIX" ;;
esac |
7595a5e4 |
disabled yasm || { check_yasm "pabsw xmm0, xmm0" && enable yasm; } |
44965991 |
fi
|
87ea51e0 |
# check for assembler specific support
|
5b6c2cbd |
enabled ppc && check_asm dcbzl '"dcbzl 0, 1"' |
799fde37 |
enabled ppc && check_asm ppc4xx '"maclhw r10, r11, r12"' |
87ea51e0 |
|
57bd82d4 |
# check for SIMD availability
|
115329f1 |
# AltiVec flags: The FSF version of GCC differs from the Apple version |
9eeed841 |
if enabled altivec; then |
3ed1a2ee |
check_cflags -maltivec -mabi=altivec &&
{ check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } || |
4477b9f4 |
check_cflags -faltivec |
b6e52719 |
|
0182fee8 |
# check if our compiler supports Motorola AltiVec C API |
497237c7 |
check_cc <<EOF || disable altivec |
dcd479c0 |
$inc_altivec_h |
a9a07762 |
int main(void) {
vector signed int v1, v2, v3;
v1 = vec_add(v2,v3);
return 0;
}
EOF |
b006b26c |
# check if our compiler supports braces for vector declarations |
80a61f08 |
check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations." |
b006b26c |
$inc_altivec_h |
80a61f08 |
int main (void) { (vector int) {1}; return 0; } |
b006b26c |
EOF |
a9a07762 |
fi |
ab6c65f6 |
|
b4e806b2 |
# We have to check if pld is a nop and disable it. |
a2fc0f6a |
enabled arm && check_asm pld '"pld [r0]"' |
940f335a |
enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"' |
ab5cb084 |
enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"' |
f55b299a |
enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"' |
940f335a |
enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"'
enabled mmi && check_asm mmi '"lq $2, 0($2)"' |
6b18d278 |
enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"' |
940f335a |
enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc |
bd9d34a0 |
|
0f010b2f |
enabled vis && add_cflags -mcpu=ultrasparc -mtune=ultrasparc |
8b03def6 |
|
57bd82d4 |
# ---
# big/little-endian test |
9eebe687 |
check_cc <<EOF || die "endian test failed"
unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E'; |
a3999908 |
EOF |
d04d9e16 |
od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian |
487a54d7 |
|
a3999908 |
# --- |
3d204385 |
# check availability of some header files
|
a98bb16d |
if check_func dlopen; then
ldl=
elif check_func dlopen -ldl; then
ldl=-ldl |
8bf5d58f |
fi
|
75ecf149 |
# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
|
7483e694 |
check_func fork
check_func gethrtime
check_func getrusage |
094c09bb |
check_func inet_aton $network_extralibs |
7483e694 |
check_func memalign
check_func mkstemp |
1f91cdce |
check_func posix_memalign |
b507ebd1 |
check_func_headers io.h setmode |
2446d3d6 |
check_func_headers windows.h GetProcessTimes |
6ffa87d3 |
|
e16e49ac |
check_header conio.h |
a98bb16d |
check_header dlfcn.h
check_header malloc.h |
bf6ce82d |
check_header poll.h |
b58412f1 |
check_header sys/mman.h |
b091aa44 |
check_header sys/resource.h |
bf6ce82d |
check_header sys/select.h |
a98bb16d |
check_header termios.h |
272081b0 |
check_header vdpau/vdpau.h
check_header vdpau/vdpau_x11.h |
68178ca9 |
check_header X11/extensions/XvMClib.h |
a98bb16d |
|
1f91cdce |
if ! enabled_any memalign memalign_hack posix_memalign && enabled need_memalign ; then
die "Error, no aligned memory allocator but SSE enabled, disable it or use --enable-memalign-hack." |
a98bb16d |
fi |
e16e49ac |
|
a4fa192c |
disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib |
632948bd |
disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib |
57bd82d4 |
# check for some common methods of building with pthread support
# do this before the optional library checks as some of them require pthreads
if enabled pthreads; then |
9e7fd101 |
if check_func pthread_create; then
:
elif check_func pthread_create -pthread; then
add_cflags -pthread |
afc9aee2 |
add_extralibs -pthread |
9e7fd101 |
elif check_func pthread_create -pthreads; then
add_cflags -pthreads |
afc9aee2 |
add_extralibs -pthreads |
8d94f606 |
elif check_func pthread_create -lpthreadGC2; then
add_extralibs -lpthreadGC2 |
9e7fd101 |
elif ! check_lib pthread.h pthread_create -lpthread; then
die "ERROR: can't find pthreads library"
fi |
57bd82d4 |
fi
|
8eee7025 |
for thread in $THREADS_LIST; do |
e5f94c2b |
if enabled $thread; then |
3ae3b721 |
test -n "$thread_type" &&
die "ERROR: Only one thread type must be selected." || |
e5f94c2b |
thread_type="$thread"
fi
done
|
fdf88598 |
check_lib math.h sin -lm
|
a33cab3a |
# test for C99 functions in math.h |
7b04b8a0 |
for func in llrint lrint lrintf round roundf truncf; do |
a33cab3a |
check_exec <<EOF && enable $func || disable $func |
f32adb22 |
#include <math.h> |
a33cab3a |
int main(void) { return ($func(3.999f) > 0)?0:1; } |
f32adb22 |
EOF |
a33cab3a |
done |
f32adb22 |
|
57bd82d4 |
# these are off by default, so fail if requested and not available |
79fda097 |
enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32 |
7483e694 |
enabled libamr_nb && require libamrnb amrnb/interf_dec.h Speech_Decode_Frame_init -lamrnb -lm
enabled libamr_wb && require libamrwb amrwb/dec_if.h D_IF_init -lamrwb -lm |
e3cc7d6f |
enabled libdirac && add_cflags $(pkg-config --cflags dirac) && |
36718e51 |
require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init -ldirac_decoder &&
require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init -ldirac_encoder |
79fda097 |
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad |
7483e694 |
enabled libgsm && require libgsm gsm.h gsm_create -lgsm |
2bfecf73 |
enabled libmp3lame && require libmp3lame lame/lame.h lame_init -lmp3lame -lm |
7483e694 |
enabled libnut && require libnut libnut.h nut_demuxer_init -lnut |
9ad437ea |
enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb -lm
enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb -lm |
3d6fac8c |
enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version -lopenjpeg |
36718e51 |
enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0) |
ae14f311 |
enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex |
7483e694 |
enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg |
53b90bb2 |
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 -lm && |
57f0ec6e |
{ check_cpp_condition x264.h "X264_BUILD >= 65" ||
die "ERROR: libx264 version must be >= 0.65."; } |
2bfecf73 |
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore |
7483e694 |
enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib |
8ac17293 |
|
0b4a1821 |
# libdc1394 check
if enabled libdc1394; then
{ check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
enable libdc1394_2; } ||
{ check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
enable libdc1394_1; } ||
die "ERROR: No version of libdc1394 found "
fi
|
c13e1abd |
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do |
57bd82d4 |
check_cc <<EOF && _restrict=$restrict_keyword && break |
dcd479c0 |
void foo(char * $restrict_keyword p);
EOF |
c13e1abd |
done
|
703afd07 |
test "$vhook" = "default" && vhook="$dlopen" |
a8721c09 |
|
4f854758 |
if test "$target_os" = cygwin -o "$target_os" = mingw32 && enabled_all static vhook ; then |
497237c7 |
disable vhook |
fbb9d104 |
echo |
b0268cc0 |
echo "At the moment vhooks don't work on Cygwin or MinGW static builds." |
fbb9d104 |
echo "Patches welcome."
echo
fi
|
8d923001 |
if enabled vhook; then
check_ldflags -rdynamic
check_ldflags -export-dynamic
fi |
bfd2edeb |
|
eea50282 |
check_foo_config imlib2 imlib2 Imlib2.h imlib_load_font
check_foo_config freetype2 freetype ft2build.h FT_Init_FreeType |
04511d53 |
|
a86b921c |
########################################## |
29799f8b |
# SDL check |
a86b921c |
|
497237c7 |
disable sdl_too_old
disable sdl |
6a1a892f |
SDL_CONFIG="${cross_prefix}sdl-config" |
2270b4b2 |
if "${SDL_CONFIG}" --version > /dev/null 2>&1; then |
225e21ef |
sdl_cflags=`"${SDL_CONFIG}" --cflags`
temp_cflags $sdl_cflags |
dcd479c0 |
temp_extralibs `"${SDL_CONFIG}" --libs` |
1ca5d97f |
if check_lib2 SDL.h SDL_Init; then |
dcd479c0 |
_sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'` |
29f3b38a |
if test "$_sdlversion" -lt 121 ; then |
497237c7 |
enable sdl_too_old |
dcd479c0 |
else |
497237c7 |
enable sdl |
225e21ef |
check_cc $sdl_cflags <<EOF && enable sdl_video_size |
29f3b38a |
#include <SDL.h> |
d6773f56 |
int main(int argc, char **argv){ |
29f3b38a |
const SDL_VideoInfo *vi = SDL_GetVideoInfo();
int w = vi->current_w;
return 0;
}
EOF |
dcd479c0 |
fi
fi |
29f3b38a |
restore_flags |
c3f6b472 |
fi |
57bd82d4 |
|
2270b4b2 |
texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html |
146ea952 |
|
7a91333f |
########################################## |
73b46a95 |
# Network check
if enabled network; then |
96000432 |
check_type "sys/types.h sys/socket.h" socklen_t |
73b46a95 |
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
check_func closesocket
elif check_header winsock2.h ; then |
ea10ddde |
network_extralibs="-lws2_32" |
72be9e73 |
check_type ws2tcpip.h socklen_t |
2446d3d6 |
check_func_headers winsock2.h closesocket |
73b46a95 |
fi
fi
########################################## |
29799f8b |
# IPv6 check |
7a91333f |
|
497237c7 |
enabled network && enabled ipv6 && check_ld <<EOF && enable ipv6 || disable ipv6 |
7a91333f |
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h> |
db817cf3 |
int main(void) { |
7483e694 |
struct sockaddr_storage saddr;
struct ipv6_mreq mreq6;
getaddrinfo(0,0,0,0);
getnameinfo(0,0,0,0,0,0,0);
IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0); |
7a91333f |
}
EOF
|
06e31011 |
check_header linux/videodev.h
check_header linux/videodev2.h |
1b6e8b73 |
check_header sys/videoio.h |
47f38850 |
|
2446d3d6 |
check_func_headers "windows.h vfw.h" capCreateCaptureWindow -lvfw32 |
c2345207 |
|
f8aa696f |
# check for ioctl_meteor.h, ioctl_bt848.h and alternatives |
1c915f83 |
{ check_header dev/bktr/ioctl_meteor.h &&
check_header dev/bktr/ioctl_bt848.h; } ||
{ check_header machine/ioctl_meteor.h &&
check_header machine/ioctl_bt848.h; } ||
{ check_header dev/video/meteor/ioctl_meteor.h &&
check_header dev/video/bktr/ioctl_bt848.h; } ||
check_header dev/ic/bt8xx.h |
f8aa696f |
|
c7682de0 |
check_header sys/soundcard.h
check_header soundcard.h |
deb29777 |
|
35fd8122 |
check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
|
7483e694 |
# deal with the X11 frame grabber |
56a059ac |
enabled x11grab && |
f58f4ce1 |
check_header X11/Xlib.h &&
check_header X11/extensions/XShm.h &&
check_func XOpenDisplay -lX11 && |
06eab4ba |
check_func XShmCreateImage -lX11 -lXext |
f58f4ce1 |
|
40bcf4c7 |
enabled debug && add_cflags -g"$debuglevel" |
57bd82d4 |
# add some useful compiler flags if supported
check_cflags -Wdeclaration-after-statement |
dcd479c0 |
check_cflags -Wall
check_cflags -Wno-switch |
c07bd6a9 |
check_cflags -Wdisabled-optimization
check_cflags -Wpointer-arith
check_cflags -Wredundant-decls |
cc1fb623 |
check_cflags -Wno-pointer-sign |
f4929996 |
check_cflags -Wcast-qual |
9aceb3cf |
check_cflags -Wwrite-strings |
652a5bf6 |
check_cflags -Wtype-limits |
764551c6 |
check_cflags -Wundef |
5af4e0cc |
enabled extra_warnings && check_cflags -Winline |
cf9d24ad |
|
57bd82d4 |
# add some linker flags |
5c0e9479 |
check_ldflags -Wl,--warn-common |
8351d2ba |
check_ldflags -Wl,--as-needed
check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil' |
c2fd6530 |
check_ldflags -Wl,-Bsymbolic |
94a3401e |
|
a9785f58 |
echo "X{};" > $TMPV
test_ldflags -Wl,--version-script,$TMPV &&
append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
|
bd2216e4 |
if enabled small; then
check_cflags -Os # not all compilers support -Os |
8400d6b8 |
optimizations="small"
elif enabled optimizations; then |
629687f6 |
if enabled xlc; then |
0f010b2f |
add_cflags -O5
add_ldflags -O5 |
df442a8d |
elif enabled ccc; then
add_cflags -fast |
cf9d24ad |
else |
0f010b2f |
add_cflags -O3 |
cf9d24ad |
fi |
cddf3f45 |
fi |
11fdbc44 |
check_cflags -fno-math-errno |
b2eb2ff0 |
check_cflags -fno-signed-zeros |
cddf3f45 |
|
504a64b9 |
# add some flags for Intel C Compiler |
629687f6 |
if enabled icc; then |
b1598b58 |
# Just warnings, no remarks
check_cflags -w1
# -wd: Disable following warnings
# 144, 167, 556: -Wno-pointer-sign
# 10006: ignoring unknown option -fno-signed-zeros
# 10156: ignoring option '-W'; no argument required
check_cflags -wd144,167,556,10006,10156
# 11030: Warning unknown option --as-needed
# 10156: ignoring option '-export'; no argument required
check_ldflags -wd10156,11030
# Allow to compile with optimizations
check_ldflags -march=$cpu |
df442a8d |
elif enabled ccc; then
# disable some annoying warnings
add_cflags -msg_disable cvtu32to64
add_cflags -msg_disable embedcomment
add_cflags -msg_disable needconstext
add_cflags -msg_disable nomainieee
add_cflags -msg_disable ptrmismatch1
add_cflags -msg_disable unreachcode |
504a64b9 |
fi
|
80581e98 |
# PIC flags for shared library objects where they are needed |
5af4e0cc |
if enabled shared; then |
569cb218 |
# LIBOBJFLAGS may have already been set in the OS configuration
if test -z "$LIBOBJFLAGS" ; then |
a8e28698 |
case "${subarch-$arch}" in |
e21e76a9 |
x86_64|ia64|alpha|sparc*|ppc|power*|parisc*|mips*) LIBOBJFLAGS='$(PIC)' ;; |
569cb218 |
esac
fi |
80581e98 |
fi
|
90be59ef |
if enabled gprof; then |
0f010b2f |
add_cflags -p
add_ldflags -p |
1db54e20 |
fi
|
3b26ee47 |
VHOOKCFLAGS="-fPIC" |
18451f7d |
|
7f3c02fc |
# Find out if the .align argument is a power of two or not. |
9377b6ce |
check_asm asmalign_pot '".align 3"' |
4454dc1b |
|
7483e694 |
enabled_any $DECODER_LIST && enable decoders
enabled_any $ENCODER_LIST && enable encoders
enabled_any $BSF_LIST && enable bsfs
enabled_any $DEMUXER_LIST && enable demuxers
enabled_any $MUXER_LIST && enable muxers |
f7679c54 |
enabled_any $FILTER_LIST && enable filters |
7483e694 |
enabled_any $INDEV_LIST && enable demuxers
enabled_any $OUTDEV_LIST && enable muxers
enabled_any $PROTOCOL_LIST && enable protocols
enabled_any $THREADS_LIST && enable threads
check_deps $CONFIG_LIST \ |
b6bb00b0 |
$CONFIG_EXTRA \ |
7483e694 |
$HAVE_LIST \
$DECODER_LIST \
$ENCODER_LIST \
$PARSER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \ |
f7679c54 |
$FILTER_LIST \ |
7483e694 |
$INDEV_LIST \
$OUTDEV_LIST \
$PROTOCOL_LIST \ |
f70f03f6 |
|
3e89171a |
echo "install prefix $prefix" |
f36958f8 |
echo "source path $source_path"
echo "C compiler $cc" |
bfd5afd8 |
echo ".align is power-of-two $asmalign_pot" |
f36958f8 |
echo "ARCH $arch ($cpu)" |
ce8871c2 |
if test "$build_suffix" != ""; then
echo "build suffix $build_suffix" |
eb94aca9 |
fi |
ac63af34 |
if test "$extra_version" != ""; then
echo "version string suffix $extra_version"
fi |
0db2ce77 |
echo "big-endian ${bigendian-no}" |
478394ba |
echo "runtime cpu detection ${runtime_cpudetect-no}" |
5b6c2cbd |
if enabled x86; then |
af44e8e4 |
echo "yasm ${yasm-no}" |
0db2ce77 |
echo "MMX enabled ${mmx-no}" |
30e98e62 |
echo "MMX2 enabled ${mmx2-no}" |
3bf96eec |
echo "3DNow! enabled ${amd3dnow-no}" |
a1ef9f08 |
echo "3DNow! extended enabled ${amd3dnowext-no}" |
1bb04d5a |
echo "SSE enabled ${sse-no}" |
30e98e62 |
echo "SSSE3 enabled ${ssse3-no}" |
0db2ce77 |
echo "CMOV enabled ${cmov-no}"
echo "CMOV is fast ${fast_cmov-no}" |
971cc990 |
echo "EBX available ${ebx_available-no}"
echo "EBP available ${ebp_available-no}" |
d3a4b4e0 |
echo "10 operands supported ${ten_operands-no}" |
e41e8342 |
fi |
5b6c2cbd |
if enabled arm; then |
0db2ce77 |
echo "ARMv5TE enabled ${armv5te-no}"
echo "ARMv6 enabled ${armv6-no}" |
ab5cb084 |
echo "ARMv6T2 enabled ${armv6t2-no}" |
f55b299a |
echo "ARM VFP enabled ${armvfp-no}" |
0db2ce77 |
echo "IWMMXT enabled ${iwmmxt-no}" |
6b18d278 |
echo "NEON enabled ${neon-no}" |
eba9ae3c |
fi |
5b6c2cbd |
if enabled mips; then |
0db2ce77 |
echo "MMI enabled ${mmi-no}" |
e41e8342 |
fi |
5b6c2cbd |
if enabled ppc; then |
0db2ce77 |
echo "AltiVec enabled ${altivec-no}" |
30e98e62 |
echo "PPC 4xx optimizations ${ppc4xx-no}" |
0db2ce77 |
echo "dcbzl available ${dcbzl-no}" |
30e98e62 |
echo "performance report ${powerpc_perf-no}"
fi
if enabled sparc; then
echo "VIS enabled ${vis-no}" |
e41e8342 |
fi |
0db2ce77 |
echo "gprof enabled ${gprof-no}"
echo "debug symbols ${debug-no}" |
87a0fb62 |
echo "strip symbols ${stripping-no}" |
8400d6b8 |
echo "optimizations ${optimizations-no}" |
0db2ce77 |
echo "static ${static-no}"
echo "shared ${shared-no}" |
4a24ab64 |
echo "postprocessing support ${postproc-no}" |
13ca50f3 |
echo "software scaler enabled ${swscale-no}" |
f7679c54 |
echo "new filter support ${avfilter-no}" |
81124ba0 |
echo "filters using lavformat ${avfilter_lavf-no}" |
0db2ce77 |
echo "video hooking ${vhook-no}" |
90be59ef |
if enabled vhook; then |
0db2ce77 |
echo "Imlib2 support ${imlib2-no}"
echo "FreeType support ${freetype2-no}" |
68892110 |
fi |
0db2ce77 |
echo "network support ${network-no}" |
90be59ef |
if enabled network; then |
0db2ce77 |
echo "IPv6 support ${ipv6-no}" |
bfd5afd8 |
fi |
0db2ce77 |
echo "threading support ${thread_type-no}"
echo "SDL support ${sdl-no}" |
90be59ef |
if enabled sdl_too_old; then |
bfd5afd8 |
echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
fi |
0db2ce77 |
echo "Sun medialib support ${mlib-no}"
echo "AVISynth enabled ${avisynth-no}"
echo "libamr-nb support ${libamr_nb-no}"
echo "libamr-wb support ${libamr_wb-no}" |
f7b8bffe |
echo "libdc1394 support ${libdc1394-no}" |
690bfceb |
echo "libdirac enabled ${libdirac-no}" |
0db2ce77 |
echo "libfaac enabled ${libfaac-no}"
echo "libfaad enabled ${libfaad-no}" |
7e0871a7 |
echo "libfaad dlopened ${libfaadbin-no}" |
0db2ce77 |
echo "libgsm enabled ${libgsm-no}"
echo "libmp3lame enabled ${libmp3lame-no}"
echo "libnut enabled ${libnut-no}" |
9ad437ea |
echo "libopencore-amrnb support ${libopencore_amrnb-no}"
echo "libopencore-amrwb support ${libopencore_amrwb-no}" |
9a77d59a |
echo "libopenjpeg enabled ${libopenjpeg-no}" |
f7cd9eed |
echo "libschroedinger enabled ${libschroedinger-no}" |
ae14f311 |
echo "libspeex enabled ${libspeex-no}" |
0db2ce77 |
echo "libtheora enabled ${libtheora-no}"
echo "libvorbis enabled ${libvorbis-no}" |
d6bd62db |
echo "libx264 enabled ${libx264-no}"
echo "libxvid enabled ${libxvid-no}" |
272081b0 |
echo "vdpau enabled ${vdpau-no}" |
0db2ce77 |
echo "zlib enabled ${zlib-no}" |
f402916e |
echo "bzlib enabled ${bzlib-no}" |
2c62e737 |
echo |
de6d9b64 |
|
f7679c54 |
for type in decoder encoder parser demuxer muxer protocol filter bsf indev outdev; do |
8138b9db |
echo "Enabled ${type}s:" |
f65c9da1 |
eval list=\$$(toupper $type)_LIST |
8138b9db |
for part in $list; do |
f65c9da1 |
enabled $part && echo ${part%_*}
done | sort | pr -3 -t
echo |
8138b9db |
done
|
41a4fd7a |
license="LGPL version 2.1 or later" |
ba321adb |
if enabled nonfree; then |
41a4fd7a |
license="nonfree and unredistributable" |
dd2089df |
elif enabled gplv3; then
license="GPL version 3 or later"
elif enabled lgplv3; then
license="LGPL version 3 or later" |
ba321adb |
elif enabled gpl; then |
41a4fd7a |
license="GPL version 2 or later" |
ba321adb |
fi
echo "License: $license" |
ca5323af |
|
cf1392e9 |
echo "Creating config.mak and config.h..."
|
29799f8b |
echo "# Automatically generated by configure - do not modify!" > config.mak
echo "/* Automatically generated by configure - do not modify! */" > $TMPH |
9c05103f |
echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
echo "#define FFMPEG_CONFIG_H" >> $TMPH |
0fd12426 |
echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH |
14a8acf1 |
echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH |
de6d9b64 |
|
d921f03f |
echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak |
c9d19248 |
echo "prefix=$prefix" >> config.mak |
22a324da |
echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak |
14a8acf1 |
echo "DATADIR=\$(DESTDIR)$datadir" >> config.mak |
22a324da |
echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak |
980fc7b8 |
echo "CC=$cc" >> config.mak |
304d586d |
echo "YASM=$yasmexe" >> config.mak |
980fc7b8 |
echo "AR=$ar" >> config.mak |
be7109c1 |
echo "RANLIB=$ranlib" >> config.mak |
20369773 |
echo "LN_S=$ln_s" >> config.mak |
87a0fb62 |
enabled stripping && |
3ae3b721 |
echo "STRIP=$strip" >> config.mak || |
f25fc9b1 |
echo "STRIP=echo ignoring strip" >> config.mak |
75388c74 |
|
a9b3f630 |
echo "OPTFLAGS=$CFLAGS" >> config.mak |
2270b4b2 |
echo "VHOOKCFLAGS=$VHOOKCFLAGS" >> config.mak |
0f3cb305 |
echo "LDFLAGS=$LDFLAGS" >> config.mak |
c536cb09 |
echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak |
e1707f52 |
echo "SHFLAGS=$SHFLAGS" >> config.mak |
304d586d |
echo "YASMFLAGS=$YASMFLAGS" >> config.mak |
408382a4 |
echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak |
fbb9d104 |
echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak |
80581e98 |
echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak |
5af4e0cc |
echo "BUILD_STATIC=$static" >> config.mak |
ce8871c2 |
echo "BUILDSUF=$build_suffix" >> config.mak |
c5f14466 |
echo "FULLNAME=$FULLNAME" >> config.mak |
f3ec2d46 |
echo "LIBPREF=$LIBPREF" >> config.mak |
c5f14466 |
echo "LIBSUF=$LIBSUF" >> config.mak |
24743a76 |
echo "LIBNAME=$LIBNAME" >> config.mak |
f3ec2d46 |
echo "SLIBPREF=$SLIBPREF" >> config.mak |
c5f14466 |
echo "SLIBSUF=$SLIBSUF" >> config.mak
echo "EXESUF=$EXESUF" >> config.mak |
ac63af34 |
echo "EXTRA_VERSION=$extra_version" >> config.mak |
315c741d |
echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak |
9da6609f |
echo "HOSTCC=$host_cc" >> config.mak
echo "HOSTCFLAGS=$host_cflags" >> config.mak
echo "HOSTLDFLAGS=$host_ldflags" >> config.mak
echo "HOSTLIBS=$host_libs" >> config.mak |
a7ada2ba |
echo "TARGET_EXEC=$target_exec" >> config.mak
echo "TARGET_PATH=$target_path" >> config.mak |
4dc62701 |
|
90be59ef |
if enabled bigendian; then |
7483e694 |
echo "WORDS_BIGENDIAN=yes" >> config.mak
echo "#define WORDS_BIGENDIAN 1" >> $TMPH |
91d1f1a4 |
fi |
44161118 |
|
90be59ef |
if enabled sdl; then |
7483e694 |
echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak |
a86b921c |
fi |
90be59ef |
if enabled texi2html; then |
7483e694 |
echo "BUILD_DOC=yes" >> config.mak |
146ea952 |
fi |
5a872801 |
|
719c8e00 |
get_version(){
name=$1
file=$source_path/$2 |
147e7692 |
eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO |
0e32c8c6 |
lcname=$(tolower $name)
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak |
719c8e00 |
}
|
147e7692 |
get_version LIBSWSCALE libswscale/swscale.h
get_version LIBPOSTPROC libpostproc/postprocess.h
get_version LIBAVCODEC libavcodec/avcodec.h
get_version LIBAVDEVICE libavdevice/avdevice.h
get_version LIBAVFORMAT libavformat/avformat.h
get_version LIBAVUTIL libavutil/avutil.h |
a6601d69 |
get_version LIBAVFILTER libavfilter/avfilter.h |
5a872801 |
|
5af4e0cc |
if enabled shared; then |
7483e694 |
echo "BUILD_SHARED=yes" >> config.mak
echo "PIC=-fPIC -DPIC" >> config.mak |
dcc01c06 |
echo "LIBTARGET=${LIBTARGET}" >> config.mak |
7483e694 |
echo "SLIBNAME=${SLIBNAME}" >> config.mak
echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak |
d22e8442 |
echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak |
7483e694 |
echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak |
0319c531 |
fi |
d7e27559 |
echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak |
ef0bc4c9 |
echo "EXTRALIBS=$extralibs" >> config.mak |
d2845d68 |
|
7b5e8a27 |
echo "ARCH=$arch" >> config.mak
|
3d907e22 |
print_config ARCH_ $TMPH config.mak $ARCH_LIST
print_config HAVE_ $TMPH config.mak $HAVE_LIST |
7483e694 |
print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \ |
b6bb00b0 |
$CONFIG_EXTRA \ |
7483e694 |
$DECODER_LIST \
$ENCODER_LIST \
$PARSER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \ |
f7679c54 |
$FILTER_LIST \ |
7483e694 |
$PROTOCOL_LIST \
$INDEV_LIST \
$OUTDEV_LIST \ |
8ac17293 |
|
c13e1abd |
echo "#define restrict $_restrict" >> $TMPH
|
bd2216e4 |
if enabled small; then |
7483e694 |
echo "#define av_always_inline" >> $TMPH |
bb801c97 |
fi
|
997baf01 |
echo "SRC_PATH=\"$source_path\"" >> config.mak
echo "SRC_PATH_BARE=$source_path" >> config.mak
echo "BUILD_ROOT=\"$PWD\"" >> config.mak |
0f3cb305 |
|
8156056e |
# Apparently it's not possible to portably echo a backslash. |
3ae3b721 |
enabled asmalign_pot && |
7483e694 |
printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH || |
295b8c70 |
printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH |
4454dc1b |
|
b4d96ba2 |
echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH |
bc634f6f |
|
9c05103f |
echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
|
b7860763 |
# Do not overwrite an unchanged config.h to avoid superfluous rebuilds. |
3ae3b721 |
cmp -s $TMPH config.h &&
echo "config.h is unchanged" ||
mv -f $TMPH config.h |
3d204385 |
|
165af439 |
# build tree in object directory if source path is different from current one |
90be59ef |
if enabled source_path_used; then |
165af439 |
DIRS="\ |
7483e694 |
doc \
libavcodec \
libavcodec/alpha \ |
a2fc0f6a |
libavcodec/arm \ |
7483e694 |
libavcodec/bfin \
libavcodec/mlib \
libavcodec/ppc \
libavcodec/sh4 \
libavcodec/sparc \ |
a6493a8f |
libavcodec/x86 \ |
52a9cf34 |
libavdevice \ |
f7679c54 |
libavfilter \ |
7483e694 |
libavformat \
libavutil \
libpostproc \
libswscale \
tests \
tools \
vhook \
" |
165af439 |
FILES="\ |
7483e694 |
Makefile \
common.mak \ |
71c61f62 |
subdir.mak \ |
7483e694 |
doc/texi2pod.pl \
libavcodec/Makefile \ |
52a9cf34 |
libavdevice/Makefile \ |
f7679c54 |
libavfilter/Makefile \ |
7483e694 |
libavformat/Makefile \
libavutil/Makefile \
libpostproc/Makefile \
libswscale/Makefile \
" |
165af439 |
for dir in $DIRS ; do |
7483e694 |
mkdir -p $dir |
165af439 |
done
for f in $FILES ; do |
20369773 |
$ln_s "$source_path/$f" $f |
165af439 |
done
fi |
def4272a |
|
d0674868 |
# build pkg-config files |
def4272a |
|
d0674868 |
pkgconfig_generate(){
name=$1 |
b0dfd108 |
shortname=${name#lib}${build_suffix} |
d0674868 |
comment=$2
version=$3
libs=$4
requires=$5 |
25cd5cb3 |
cat <<EOF > $name/$name.pc |
3e89171a |
prefix=$prefix |
a94e666c |
exec_prefix=\${prefix} |
f2b7382c |
libdir=$libdir |
7622778e |
includedir=$incdir |
def4272a |
|
d0674868 |
Name: $name
Description: $comment
Version: $version |
5dcfe9f8 |
Requires: $(disabled shared && echo $requires)
Requires.private: $(enabled shared && echo $requires) |
def4272a |
Conflicts: |
12701f6e |
Libs: -L\${libdir} -l${shortname} $(disabled shared && echo $libs)
Libs.private: $(enabled shared && echo $libs) |
76a448ed |
Cflags: -I\${includedir} |
def4272a |
EOF |
25cd5cb3 |
cat <<EOF > $name/$name-uninstalled.pc |
def4272a |
prefix=
exec_prefix= |
46d1ff83 |
libdir=\${pcfiledir} |
1d44d365 |
includedir=${source_path} |
def4272a |
|
d0674868 |
Name: $name
Description: $comment
Version: $version
Requires: $requires |
def4272a |
Conflicts: |
12701f6e |
Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs |
def4272a |
Cflags: -I\${includedir}
EOF |
d0674868 |
} |
def4272a |
|
e426941d |
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" |
46983309 |
pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION" |
3ed1a2ee |
enabled avfilter && |
46983309 |
pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION" |
3ed1a2ee |
enabled postproc && |
e426941d |
pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION" |
13ca50f3 |
if enabled swscale; then |
e426941d |
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION" |
6c0d0413 |
else |
46983309 |
pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavcodec = $LIBAVCODEC_VERSION" |
25cd5cb3 |
apply libswscale/libswscale.pc sed s/^Libs:.*$/Libs:/ |
6c0d0413 |
fi |