home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / CLISP / CLISPSRC.TAR / clisp-1995-01-01 / src / autoconf-1.7 / autoheadercheck < prev   
Encoding:
Text File  |  1994-07-07  |  1.2 KB  |  38 lines

  1. #!/bin/sh
  2. # Usage: autoheadercheck configure config.h.in
  3. # checks whether some macros put into DEFS by `configure' but are not listed
  4. # in `config.h.in'.
  5. # Bruno Haible 7.7.1994
  6.  
  7. syms=`grep 'DEFS="$DEFS -D' $1 | sed -e 's/^.*DEFS="$DEFS -D//g' -e 's/=.*$//g' | sort | uniq`
  8. #echo $syms
  9. syms=`echo "$syms" | sed -e 's/${trhdr}//g' | sed -e 's/${trfunc}//g'`
  10. #echo $syms
  11. syms1=`grep 'for hdr in ' $1 | sed -e 's/^.*for hdr in //g'`
  12. syms2=''
  13. for sym in $syms1; do syms2=$syms2' HAVE_'`echo $sym | tr '[a-z]./' '[A-Z]__'`; done
  14. syms="$syms $syms2"
  15. #echo $syms
  16. syms1=`grep 'for func in ' $1 | sed -e 's/^.*for func in //g'`
  17. syms2=''
  18. for sym in $syms1; do syms2=$syms2' HAVE_'`echo $sym | tr '[a-z]' '[A-Z]'`; done
  19. syms="$syms $syms2"
  20. #echo $syms
  21.  
  22. # syms is now the list of symbols that may be defined in `configure'.
  23.  
  24. ksyms=`(grep '^#undef' $2 ; grep '^#define' $2) | sed -e 's/^#[a-z]*[     ]*//g' | sed -e 's/[     ].*$//g' | sort | uniq`
  25. #echo $ksyms
  26.  
  27. # ksyms is now the list of symbols that are listed in `config.h.in'.
  28.  
  29. # Now list every symbol contained in syms but not contained in ksyms:
  30.  
  31. for sym in $syms; do
  32.   if test -z `echo "$ksyms" | grep "^$sym\$"`; then
  33.     echo "$sym missing from $2" ;
  34.   fi
  35. done
  36.  
  37.  
  38.