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