diff options
author | Christopher Faylor <me@cgf.cx> | 2002-01-22 03:02:00 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-01-22 03:02:00 +0000 |
commit | f3647dd7e6ad65cd14c201eb22e3a40028456cf6 (patch) | |
tree | a11b38bfcf4fe904cfbd99d1a9e994e4cff0b4a0 /winsup/cygwin/cygmagic | |
parent | 51076b73607c16e0403dca41ddcf58ca64627b55 (diff) | |
download | newlib-f3647dd7e6ad65cd14c201eb22e3a40028456cf6.zip newlib-f3647dd7e6ad65cd14c201eb22e3a40028456cf6.tar.gz newlib-f3647dd7e6ad65cd14c201eb22e3a40028456cf6.tar.bz2 |
* cygmagic: Attempt to figure out if sum takes an option.
Diffstat (limited to 'winsup/cygwin/cygmagic')
-rwxr-xr-x | winsup/cygwin/cygmagic | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/cygmagic b/winsup/cygwin/cygmagic index 87e571d..1605362 100755 --- a/winsup/cygwin/cygmagic +++ b/winsup/cygwin/cygmagic @@ -17,10 +17,16 @@ cat <<EOF > $file_magic /* autogenerated - do not edit */ #include "$file" EOF +if sum -r /dev/null; then + sumit(){ sum -r $*; } +else + sumit(){ sum $*; } +fi + while [ -n "$1" ]; do define=$1; shift struct=$1; shift - sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sum | awk '{printf "0x%x", $1}'` + sum=`$gcc -E $file | sed -n "/^$struct/,/^};/p" | sed -e 's/[ ]//g' -e '/^$/d' | sumit | awk '{printf "0x%x", $1}'` echo "#define $define $sum" curr=`sed -n "s/^#[ ]*define CURR_$define[ ][ ]*\([^ ][^ ]*\)/\1/p" $file` [ "$curr" != "$sum" ] && echo "*** WARNING WARNING WARNING WARNING WARNING *** |