]> git.sesse.net Git - ffmpeg/blobdiff - configure
wtvenc: fix typo
[ffmpeg] / configure
index 2131b218d771e08ba654b3cccdfa1141e05936a7..ae11f5d9b0d351da37e27400de393570e125373f 100755 (executable)
--- a/configure
+++ b/configure
@@ -612,31 +612,29 @@ check_deps(){
     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(){
@@ -770,8 +768,8 @@ check_ld(){
     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)
@@ -852,23 +850,13 @@ EOF
 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
 }
@@ -1279,6 +1267,7 @@ HAVE_LIST_PUB='
 
 MATH_FUNCS="
     atanf
+    atan2f
     cbrtf
     cosf
     exp2
@@ -1286,6 +1275,7 @@ MATH_FUNCS="
     expf
     isinf
     isnan
+    ldexpf
     llrint
     llrintf
     log2
@@ -1293,6 +1283,7 @@ MATH_FUNCS="
     log10f
     lrint
     lrintf
+    powf
     rint
     round
     roundf
@@ -1301,12 +1292,6 @@ MATH_FUNCS="
     truncf
 "
 
-MATH2_FUNCS="
-    atan2f
-    ldexpf
-    powf
-"
-
 HAVE_LIST="
     $ARCH_EXT_LIST
     $(add_suffix _external $ARCH_EXT_LIST)
@@ -1315,7 +1300,6 @@ HAVE_LIST="
     $HAVE_LIST_PUB
     $THREADS_LIST
     $MATH_FUNCS
-    $MATH2_FUNCS
     aligned_malloc
     aligned_stack
     alsa_asoundlib_h
@@ -1621,6 +1605,7 @@ atrac3_decoder_select="mdct"
 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"
@@ -1955,6 +1940,7 @@ frei0r_filter_extralibs='$ldl'
 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"
@@ -2759,9 +2745,8 @@ case "$arch" in
     sh4|sh)
         arch="sh4"
     ;;
-    sun4u|sparc64)
+    sun4u|sparc*)
         arch="sparc"
-        subarch="sparc64"
     ;;
     tilegx|tile-gx)
         arch="tilegx"
@@ -2855,12 +2840,12 @@ elif enabled x86; then
 elif enabled sparc; then
 
     case $cpu in
-        niagara)
+        cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
             cpuflags="-mcpu=$cpu"
             disable vis
         ;;
-        sparc64)
-            cpuflags="-mcpu=v9"
+        ultrasparc*|niagara[234])
+            cpuflags="-mcpu=$cpu"
         ;;
     esac
 
@@ -2979,7 +2964,7 @@ check_64bit(){
 }
 
 case "$arch" in
-    alpha|ia64|sparc)
+    alpha|ia64)
         spic=$shared
     ;;
     mips)
@@ -2993,6 +2978,10 @@ case "$arch" in
     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
@@ -3446,9 +3435,7 @@ EOF
 
 elif enabled sparc; then
 
-    enabled vis &&
-        check_inline_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc &&
-            add_cflags -mcpu=ultrasparc -mtune=ultrasparc
+    enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"'
 
 elif enabled x86; then
 
@@ -3673,12 +3660,12 @@ check_lib math.h sin -lm && LIBM="-lm"
 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