#!/bin/sh
# Given a bunch of names, build "generic" sys_name.h files for them.
# Of course, we have no way of knowing where to look, but we can make
# a guess by looking around on our system.
I=/usr/include
for n
do	echo Name: $n
	if [ -f $SRCDIR/hdr/sys_$n'.h' ];then
		echo Link: $SRCDIR/hdr/sys_$n'.h'
		Ln $SRCDIR/hdr/sys_$n'.h' sys_$n'.h'
		continue;
	fi
	if [ -f $I/$n.h ];then F=$n.h; 
	elif [ -f $I/sys/$n.h ];then F=sys/$n.h;
	elif [ -f $I/net/$n.h ];then F=net/$n.h;
	elif [ -f $I/netinet/$n.h ];then F=netinet/$n.h;
	elif [ -f $I/bsd/$n.h ];then F=bsd/$n.h;
	elif [ -f $I/lan/$n.h ];then F=lan/$n.h;
	else echo "Can't find $n.h include file."; F=$n.h
	fi
	{	echo '#ifndef sys_'$n'_h'
		echo '#define sys_'$n'_h'
		echo ''
		echo '#include <'$F'>'
		echo ''
		echo '#endif'
	} > 'sys_'$n'.h'
done
