Newer
Older
struct_rusage_ru_maxrss
Alessandro Sappia
committed
libdc1394_1
libdc1394_2
llrint
local_aligned_16
local_aligned_8
Alex Converse
committed
log2
Vitor Sessak
committed
log2f
lrint
Diego Biurrun
committed
lzo1x_999_compress
machine_ioctl_bt848_h
machine_ioctl_meteor_h
malloc_h
memalign
Matthieu Castet
committed
pld
round
roundf
sdl
sdl_video_size
setmode
struct_addrinfo
struct_ipv6_mreq
struct_sockaddr_in6
Ronald S. Bultje
committed
struct_sockaddr_sa_len
struct_sockaddr_storage
symver
symver_gnu_asm
symver_asm_label
sys_select_h
ten_operands
VirtualAlloc
"
# options emitted with CONFIG_ prefix but not available on command line
CONFIG_EXTRA="
$ARCH_EXT_LIST
$THREADS_LIST
logging
optimizations
stripping
PATHS_LIST='
incdir
libdir
mandir
prefix
shlibdir
'
CMDLINE_SET="
$PATHS_LIST
build_suffix
cc
cpu
cross_prefix
extra_version
host_cc
host_cflags
host_ldflags
host_libs
malloc_prefix
sysinclude
sysroot
CMDLINE_APPEND="
extra_cflags
"
armv5te_deps="arm"
armv6_deps="arm"
armvfp_deps="arm"
iwmmxt_deps="arm"
Diego Biurrun
committed
mmi_deps="mips"
altivec_deps="ppc"
ppc4xx_deps="ppc"
vis_deps="sparc"
amd3dnow_deps="mmx"
amd3dnowext_deps="amd3dnow"
mmx2_deps="mmx"
sse_deps="mmx"
ssse3_deps="sse"
fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
fast_clz_if_any="alpha armv5te avr32 mips ppc x86"
fast_unaligned_if_any="armv6 ppc x86"
need_memalign="altivec neon sse"
symver_if_any="symver_asm_label symver_gnu_asm"
# subsystems
mdct_select="fft"
rdft_select="fft"
# decoders / encoders / hardware accelerators
Georgi Chorbadzhiyski
committed
aac_decoder_select="mdct rdft aac_parser"
aac_encoder_select="mdct"
ac3_decoder_select="mdct ac3_parser"
alac_encoder_select="lpc"
amrnb_decoder_select="lsp"
atrac3_decoder_select="mdct"
binkaudio_dct_decoder_select="mdct rdft dct"
binkaudio_rdft_decoder_select="mdct rdft"
cavs_decoder_select="golomb"
cook_decoder_select="mdct"
dca_decoder_select="mdct"
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 lpc"
flashsv_decoder_select="zlib"
flashsv_encoder_select="zlib"
flv_decoder_select="h263_decoder"
flv_encoder_select="h263_encoder"
h261_encoder_select="aandct"
Diego Biurrun
committed
h263_decoder_select="h263_parser"
h263_encoder_select="aandct"
h263_vaapi_hwaccel_select="vaapi h263_decoder"
h263i_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder"
h264_decoder_select="golomb h264dsp"
h264_dxva2_hwaccel_deps="dxva2api_h"
h264_dxva2_hwaccel_select="dxva2 h264_decoder"
h264_vaapi_hwaccel_select="vaapi"
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"
mlp_decoder_select="mlp_parser"
mp1float_decoder_select="dct"
mp2float_decoder_select="dct"
mp3adufloat_decoder_select="dct"
mp3float_decoder_select="dct"
mp3on4float_decoder_select="dct"
mpeg1video_encoder_select="aandct"
mpeg2video_encoder_select="aandct"
mpeg4_decoder_select="h263_decoder mpeg4video_parser"
mpeg4_encoder_select="h263_encoder"
mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
mpeg2_dxva2_hwaccel_deps="dxva2api_h"
mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder"

NVIDIA Corporation
committed
mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder"
mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
mpeg_xvmc_decoder_select="mpegvideo_decoder"
msmpeg4v1_decoder_select="h263_decoder"
Diego Biurrun
committed
msmpeg4v1_encoder_select="h263_encoder"
msmpeg4v2_decoder_select="h263_decoder"
Diego Biurrun
committed
msmpeg4v2_encoder_select="h263_encoder"
msmpeg4v3_decoder_select="h263_decoder"
Diego Biurrun
committed
msmpeg4v3_encoder_select="h263_encoder"
nellymoser_decoder_select="mdct"
nellymoser_encoder_select="mdct"
png_decoder_select="zlib"
png_encoder_select="zlib"
qcelp_decoder_select="lsp"
qdm2_decoder_select="mdct rdft"
Diego Biurrun
committed
rv10_decoder_select="h263_decoder"
Diego Biurrun
committed
rv10_encoder_select="h263_encoder"
Diego Biurrun
committed
rv20_decoder_select="h263_decoder"
Diego Biurrun
committed
rv20_encoder_select="h263_encoder"
rv30_decoder_select="golomb h264dsp"
rv40_decoder_select="golomb h264dsp"
shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
snow_decoder_select="dwt"
snow_encoder_select="aandct dwt"
sonic_decoder_select="golomb"
sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb"
svq3_decoder_select="golomb h264dsp"
theora_decoder_select="vp3_decoder"
tiff_decoder_suggest="zlib"
tiff_encoder_suggest="zlib"
truehd_decoder_select="mlp_decoder"
twinvq_decoder_select="mdct lsp"
Diego Biurrun
committed
vc1_decoder_select="h263_decoder"
vc1_dxva2_hwaccel_deps="dxva2api_h DXVA_PictureParameters_wDecodedPictureIndex"
vc1_dxva2_hwaccel_select="dxva2 vc1_decoder"
vc1_vaapi_hwaccel_select="vaapi vc1_decoder"
vc1_vdpau_decoder_select="vdpau vc1_decoder"
vorbis_decoder_select="mdct"
vorbis_encoder_select="mdct"
vp6a_decoder_select="vp6_decoder"
vp6f_decoder_select="vp6_decoder"
vp8_decoder_select="h264dsp"
wmav1_decoder_select="mdct"
wmav1_encoder_select="mdct"
wmav2_decoder_select="mdct"
wmav2_encoder_select="mdct"
Diego Biurrun
committed
wmv1_decoder_select="h263_decoder"
wmv1_encoder_select="h263_encoder"
Diego Biurrun
committed
wmv2_decoder_select="h263_decoder"
wmv2_encoder_select="h263_encoder"
wmv3_decoder_select="vc1_decoder"
wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
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"
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
Diego Biurrun
committed
# parsers
h264_parser_select="golomb h264dsp"
Diego Biurrun
committed
# bitstream_filters
aac_adtstoasc_bsf_select="aac_parser"
libdirac_decoder_deps="libdirac !libschroedinger"
libdirac_encoder_deps="libdirac"
libfaac_encoder_deps="libfaac"
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"
Diego Biurrun
committed
eac3_demuxer_select="ac3_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"
rtsp_demuxer_deps="sdp_demuxer"
rtsp_muxer_deps="sdp_demuxer"
rtsp_muxer_select="rtp_muxer"
sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
sdp_demuxer_select="asf_demuxer rm_demuxer"
spdif_muxer_select="aac_parser"
tg2_muxer_select="mov_muxer"
tgp_muxer_select="mov_muxer"
w64_demuxer_deps="wav_demuxer"
# indevs / outdevs
alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
alsa_indev_extralibs="-lasound"
alsa_outdev_deps="alsa_asoundlib_h"
alsa_outdev_extralibs="-lasound"
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="-lavicap32"
x11_grab_device_indev_deps="x11grab XShmCreateImage"
x11_grab_device_indev_extralibs="-lX11 -lXext -lXfixes"
gopher_protocol_deps="network"
http_protocol_deps="network"
http_protocol_select="tcp_protocol"
rtmp_protocol_select="tcp_protocol"
rtp_protocol_select="udp_protocol"
tcp_protocol_deps="network"
udp_protocol_deps="network"
Vitor Sessak
committed
# filters
movie_filter_deps="avfilter_lavf"
avfilter_lavf_deps="avformat"
# libraries
avdevice_deps="avcodec avformat"
avformat_deps="avcodec"
Vitor Sessak
committed
ffmpeg_deps="avcodec avformat swscale"
ffmpeg_select="buffer_filter"
ffplay_deps="avcodec avformat swscale sdl"
ffserver_deps="avformat ffm_muxer rtp_protocol rtsp_demuxer"
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
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
1485
1486
1487
1488
# tests
test_deps(){
suf1=$1
suf2=$2
shift 2
for v; do
dep=${v%=*}
tests=${v#*=}
for name in ${tests}; do
eval ${name}_test_deps="'${dep}$suf1 ${dep}$suf2'"
done
done
}
test_deps _encoder _decoder \
ac3 \
adpcm_g726=g726 \
adpcm_ima_qt \
adpcm_ima_wav \
adpcm_ms \
adpcm_swf \
adpcm_yamaha=adpcm_yam \
alac \
asv1 \
asv2 \
bmp \
dnxhd="hdxhd_1080i dnxhd_720p dnxhd_720p_rd" \
dvvideo="dv dv50" \
ffv1 \
flac \
flashsv \
flv \
gif \
h261 \
h263="h263 h263p" \
huffyuv \
jpegls \
mjpeg="jpg mjpeg ljpeg" \
mp2 \
mpeg1video="mpeg mpeg1b" \
mpeg2video="mpeg2 mpeg2thread" \
mpeg4="mpeg4 mpeg4adv mpeg4nr mpeg4thread error rc" \
msmpeg4v1=msmpeg4 \
msmpeg4v2 \
pbm=pbmpipe \
pcx \
pgm="pgm pgmpipe" \
ppm="ppm ppmpipe" \
rawvideo="rgb yuv" \
roq \
rv10 \
rv20 \
sgi \
snow="snow snowll" \
svq1 \
targa=tga \
tiff \
wmav1 \
wmav2 \
wmv1 \
wmv2 \
test_deps _muxer _demuxer \
aiff \
pcm_alaw=alaw \
asf \
au \
avi \
dv=dv_fmt \
ffm \
flv=flv_fmt \
gxf \
matroska=mkv \
mmf \
mov \
pcm_mulaw=mulaw \
mxf \
nut \
ogg \
rawvideo=pixfmt \
rm \
swf \
mpegts=ts \
voc \
wav \
yuv4mpegpipe=yuv4mpeg \
mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
logfile="config.log"
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"
Diego Biurrun
committed
cc_version=\"unknown\"
nm_default="nm"
arch_default=$(uname -m)
Guillaume Poirier
committed
cpu="generic"
target_os_default=$(tolower $(uname -s))
host_os=$target_os_default
enable avcodec
enable avdevice
enable avfilter
enable ffmpeg
enable ffplay
enable ffserver
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='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall'
# since the object filename is not given with the -MM flag, the compiler
# is only able to print the basename, and we must add the path ourselves
DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
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)
find_tests(){
map 'echo ${v}_test' $(ls "$source_path"/tests/ref/$1)
}
ACODEC_TESTS=$(find_tests acodec)
VCODEC_TESTS=$(find_tests vsynth1)
LAVF_TESTS=$(find_tests lavf)
pcm_test_deps=$(map 'echo ${v%_*}_decoder $v' $(filter pcm_* $ENCODER_LIST))
for n in $COMPONENT_LIST; do
v=$(toupper ${n%s})_LIST
eval enable \$$v
eval ${n}_if_any="\$$v"
done
enable $ARCH_EXT_LIST $ACODEC_TESTS $VCODEC_TESTS $LAVF_TESTS
die_unknown(){
echo "Unknown option \"$1\"."
echo "See $0 --help for available options."
exit 1
}
Panagiotis Issaris
committed
show_list() {
echo $* | sed s/$suffix//g | tr ' ' '\n' | sort | pr -3 -t
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"
;;
map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
Diego Biurrun
committed
--enable-*=*|--disable-*=*)
eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
eval list=\$$(toupper $thing)_LIST
name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
$action $(filter "$name" $list)
Diego Biurrun
committed
;;
--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
if enabled cross_compile; then
test -n "$arch" && test -n "$target_os" ||
die "Must specify target arch and OS when cross-compiling"
fi
set_default arch target_os
ar_default="${cross_prefix}${ar_default}"
cc_default="${cross_prefix}${cc_default}"
ranlib="${cross_prefix}${ranlib}"
strip_default="${cross_prefix}${strip_default}"
sysinclude_default="${sysroot}/usr/include"
set_default cc nm strip 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}
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 temporary 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 -v 2>&1 | grep -qi ^gcc; then
cc_type=gcc
Diego Biurrun
committed
cc_version=__VERSION__
if ! $cc -dumpversion | grep -q '^2\.'; then
CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
fi
speed_cflags='-O3'
size_cflags='-Os'
elif $cc --version 2>/dev/null | grep -q Intel; then
cc_type=icc
cc_version="AV_STRINGIFY(__INTEL_COMPILER)"
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
speed_cflags='-O3'
size_cflags='-Os'
noopt_cflags='-O1'
elif $cc -v 2>&1 | grep -q xlc; then
cc_type=xlc
cc_version="AV_STRINGIFY(__IBMC__)"
speed_cflags='-O5'
size_cflags='-O5 -qcompact'
elif $cc -V 2>/dev/null | grep -q Compaq; then
cc_type=ccc
cc_version="AV_STRINGIFY(__DECC_VER)"
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -M'
debuglevel=3
add_ldflags -Wl,-z,now # calls to libots crash without this
speed_cflags='-fast'
size_cflags='-O1'
elif $cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
test -d "$sysroot" || die "No valid sysroot specified."
cc_type=armcc
cc_version="AV_STRINGIFY(__ARMCC_VERSION)"
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"
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
speed_cflags='-O3'
size_cflags='-Os'
elif $cc -version 2>/dev/null | grep -q TMS470; then
cc_type=tms470
cc_version="AV_STRINGIFY(__TI_COMPILER_VERSION__)"
cc="$cc --gcc --abi=eabi -eo=.o -mc -me"
CC_O='-fr=$(@D)'
as_default="${cross_prefix}gcc"
ld_default="${cross_prefix}gcc"
TMPO=$(basename $TMPC .c).o
append TMPFILES $TMPO
add_cflags -D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=
CC_DEPFLAGS='-ppa -ppd=$(@:.o=.d)'
AS_DEPFLAGS='-MMD'
speed_cflags='-O3 -mf=5'
size_cflags='-O3 -mf=2'
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=vfpv3) echo --float_support=vfpv3 ;;
-msoft-float) echo --float_support=vfplib ;;
-O[0-3]|-mf=*) echo $flag ;;
-pds=*) echo $flag ;;
elif $cc -v 2>&1 | grep -q clang; then
cc_type=clang
$cc -dM -E $TMPC | grep -q __clang_version__ &&
cc_version=__clang_version__ || cc_version=__VERSION__
CC_DEPFLAGS='-MMD'
AS_DEPFLAGS='-MMD'
speed_cflags='-O3'
size_cflags='-Os'
elif $cc -V 2>&1 | grep -q Sun; then
cc_type=suncc
cc_version="AV_STRINGIFY(__SUNPRO_C)"
DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
speed_cflags='-O5'
size_cflags='-O5 -xspace'
filter_cflags=suncc_flags
suncc_flags(){
for flag; do
case $flag in
-march=*|-mcpu=*)
case "${flag#*=}" in
native) echo -xtarget=native ;;
v9|niagara) echo -xarch=sparc ;;
ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
i586|pentium) echo -xchip=pentium ;;
i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
pentium3*|c3-2) echo -xtarget=pentium3 ;;
pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
pentium4*) echo -xtarget=pentium4 ;;
prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
*-sse3) echo -xarch=sse3 ;;
core2) echo -xarch=ssse3 -xchip=core2 ;;
amdfam10|barcelona) echo -xarch=sse4_1 ;;
athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
k8|opteron|athlon64|athlon-fx)
echo -xarch=sse2a ;;
athlon*) echo -xarch=pentium_proa ;;
esac
;;
-std=c99) echo -xc99 ;;
-fomit-frame-pointer) echo -xregs=frameptr ;;
-fPIC) echo -KPIC -xcode=pic32 ;;
-W*,*) echo $flag ;;
-f*-*|-W*) ;;
*) echo $flag ;;
esac
done
}
test -n "$cc_type" && enable $cc_type ||
warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
Måns Rullgård
committed
: ${as_default:=$cc}
: ${dep_cc_default:=$cc}
test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
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"
;;
add_cppflags -isysroot "$sysroot"
add_ldflags -isysroot "$sysroot"
if test "$cpu" = host; then
enabled cross_compile && die "--cpu=host makes no sense when cross-compiling."
case "$cc_type" in
gcc)
check_native(){
$cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
sed -n "/$1=/{
s/.*$1=\\([^ ]*\\).*/\\1/
p
q
}" $TMPE
}
cpu=$(check_native -march || check_native -mcpu)
;;
esac
test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
fi
# Deal with common $arch aliases
case "$arch" in
arm*)
arch="arm"
;;
mips|mipsel|IP*)
arch="mips"
;;
arch="mips"
subarch="mips64"
;;
parisc|hppa)
arch="parisc"
;;
parisc64|hppa64)
arch="parisc"
subarch="parisc64"
;;
"Power Macintosh"|ppc|powerpc)
arch="ppc"
;;
ppc64|powerpc64)
arch="ppc"
subarch="ppc64"
;;
s390|s390x)
arch="s390"