--enable-gray enable full grayscale support (slower color)
--disable-swscale-alpha disable alpha channel support in swscale
-Component options:
+Documentation options:
--disable-doc do not build documentation
+ --disable-htmlpages do not build HTML documentation pages
+ --disable-manpages do not build man documentation pages
+ --disable-podpages do not build POD documentation pages
+ --disable-txtpages do not build text documentation pages
+
+Component options:
--disable-ffmpeg disable ffmpeg build
--disable-ffplay disable ffplay build
--disable-ffprobe disable ffprobe build
--enable-x11grab enable X11 grabbing [no]
--disable-network disable network support [no]
--disable-dct disable DCT code
+ --disable-dwt disable DWT code
+ --disable-lsp disable LSP code
--disable-mdct disable MDCT code
--disable-rdft disable RDFT code
--disable-fft disable FFT code
and libraw1394 [no]
--enable-libfaac enable AAC encoding via libfaac [no]
--enable-libfdk-aac enable AAC encoding via libfdk-aac [no]
+ --enable-libflite enable flite (voice synthesis) support via libflite [no]
--enable-libfreetype enable libfreetype [no]
--enable-libgsm enable GSM de/encoding via libgsm [no]
--enable-libiec61883 enable iec61883 via libiec61883 [no]
--enable-libspeex enable Speex de/encoding via libspeex [no]
--enable-libstagefright-h264 enable H.264 decoding via libstagefright [no]
--enable-libtheora enable Theora encoding via libtheora [no]
+ --enable-libtwolame enable MP2 encoding via libtwolame [no]
--enable-libutvideo enable Ut Video encoding and decoding via libutvideo [no]
--enable-libv4l2 enable libv4l2/v4l-utils [no]
--enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
--yasmexe=EXE use yasm-compatible assembler EXE [$yasmexe_default]
--cc=CC use C compiler CC [$cc_default]
--cxx=CXX use C compiler CXX [$cxx_default]
+ --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
--ld=LD use linker LD [$ld_default]
--host-cc=HOSTCC use host C compiler HOSTCC
--host-cflags=HCFLAGS use HCFLAGS when compiling for host
--host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
--host-libs=HLIBS use libs HLIBS when linking for host
+ --host-os=OS compiler host OS [$target_os]
--extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
--extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
--extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
--extra-libs=ELIBS add ELIBS [$ELIBS]
--extra-version=STRING version string suffix []
- --optflags override optimization-related compiler flags
+ --optflags=OPTFLAGS override optimization-related compiler flags
--build-suffix=SUFFIX library name suffix []
--malloc-prefix=PREFIX prefix malloc and related names with PREFIX
--progs-suffix=SUFFIX program name suffix []
instruction selection, may crash on older CPUs)
--enable-pic build position-independent code
--enable-sram allow use of on-chip SRAM
+ --enable-thumb compile for Thumb instruction set
--disable-symver disable symbol versioning
--disable-fastdiv disable table-based division
--enable-hardcoded-tables use hardcoded tables instead of runtime generation
--disable-amd3dnow disable 3DNow! optimizations
--disable-amd3dnowext disable 3DNow! extended optimizations
--disable-mmx disable MMX optimizations
- --disable-mmx2 disable MMX2 optimizations
+ --disable-mmxext disable MMXEXT optimizations
--disable-sse disable SSE optimizations
--disable-ssse3 disable SSSE3 optimizations
--disable-avx disable AVX optimizations
+ --disable-fma4 disable FMA4 optimizations
--disable-armv5te disable armv5te optimizations
--disable-armv6 disable armv6 optimizations
--disable-armv6t2 disable armv6t2 optimizations
}
add_cppflags(){
- append CPPFLAGS $($filter_cppflags "$@")
+ append CPPFLAGS "$@"
}
add_cflags(){
- append CFLAGS $($filter_cflags "$@")
+ append CFLAGS $($cflags_filter "$@")
}
add_cxxflags(){
- append CXXFLAGS $($filter_cflags "$@")
+ append CXXFLAGS $($cflags_filter "$@")
}
add_asflags(){
- append ASFLAGS $($filter_asflags "$@")
+ append ASFLAGS $($asflags_filter "$@")
}
add_ldflags(){
- append LDFLAGS "$@"
+ append LDFLAGS $($ldflags_filter "$@")
}
add_extralibs(){
- prepend extralibs "$@"
+ prepend extralibs $($ldflags_filter "$@")
+}
+
+add_host_cflags(){
+ append host_cflags $($host_cflags_filter "$@")
+}
+
+add_host_ldflags(){
+ append host_ldflags $($host_ldflags_filter "$@")
}
check_cmd(){
"$@" >> $logfile 2>&1
}
+cc_o(){
+ eval printf '%s\\n' $CC_O
+}
+
+cc_e(){
+ eval printf '%s\\n' $CC_E
+}
+
check_cc(){
log check_cc "$@"
cat > $TMPC
log_file $TMPC
- check_cmd $cc $CPPFLAGS $CFLAGS "$@" -c -o $TMPO $TMPC
+ check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
}
check_cxx(){
log check_cxx "$@"
cat > $TMPCPP
log_file $TMPCPP
- check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" -c -o $TMPO $TMPCPP
+ check_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
}
check_cpp(){
log check_cpp "$@"
cat > $TMPC
log_file $TMPC
- check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
+ check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
}
check_as(){
log check_as "$@"
cat > $TMPC
log_file $TMPC
- check_cmd $as $CPPFLAGS $ASFLAGS "$@" -c -o $TMPO $TMPC
+ check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C -o $TMPO $TMPC
}
-check_asm(){
- log check_asm "$@"
+check_inline_asm(){
+ log check_inline_asm "$@"
name="$1"
code="$2"
shift 2
for f; do
test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
done
- check_$type $($filter_cflags $flags) || return
+ check_$type $($cflags_filter $flags) || return
+ flags=$($ldflags_filter $flags)
+ libs=$($ldflags_filter $libs)
check_cmd $ld $LDFLAGS $flags -o $TMPE $TMPO $libs $extralibs
}
check_cppflags(){
log check_cppflags "$@"
- set -- $($filter_cppflags "$@")
check_cc "$@" <<EOF && append CPPFLAGS "$@"
int x;
EOF
check_cflags(){
log check_cflags "$@"
- set -- $($filter_cflags "$@")
+ set -- $($cflags_filter "$@")
check_cc "$@" <<EOF && append CFLAGS "$@"
int x;
EOF
check_cxxflags(){
log check_cxxflags "$@"
- set -- $($filter_cflags "$@")
+ set -- $($cflags_filter "$@")
check_cxx "$@" <<EOF && append CXXFLAGS "$@"
int x;
EOF
header=$1
condition=$2
shift 2
- check_cpp $($filter_cppflags "$@") <<EOF
+ check_cpp "$@" <<EOF
#include <$header>
#if !($condition)
#error "unsatisfied condition: $condition"
check_host_cflags(){
log check_host_cflags "$@"
+ set -- $($host_cflags_filter "$@")
check_host_cc "$@" <<EOF && append host_cflags "$@"
int x;
EOF
protocols
"
+DOCUMENT_LIST="
+ doc
+ htmlpages
+ manpages
+ podpages
+ txtpages
+"
+
PROGRAM_LIST="
ffplay
ffprobe
CONFIG_LIST="
$COMPONENT_LIST
+ $DOCUMENT_LIST
$PROGRAM_LIST
- ac3dsp
avcodec
avdevice
avfilter
bzlib
crystalhd
dct
- doc
dwt
dxva2
fast_unaligned
libdc1394
libfaac
libfdk_aac
+ libflite
libfreetype
libgsm
libiec61883
libspeex
libstagefright_h264
libtheora
+ libtwolame
libutvideo
libv4l2
libvo_aacenc
mdct
memalign_hack
memory_poisoning
- mpegaudiodsp
network
nonfree
openal
pic
postproc
rdft
- rtpdec
runtime_cpudetect
safe_bitstream_reader
shared
- sinewin
small
sram
static
armv6t2
armvfp
avx
+ fma4
mmi
mmx
- mmx2
+ mmxext
neon
ppc4xx
sse
alsa_asoundlib_h
altivec_h
arpa_inet_h
+ asm_mod_q
asm_mod_y
asm_types_h
attribute_may_alias
closesocket
cmov
cpuid
+ cpunop
dcbzl
dev_bktr_ioctl_bt848_h
dev_bktr_ioctl_meteor_h
mm_empty
mmap
nanosleep
- netinet_sctp_h
PeekNamedPipe
+ perl
pod2man
poll_h
posix_memalign
struct_ipv6_mreq
struct_pollfd
struct_rusage_ru_maxrss
+ struct_sctp_event_subscribe
struct_sockaddr_in6
struct_sockaddr_sa_len
struct_sockaddr_storage
# options emitted with CONFIG_ prefix but not available on command line
CONFIG_EXTRA="
- aandct
+ aandcttables
+ ac3dsp
avutil
+ error_resilience
+ gcrypt
golomb
gplv3
h264chroma
huffman
lgplv3
lpc
+ mpegaudiodsp
+ mpegvideo
+ mpegvideoenc
+ nettle
+ rangecoder
+ rtpdec
+ sinewin
vp3dsp
"
amd3dnow_deps="mmx"
amd3dnowext_deps="amd3dnow"
mmx_deps="x86"
-mmx2_deps="mmx"
+mmxext_deps="mmx"
sse_deps="mmx"
ssse3_deps="sse"
avx_deps="ssse3"
+fma4_deps="avx"
aligned_stack_if_any="ppc x86"
fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
mdct_select="fft"
rdft_select="fft"
mpegaudiodsp_select="dct"
+mpegvideoenc_select="mpegvideo"
# decoders / encoders / hardware accelerators
aac_decoder_select="mdct sinewin"
alac_encoder_select="lpc"
amrnb_decoder_select="lsp"
amrwb_decoder_select="lsp"
-amv_encoder_select="aandct"
+amv_encoder_select="aandcttables"
atrac1_decoder_select="mdct sinewin"
atrac3_decoder_select="mdct"
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
binkaudio_rdft_decoder_select="mdct rdft sinewin"
-cavs_decoder_select="golomb"
+cavs_decoder_select="golomb mpegvideo"
cook_decoder_select="mdct sinewin"
cscd_decoder_suggest="zlib"
dca_decoder_select="mdct"
dirac_decoder_select="dwt golomb"
-dnxhd_encoder_select="aandct"
+dnxhd_encoder_select="aandcttables mpegvideoenc"
dxa_decoder_select="zlib"
eac3_decoder_select="ac3_decoder"
eac3_encoder_select="mdct ac3dsp"
-eamad_decoder_select="aandct"
-eatgq_decoder_select="aandct"
-eatqi_decoder_select="aandct"
+eamad_decoder_select="aandcttables error_resilience"
+eatgq_decoder_select="aandcttables"
+eatqi_decoder_select="aandcttables error_resilience mpegvideo"
exr_decoder_select="zlib"
-ffv1_decoder_select="golomb"
+ffv1_decoder_select="golomb rangecoder"
+ffv1_encoder_select="rangecoder"
flac_decoder_select="golomb"
flac_encoder_select="golomb lpc"
flashsv_decoder_select="zlib"
flv_decoder_select="h263_decoder"
flv_encoder_select="h263_encoder"
fraps_decoder_select="huffman"
-h261_encoder_select="aandct"
-h263_decoder_select="h263_parser"
-h263_encoder_select="aandct"
+h261_decoder_select="error_resilience mpegvideo"
+h261_encoder_select="aandcttables mpegvideoenc"
+h263_decoder_select="error_resilience h263_parser mpegvideo"
+h263_encoder_select="aandcttables error_resilience mpegvideoenc"
h263_vaapi_hwaccel_select="vaapi h263_decoder"
h263i_decoder_select="h263_decoder"
h263p_encoder_select="h263_encoder"
h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
-h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel"
+h264_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
h264_dxva2_hwaccel_deps="dxva2api_h"
h264_dxva2_hwaccel_select="dxva2 h264_decoder"
h264_vaapi_hwaccel_select="vaapi h264_decoder"
imc_decoder_select="fft mdct sinewin"
jpegls_decoder_select="golomb"
jpegls_encoder_select="golomb"
-ljpeg_encoder_select="aandct"
+ljpeg_encoder_select="aandcttables mpegvideoenc"
loco_decoder_select="golomb"
-mjpeg_encoder_select="aandct"
+mdec_decoder_select="error_resilience mpegvideo"
+mjpeg_encoder_select="aandcttables mpegvideoenc"
mlp_decoder_select="mlp_parser"
mp1_decoder_select="mpegaudiodsp"
mp1float_decoder_select="mpegaudiodsp"
mpeg_xvmc_decoder_select="mpegvideo_decoder"
mpeg1_vdpau_decoder_select="vdpau mpeg1video_decoder"
mpeg1_vdpau_hwaccel_select="vdpau mpeg1video_decoder"
-mpeg1video_encoder_select="aandct"
+mpeg1video_decoder_select="error_resilience mpegvideo"
+mpeg1video_encoder_select="aandcttables error_resilience mpegvideoenc"
mpeg2_crystalhd_decoder_select="crystalhd"
mpeg2_dxva2_hwaccel_deps="dxva2api_h"
mpeg2_dxva2_hwaccel_select="dxva2 mpeg2video_decoder"
mpeg2_vdpau_hwaccel_select="vdpau mpeg2video_decoder"
mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder"
-mpeg2video_encoder_select="aandct"
+mpeg2video_decoder_select="error_resilience mpegvideo"
+mpeg2video_encoder_select="aandcttables error_resilience mpegvideoenc"
mpeg4_crystalhd_decoder_select="crystalhd"
mpeg4_decoder_select="h263_decoder mpeg4video_parser"
mpeg4_encoder_select="h263_encoder"
rv10_encoder_select="h263_encoder"
rv20_decoder_select="h263_decoder"
rv20_encoder_select="h263_encoder"
-rv30_decoder_select="golomb h264chroma h264pred h264qpel"
-rv40_decoder_select="golomb h264chroma h264pred h264qpel"
+rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
+rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo"
shorten_decoder_select="golomb"
sipr_decoder_select="lsp"
-snow_decoder_select="dwt"
-snow_encoder_select="aandct dwt"
+snow_decoder_select="dwt rangecoder"
+snow_encoder_select="aandcttables dwt error_resilience mpegvideoenc rangecoder"
sonic_decoder_select="golomb"
sonic_encoder_select="golomb"
sonic_ls_encoder_select="golomb"
-svq1_encoder_select="aandct"
-svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel"
+svq1_decoder_select="error_resilience mpegvideo"
+svq1_encoder_select="aandcttables error_resilience mpegvideoenc"
+svq3_decoder_select="error_resilience golomb h264chroma h264dsp h264pred h264qpel mpegvideo"
svq3_decoder_suggest="zlib"
theora_decoder_select="vp3_decoder"
tiff_decoder_suggest="zlib"
vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
# parsers
-h264_parser_select="golomb h264dsp h264pred"
+h264_parser_select="error_resilience golomb h264dsp h264pred mpegvideo"
+mpeg4video_parser_select="error_resilience mpegvideo"
+mpegvideo_parser_select="error_resilience mpegvideo"
+vc1_parser_select="error_resilience mpegvideo"
# external libraries
libaacplus_encoder_deps="libaacplus"
libspeex_encoder_deps="libspeex"
libstagefright_h264_decoder_deps="libstagefright_h264"
libtheora_encoder_deps="libtheora"
+libtwolame_encoder_deps="libtwolame"
libvo_aacenc_encoder_deps="libvo_aacenc"
libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
libvorbis_decoder_deps="libvorbis"
mov_demuxer_suggest="zlib"
mp3_demuxer_select="mpegaudio_parser"
mp4_muxer_select="mov_muxer"
-mpegts_muxer_select="adts_muxer latm_muxer"
+mpegts_muxer_select="adts_muxer latm_muxer mpegvideo"
mpegtsraw_demuxer_select="mpegts_demuxer"
mxf_d10_muxer_select="mxf_muxer"
ogg_demuxer_select="golomb"
psp_muxer_select="mov_muxer"
rtp_demuxer_select="sdp_demuxer"
+rtp_muxer_select="mpegvideo"
rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
rtsp_demuxer_select="http_protocol rtpdec"
rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol"
v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
vfwcap_indev_extralibs="-lavicap32"
-x11_grab_device_indev_deps="x11grab"
+x11grab_indev_deps="x11grab"
# protocols
bluray_protocol_deps="libbluray"
+ffrtmpcrypt_protocol_deps="!librtmp_protocol"
+ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
+ffrtmpcrypt_protocol_select="tcp_protocol"
ffrtmphttp_protocol_deps="!librtmp_protocol"
ffrtmphttp_protocol_select="http_protocol"
gopher_protocol_deps="network"
mmst_protocol_deps="network"
rtmp_protocol_deps="!librtmp_protocol"
rtmp_protocol_select="tcp_protocol"
+rtmpe_protocol_select="ffrtmpcrypt_protocol"
rtmps_protocol_deps="!librtmp_protocol"
rtmps_protocol_select="tls_protocol"
-rtmpt_protocol_deps="!librtmp_protocol"
rtmpt_protocol_select="ffrtmphttp_protocol"
-rtmpts_protocol_deps="!librtmp_protocol"
-rtmpts_protocol_select="ffrtmphttp_protocol"
+rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
+rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
rtp_protocol_select="udp_protocol"
-sctp_protocol_deps="network netinet_sctp_h"
+sctp_protocol_deps="network struct_sctp_event_subscribe"
tcp_protocol_deps="network"
tls_protocol_deps_any="openssl gnutls"
tls_protocol_select="tcp_protocol"
delogo_filter_deps="gpl"
deshake_filter_deps="avcodec"
drawtext_filter_deps="libfreetype"
+flite_filter_deps="libflite"
frei0r_filter_deps="frei0r dlopen"
frei0r_filter_extralibs='$ldl'
frei0r_src_filter_deps="frei0r dlopen"
ffserver_deps="avformat ffm_muxer fork rtp_protocol rtsp_demuxer"
ffserver_extralibs='$ldl'
-doc_deps_any="texi2html makeinfo pod2man"
+# documentation
+podpages_deps="perl"
+manpages_deps="perl pod2man"
+htmlpages_deps="texi2html"
+txtpages_deps="makeinfo"
+doc_deps_any="manpages htmlpages podpages txtpages"
# tests
+colormatrix1_test_deps="colormatrix_filter"
+colormatrix2_test_deps="colormatrix_filter"
+flashsv2_test_deps="zlib"
+mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
+mpng_test_deps="zlib"
+pp_test_deps="mp_filter"
+pp2_test_deps="mp_filter"
+pp3_test_deps="mp_filter"
+pp4_test_deps="mp_filter"
+pp5_test_deps="mp_filter"
+pp6_test_deps="mp_filter"
+seek_lavf_mxf_d10_test_deps="mxf_d10_test"
+zlib_test_deps="zlib"
+zmbv_test_deps="zlib"
test_deps(){
suf1=$1
done
}
-seek_lavf_mxf_d10_test_deps="mxf_d10_test"
-
test_deps _muxer _demuxer \
aiff \
pcm_alaw=alaw \
wav \
yuv4mpegpipe=yuv4mpeg \
-colormatrix1_test_deps="colormatrix_filter"
-colormatrix2_test_deps="colormatrix_filter"
-flashsv2_test_deps="zlib"
-mpg_test_deps="mpeg1system_muxer mpegps_demuxer"
-mpng_test_deps="zlib"
-pp_test_deps="mp_filter"
-pp2_test_deps="mp_filter"
-pp3_test_deps="mp_filter"
-pp4_test_deps="mp_filter"
-pp5_test_deps="mp_filter"
-pp6_test_deps="mp_filter"
-zlib_test_deps="zlib"
-zmbv_test_deps="zlib"
-
# default parameters
logfile="config.log"
# configurable options
enable $PROGRAM_LIST
+enable $DOCUMENT_LIST
enable avcodec
enable avdevice
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
+asflags_filter=echo
+cflags_filter=echo
+ldflags_filter=echo
+
+AS_C='-c'
AS_O='-o $@'
+CC_C='-c'
+CC_E='-E -o $@'
CC_O='-o $@'
+CXX_C='-c'
CXX_O='-o $@'
+LD_O='-o $@'
+HOSTCC_C='-c'
+HOSTCC_O='-o $@'
host_cflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600 -O3 -g'
host_libs='-lm'
+host_cflags_filter=echo
+host_ldflags_filter=echo
target_path='$(CURDIR)'
# 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'
+DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
+DEPFLAGS='-MM'
# find source path
if test -f configure; then
die "Sanity test failed."
fi
-filter_asflags=echo
-filter_cflags=echo
-filter_cppflags=echo
-
-if $cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
- cc_type=llvm_gcc
- gcc_extra_ver=$(expr "$($cc --version | head -n1)" : '.*\((.*)\)')
- cc_ident="llvm-gcc $($cc -dumpversion) $gcc_extra_ver"
- CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
- AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
- speed_cflags='-O3'
- size_cflags='-Os'
-elif $cc -v 2>&1 | grep -qi ^gcc; then
- cc_type=gcc
- gcc_version=$($cc --version | head -n1)
- gcc_basever=$($cc -dumpversion)
- gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
- gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
- cc_ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
- if ! $cc -dumpversion | grep -q '^2\.'; then
- CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
- AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
+pgi_flags(){
+ for flag; do
+ case $flag in
+ -fomit-frame-pointer) echo -Mnoframe ;;
+ -g) echo -gopt ;;
+ *) echo $flag ;;
+ esac
+ done
+}
+
+suncc_flags(){
+ for flag; do
+ case $flag in
+ -march=*|-mcpu=*)
+ case "${flag#*=}" in
+ native) echo -xtarget=native ;;
+ v9|niagara) echo -xarch=sparc ;;
+ ultrasparc) echo -xarch=sparcvis ;;
+ ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
+ 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
+}
+
+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 ;;
+ -g) echo -g -mn ;;
+ -pds=*) echo $flag ;;
+ -D*|-I*) echo $flag ;;
+ --gcc|--abi=*) echo $flag ;;
+ -me) echo $flag ;;
+ esac
+ done
+}
+
+probe_cc(){
+ pfx=$1
+ _cc=$2
+
+ unset _type _ident _cc_c _cc_e _cc_o _flags _cflags _ldflags
+ unset _depflags _DEPCMD _DEPFLAGS
+ _flags_filter=echo
+
+ if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
+ _type=llvm_gcc
+ gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
+ _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
+ _depflags='-MMD -MF $(@:.o=.d) -MT $@'
+ _cflags_speed='-O3'
+ _cflags_size='-Os'
+ elif $_cc -v 2>&1 | grep -qi ^gcc; then
+ _type=gcc
+ gcc_version=$($_cc --version | head -n1)
+ gcc_basever=$($_cc -dumpversion)
+ gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
+ gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
+ _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
+ if ! $_cc -dumpversion | grep -q '^2\.'; then
+ _depflags='-MMD -MF $(@:.o=.d) -MT $@'
+ fi
+ _cflags_speed='-O3'
+ _cflags_size='-Os'
+ elif $_cc --version 2>/dev/null | grep -q Intel; then
+ _type=icc
+ _ident=$($_cc --version | head -n1)
+ _depflags='-MMD'
+ _cflags_speed='-O3'
+ _cflags_size='-Os'
+ _cflags_noopt='-O1'
+ elif $_cc -v 2>&1 | grep -q xlc; then
+ _type=xlc
+ _ident=$($_cc -qversion 2>/dev/null | head -n1)
+ _cflags_speed='-O5'
+ _cflags_size='-O5 -qcompact'
+ elif $_cc -V 2>/dev/null | grep -q Compaq; then
+ _type=ccc
+ _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
+ _DEPFLAGS='-M'
+ debuglevel=3
+ _ldflags='-Wl,-z,now' # calls to libots crash without this
+ _cflags_speed='-fast'
+ _cflags_size='-O1'
+ elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
+ test -d "$sysroot" || die "No valid sysroot specified."
+ _type=armcc
+ _ident=$($_cc --vsn | head -n1)
+ 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 --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
+ _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
+ as_default="${cross_prefix}gcc"
+ _depflags='-MMD'
+ _cflags_speed='-O3'
+ _cflags_size='-Os'
+ elif $_cc -version 2>/dev/null | grep -q TMS470; then
+ _type=tms470
+ _ident=$($_cc -version | head -n1 | tr -s ' ')
+ _flags='--gcc --abi=eabi -me'
+ _cflags='-D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__='
+ _cc_e='-ppl -fe=$@'
+ _cc_o='-fe=$@'
+ as_default="${cross_prefix}gcc"
+ ld_default="${cross_prefix}gcc"
+ _depflags='-ppa -ppd=$(@:.o=.d)'
+ _cflags_speed='-O3 -mf=5'
+ _cflags_size='-O3 -mf=2'
+ _flags_filter=tms470_flags
+ elif $_cc -v 2>&1 | grep -q clang; then
+ _type=clang
+ _ident=$($_cc --version | head -n1)
+ _depflags='-MMD'
+ _cflags_speed='-O3'
+ _cflags_size='-Os'
+ elif $_cc -V 2>&1 | grep -q Sun; then
+ _type=suncc
+ _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
+ _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
+ _DEPFLAGS='-xM1 -xc99'
+ _ldflags='-std=c99'
+ _cflags_speed='-O5'
+ _cflags_size='-O5 -xspace'
+ _flags_filter=suncc_flags
+ elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
+ _type=pathscale
+ _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
+ _depflags='-MMD -MF $(@:.o=.d) -MT $@'
+ _cflags_speed='-O2'
+ _cflags_size='-Os'
+ _flags_filter='filter_out -Wdisabled-optimization'
+ elif $_cc -v 2>&1 | grep -q Open64; then
+ _type=open64
+ _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
+ _depflags='-MMD -MF $(@:.o=.d) -MT $@'
+ _cflags_speed='-O2'
+ _cflags_size='-Os'
+ _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
+ elif $_cc -V 2>&1 | grep -q Portland; then
+ _type=pgi
+ _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
+ opt_common='-alias=ansi -Mlre -Mpre'
+ _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
+ _cflags_size="-O2 -Munroll=c:1 $opt_common"
+ _cflags_noopt="-O1"
+ _flags_filter=pgi_flags
fi
- speed_cflags='-O3'
- size_cflags='-Os'
-elif $cc --version 2>/dev/null | grep -q Intel; then
- cc_type=icc
- cc_ident=$($cc --version | head -n1)
- icc_version=$($cc -dumpversion)
- 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_ident=$($cc -qversion 2>/dev/null | head -n1)
- speed_cflags='-O5'
- size_cflags='-O5 -qcompact'
-elif $cc -V 2>/dev/null | grep -q Compaq; then
- cc_type=ccc
- cc_ident=$($cc -V | head -n1 | cut -d' ' -f1-3)
- 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_ident=$($cc --vsn | head -n1)
- 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 --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
- 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'
- filter_asflags="filter_out -W${armcc_opt}*"
-elif $cc -version 2>/dev/null | grep -q TMS470; then
- cc_type=tms470
- cc_ident=$($cc -version | head -n1 | tr -s ' ')
- 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 ;;
- -g) echo -g -mn ;;
- -pds=*) echo $flag ;;
- esac
- done
- }
-elif $cc -v 2>&1 | grep -q clang; then
- cc_type=clang
- cc_ident=$($cc --version | head -n1)
- 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_ident=$($cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
- DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
- DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1'
- add_ldflags -xc99
- 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 ;;
- ultrasparc) echo -xarch=sparcvis ;;
- ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
- 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
- }
-elif $cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
- cc_type=pathscale
- cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
- CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
- AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
- speed_cflags='-O2'
- size_cflags='-Os'
- filter_cflags='filter_out -Wdisabled-optimization'
-elif $cc -v 2>&1 | grep -q Open64; then
- cc_type=open64
- cc_ident=$($cc -v 2>&1 | head -n1 | tr -d :)
- CC_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
- AS_DEPFLAGS='-MMD -MF $(@:.o=.d) -MT $@'
- speed_cflags='-O2'
- size_cflags='-Os'
- filter_cflags='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
-elif $cc -V 2>&1 | grep -q Portland; then
- cc_type=pgi
- cc_ident="PGI $($cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
- opt_common='-alias=ansi -Mlre -Mpre'
- speed_cflags="-O3 -Mautoinline -Munroll=c:4 $opt_common"
- size_cflags="-O2 -Munroll=c:1 $opt_common"
- noopt_cflags="-O1"
- filter_cflags=pgi_flags
- pgi_flags(){
- for flag; do
- case $flag in
- -fomit-frame-pointer) echo -Mnoframe ;;
- -g) echo -gopt ;;
- *) echo $flag ;;
- esac
- done
- }
-fi
+
+ eval ${pfx}_type=\$_type
+ eval ${pfx}_ident=\$_ident
+}
+
+set_ccvars(){
+ eval ${1}_C=\${_cc_c-\${${1}_C}}
+ eval ${1}_E=\${_cc_e-\${${1}_E}}
+ eval ${1}_O=\${_cc_o-\${${1}_O}}
+
+ if [ -n "$_depflags" ]; then
+ eval ${1}_DEPFLAGS=\$_depflags
+ else
+ eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
+ eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
+ eval DEP${1}FLAGS=\$_flags
+ fi
+}
+
+probe_cc cc "$cc"
+cflags_filter=$_flags_filter
+cflags_speed=$_cflags_speed
+cflags_size=$_cflags_size
+cflags_noopt=$_cflags_noopt
+add_cflags $_flags $_cflags
+cc_ldflags=$_ldflags
+set_ccvars CC
+
+probe_cc hostcc "$host_cc"
+host_cflags_filter=$_flags_filter
+host_ldflags_filter=$_flags_filter
+add_host_cflags $_flags $_cflags
+add_host_ldflags $_flags $_ldflags
+set_ccvars HOSTCC
test -n "$cc_type" && enable $cc_type ||
warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
: ${ld_default:=$cc}
set_default ar as dep_cc ld
-test -n "$CC_DEPFLAGS" || CCDEP=$DEPEND_CMD
-test -n "$CXX_DEPFLAGS" || CXXDEP=$DEPEND_CMD
-test -n "$AS_DEPFLAGS" || ASDEP=$DEPEND_CMD
+probe_cc as "$as"
+asflags_filter=$_flags_filter
+add_asflags $_flags $_cflags
+set_ccvars AS
+
+probe_cc ld "$ld"
+ldflags_filter=$_flags_filter
+add_ldflags $_flags $_ldflags
+test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
+LD_O=${_cc_o-$LD_O}
+
+if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
+ probe_cc depcc "$dep_cc"
+ CCDEP=${_DEPCMD:-$DEPCMD}
+ CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
+ DEPCCFLAGS=$_flags
+fi
add_cflags $extra_cflags
add_cxxflags $extra_cxxflags
cpuflags="-mcpu=cell"
enable ldbrx
;;
+ e500mc)
+ cpuflags="-mcpu=e500mc"
+ disable altivec
+ ;;
e500v2)
cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
disable altivec
fi
LIBTARGET=i386
if enabled x86_64; then
- LIBTARGET=x64
+ LIBTARGET="i386:x86-64"
elif enabled arm; then
LIBTARGET=arm-wince
fi
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:$(SLIBSUF)=.lib)'
+ dlltool="${cross_prefix}dlltool"
+ if check_cmd lib.exe -list; then
+ SLIB_EXTRA_CMD='-lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
+ if enabled x86_64; then
+ LIBTARGET=x64
+ fi
+ elif check_cmd $dlltool --version; then
+ SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
+ fi
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS=
SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
- SHFLAGS='-shared -Wl,--enable-auto-image-base'
+ SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
+ SLIB_INSTALL_LINKS=
+ SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
+ SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
objformat="win32"
enable dos_paths
check_cflags -fno-common
warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
fi
- enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
- enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
- enabled armv6t2 && check_asm armv6t2 '"movt r0, #0"'
- enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
- enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
- enabled vfpv3 && check_asm vfpv3 '"vmov.f32 s0, #1.0"'
+ enabled armv5te && check_inline_asm armv5te '"qadd r0, r0, r0"'
+ enabled armv6 && check_inline_asm armv6 '"sadd16 r0, r0, r0"'
+ enabled armv6t2 && check_inline_asm armv6t2 '"movt r0, #0"'
+ enabled armvfp && check_inline_asm armvfp '"fadds s0, s0, s0"'
+ enabled neon && check_inline_asm neon '"vadd.i16 q0, q0, q0"'
+ enabled vfpv3 && check_inline_asm vfpv3 '"vmov.f32 s0, #1.0"'
- check_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
+ check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
+ check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
enabled_all armv6t2 shared !pic && enable_pic
elif enabled mips; then
- check_asm loongson '"dmult.g $1, $2, $3"'
- enabled mmi && check_asm mmi '"lq $2, 0($2)"'
+ check_inline_asm loongson '"dmult.g $1, $2, $3"'
+ enabled mmi && check_inline_asm mmi '"lq $2, 0($2)"'
enabled mips32r2 && add_cflags "-mips32r2" &&
- check_asm mips32r2 '"rotr $t0, $t1, 1"'
+ check_inline_asm mips32r2 '"rotr $t0, $t1, 1"'
enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
- check_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
+ check_inline_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
- check_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
+ check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
enabled mipsfpu && add_cflags "-mhard-float" &&
- check_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
-
+ check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
elif enabled ppc; then
enable local_aligned_8 local_aligned_16
- check_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
- check_asm ibm_asm '"add 0, 0, 0"'
- check_asm ppc4xx '"maclhw r10, r11, r12"'
- check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
+ check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
+ check_inline_asm ibm_asm '"add 0, 0, 0"'
+ check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
+ check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
# AltiVec flags: The FSF version of GCC differs from the Apple version
if enabled altivec; then
check_cc <<EOF || disable altivec
$inc_altivec_h
int main(void) {
- vector signed int v1, v2, v3;
- v1 = vec_add(v2,v3);
+ vector signed int v1 = (vector signed int) { 0 };
+ vector signed int v2 = (vector signed int) { 1 };
+ v1 = vec_add(v1, v2);
return 0;
}
EOF
- # check if our compiler supports braces for vector declarations
- check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
-$inc_altivec_h
-int main (void) { (vector int) {1}; return 0; }
-EOF
+ enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
fi
elif enabled sparc; then
- enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
+ enabled vis &&
+ check_inline_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
add_cflags -mcpu=ultrasparc -mtune=ultrasparc
elif enabled x86; then
EOF
# check whether EBX is available on x86
- check_asm ebx_available '""::"b"(0)' &&
- check_asm ebx_available '"":::"%ebx"'
+ check_inline_asm ebx_available '""::"b"(0)' &&
+ check_inline_asm ebx_available '"":::"%ebx"'
# check whether xmm clobbers are supported
- check_asm xmm_clobbers '"":::"%xmm0"'
+ check_inline_asm xmm_clobbers '"":::"%xmm0"'
- # check whether binutils is new enough to compile SSSE3/MMX2
- enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
- enabled mmx2 && check_asm mmx2 '"pmaxub %mm0, %mm1"'
+ # check whether binutils is new enough to compile SSSE3/MMXEXT
+ enabled ssse3 && check_inline_asm ssse3 '"pabsw %xmm0, %xmm0"'
+ enabled mmxext && check_inline_asm mmxext '"pmaxub %mm0, %mm1"'
if ! disabled_any asm mmx yasm; then
if check_cmd $yasmexe --version; then
check_yasm "pextrd [eax], xmm0, 1" && enable yasm ||
die "yasm not found, use --disable-yasm for a crippled build"
check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx
+ check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4
+ check_yasm "CPU amdnop" && enable cpunop
fi
case "$cpu" in
if enabled asm; then
as=${gas:=$as}
- check_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
+ check_inline_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
$nogas "GNU assembler not found, install gas-preprocessor"
fi
check_type poll.h "struct pollfd"
check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
- check_header netinet/sctp.h
+ check_type netinet/sctp.h "struct sctp_event_subscribe"
check_func getaddrinfo $network_extralibs
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
{ check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
- die "ERROR: libcelt version must be >= 0.11.0."; }
+ die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
+flite_libs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
+enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
enabled libgsm && require libgsm gsm/gsm.h gsm_create -lgsm
enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
+enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
+ { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
+ die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
enabled libvpx && {
enabled libvpx_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
- die "ERROR: libvpx decoder version must be >=0.9.1"; }
+ die "ERROR: libvpx decoder must be installed and version must be >=0.9.1"; }
enabled libvpx_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VP8E_SET_MAX_INTRA_BITRATE_PCT" -lvpx ||
die "ERROR: libvpx encoder version must be >=0.9.7"; } }
enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
{ check_cpp_condition x264.h "X264_BUILD >= 118" ||
- die "ERROR: libx264 version must be >= 0.118."; }
+ die "ERROR: libx264 must be installed and version must be >= 0.118."; }
enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
die "ERROR: openal not found"; } &&
{ check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
- die "ERROR: openal version must be 1.1 or compatible"; }
+ die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
die "ERROR: openssl not found"; }
+if enabled gnutls; then
+ { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
+ { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
+fi
+
# libdc1394 check
if enabled libdc1394; then
{ check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
+perl --version > /dev/null 2>&1 && enable perl || disable perl
pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
check_header linux/fb.h
if [ -n "$optflags" ]; then
add_cflags $optflags
elif enabled small; then
- add_cflags $size_cflags
+ add_cflags $cflags_size
elif enabled optimizations; then
- add_cflags $speed_cflags
+ add_cflags $cflags_speed
else
- add_cflags $noopt_cflags
+ add_cflags $cflags_noopt
fi
check_cflags -fno-math-errno
check_cflags -fno-signed-zeros
# icc 11.0 and 11.1 work with ebp_available, but don't pass the test
enable ebp_available
if enabled x86_32; then
+ icc_version=$($cc -dumpversion)
test ${icc_version%%.*} -ge 11 &&
check_cflags -falign-stack=maintain-16-byte ||
disable aligned_stack
if enabled x86; then
echo "${yasmexe} ${yasm-no}"
echo "MMX enabled ${mmx-no}"
- echo "MMX2 enabled ${mmx2-no}"
+ echo "MMXEXT enabled ${mmxext-no}"
echo "3DNow! enabled ${amd3dnow-no}"
echo "3DNow! extended enabled ${amd3dnowext-no}"
echo "SSE enabled ${sse-no}"
echo "SSSE3 enabled ${ssse3-no}"
echo "AVX enabled ${avx-no}"
+ echo "FMA4 enabled ${fma4-no}"
echo "CMOV enabled ${cmov-no}"
echo "CMOV is fast ${fast_cmov-no}"
echo "EBX available ${ebx_available-no}"
echo "libspeex enabled ${libspeex-no}"
echo "libstagefright-h264 enabled ${libstagefright_h264-no}"
echo "libtheora enabled ${libtheora-no}"
+echo "libtwolame enabled ${libtwolame-no}"
echo "libutvideo enabled ${libutvideo-no}"
echo "libv4l2 enabled ${libv4l2-no}"
echo "libvo-aacenc support ${libvo_aacenc-no}"
echo "zlib enabled ${zlib-no}"
echo "bzlib enabled ${bzlib-no}"
echo "texi2html enabled ${texi2html-no}"
+echo "perl enabled ${perl-no}"
echo "pod2man enabled ${pod2man-no}"
echo "makeinfo enabled ${makeinfo-no}"
test -n "$random_seed" &&
AS=$as
LD=$ld
DEPCC=$dep_cc
+DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
+DEPAS=$as
+DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
YASM=$yasmexe
-YASMDEP=$yasmexe
+DEPYASM=$yasmexe
AR=$ar
RANLIB=$ranlib
CP=cp -p
CFLAGS=$CFLAGS
CXXFLAGS=$CXXFLAGS
ASFLAGS=$ASFLAGS
-AS_O=$CC_O
+AS_C=$AS_C
+AS_O=$AS_O
+CC_C=$CC_C
CC_O=$CC_O
+CXX_C=$CXX_C
CXX_O=$CXX_O
+LD_O=$LD_O
+DLLTOOL=$dlltool
LDFLAGS=$LDFLAGS
-FFSERVERLDFLAGS=$FFSERVERLDFLAGS
+LDFLAGS-ffserver=$FFSERVERLDFLAGS
SHFLAGS=$SHFLAGS
YASMFLAGS=$YASMFLAGS
BUILDSUF=$build_suffix
SLIBSUF=$SLIBSUF
EXESUF=$EXESUF
EXTRA_VERSION=$extra_version
-DEPFLAGS=$DEPFLAGS
CCDEP=$CCDEP
CXXDEP=$CXXDEP
+CCDEP_FLAGS=$CCDEP_FLAGS
ASDEP=$ASDEP
+ASDEP_FLAGS=$ASDEP_FLAGS
CC_DEPFLAGS=$CC_DEPFLAGS
AS_DEPFLAGS=$AS_DEPFLAGS
HOSTCC=$host_cc
HOSTEXESUF=$HOSTEXESUF
HOSTLDFLAGS=$host_ldflags
HOSTLIBS=$host_libs
+DEPHOSTCC=$host_cc
+DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
+HOSTCCDEP=$HOSTCCDEP
+HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
+HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
+HOSTCC_C=$HOSTCC_C
+HOSTCC_O=$HOSTCC_O
TARGET_EXEC=$target_exec
TARGET_PATH=$target_path
-SDL_LIBS=$sdl_libs
-SDL_CFLAGS=$sdl_cflags
+LIBS-ffplay=$sdl_libs
+CFLAGS-ffplay=$sdl_cflags
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
INSTALL=$install
#define EXTERN_PREFIX "${extern_prefix}"
#define EXTERN_ASM ${extern_prefix}
#define SLIBSUF "$SLIBSUF"
+#define HAVE_MMX2 HAVE_MMXEXT
EOF
test -n "$assert_level" &&