[SCM] libav/experimental: configure: support --cpu=host to tune for the host system

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:49:49 UTC 2013


The following commit has been merged in the experimental branch:
commit d22c13a8df238d9215d0adb8d47b1e458513aa93
Author: Måns Rullgård <mans at mansr.com>
Date:   Thu Aug 6 15:45:19 2009 +0000

    configure: support --cpu=host to tune for the host system
    
    This requires a gcc version with -march=native or -mcpu=native support,
    which is somewhat random for non-x86.
    
    Originally committed as revision 19602 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/configure b/configure
index 47731ef..f26c0ad 100755
--- a/configure
+++ b/configure
@@ -1582,6 +1582,22 @@ if test -n "$sysroot"; then
     esac
 fi
 
+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
+                awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
+            }
+            cpu=$(check_native -march || check_native -mcpu)
+        ;;
+    esac
+
+    test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc"
+fi
+
 # Add processor-specific flags
 case $cpu in
     601|ppc601|PowerPC601)

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list