This is the new cpp-less auto-extern generator. It should be drop-in compatible with the previous genextern.sh, which was causing problems with the linux cpp. I'd appreciate it if people could tell me how this fares on linux and other systems before it goes into the 1.0.6 release. Cheers, Julian. #!/bin/sh # $Id: genextern.sh,v 1.11 1997/03/06 10:48:56 proff Exp $ # cute huh? # --proff ( cat $* | egrep '^X(add|dir|def|ndef)? *\(') |\ sed -e '{ s/^X *(\(.*\))/extern \1;/ s/^Xadd *(\(.*\))/\1/ s/^Xdir *(\(.*\))/#\1/ s/^Xdef *(\([^,]*\), *\(.*\))[ ]*$/#if defined(\1)\ \2;\ #endif\ / s/^Xndef *(\([^,]*\), *\(.*\))[ ]*$/#if !defined(\1)\ \2;\ #endif\ / } '| (cat <<END #ifdef __cplusplus extern "C" { #endif #ifndef X # define X(y) y #endif #ifndef Xadd # define Xadd(y) #endif #ifndef Xdir # define Xdir(y) #endif #ifndef Xdef # define Xdef(x,y) y #endif #ifndef Xndef # define Xndef(x,y) y #endif END cat cat <<END2 #ifdef __cplusplus } #endif END2 )