summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/build
blob: 2a65d8678266faad525febfdb4b008acd08f00a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#! /bin/sh

LOGF=make.log
IAM=`hostname || uname -n`
MYNAME=`IFS=. ; set $IAM ; echo $1`
SIG=

case "$1" in
 0.*)
    SIG=$1
    shift
    CONFIG_ARGS="$@"
    KEY=`sed -e q < .buildkey-$MYNAME`
    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

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

#
# make sure we have a nice that works,
#
nice true && NICEB=nice
nice true || NICEB=./.nicebuild-$MYNAME-$SIG && (
    cat > .nicebuild-$MYNAME-$SIG <<UNLYKUHLY
#! /bin/sh
shift
\$*
UNLYKUHLY
    chmod +x .nicebuild-$MYNAME-$SIG
)


(
[ -f config.status ] || $NICEB -7 ../configure --config-cache \
				$CONFIG_ARGS

$NICEB -5 ./config.status

case "$MAKE" in
 '') $NICEB -14 make && $NICEB -10 make check
     ;;
 *)  $NICEB -14 $MAKE && $NICEB -10 $MAKE check
     ;;
esac
) > $LOGF 2>&1
OpenPOWER on IntegriCloud