exit 1
fi
+test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
+
show_help(){
cat <<EOF
Usage: configure [options]
disable buffer boundary checking in bitreaders
(faster, but may crash)
--enable-memalign-hack emulate memalign, interferes with memory debuggers
+ --enable-lto use link-time optimization
Optimization options (experts only):
--disable-asm disable all assembler optimizations
--disable-armv6 disable armv6 optimizations
--disable-armv6t2 disable armv6t2 optimizations
--disable-armvfp disable ARM VFP optimizations
- --disable-mmi disable MMI optimizations
--disable-neon disable NEON optimizations
--disable-vis disable VIS optimizations
--disable-inline-asm disable use of inline assembler
}
print_enabled(){
- test "$1" = -n && end=" " && shift || end="\n"
+ test x"$1" = x-n && end=" " && shift || end="\n"
suf=$1
shift
for v; do
armv6
armv6t2
armvfp
- mmi
neon
ppc4xx
vfpv3
cbrtf
closesocket
cmov
- cpuid
cpunop
+ CryptGenRandom
dcbzl
dev_bktr_ioctl_bt848_h
dev_bktr_ioctl_meteor_h
rint
round
roundf
- rweflags
sched_getaffinity
sdl
sdl_video_size
windows_h
winsock2_h
xform_asm
- xgetbv
xmm_clobbers
"
huffman
lgplv3
lpc
+ mpegaudio
mpegaudiodsp
mpegvideo
mpegvideoenc
debug
extra_warnings
logging
+ lto
optimizations
"
neon_deps="arm"
vfpv3_deps="armvfp"
-mmi_deps="mips"
-
altivec_deps="ppc"
ppc4xx_deps="ppc"
dct_select="rdft"
mdct_select="fft"
rdft_select="fft"
+mpegaudio_select="mpegaudiodsp"
mpegaudiodsp_select="dct"
mpegvideoenc_select="mpegvideo"
mdec_decoder_select="error_resilience mpegvideo"
mjpeg_encoder_select="aandcttables mpegvideoenc"
mlp_decoder_select="mlp_parser"
-mp1_decoder_select="mpegaudiodsp"
-mp1float_decoder_select="mpegaudiodsp"
-mp2_decoder_select="mpegaudiodsp"
-mp2float_decoder_select="mpegaudiodsp"
-mp3_decoder_select="mpegaudiodsp"
-mp3adu_decoder_select="mpegaudiodsp"
-mp3adufloat_decoder_select="mpegaudiodsp"
-mp3float_decoder_select="mpegaudiodsp"
-mp3on4_decoder_select="mpegaudiodsp"
-mp3on4float_decoder_select="mpegaudiodsp"
+mp1_decoder_select="mpegaudio"
+mp1float_decoder_select="mpegaudio"
+mp2_decoder_select="mpegaudio"
+mp2float_decoder_select="mpegaudio"
+mp3_decoder_select="mpegaudio"
+mp3adu_decoder_select="mpegaudio"
+mp3adufloat_decoder_select="mpegaudio"
+mp3float_decoder_select="mpegaudio"
+mp3on4_decoder_select="mpegaudio"
+mp3on4float_decoder_select="mpegaudio"
mpc7_decoder_select="mpegaudiodsp"
mpc8_decoder_select="mpegaudiodsp"
mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder"
pgi_flags(){
for flag; do
case $flag in
+ -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
-fomit-frame-pointer) echo -Mnoframe ;;
-g) echo -gopt ;;
*) echo $flag ;;
-mfpu=neon) echo --float_support=vfpv3 --neon ;;
-mfpu=vfp) echo --float_support=vfpv2 ;;
-mfpu=vfpv3) echo --float_support=vfpv3 ;;
+ -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
-msoft-float) echo --float_support=vfplib ;;
-O[0-3]|-mf=*) echo $flag ;;
-g) echo -g -mn ;;
_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'
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'
+ opt_common='-alias=ansi -Mdse -Mlre -Mpre'
_cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
_cflags_size="-O2 -Munroll=c:1 $opt_common"
_cflags_noopt="-O1"
dlltool="${cross_prefix}dlltool"
ranlib=:
enable dos_paths
- check_cflags -fno-common
add_cppflags -U__STRICT_ANSI__
;;
cygwin*)
SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
objformat="win32"
enable dos_paths
- check_cflags -fno-common
add_cppflags -U__STRICT_ANSI__
;;
*-dos|freedos|opendos)
-l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
-l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
;;
+ osf1)
+ add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
+ AVSERVERLDFLAGS=
+ ;;
+ minix)
+ ;;
none)
;;
*)
test -n "$libc_type" && enable $libc_type
+# hacks for compiler/libc/os combinations
+
+if enabled_all tms470 glibc; then
+ CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
+ add_cppflags -D__USER_LABEL_PREFIX__=
+ add_cppflags -D__builtin_memset=memset
+ add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
+ add_cflags -pds=48 # incompatible redefinition of macro
+fi
+
esc(){
echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
}
elif enabled mips; then
check_inline_asm loongson '"dmult.g $1, $2, $3"'
- enabled mmi && check_inline_asm mmi '"lq $2, 0($2)"'
elif enabled ppc; then
elif enabled x86; then
- check_code ld immintrin.h "return __xgetbv(0)" && enable xgetbv
- check_code ld intrin.h "int info[4]; __cpuid(info, 0)" && enable cpuid
check_code ld intrin.h "__rdtsc()" && enable rdtsc
- check_code ld intrin.h "unsigned int x = __readeflags()" && enable rweflags
check_code ld mmintrin.h "_mm_empty()" && enable mm_empty
check_func usleep
check_func_headers io.h setmode
check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
+check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
check_func_headers windows.h GetProcessAffinityMask
check_func_headers windows.h GetProcessTimes
EOF
fi
-if [ -n "$optflags" ]; then
- add_cflags $optflags
-elif enabled small; then
- add_cflags $cflags_size
-elif enabled optimizations; then
- add_cflags $cflags_speed
-else
- add_cflags $cflags_noopt
+if [ -z "$optflags" ]; then
+ if enabled small; then
+ optflags=$cflags_size
+ elif enabled optimizations; then
+ optflags=$cflags_speed
+ else
+ optflags=$cflags_noopt
+ fi
fi
-check_cflags -fno-math-errno
-check_cflags -fno-signed-zeros
+
+check_optflags(){
+ check_cflags "$@"
+ enabled lto && check_ldflags "$@"
+}
+
+
+if enabled lto; then
+ test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
+ check_cflags -flto
+ check_ldflags -flto $cpuflags
+fi
+
+check_optflags $optflags
+check_optflags -fno-math-errno
+check_optflags -fno-signed-zeros
if enabled icc; then
# Just warnings, no remarks
add_cflags -msg_disable ptrmismatch1
add_cflags -msg_disable unreachcode
elif enabled gcc; then
- check_cflags -fno-tree-vectorize
+ check_optflags -fno-tree-vectorize
check_cflags -Werror=implicit-function-declaration
check_cflags -Werror=missing-prototypes
check_cflags -Werror=declaration-after-statement
+ check_cflags -Werror=vla
elif enabled llvm_gcc; then
check_cflags -mllvm -stack-alignment=16
elif enabled clang; then
echo "ARM VFP enabled ${armvfp-no}"
echo "NEON enabled ${neon-no}"
fi
-if enabled mips; then
- echo "MMI enabled ${mmi-no}"
-fi
if enabled ppc; then
echo "AltiVec enabled ${altivec-no}"
echo "PPC 4xx optimizations ${ppc4xx-no}"