xref: /freebsd/contrib/ntp/build (revision 39beb93c3f8bdbf72a61fda42300b5ebed7390c8)
1#! /bin/sh
2
3LOGF=make.log
4IAM=`hostname || uname -n`
5
6case "$1" in
7 0.*)
8    SIG=$1
9    shift
10    CONFIG_ARGS="$@"
11    KEY=`sed -e q < .buildkey`
12    case "$SIG" in
13     $KEY) ;;
14     *)
15	echo "Wrong directory for build on host $IAM"
16	echo "This is <`pwd`>"
17	echo "SIG is <$SIG>"
18	echo "KEY is <$KEY>"
19        exit 1
20        ;;
21    esac
22    ;;
23 *)
24    CONFIG_ARGS="$@"
25    ;;
26esac
27
28#set -e
29#set -x
30
31CVO=`./config.guess`
32case "$CVO" in
33 *-*-*) ;;
34 *) echo "config.guess returned <$CVO>, which makes no sense to me."
35    exit 1
36    ;;
37esac
38
39MYNAME=`IFS=. ; set $IAM ; echo $1`
40
41case "$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"
48	;;
49    esac
50    ;;
51 *)
52    BDIR=A.$CVO
53    ;;
54esac
55
56KEYSUF=""
57
58case "$CONFIG_ARGS" in
59 *--with-crypto=autokey*)
60    KEYSUF="-autokey"
61    ;;
62 *--without-crypto*)
63    KEYSUF="-noopenssl"
64    ;;
65esac
66
67case "$CONFIG_ARGS" in
68 *--disable-all-clocks*)
69    KEYSUF="$KEYSUF-no-refclocks"
70    ;;
71esac
72
73case "$CONFIG_ARGS" in
74 *--disable-debugging*)
75    KEYSUF="$KEYSUF-nodebug"
76    ;;
77esac
78
79CCSUF=""
80
81case "$CC" in
82 '') ;;
83 *) CCSUF="-$CC"
84    ;;
85esac
86
87BDIR="$BDIR$KEYSUF$CCSUF"
88
89[ -d "$BDIR" ] || mkdir $BDIR
90[ -f "$BDIR/.buildcvo" ] || echo $CVO > $BDIR/.buildcvo
91[ -f "$BDIR/.buildhost" ] || echo $IAM > $BDIR/.buildhost
92
93cd $BDIR
94
95(
96[ -f config.status ] || ../configure $CONFIG_ARGS
97
98./config.status
99
100case "$MAKE" in
101 '') make && make check
102     ;;
103 *)  $MAKE && $MAKE check
104     ;;
105esac
106) > $LOGF 2>&1
107