r8374: avoid running flex and bison unless needed
authorAndrew Tridgell <tridge@samba.org>
Tue, 12 Jul 2005 12:12:03 +0000 (12:12 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:20:13 +0000 (13:20 -0500)
this should stop the files changes in svn for other developers
(This used to be commit 18d3deb777bd6aa4dd102fa2a2838d0afc2bd74c)

source4/heimdal_build/build_external.sh

index 355facc6dda1c34538a12339d0364093f0d5b7f8..5b512899cc4ffd4aa000f96a3fc0b574dadcb208 100755 (executable)
@@ -41,10 +41,15 @@ build_lex() {
     dir=`dirname $f`
     file=`basename $f`
     base=`basename $f .l`
+    if [ -r $dir/$base.c ]; then
+       if [ x`find $f -newer $dir/$base.c -print` != x$f ]; then
+           return;
+       fi
+    fi
     echo Building $f
     if cd $dir && $FLEX $file; then
-       sed '/^#/ s|$base.yy\.c|$base.c|' $base.yy.c > $base.c
-       rm -f $base.yy.c
+       sed '/^#/ s|$base.yy\.c|$base.c|' $base.yy.c > $base.c
+       rm -f $base.yy.c
     fi
     cd $TOP || exit 1
 }
@@ -54,6 +59,11 @@ build_bison() {
     dir=`dirname $f`
     file=`basename $f`
     base=`basename $f .y`
+    if [ -r $dir/$base.c ]; then
+       if [ x`find $f -newer $dir/$base.c -print` != x$f ]; then
+           return;
+       fi
+    fi
     echo Building $f
     if cd $dir && $BISON -y -d $file; then
        sed -e "/^#/!b" -e "s|y\.tab\.h|$base.h|" y.tab.h > $base.h