]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Updated build and flock-build scripts. flock-build --one is a way
authorDave Hart <hart@ntp.org>
Sun, 27 Sep 2009 06:53:59 +0000 (06:53 +0000)
committerDave Hart <hart@ntp.org>
Sun, 27 Sep 2009 06:53:59 +0000 (06:53 +0000)
  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

ChangeLog
bootstrap
build
flock-build
ntpd/Makefile.am

index fd7eb2cf98d03b9d58c9d21255dc97114496b553..c4a28c431ae2a4adcc12f1ec113436007927f6fc 100644 (file)
--- 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 <stenn@ntp.org>
index 29cb5d4db01a9d097234fcfb515c72bcf8d78274..388d1a3fec6a0ce54507075cfa22f0d6d975da3d 100755 (executable)
--- 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 b850a7d95051bc8a71c687817bfb8e731e7d6cea..6451ec46350fb6bc0d258909b7fa0f1daf38bedd 100755 (executable)
--- 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 <<UNLYKUHLY
-#! /bin/sh
-shift
-\$*
-UNLYKUHLY
-    chmod +x .nicebuild-$MYNAME-$SIG
-)
+nice true || {
+       NICEB=./.nicebuild-$MYNAME-$SIG
+       cat > .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
index d80fc6d3d48cea3ea3d959342b620952fe88f1fe..dbdf990a4d695a5f21e5107c1733eae64189794e 100755 (executable)
@@ -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 <<ENDQUOT
-#!/bin/sh
-
-# depends on job control and expects to be invoked under ssh -tt
+            cat > .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
index 90f5b43accfbfa2293fcc61f542342a5fc647552..6120a77a96be1a4f207fbac8f57b81484e836cad 100644 (file)
@@ -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