From: Dave Hart Date: Sun, 27 Sep 2009 06:53:59 +0000 (+0000) Subject: Updated build and flock-build scripts. flock-build --one is a way X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=716897106ebde099ae40c44ec99453ce2a497ebb;p=thirdparty%2Fntp.git Updated build and flock-build scripts. flock-build --one is a way to perform a flock-build compatible solitary build, handy for a repo clone's first build on a machine with autoconf, automake, etc. Compiling ntp_parser.y using BSD make correctly places ntp_parser.h in the top-level ntpd directory instead of A.*/ntpd. bootstrap script updated to remove potentially stale .deps dirs. bk: 4abf0c07J1SkvF6yFUVSyDcLktEBjg --- diff --git a/ChangeLog b/ChangeLog index fd7eb2cf98..c4a28c431a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,12 @@ libisc merges using a separate "upstream" bk repo. That will enable normal bk pull automerge to handle carrying forward any local changes and should enable us to take updated libisc snapshots more often. +* Updated build and flock-build scripts. flock-build --one is a way + to perform a flock-build compatible solitary build, handy for a repo + clone's first build on a machine with autoconf, automake, etc. +* Compiling ntp_parser.y using BSD make correctly places ntp_parser.h + in the top-level ntpd directory instead of A.*/ntpd. +* bootstrap script updated to remove potentially stale .deps dirs. * [Bug 1316] segfault if refclock_nmea can't open file. * [Bug 1317] Distribute cvo.sh. (4.2.5p220) 2009/09/25 Released by Harlan Stenn diff --git a/bootstrap b/bootstrap index 29cb5d4db0..388d1a3fec 100755 --- a/bootstrap +++ b/bootstrap @@ -110,6 +110,14 @@ done touch ntpd/ntp_parser.[ch] +# remove .deps directories to handle source files +# moved, added, or removed. config.status will +# regenerate dummy .Po files, which are included +# in Makefiles + +rm -rf */.deps >/dev/null 2>&1 +rm -rf */*/.deps >/dev/null 2>&1 + cp bincheck.mf sntp/ ${AUTORECONF} -i -v diff --git a/build b/build index b850a7d950..6451ec4635 100755 --- a/build +++ b/build @@ -30,23 +30,20 @@ esac #set -e #set -x -# config.guess may only be here, and some don't have . in their PATH -PATH="$PATH:." - CVO=`./scripts/cvo.sh @cvo@` case "$CVO" in - *-*-*-*) echo "config.guess returned <$CVO>, which makes no sense to me." + *-*-*-*) "echo scripts/cvo.sh returned <$CVO>, which makes no sense to me." exit 1 ;; *-*-*) ;; - *) echo "config.guess returned <$CVO>, which makes no sense to me." + *) echo "scripts/cvo.sh returned <$CVO>, which makes no sense to me." exit 1 ;; esac case "$IAM" in *.udel.edu) - BDIR=A.$MYNAME + BASEDIR=A.$MYNAME CONFIG_ARGS="$CONFIG_ARGS --enable-local-libopts" case "$CVO" in *-*-ultrix*) @@ -55,7 +52,7 @@ case "$IAM" in esac ;; *) - BDIR=A.$CVO + BASEDIR=A.$CVO ;; esac @@ -90,7 +87,7 @@ case "$CC" in ;; esac -BDIR="$BDIR$KEYSUF$CCSUF" +BDIR="$BASEDIR$KEYSUF$CCSUF" [ -d "$BDIR" ] || mkdir $BDIR [ -f "$BDIR/.buildcvo" ] || echo $CVO > $BDIR/.buildcvo @@ -100,22 +97,28 @@ BDIR="$BDIR$KEYSUF$CCSUF" cd $BDIR # -# make sure we have a nice that works, +# Make sure we have a nice that works. +# To disable use of nice make a dummy nice script such +# as the heredoc a few lines below and set BNICE to its +# path. +# # nice true && NICEB=nice -nice true || NICEB=./.nicebuild-$MYNAME-$SIG && ( - cat > .nicebuild-$MYNAME-$SIG < .nicebuild-$MYNAME-$SIG <<-HEREDOC + #! /bin/sh + shift + \$* +HEREDOC + chmod +x .nicebuild-$MYNAME-$SIG +} ( -[ -f config.status ] || $NICEB -7 ../configure --config-cache \ - $CONFIG_ARGS +[ -f config.status ] || $NICEB -7 ../configure \ + --cache-file=../config.cache-$IAM \ + $CONFIG_ARGS $NICEB -5 ./config.status @@ -126,3 +129,7 @@ case "$MAKE" in ;; esac ) > $LOGF 2>&1 + + +# clean up if we made a dummy nice script +[ -f .nicebuild-$MYNAME-$SIG ] && rm .nicebuild-$MYNAME-$SIG diff --git a/flock-build b/flock-build index d80fc6d3d4..dbdf990a4d 100755 --- a/flock-build +++ b/flock-build @@ -1,5 +1,18 @@ #! /bin/sh +IAM=`hostname || uname -n` +MYNAME=`IFS=. ; set $IAM ; echo $1` + +case "$1" in + '--one'|'-1') + shift + FB_FIRSTONLY=1 + LIST=$MYNAME + ;; + *) + FB_FIRSTONLY=0 +esac + BUILD_ARGS="$@" PARSE="--enable-parse-clocks" #PARSE= @@ -30,7 +43,6 @@ esac # Campus: # * baldwin sparc-sun-solaris2.10 # * bridgeport sparc-sun-solaris2.10 -# * cowbird freebsd-6.1 # * malarky sparc-sun-solaris2.10 # * pogo sparc-sun-solaris2.10 # * rackety freebsd-6.1 @@ -42,7 +54,7 @@ c_d=${PWD:-`pwd`} SIG=`perl -e 'print rand'` case "$LIST" in - '') LIST="baldwin bridgeport cowbird malarky pogo rackety" ;; + '') LIST="malarky rackety" ;; esac for i in $LIST @@ -63,43 +75,48 @@ do ssh $i "cd $c_d ; ./build $SIG $STD --disable-all-clocks $BUILD_ARGS" & ;; 1) - cat > .flockbuild-$i-$SIG < .flockbuild-$i-$SIG <<-ENDQUOT + #!/bin/sh -cd $c_d -COUNT=0 + # script uses job control and expects to be invoked + # in a ssh session started with the -tt option, + # which forces a pseudo-tty to be used. + + cd $c_d + COUNT=0 -./build $SIG $PARSE $STD $BUILD_ARGS & + ./build $SIG $PARSE $STD $BUILD_ARGS & -COUNT=\`expr \$COUNT + 1\` -echo $i started build \$COUNT of 4 -[ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait + COUNT=\`expr \$COUNT + 1\` + echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 + [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait -./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS & + case $FB_FIRSTONLY in + '0') + ./build $SIG $PARSE $STD --disable-debugging $BUILD_ARGS & -COUNT=\`expr \$COUNT + 1\` -echo $i started build \$COUNT of 4 -[ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait + COUNT=\`expr \$COUNT + 1\` + echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 + [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait -./build $SIG $PARSE $STD --without-crypto $BUILD_ARGS & + ./build $SIG $PARSE $STD --without-crypto $BUILD_ARGS & -COUNT=\`expr \$COUNT + 1\` -echo $i started build \$COUNT of 4 -[ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait + COUNT=\`expr \$COUNT + 1\` + echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 + [ 0 -lt \`expr \$COUNT % $PARALLEL_BUILDS\` ] || wait -./build $SIG $STD --disable-all-clocks $BUILD_ARGS & + ./build $SIG $STD --disable-all-clocks $BUILD_ARGS & -COUNT=\`expr \$COUNT + 1\` -echo $i started build \$COUNT of 4 -wait -echo \`date -u '+%H:%M:%S'\` $i flock-build $c_d done. -rm .buildkey-$i + COUNT=\`expr \$COUNT + 1\` + echo \`date -u '+%H:%M:%S'\` $i started build \$COUNT of 4 + wait + esac + echo \`date -u '+%H:%M:%S'\` $i flock-build $c_d done. + rm .buildkey-$i ENDQUOT - chmod +x .flockbuild-$i-$SIG - ssh -tt $i "$c_d/.flockbuild-$i-$SIG ; \ - rm $c_d/.flockbuild-$i-$SIG" 2>/dev/null & + chmod +x .flockbuild-$i-$SIG + ssh -tt $i "$c_d/.flockbuild-$i-$SIG ; \ + rm $c_d/.flockbuild-$i-$SIG" 2>/dev/null & esac esac done diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index 90f5b43acc..6120a77a96 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -21,17 +21,43 @@ AM_CPPFLAGS= -I$(top_srcdir)/include \ LDADD= version.o libntpd.a @LIBPARSE@ AM_YFLAGS= -d -t -r all +# +# VPHACK and VPHACK_AFTER are enabled on non-GNU makes (such as +# BSD make) to work around issues specific to compiling +# ntp_parser.y into ntp_parser.h and ntp_parser.c in a vPATH +# configuration where we would like (for a change) the output +# files ntp_parser.[ch] to be placed in the source directory, +# as opposed to the build directory. This allows a single +# host of a flock configured with Bison to update ntp_parser.[ch] +# used by the rest. +# + if VPATH_HACK VPHACK= vphack +VPHACK_AFTER= vphack_after else VPHACK= +VPHACK_AFTER= endif vphack: test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c . test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h . -BUILT_SOURCES= ${VPHACK} ntp_parser.c ntp_parser.h \ +# +# ylwrap script which invokes Bison replaces ntp_parser.h +# symlink with the updated file, when ntp_parser.h changes. +# vphack_after detects this and copies the updated file to srcdir +# and re-creates the ntp_parser.h symlink in its place. +# + +vphack_after: + test -L ntp_parser.h || ( \ + mv ntp_parser.h $(srcdir)/ntp_parser.h && \ + ln -s $(srcdir)/ntp_parser.h . \ + ) + +BUILT_SOURCES= $(VPHACK) ntp_parser.c ntp_parser.h $(VPHACK_AFTER) \ ntpd-opts.c ntpd-opts.h ntpd.1 ntpd-opts.texi ntpd-opts.menu man_MANS= ntpd.1