configure: fix --cpu=host
authorMåns Rullgård <mans@mansr.com>
Fri, 22 Jan 2010 03:14:19 +0000 (03:14 +0000)
committerMåns Rullgård <mans@mansr.com>
Fri, 22 Jan 2010 03:14:19 +0000 (03:14 +0000)
The awk command used inadvertently relied on non-standard features.

Originally committed as revision 21376 to svn://svn.ffmpeg.org/ffmpeg/trunk

configure

index 55402902e8bad438a6c80fcd52d25c010b709bfe..2b0e35aba34ffd0b9b9a3268d949747f66463dbc 100755 (executable)
--- a/configure
+++ b/configure
@@ -1783,7 +1783,11 @@ if test "$cpu" = host; then
         gcc)
             check_native(){
                 $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
         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
+                sed -n "/$1=/{
+                            s/.*$1=\\([^ ]*\\).*/\\1/
+                            p
+                            q
+                        }" $TMPE
             }
             cpu=$(check_native -march || check_native -mcpu)
         ;;
             }
             cpu=$(check_native -march || check_native -mcpu)
         ;;