Sync usage with man page.
[netbsd-mini2440.git] / dist / ntp / build
blob2a65d8678266faad525febfdb4b008acd08f00a2
1 #! /bin/sh
3 LOGF=make.log
4 IAM=`hostname || uname -n`
5 MYNAME=`IFS=. ; set $IAM ; echo $1`
6 SIG=
8 case "$1" in
9 0.*)
10 SIG=$1
11 shift
12 CONFIG_ARGS="$@"
13 KEY=`sed -e q < .buildkey-$MYNAME`
14 case "$SIG" in
15 $KEY) ;;
17 echo "Wrong directory for build on host $IAM"
18 echo "This is <`pwd`>"
19 echo "SIG is <$SIG>"
20 echo "KEY is <$KEY>"
21 exit 1
23 esac
26 CONFIG_ARGS="$@"
28 esac
30 #set -e
31 #set -x
33 CVO=`./config.guess`
34 case "$CVO" in
35 *-*-*) ;;
36 *) echo "config.guess returned <$CVO>, which makes no sense to me."
37 exit 1
39 esac
41 case "$IAM" in
42 *.udel.edu)
43 BDIR=A.$MYNAME
44 CONFIG_ARGS="$CONFIG_ARGS --enable-local-libopts"
45 case "$CVO" in
46 *-*-ultrix*)
47 CONFIG_ARGS="$CONFIG_ARGS --with-libregex=/usr/local"
49 esac
52 BDIR=A.$CVO
54 esac
56 KEYSUF=""
58 case "$CONFIG_ARGS" in
59 *--with-crypto=autokey*)
60 KEYSUF="-autokey"
62 *--without-crypto*)
63 KEYSUF="-noopenssl"
65 esac
67 case "$CONFIG_ARGS" in
68 *--disable-all-clocks*)
69 KEYSUF="$KEYSUF-no-refclocks"
71 esac
73 case "$CONFIG_ARGS" in
74 *--disable-debugging*)
75 KEYSUF="$KEYSUF-nodebug"
77 esac
79 CCSUF=""
81 case "$CC" in
82 '') ;;
83 *) CCSUF="-$CC"
85 esac
87 BDIR="$BDIR$KEYSUF$CCSUF"
89 [ -d "$BDIR" ] || mkdir $BDIR
90 [ -f "$BDIR/.buildcvo" ] || echo $CVO > $BDIR/.buildcvo
91 [ -f "$BDIR/.buildhost" ] || echo $IAM > $BDIR/.buildhost
94 cd $BDIR
97 # make sure we have a nice that works,
99 nice true && NICEB=nice
100 nice true || NICEB=./.nicebuild-$MYNAME-$SIG && (
101 cat > .nicebuild-$MYNAME-$SIG <<UNLYKUHLY
102 #! /bin/sh
103 shift
105 UNLYKUHLY
106 chmod +x .nicebuild-$MYNAME-$SIG
111 [ -f config.status ] || $NICEB -7 ../configure --config-cache \
112 $CONFIG_ARGS
114 $NICEB -5 ./config.status
116 case "$MAKE" in
117 '') $NICEB -14 make && $NICEB -10 make check
119 *) $NICEB -14 $MAKE && $NICEB -10 $MAKE check
121 esac
122 ) > $LOGF 2>&1