Home | History | Annotate | Line # | Download | only in tools
ck-clz_tab revision 1.1.1.3
      1      1.1  mrg #!/bin/sh
      2      1.1  mrg 
      3  1.1.1.3  mrg # Copyright 2016-2023 Free Software Foundation, Inc.
      4      1.1  mrg # This script is free software; the Free Software Foundation
      5      1.1  mrg # gives unlimited permission to copy and/or distribute it,
      6      1.1  mrg # with or without modifications, as long as this notice is preserved.
      7      1.1  mrg 
      8      1.1  mrg # This program is distributed in the hope that it will be useful,
      9      1.1  mrg # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
     10      1.1  mrg # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
     11      1.1  mrg # PARTICULAR PURPOSE.
     12      1.1  mrg 
     13      1.1  mrg # ck-clz_tab can be run from the tools directory
     14  1.1.1.2  mrg dir=`pwd`
     15  1.1.1.2  mrg [ -d src ] || [ "`basename \"$dir\"`" != tools ] || cd ..
     16      1.1  mrg 
     17  1.1.1.2  mrg size1=`sed -n 's/^extern .* __clz_tab\[\([0-9]\+\)\].*/\1/p' \
     18  1.1.1.2  mrg         src/mpfr-longlong.h`
     19      1.1  mrg 
     20  1.1.1.2  mrg size2=`sed -n 's/^.* __clz_tab\[\([0-9]\+\)\].*/\1/p' \
     21  1.1.1.2  mrg         src/mp_clz_tab.c`
     22      1.1  mrg 
     23      1.1  mrg if [ -n "$size1" ] && [ -n "$size2" ] && [ "$size1" != "$size2" ]; then
     24      1.1  mrg   cat >&2 <<EOF
     25      1.1  mrg The __clz_tab sizes do not match.
     26      1.1  mrg   mpfr-longlong.h  $size1
     27      1.1  mrg   mp_clz_tab.c     $size2
     28      1.1  mrg EOF
     29      1.1  mrg   exit 1
     30      1.1  mrg fi
     31