Newer
Older
build_suffix
cc
cpu
cross_prefix
extra_version
host_cc
host_cflags
host_ldflags
host_libs
sysinclude
sysroot
CMDLINE_APPEND="
extra_cflags
"
altivec_deps="ppc"
amd3dnow_deps="mmx"
amd3dnowext_deps="amd3dnow"
armv5te_deps="arm"
armv6_deps="arm"
armvfp_deps="arm"
iwmmxt_deps="arm"
Diego Biurrun
committed
mmi_deps="mips"
Diego Biurrun
committed
ppc4xx_deps="ppc"
sse_deps="mmx"
ssse3_deps="sse"
need_memalign="altivec neon sse"
# decoders / encoders / hardware accelerators
ac3_decoder_select="fft mdct"
atrac3_decoder_select="fft mdct"
cavs_decoder_select="golomb"
dnxhd_encoder_select="aandct"
eac3_decoder_select="ac3_decoder"
eatgq_decoder_select="aandct"
ffv1_decoder_select="golomb"
flac_decoder_select="golomb"
flac_encoder_select="golomb"
flashsv_decoder_select="zlib"
flashsv_encoder_select="zlib"
flv_encoder_select="aandct"
h261_encoder_select="aandct"
h263_encoder_select="aandct"
h263_vaapi_hwaccel_select="vaapi h263_decoder"
h263p_encoder_select="aandct"
h264_decoder_select="golomb"
h264_vaapi_hwaccel_select="vaapi"
Diego Biurrun
committed
h264_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
h264_vdpau_decoder_select="vdpau h264_decoder"
jpegls_decoder_select="golomb"
jpegls_encoder_select="golomb"
ljpeg_encoder_select="aandct"
loco_decoder_select="golomb"
mjpeg_encoder_select="aandct"
mpeg1video_encoder_select="aandct"
mpeg2video_encoder_select="aandct"
mpeg4_encoder_select="aandct"
Diego Biurrun
committed
mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
Diego Biurrun
committed
mpeg1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
mpeg_xvmc_decoder_select="mpegvideo_decoder"
Diego Biurrun
committed
msmpeg4v1_encoder_select="h263_encoder"
msmpeg4v2_encoder_select="h263_encoder"
msmpeg4v3_encoder_select="h263_encoder"
nellymoser_decoder_select="fft mdct"
nellymoser_encoder_select="fft mdct"
png_decoder_select="zlib"
png_encoder_select="zlib"
qdm2_decoder_select="fft mdct rdft"
Diego Biurrun
committed
rv10_encoder_select="h263_encoder"
rv20_encoder_select="h263_encoder"
rv30_decoder_select="golomb"
rv40_decoder_select="golomb"
shorten_decoder_select="golomb"
sonic_decoder_select="golomb"
sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb"
svq3_decoder_select="golomb"
theora_decoder_select="vp3_decoder"
tiff_decoder_suggest="zlib"
tiff_encoder_suggest="zlib"
tscc_decoder_select="zlib"
vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
Diego Biurrun
committed
vc1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
vc1_vdpau_decoder_select="vdpau vc1_decoder"
vorbis_decoder_select="fft mdct"
vorbis_encoder_select="fft mdct"
vp6a_decoder_select="vp6_decoder"
vp6f_decoder_select="vp6_decoder"
wmav1_decoder_select="fft mdct"
wmav1_encoder_select="fft mdct"
wmav2_decoder_select="fft mdct"
wmav2_encoder_select="fft mdct"
wmv1_encoder_select="aandct"
wmv2_encoder_select="aandct"
wmv3_decoder_select="vc1_decoder"
wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
zlib_decoder_select="zlib"
zlib_encoder_select="zlib"
zmbv_decoder_select="zlib"
zmbv_encoder_select="zlib"
Diego Biurrun
committed
# parsers
h264_parser_select="golomb"
libdirac_decoder_deps="libdirac !libschroedinger"
libdirac_encoder_deps="libdirac"
libfaac_encoder_deps="libfaac"
libfaad_decoder_deps="libfaad"
libfaadbin_decoder_extralibs='$ldl'
libgsm_decoder_deps="libgsm"
libgsm_encoder_deps="libgsm"
libgsm_ms_decoder_deps="libgsm"
libgsm_ms_encoder_deps="libgsm"
Diego Biurrun
committed
libmp3lame_encoder_deps="libmp3lame"
libopencore_amrnb_decoder_deps="libopencore_amrnb"
libopencore_amrnb_encoder_deps="libopencore_amrnb"
libopencore_amrwb_decoder_deps="libopencore_amrwb"
libopenjpeg_decoder_deps="libopenjpeg"
libschroedinger_decoder_deps="libschroedinger"
libschroedinger_encoder_deps="libschroedinger"
libvorbis_encoder_deps="libvorbis"
Diego Biurrun
committed
libx264_encoder_deps="libx264"
libxvid_encoder_deps="libxvid"
ac3_demuxer_deps="ac3_parser"
asf_stream_muxer_select="asf_muxer"
avisynth_demuxer_deps="avisynth"
dirac_demuxer_deps="dirac_parser"
ipod_muxer_select="mov_muxer"
libnut_demuxer_deps="libnut"
libnut_muxer_deps="libnut"
matroska_audio_muxer_select="matroska_muxer"
matroska_demuxer_suggest="zlib bzlib"
mov_demuxer_suggest="zlib"
mp3_demuxer_deps="mpegaudio_parser"
mp4_muxer_select="mov_muxer"
mpegtsraw_demuxer_select="mpegts_demuxer"
mxf_d10_muxer_select="mxf_muxer"
psp_muxer_select="mov_muxer"
redir_demuxer_deps="network"
rtp_muxer_deps="network rtp_protocol"
rtsp_demuxer_deps="sdp_demuxer"
sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
tg2_muxer_select="mov_muxer"
tgp_muxer_select="mov_muxer"
# indevs / outdevs
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
alsa_indev_extralibs="-lasound"
alsa_outdev_deps="alsa_asoundlib_h"
alsa_outdev_extralibs="-lasound"
audio_beos_indev_deps="audio_beos"
audio_beos_indev_extralibs="-lmedia -lbe"
audio_beos_outdev_deps="audio_beos"
audio_beos_outdev_extralibs="-lmedia -lbe"
bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
dv1394_indev_deps="dv1394 dv_demuxer"
jack_indev_deps="jack_jack_h"
jack_indev_extralibs="-ljack"
libdc1394_indev_deps="libdc1394"
oss_indev_deps_any="soundcard_h sys_soundcard_h"
oss_outdev_deps_any="soundcard_h sys_soundcard_h"
v4l_indev_deps="linux_videodev_h"
v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_indev_deps="capCreateCaptureWindow"
vfwcap_indev_extralibs="-lvfw32"
x11_grab_device_indev_deps="x11grab XShmCreateImage"
x11_grab_device_indev_extralibs="-lX11 -lXext"
gopher_protocol_deps="network"
http_protocol_deps="network"
rtp_protocol_deps="udp_protocol"
tcp_protocol_deps="network"
udp_protocol_deps="network"
Vitor Sessak
committed
# filters
movie_filter_deps="avfilter_lavf"
Vitor Sessak
committed
Ramiro Polla
committed
ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
logfile="config.err"
prefix_default="/usr/local"
bindir_default='${prefix}/bin'
datadir_default='${prefix}/share/ffmpeg'
incdir_default='${prefix}/include'
libdir_default='${prefix}/lib'
mandir_default='${prefix}/share/man'
shlibdir_default="$libdir_default"
cc_default="gcc"
nm_default="nm"
Fabrice Bellard
committed
strip="strip"
arch=$(uname -m)
Guillaume Poirier
committed
cpu="generic"
target_os=$(tolower $(uname -s))
host_os=$target_os
enable ffmpeg
enable ffplay
enable ffserver
enable ipv6
enable mpegaudio_hp
enable network
enable optimizations
enable stripping
Cédric Schieli
committed
enable swscale_alpha
FFSERVERLDFLAGS=-Wl,-E
LIBPREF="lib"
LIBSUF=".a"
FULLNAME='$(NAME)$(BUILDSUF)'
LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
SLIBPREF="lib"
SLIBSUF=".so"
SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
CC_O='-o $@'
host_cflags='-O3 -g -Wall'
host_libs='-lm'
# 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.
DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $@'
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -MM'
# find source path
source_path="$(dirname "$0")"
if test -f configure; then
source_path="$(pwd)"
disable source_path_used
else
source_path="$(cd "$source_path"; pwd)"
echo "$source_path" | grep -q '[[:blank:]]' &&
Diego Biurrun
committed
die "Out of tree builds are impossible with whitespace in source path."
test -e "$source_path/config.h" &&
die "Out of tree builds are impossible with config.h in source dir."
fi
r=${v#*=}
l=${v%"$r"}
r=$(sh_quote "$r")
FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
done
find_things(){
thing=$1
pattern=$2
file=$source_path/$3
sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
}
ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
HWACCEL_LIST=$(find_things hwaccel HWACCEL 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 outdev OUTDEV libavdevice/alldevices.c)
INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
Diego Biurrun
committed
enable $ARCH_EXT_LIST \
$DECODER_LIST \
$ENCODER_LIST \
$HWACCEL_LIST \
Diego Biurrun
committed
$PARSER_LIST \
$BSF_LIST \
$DEMUXER_LIST \
$MUXER_LIST \
Vitor Sessak
committed
$FILTER_LIST \
Diego Biurrun
committed
$PROTOCOL_LIST \
$INDEV_LIST \
$OUTDEV_LIST \
die_unknown(){
echo "Unknown option \"$1\"."
echo "See $0 --help for available options."
exit 1
}
Panagiotis Issaris
committed
show_list() {
suffix=_$1
shift
echo $* | sed s/$suffix//g | tr ' ' '\n' | sort
Panagiotis Issaris
committed
exit 0
}
for opt do
Diego Biurrun
committed
optval="${opt#*=}"
case "$opt" in
--extra-ldflags=*) add_ldflags $optval
Diego Biurrun
committed
;;
--extra-libs=*) add_extralibs $optval
Diego Biurrun
committed
;;
--disable-devices) disable $INDEV_LIST $OUTDEV_LIST
;;
--enable-debug=*) debuglevel="$optval"
;;
Diego Biurrun
committed
--enable-*=*|--disable-*=*)
eval $(echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/')
Diego Biurrun
committed
case "$thing" in
encoder|decoder|hwaccel|muxer|demuxer|indev|outdev|parser|bsf|protocol|filter) $action ${optval}_${thing} ;;
Diego Biurrun
committed
*) die_unknown "$opt" ;;
esac
;;
--enable-?*|--disable-?*)
eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
if is_in $option $COMPONENT_LIST; then
test $action = disable && action=unset
eval $action \$$(toupper ${option%s})_LIST
elif is_in $option $CMDLINE_SELECT; then
$action $option
else
die_unknown $opt
fi
Diego Biurrun
committed
;;
--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
;;
*)
optname="${opt%%=*}"
optname="${optname#--}"
optname=$(echo "$optname" | sed 's/-/_/g')
if is_in $optname $CMDLINE_SET; then
eval $optname='$optval'
elif is_in $optname $CMDLINE_APPEND; then
append $optname "$optval"
else
die_unknown $opt
fi
Diego Biurrun
committed
;;
esac
done
echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
test -n "$cross_prefix" && enable cross_compile
ar="${cross_prefix}${ar}"
cc_default="${cross_prefix}${cc_default}"
ranlib="${cross_prefix}${ranlib}"
strip="${cross_prefix}${strip}"
sysinclude_default="${sysroot}/usr/include"
set_default cc nm sysinclude
enabled cross_compile || host_cc_default=$cc
set_default host_cc
exesuf() {
case $1 in
mingw32*|cygwin*|*-dos|freedos|opendos|os/2*) echo .exe ;;
esac
}
EXESUF=$(exesuf $target_os)
HOSTEXESUF=$(exesuf $host_os)
: ${TMPDIR:=$TMP}
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
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 TMPSH .sh
unset -f mktemp
# 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
filter_cflags=echo
filter_cppflags=echo
filter_asflags=echo
if $cc --version 2>/dev/null | grep -qi gcc; then
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
elif $cc -V 2>/dev/null | grep -q Compaq; then
cc_type=ccc
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
debuglevel=3
add_ldflags -Wl,-z,now # calls to libots crash without this
elif $cc --vsn 2>/dev/null | grep -q RVCT; then
test -d "$sysroot" || die "No valid sysroot specified."
cc_type=armcc
armcc_conf="$PWD/armcc.conf"
$cc --arm_linux_configure \
--arm_linux_config_file="$armcc_conf" \
--configure_sysroot="$sysroot" \
--configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
die "Error creating armcc configuration file."
cc="$cc --arm_linux_config_file=$armcc_conf --translate_gcc"
as_default="${cross_prefix}gcc"
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
elif $cc -version 2>/dev/null | grep -q TMS470; then
cc_type=tms470
cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
CC_O='-fr=$(@D)'
as_default="${cross_prefix}gcc"
ld_default="${cross_prefix}gcc"
dep_cc_default="${cross_prefix}gcc"
TMPO=$(basename $TMPC .c).o
append TMPFILES $TMPO
add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
DEPFLAGS='$(CPPFLAGS) -MM'
filter_cflags=tms470_flags
tms470_flags(){
for flag; do
case $flag in
-march=*|-mcpu=*)
case "${flag#*=}" in
armv7-a|cortex-a*) echo -mv=7a8 ;;
armv7-r|cortex-r*) echo -mv=7r4 ;;
armv7-m|cortex-m*) echo -mv=7m3 ;;
armv6*|arm11*) echo -mv=6 ;;
armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
echo -mv=5e ;;
armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
esac
;;
-mfpu=neon) echo --float_support=vfpv3 --neon ;;
-mfpu=vfp) echo --float_support=vfpv2 ;;
-mfpu=softvfp) echo --float_support=vfplib ;;
-Os) echo -O3 -mf=2 ;;
-O[0-3]) echo $flag -mf=5 ;;
-g) echo -g -mn ;;
esac
done
}
fi
test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc"
Måns Rullgård
committed
: ${as_default:=$cc}
: ${dep_cc_default:=$cc}
set_default as dep_cc ld
add_cflags $extra_cflags
if test -n "$sysroot"; then
case "$cc_type" in
gcc)
add_cppflags --sysroot="$sysroot"
tms470)
add_cppflags -I"$sysinclude"
add_ldflags --sysroot="$sysroot"
;;
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
# Add processor-specific flags
case $cpu in
601|ppc601|PowerPC601)
cpuflags="-mcpu=601"
;;
603*|ppc603*|PowerPC603*)
cpuflags="-mcpu=603"
;;
604*|ppc604*|PowerPC604*)
cpuflags="-mcpu=604"
;;
G3|g3|75*|ppc75*|PowerPC75*)
cpuflags="-mcpu=750 -mpowerpc-gfxopt"
;;
G4|g4|745*|ppc745*|PowerPC745*)
cpuflags="-mcpu=7450 -mpowerpc-gfxopt"
;;
74*|ppc74*|PowerPC74*)
cpuflags="-mcpu=7400 -mpowerpc-gfxopt"
;;
G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
;;
Cell|CELL|cell)
cpuflags="-mcpu=cell"
enable ldbrx
;;
# targets that do NOT support conditional mov (cmov)
i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
cpuflags="-march=$cpu"
disable cmov
;;
# targets that do support conditional mov (cmov)
i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
cpuflags="-march=$cpu"
enable cmov
enable fast_cmov
;;
# targets that do support conditional mov but on which it's slow
pentium4|pentium4m|prescott|nocona)
cpuflags="-march=$cpu"
enable cmov
disable fast_cmov
;;
sparc64)
cpuflags="-mcpu=v9"
;;
arm11*|cortex*)
cpuflags="-mcpu=$cpu"
enable fast_unaligned
;;
armv[67]*)
cpuflags="-march=$cpu"
enable fast_unaligned
;;
armv*)
cpuflags="-march=$cpu"
;;
arm*)
cpuflags="-mcpu=$cpu"
;;
ev4|ev45|ev5|ev56|pca56|ev6|ev67)
enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu"
;;
bf*)
cpuflags="-mcpu=$cpu"
;;
mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef])
cpuflags="-march=$cpu"
;;
generic)
;;
*)
echo "WARNING: Unknown CPU \"$cpu\", ignored."
;;
esac
add_cflags $cpuflags
add_asflags $cpuflags
# 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
add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
Diego Biurrun
committed
#include <stdlib.h>
EOF
check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
Diego Biurrun
committed
#include <stdlib.h>
EOF
case "$arch" in
alpha)
arch="alpha"
enable fast_64bit
pic=$shared
arm|armv[4567]*l)
arch="arm"
bfin)
arch="bfin"
;;
ia64)
arch="ia64"
pic=$shared
pic=$shared
pic=$shared
pic=$shared
parisc64|hppa64)
pic=$shared
"Power Macintosh"|ppc|powerpc)
arch="ppc"
enable fast_unaligned
;;
ppc64)
arch="ppc"
enable fast_64bit
enable fast_unaligned
;;
pic=$shared
;;
sun4u|sparc64)
arch="sparc"
subarch="sparc64"
pic=$shared
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" && pic=$shared
int test[sizeof(char*) - 7];
EOF
;;
*)
arch="unknown"
;;
esac
Diego Biurrun
committed
# OS specific
Diego Biurrun
committed
beos|haiku|zeta)
Diego Biurrun
committed
# helps building libavcodec
add_cppflags -DPIC
add_cflags -fomit-frame-pointer
Diego Biurrun
committed
# 3 gcc releases known for BeOS, each with ugly bugs
gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
Diego Biurrun
committed
case "$gcc_version" in
2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
disable mmx
;;
*20010315*) echo "BeBits gcc"
add_cflags -fno-expensive-optimizations
Diego Biurrun
committed
;;
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
if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
Diego Biurrun
committed
network_extralibs="-lbind -lsocket"
else
enable beos_netserver
network_extralibs="-lnet"
fi ;;
sunos)
FFSERVERLDFLAGS=""
Diego Biurrun
committed
network_extralibs="-lsocket -lnsl"
add_cppflags -D__EXTENSIONS__
Diego Biurrun
committed
;;
netbsd)
oss_indev_extralibs="-lossaudio"
oss_outdev_extralibs="-lossaudio"
Diego Biurrun
committed
;;
openbsd)
enable malloc_aligned
Diego Biurrun
committed
SHFLAGS='-shared'
oss_indev_extralibs="-lossaudio"
oss_outdev_extralibs="-lossaudio"
Diego Biurrun
committed
;;
freebsd|dragonfly)
enable malloc_aligned
Diego Biurrun
committed
;;
bsd/os)
osextralibs="-lpoll -lgnugetopt"
strip="strip -d"
;;
darwin)
enable malloc_aligned
SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
Diego Biurrun
committed
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
enabled x86_64 && objformat="macho64"
enabled shared || check_cflags -mdynamic-no-pic
Diego Biurrun
committed
;;
mingw32*)
if test $target_os = "mingw32ce"; then
disable network
else
target_os=mingw32
fi
if enabled x86_64; then
enable malloc_aligned
elif enabled arm; then
LIBTARGET=arm
shlibdir_default="$bindir_default"
Diego Biurrun
committed
disable ffserver
SLIBPREF=""
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
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)"; \
install -d "$(LIBDIR)"; \
install -m 644 $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) "$(LIBDIR)/lib$(SLIBNAME:$(SLIBSUF)=.dll.a)"'
Diego Biurrun
committed
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
enable dos_paths
check_cflags -fno-common
Ramiro Polla
committed
if ! enabled x86_64; then
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_indev &&
{ check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 13)" ||
die "ERROR: avisynth and vfwcap_indev require w32api version 3.13 or later."; }
Diego Biurrun
committed
;;
cygwin*)
shlibdir_default="$bindir_default"
Diego Biurrun
committed
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'
enable dos_paths
check_cflags -fno-common
Diego Biurrun
committed
;;
disable $INDEV_LIST $OUTDEV_LIST
network_extralibs="-lsocket"
enable dos_paths
Diego Biurrun
committed
linux)
enable dv1394
;;
irix*)
Diego Biurrun
committed
ranlib="echo ignoring ranlib"
;;
os/2*)
strip="lxlite"
ln_s="cp -f"
FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
LIBSUF="_s.a"
SLIBPREF=""
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
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)"'
SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
enable dos_paths
gnu/kfreebsd)
;;
Diego Biurrun
committed
*)
die "Unknown OS '$target_os'."
Diego Biurrun
committed
;;
esac
add_extralibs $osextralibs
# Combine FFLDFLAGS and the LDFLAGS environment variable.
LDFLAGS="$FFLDFLAGS $LDFLAGS"
# we need to build at least one lib type
if ! enabled_any static shared; then
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
if enabled_any libfaad libfaadbin ; then
if check_header faad.h; then
#include <faad.h>
#ifndef FAAD2_VERSION
ok faad1
#endif
EOF
test $? = 0 && enable libfaad2
else
die_license_disabled() {
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
}
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 libfaac
Michael Niedermayer
committed
die_license_disabled version3 libopencore_amrnb
die_license_disabled version3 libopencore_amrwb
enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
Fabrice Bellard
committed
disabled optimizations || check_cflags -fomit-frame-pointer
check_cc <<EOF || die "Symbol mangling check failed."
int ff_extern;
EOF
sym=$($nm -P -g $TMPO | grep ff_extern)
extern_prefix=${sym%%ff_extern*}