2000-06-26 08:06:22 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2002-02-19 11:04:34 +00:00
|
|
|
#sysname=$1
|
|
|
|
|
|
|
|
while [ $# != 0 ]; do
|
|
|
|
if [ x$1 = x--with-nsupdate ]; then
|
|
|
|
echo "nsupdate is always built now."
|
|
|
|
elif [ x$1 = x--print-sysname ]; then
|
|
|
|
print_sysname=yes
|
|
|
|
elif [ x$1 = x--work-dir ]; then
|
|
|
|
workname=$2
|
|
|
|
shift
|
|
|
|
elif [ x$1 = x--dirs ]; then
|
|
|
|
dirs=$2
|
|
|
|
shift
|
|
|
|
elif [ x$1 = x--no-links ]; then
|
|
|
|
nolinks=YES
|
|
|
|
elif [ x$1 = x--copts ]; then
|
|
|
|
copts=$2
|
|
|
|
shift
|
|
|
|
elif [ x$sysname = x ]; then
|
|
|
|
sysname=$1
|
|
|
|
else
|
|
|
|
echo "Unexpected argument: $1"
|
|
|
|
fi
|
|
|
|
shift
|
|
|
|
done
|
2000-06-26 08:06:22 +00:00
|
|
|
|
|
|
|
uname=`uname -s`
|
|
|
|
machine=`uname -m`
|
|
|
|
|
|
|
|
if [ "$sysname" = "" ]; then
|
|
|
|
case $uname in
|
2002-02-19 11:04:34 +00:00
|
|
|
SCO_SV)
|
|
|
|
IFS=":"
|
|
|
|
for foo in $PATH; do
|
|
|
|
if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then
|
|
|
|
gcc_path=$foo/gcc
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS=" "
|
|
|
|
if [ x$gcc_path = x ]; then
|
|
|
|
sysname=sco-cc
|
|
|
|
sysname_print=sco
|
|
|
|
else
|
|
|
|
sysname=sco-gcc
|
|
|
|
sysname_print=sco
|
|
|
|
fi
|
|
|
|
;;
|
2000-06-26 08:06:22 +00:00
|
|
|
AIX)
|
|
|
|
sysname=aix;;
|
2002-02-19 11:04:34 +00:00
|
|
|
Darwin)
|
|
|
|
sysname=darwin;;
|
2000-06-26 08:06:22 +00:00
|
|
|
Rhapsody)
|
|
|
|
sysname=rhapsody;;
|
|
|
|
ULTRIX)
|
|
|
|
sysname=ultrix;;
|
|
|
|
BSD/OS)
|
2002-02-19 11:04:34 +00:00
|
|
|
release=`uname -r`
|
|
|
|
minor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
|
|
|
|
major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
|
|
|
|
|
|
|
|
case $major in
|
|
|
|
[123]) sysname=bsdos ;;
|
|
|
|
*) case $minor in
|
|
|
|
0) sysname=bsdos ;;
|
|
|
|
*) sysname=bsdos-4.1 ;;
|
|
|
|
esac;;
|
|
|
|
esac;;
|
2000-06-26 08:06:22 +00:00
|
|
|
OSF1)
|
|
|
|
if [ $machine = 'alpha' ]; then
|
|
|
|
sysname=alphaosf
|
|
|
|
fi;;
|
|
|
|
Linux)
|
|
|
|
release=`uname -r`
|
|
|
|
minor=`echo $release |sed -e 's/[0-9]*\.\([0-9][0-9]*\)\(\..*\)*$/\1/'`
|
|
|
|
major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
|
|
|
|
|
|
|
|
case $major in
|
|
|
|
1) sysname=linux-1 ;;
|
|
|
|
2) case $minor in
|
|
|
|
0) sysname=linux-2.0 ;;
|
|
|
|
1) sysname=linux-2.1 ;;
|
|
|
|
2) sysname=linux-2.2 ;;
|
|
|
|
*) sysname=linux-2.2 ;;
|
|
|
|
esac;;
|
|
|
|
esac;;
|
|
|
|
SunOS)
|
2002-02-19 11:04:34 +00:00
|
|
|
release=`uname -r`
|
|
|
|
minor=`echo $release |sed -e 's/.*[0-9]*\.\([0-9][0-9]*\).*$/\1/'`
|
|
|
|
major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
|
|
|
|
IFS=":"
|
|
|
|
for foo in $PATH; do
|
|
|
|
if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then
|
|
|
|
gcc_path=$foo/gcc
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS=" "
|
|
|
|
|
|
|
|
case $major in
|
|
|
|
4)
|
|
|
|
if [ x$gcc_path = x ]; then
|
|
|
|
echo SunOS 4 build will not work without the GNU C Compiler.
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
sysname=sunos4;;
|
|
|
|
5)
|
|
|
|
if [ x$gcc_path = x ]; then
|
2000-06-26 08:06:22 +00:00
|
|
|
sysname=sunos5-cc
|
2002-02-19 11:04:34 +00:00
|
|
|
sysname_print=sunos5
|
|
|
|
else
|
|
|
|
sysname=sunos5-gcc
|
|
|
|
sysname_print=sunos5
|
2000-06-26 08:06:22 +00:00
|
|
|
fi;;
|
|
|
|
esac;;
|
|
|
|
NetBSD)
|
2002-02-19 11:04:34 +00:00
|
|
|
hw=`uname -m`
|
|
|
|
case $hw in
|
|
|
|
arm32) sysname=netbsd-nocast;;
|
|
|
|
alpha) sysname=netbsd-nocast;;
|
2002-04-01 07:54:44 +00:00
|
|
|
sparc) sysname=netbsd-nocast;;
|
2002-09-30 08:39:27 +00:00
|
|
|
sparc64) sysname=netbsd-nocast;;
|
2002-02-19 11:04:34 +00:00
|
|
|
*) sysname=netbsd;;
|
|
|
|
esac;;
|
|
|
|
OpenBSD)
|
|
|
|
sysname=openbsd;;
|
2000-06-26 08:06:22 +00:00
|
|
|
FreeBSD)
|
|
|
|
sysname=freebsd;;
|
|
|
|
hpux)
|
2002-02-19 11:04:34 +00:00
|
|
|
IFS=":"
|
|
|
|
for foo in $PATH; do
|
|
|
|
if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then
|
|
|
|
gcc_path=$foo/gcc
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS=" "
|
|
|
|
|
|
|
|
if [ x$gcc_path = x ]; then
|
|
|
|
sysname=hpux-cc
|
|
|
|
sysname_print=hpux
|
|
|
|
else
|
|
|
|
sysname=hpux-gcc
|
|
|
|
sysname_print=hpux
|
|
|
|
fi;;
|
2000-06-26 08:06:22 +00:00
|
|
|
HP-UX)
|
2002-02-19 11:04:34 +00:00
|
|
|
IFS=":"
|
|
|
|
for foo in $PATH; do
|
|
|
|
if [ x$gcc_path = x ] && [ -x $foo/gcc ]; then
|
|
|
|
gcc_path=$foo/gcc
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
IFS=" "
|
|
|
|
|
|
|
|
if [ x$gcc_path = x ]; then
|
|
|
|
sysname=hpux-cc
|
|
|
|
sysname_print=hpux
|
|
|
|
else
|
|
|
|
sysname=hpux-gcc
|
|
|
|
sysname_print=hpux
|
|
|
|
fi;;
|
2000-06-26 08:06:22 +00:00
|
|
|
QNX)
|
2002-02-19 11:04:34 +00:00
|
|
|
release=`uname -r`
|
|
|
|
major=`echo $release |sed -e 's/\([0-9][0-9]*\)\..*$/\1/'`
|
|
|
|
case $major in
|
|
|
|
6)
|
|
|
|
sysname=qnxnto;;
|
|
|
|
*)
|
|
|
|
sysname=qnx;;
|
|
|
|
esac;;
|
2000-06-26 08:06:22 +00:00
|
|
|
NEXTSTEP)
|
|
|
|
sysname=nextstep;;
|
2002-02-19 11:04:34 +00:00
|
|
|
UnixWare)
|
|
|
|
sysname=uw7;;
|
2000-06-26 08:06:22 +00:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$sysname" = "" ]; then
|
2002-02-19 11:04:34 +00:00
|
|
|
if [ x$print_sysname = xyes ]; then
|
|
|
|
echo "unknown"
|
|
|
|
else
|
|
|
|
echo "UNIX name: $uname machine: $machine"
|
|
|
|
echo
|
|
|
|
echo "Unknown system. If this is an SCO system running ODT 3.0 or"
|
|
|
|
echo "higher, type \`\`./configure sco''. Otherwise, this is a"
|
|
|
|
echo "configuration that isn't supported or hasn't been tested."
|
|
|
|
echo
|
|
|
|
echo "Supported configurations are:"
|
|
|
|
echo " aix AIX 4.1.5.0"
|
|
|
|
echo " ultrix ULTRIX 4.2A or higher"
|
|
|
|
echo " bsdos BSDI BSD/OS 2.1"
|
|
|
|
echo " alphaosf DEC Alpha OSF/1"
|
|
|
|
echo " linux Linux"
|
|
|
|
echo " sunos4 Sunos 4.1.4 (earlier releases may work)"
|
|
|
|
echo " sunos5-cc Solaris 2.4 or higher with Sun cc"
|
|
|
|
echo " sunos5-gcc Solaris 2.4 or higher with gcc"
|
|
|
|
echo " netbsd NetBSD 1.1 or higher"
|
|
|
|
echo " freebsd FreeBSD"
|
|
|
|
echo " openbsd OpenBSD (i386/alpha)"
|
|
|
|
echo " hpux HP-UX"
|
|
|
|
echo " qnx QNX 4.2 or higher"
|
|
|
|
echo " NEXTSTEP NeXTSTEP"
|
|
|
|
echo " sco SCO Open Server"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ x$print_sysname = xyes ]; then
|
|
|
|
if [ x$sysname_print != x ]; then
|
|
|
|
echo $sysname_print
|
|
|
|
else
|
|
|
|
echo $sysname
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ x$workname = x ]; then
|
|
|
|
if [ x$sysname_print != x ]; then
|
|
|
|
workname=work.${sysname_print}
|
|
|
|
else
|
|
|
|
workname=work.${sysname}
|
|
|
|
fi
|
2000-06-26 08:06:22 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "System Type: $sysname"
|
|
|
|
|
|
|
|
if [ x$major != x ] && [ x$minor != x ]; then
|
|
|
|
majversubst="-e /^##--majver--/,/^##--majver--/s/MajorVersion/$major/"
|
|
|
|
minversubst="-e /^##--minver--/,/^##--minver--/s/MinorVersion/$minor/"
|
|
|
|
fi
|
|
|
|
|
2002-02-19 11:04:34 +00:00
|
|
|
if [ ! -d $workname ]; then
|
|
|
|
mkdir $workname
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ x"$dirs" = x ]; then
|
|
|
|
dirs=". client server relay common omapip dhcpctl minires dst"
|
|
|
|
fi
|
|
|
|
|
|
|
|
for foo in $dirs; do
|
|
|
|
bar=`basename $foo`
|
|
|
|
if [ ! -d ${workname}/$bar ]; then
|
|
|
|
mkdir ${workname}/$bar
|
|
|
|
fi
|
|
|
|
(sed $majversubst $minversubst \
|
2000-06-26 08:06:22 +00:00
|
|
|
-e "/^##--${sysname}--/,/^##--${sysname}--/s/^#//" \
|
2002-02-19 11:04:34 +00:00
|
|
|
<Makefile.conf; \
|
|
|
|
cat site.conf; \
|
|
|
|
echo "TOP = `pwd`"; \
|
|
|
|
echo CC_OPTIONS = $copts; \
|
|
|
|
cat $foo/Makefile.dist) \
|
|
|
|
>${workname}/$bar/Makefile
|
2000-06-26 08:06:22 +00:00
|
|
|
done
|
|
|
|
|
2002-02-19 11:04:34 +00:00
|
|
|
# Make the link tree in which to actually build.
|
|
|
|
if [ x$nolinks = x ]; then
|
|
|
|
make links
|
|
|
|
fi
|
|
|
|
|
2000-06-26 08:06:22 +00:00
|
|
|
exit 0
|