#
#        Copyright(C) 1997 Network Flight Recorder, Inc.
#        All rights reserved.
#
#        Use and distribution of this software and its source code
#        are governed by the terms and conditions of the
#        Network Flight Recorder Software License ("LICENSE.TXT")
#
# By Mark Sienkiewicz / NFR
#

os=`uname -s`
rev=`uname -r`

cd $nfr/include

rm -f ../Makefile.include sys-include.h opts.h

case  $os$rev in
	SunOS5.[45]*)
		type=solaris
		;;
	BSD/OS3.0|FreeBSD2.2.1-RELEASE)
		type=bsdi
		;;
	BSD/OS3.1)
		type=bsdi
		echo NFR has not been fully tested on BSD/OS 3.1,
		echo -n "build NFR anyway? [Y/n] "
		read ans
		case $ans in
			[nN] | [nN][Oo] )  exit 1
			;;
		esac
		;;
	Linux2.0.*)
		type=linux2.0
		;;
	Linux2.1.*)
		type=linux2.0
		echo experimental kernels are not officially supported,
		echo -n "build NFR anyway? [Y/n] "
		read ans
		case $ans in
			[nN] | [nN][Oo] )  exit 1
			;;
		esac
		;;
	HP-UXB.10.20)
		if [ `uname -n` != 'daria' ]
		then
			echo NFR has not been fully tested on HPUX
                	echo -n "build NFR anyway? [Y/n] "
                	read ans
                	case $ans in
                        	[nN] | [nN][Oo] )  exit 1
                        	;;
			esac
		fi
		type=hpux
		;;
	*)
	    echo "Don't know how to select include file for $os $rev"
	    exit 1
	    ;;
esac

echo '/* automatically generated by select_include */' > sys-include.h
cat sys-$type.h >> sys-include.h

cat opts-$type.h > opts.h

cat Makefile-$type > ../Makefile.include
cat Makefile-config >> ../Makefile.include

exit 0
