done
}
-print_config_h(){
- enabled $1 && v=1 || v=0
- echo "#define $2 $v"
-}
-
-print_config_mak(){
- enabled $1 && v= || v=!
- echo "$v$2=yes"
-}
-
-print_config_asm(){
- enabled $1 && v=1 || v=0
- echo "%define $2 $v"
-}
-
print_config(){
pfx=$1
files=$2
shift 2
- for cfg; do
- ucname="$(toupper $cfg)"
- for f in $files; do
- "print_config_${f##*.}" $cfg ${pfx}${ucname} >>$f
- done
- done
+ map 'eval echo "$v \${$v:-no}"' "$@" |
+ awk "BEGIN { split(\"$files\", files) }
+ {
+ c = \"$pfx\" toupper(\$1);
+ v = \$2;
+ sub(/yes/, 1, v);
+ sub(/no/, 0, v);
+ for (f in files) {
+ file = files[f];
+ if (file ~ /\\.h\$/) {
+ printf(\"#define %s %d\\n\", c, v) >>file;
+ } else if (file ~ /\\.asm\$/) {
+ printf(\"%%define %s %d\\n\", c, v) >>file;
+ } else if (file ~ /\\.mak\$/) {
+ n = -v ? \"\" : \"!\";
+ printf(\"%s%s=yes\\n\", n, c) >>file;
+ }
+ }
+ }"
}
print_enabled(){
log check_ld "$@"
type=$1
shift 1
- flags=$(filter_out '-l*' "$@")
- libs=$(filter '-l*' "$@")
+ flags=$(filter_out '-l*' $@)
+ libs=$(filter '-l*' $@)
check_$type $($cflags_filter $flags) || return
flags=$($ldflags_filter $flags)
libs=$($ldflags_filter $libs)
check_mathfunc(){
log check_mathfunc "$@"
func=$1
- shift
- disable $func
- check_ld "cc" "$@" <<EOF && enable $func
-#include <math.h>
-float foo(float f) { return $func(f); }
-int main(void){ return (int) foo; }
-EOF
-}
-
-check_math2func(){
- log check_math2func "$@"
- func=$1
- shift
+ narg=$2
+ shift 2
+ test $narg = 2 && args="f, g" || args="f"
disable $func
check_ld "cc" "$@" <<EOF && enable $func
#include <math.h>
-float foo(float f) { return $func(f, f); }
+float foo(float f, float g) { return $func($args); }
int main(void){ return (int) foo; }
EOF
}
MATH_FUNCS="
atanf
+ atan2f
cbrtf
cosf
exp2
expf
isinf
isnan
+ ldexpf
llrint
llrintf
log2
log10f
lrint
lrintf
+ powf
rint
round
roundf
truncf
"
-MATH2_FUNCS="
- atan2f
- ldexpf
- powf
-"
-
HAVE_LIST="
$ARCH_EXT_LIST
$(add_suffix _external $ARCH_EXT_LIST)
$HAVE_LIST_PUB
$THREADS_LIST
$MATH_FUNCS
- $MATH2_FUNCS
aligned_malloc
aligned_stack
alsa_asoundlib_h
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
binkaudio_rdft_decoder_select="mdct rdft sinewin"
cavs_decoder_select="golomb mpegvideo"
+comfortnoise_encoder_select="lpc"
cook_decoder_select="mdct sinewin"
cscd_decoder_select="lzo"
cscd_decoder_suggest="zlib"
frei0r_src_filter_deps="frei0r dlopen"
frei0r_src_filter_extralibs='$ldl'
hqdn3d_filter_deps="gpl"
+hue_filter_deps="gpl"
movie_filter_deps="avcodec avformat"
mp_filter_deps="gpl avcodec swscale postproc inline_asm"
mptestsrc_filter_deps="gpl"
sh4|sh)
arch="sh4"
;;
- sun4u|sparc64)
+ sun4u|sparc*)
arch="sparc"
- subarch="sparc64"
;;
tilegx|tile-gx)
arch="tilegx"
}
case "$arch" in
- alpha|ia64|sparc)
+ alpha|ia64)
spic=$shared
;;
mips)
ppc)
check_64bit ppc ppc64 'sizeof(void *) > 4'
;;
+ sparc)
+ check_64bit sparc sparc64 'sizeof(void *) > 4'
+ spic=$shared
+ ;;
x86)
check_64bit x86_32 x86_64 'sizeof(void *) > 4'
if test "$subarch" = "x86_64"; then
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
enabled vaapi && require vaapi va/va.h vaInitialize -lva
-for func in $MATH_FUNCS; do
- check_mathfunc $func
-done
+atan2f_args=2
+ldexpf_args=2
+powf_args=2
-for func in $MATH2_FUNCS; do
- check_math2func $func
+for func in $MATH_FUNCS; do
+ eval check_mathfunc $func \${${func}_args:-1}
done
# these are off by default, so fail if requested and not available