From: Harlan Stenn Date: Sun, 28 Nov 2010 04:10:00 +0000 (-0500) Subject: Improvements to the 'build' script X-Git-Tag: NTP_4_2_6P3_RC11~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f5cc515180a2927a9f71ed16c07599cc01cb34f;p=thirdparty%2Fntp.git Improvements to the 'build' script bk: 4cf1d618vaIHv77OQBvn9QlEAtQmHg --- diff --git a/ChangeLog b/ChangeLog index 13bfcb429..142ffd037 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ * Upgrade libopts to 33.3.8. * Bump minimum Automake version to 1.11, required for AM_COND_IF use in LIBOPTS_CHECK. +* Improvements to the 'build' script. --- (4.2.6p3-RC10) 2010/11/14 Released by Harlan Stenn diff --git a/build b/build index de4ea8131..cc6a53bda 100755 --- a/build +++ b/build @@ -46,19 +46,36 @@ case "$CVO" in ;; esac -case "$IAM" in - *.udel.edu) - BASEDIR=A.$MYNAME - CONFIG_ARGS="$CONFIG_ARGS --enable-local-libopts" - case "$CVO" in - *-*-ultrix*) - CONFIG_ARGS="$CONFIG_ARGS --with-libregex=/usr/local" +case "$NTP_BDIR" in + '') + case "$IAM" in + *.udel.edu) + NTP_BDIR=host + CONFIG_ARGS="$CONFIG_ARGS --enable-local-libopts" + case "$CVO" in + *-*-ultrix*) + CONFIG_ARGS="$CONFIG_ARGS --with-libregex=/usr/local" + ;; + esac ;; - esac + *) + NTP_BDIR=cvo + ;; + esac + ;; +esac + +case "$NTP_BDIR" in + host) + BASEDIR=A.$MYNAME ;; - *) + cvo) BASEDIR=A.$CVO ;; + *) + echo "build: NTP_BDIR must be either 'cvo' or 'host'!" 1>&2 + exit 1 + ;; esac KEYSUF="" @@ -106,7 +123,7 @@ cd $BDIR # Make sure we have a nice that works. # To disable use of nice, setenv NO_NICE_BUILD=1 # -NICEB="" +NICEB= [ "$NO_NICE_BUILD" != "1" ] && nice true && NICEB=nice [ -z "$NICEB" ] && { NICEB="./.nicebuild-$MYNAME-$SIG" @@ -118,16 +135,40 @@ HEREDOC chmod +x $NICEB } +# +# Find a test which supports -nt, unlike Solaris /bin/sh builtin. +# +TEST="${TEST-}" +if [ -z "$TEST" ] ; then + for try in test /bin/test /usr/bin/test ; do + case `$try config.status -nt ../configure 2>&1` in + '') + TEST="$try" + # echo "Using $TEST" + break + ;; + esac + done + if [ -z "$TEST" ] ; then + echo "build: need help finding test binary" 1>&2 + exit 1 + fi +fi + CONFIGURE="../configure --cache-file=../config.cache-$IAM$CCSUF $CONFIG_ARGS" ( # This sequence of commands is logged to make.log. - # Solaris /bin/sh doesn't grok -nt, csh does - csh -c '[ config.status -nt ../configure ] && \ - [ sntp/config.status -nt ../sntp/configure ]' || \ - $NICEB -7 $CONFIGURE - $NICEB -5 ./config.status && \ - ( cd sntp && $NICEB -5 ./config.status ) - $NICEB -14 ${MAKE-make} && $NICEB -11 ${MAKE-make} check + # If config.status is newer than ../configure, and the same + # is true for sntp, we do not need to re-run configure. + # Solaris /bin/sh doesn't grok -nt. + + ( "$TEST" config.status -nt ../configure && + $TEST sntp/config.status -nt ../sntp/configure ) || + "$NICEB" -7 $CONFIGURE + "$NICEB" -5 ./config.status && + ( cd sntp && "$NICEB" -5 ./config.status ) && + "$NICEB" -14 ${MAKE-make} && + "$NICEB" -11 ${MAKE-make} check ) > $LOGF 2>&1 EXITCODE=$? @@ -137,7 +178,8 @@ case "$NICEB" in nice) ;; *) - rm $NICEB + rm "$NICEB" + ;; esac exit $EXITCODE