freebsd-dev/contrib/ntp/build
Ollivier Robert ea906c4152 Merge ntpd & friends 4.2.4p5 from vendor/ntp/dist into head. Next commit
will update usr.sbin/ntp to match this.

MFC after:	2 weeks
2008-08-22 15:58:00 +00:00

107 lines
1.5 KiB
Bash
Executable File

#! /bin/sh
LOGF=make.log
IAM=`hostname || uname -n`
case "$1" in
0.*)
SIG=$1
shift
CONFIG_ARGS="$@"
KEY=`sed -e q < .buildkey`
case "$SIG" in
$KEY) ;;
*)
echo "Wrong directory for build on host $IAM"
echo "This is <`pwd`>"
echo "SIG is <$SIG>"
echo "KEY is <$KEY>"
exit 1
;;
esac
;;
*)
CONFIG_ARGS="$@"
;;
esac
#set -e
#set -x
CVO=`./config.guess`
case "$CVO" in
*-*-*) ;;
*) echo "config.guess returned <$CVO>, which makes no sense to me."
exit 1
;;
esac
MYNAME=`IFS=. ; set $IAM ; echo $1`
case "$IAM" in
*.udel.edu)
BDIR=A.$MYNAME
CONFIG_ARGS="$CONFIG_ARGS --enable-local-libopts"
case "$CVO" in
*-*-ultrix*)
CONFIG_ARGS="$CONFIG_ARGS --with-libregex=/usr/local"
;;
esac
;;
*)
BDIR=A.$CVO
;;
esac
KEYSUF=""
case "$CONFIG_ARGS" in
*--with-crypto=autokey*)
KEYSUF="-autokey"
;;
*--without-crypto*)
KEYSUF="-noopenssl"
;;
esac
case "$CONFIG_ARGS" in
*--disable-all-clocks*)
KEYSUF="$KEYSUF-no-refclocks"
;;
esac
case "$CONFIG_ARGS" in
*--disable-debugging*)
KEYSUF="$KEYSUF-nodebug"
;;
esac
CCSUF=""
case "$CC" in
'') ;;
*) CCSUF="-$CC"
;;
esac
BDIR="$BDIR$KEYSUF$CCSUF"
[ -d "$BDIR" ] || mkdir $BDIR
[ -f "$BDIR/.buildcvo" ] || echo $CVO > $BDIR/.buildcvo
[ -f "$BDIR/.buildhost" ] || echo $IAM > $BDIR/.buildhost
cd $BDIR
(
[ -f config.status ] || ../configure $CONFIG_ARGS
./config.status
case "$MAKE" in
'') make && make check
;;
*) $MAKE && $MAKE check
;;
esac
) > $LOGF 2>&1