+Mon Jun 19 00:58:33 1995 Tom Yu (tlyu@dragons-lair)
+
+ * getsyms, getsyms.sed: simple scripts to find #ifdef's that
+ aren't declared with configure.in
+
Fri Jun 16 14:05:03 1995 Tom Yu (tlyu@dragons-lair)
* libupdate.sh: oops they were right to begin with; hack
--- /dev/null
+#!/bin/sh
+# Run this from the TOP of the source tree!
+M4=gm4
+configs=`find $1 -name configure.in -print|sed -e 's@/configure.in@@`
+for dir in $configs; do
+ AC_MACRODIR=./util/autoconf
+ # The following bits shamelessly stolen from autoheader.sh
+ eval "`$M4 -I$AC_MACRODIR autoheader.m4 $dir/configure.in|
+ sed -n -e '
+ : again
+ /^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
+ /^@@@/{
+ s/^@@@//p
+ n
+ s/^/@@@/
+ b again
+ }'`"
+ syms="`for sym in $syms; do echo $sym; done | sort | uniq`"
+ echo $dir/configure.in: $syms
+ files="$dir/*.[ch]"
+ for file in $files; do
+ badsyms=""
+ fsyms=`sed -f ./util/getsyms.sed $file`
+ fsyms="`for sym in $fsyms; do echo $sym; done | sort | uniq`"
+ for sym in $fsyms; do
+ isbad=yes
+ for tsym in $syms; do
+ if [ $tsym = $sym ]; then isbad=no; fi
+ done
+ if [ $isbad = yes ]; then
+ badsyms="$badsyms $sym"
+ fi
+ done
+ echo $file:$badsyms
+ done
+done
--- /dev/null
+# emulate a C preprocessor (well, sort of)
+y/ / /
+s/ */ /g
+/\/\*/{
+:COMMENT
+N
+y/ / /
+s/ */ /g
+/\*\//!bCOMMENT
+}
+s/\/\*.*\*\///
+/^ *#ifdef/{
+s/^ *#ifdef //
+b
+}
+/^ *#ifndef/{
+s/^ *#ifndef //
+b
+}
+/^ *#if/{
+s/^ *#if//
+s/ *defined *( *\([A-Za-z0-9_]*\) *) */\1 /g
+s/||//g
+s/&&//g
+s/!//g
+s/(//g
+s/)//g
+b
+}
+d