Author: mru Date: Thu Aug 6 17:45:19 2009 New Revision: 19602 Log: 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. Modified: trunk/configure Modified: trunk/configure ============================================================================== --- trunk/configure Thu Aug 6 17:04:59 2009 (r19601) +++ trunk/configure Thu Aug 6 17:45:19 2009 (r19602) @@ -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)
On Thu, 2009-08-06 at 17:45 +0200, mru wrote:
+ awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
This fails with mawk. Looks like 3-argument match() is not in POSIX.
Uoti Urpala <uoti.urpala at pp1.inet.fi> writes:
On Thu, 2009-08-06 at 17:45 +0200, mru wrote:
+ awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
This fails with mawk.
For the record, mawk is not posix-compliant. Check the real spec before complaining. If you did, don't bother mentioning non-standard tools.
Looks like 3-argument match() is not in POSIX.
Fixed. -- M?ns Rullg?rd mans at mansr.com
On Fri, 2010-01-22 at 03:15 +0000, M?ns Rullg?rd wrote:
Uoti Urpala <uoti.urpala at pp1.inet.fi> writes:
On Thu, 2009-08-06 at 17:45 +0200, mru wrote:
+ awk "/$1=/{ match(\$0, /$1=(\\w+)/, a);print a[1];exit }" $TMPE
This fails with mawk.
For the record, mawk is not posix-compliant. Check the real spec before complaining. If you did, don't bother mentioning non-standard tools.
Looks like 3-argument match() is not in POSIX.
I saw a report about a failure with mawk, and checked the actual POSIX spec. I'm not familiar with mawk or its level of standard-compliance myself. I think the way I reported the problem was reasonable.
participants (3)
-
mans@mansr.com -
subversion@mplayerhq.hu -
uoti.urpala@pp1.inet.fi