diff options
author | Yves Orton <demerphq@dromedary.booking.com> | 2008-12-21 16:34:56 +0100 |
---|---|---|
committer | Yves Orton <demerphq@dromedary.booking.com> | 2008-12-27 11:18:08 +0100 |
commit | 8565263ab8a47cda76538c0286536f59c53e155f (patch) | |
tree | 2469fe3585779259f05b8cf2522161bc39b2107f | |
parent | 6a71721dfccd239c818c4403e1d0f62568633088 (diff) | |
download | perl-8565263ab8a47cda76538c0286536f59c53e155f.tar.gz |
make sure that the perl -v/-V output corresponds to the latest commit
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | Makefile.SH | 7 | ||||
-rwxr-xr-x | cflags.SH | 8 | ||||
-rw-r--r-- | make_patchnun.sh | 11 |
4 files changed, 23 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore index 5a760a11d2..81f4486921 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ +# ignore .patch from rsync, and any generated patch files from git-am *.patch +# ignore local .config files .config - +# ignore generated .patchnum file +.patchnum # files produced by './configure.gnu' on a Linux machine diff --git a/Makefile.SH b/Makefile.SH index 2a902c3089..755e600ac6 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -535,7 +535,12 @@ sperl$(OBJ_EXT): perl.c $(h) sperl.i: perl.c $(h) $(CCCMDSRC) -DIAMSUID -E perl.c > sperl.i -.PHONY: all translators utilities +.PHONY: all translators utilities make_patchnum + +make_patchnum: + sh $(shellflags) make_patchnum.sh + +perl$(OBJ_EXT): make_patchnum .patchnum translators: miniperl$(EXE_EXT) $(CONFIGPM) FORCE @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all @@ -354,12 +354,8 @@ case "$cc" in ;; esac -if test -d .git; then - ccflags="-DPERL_PATCHNUM=`git describe` $ccflags" -else - if test -f .patch; then - ccflags="-DPERL_PATCHNUM=`awk '{print $4}' .patch` $ccflags" - fi +if [ -f .patchnum -a -n "$(cat .patchnum)"]; then + ccflags="-DPERL_PATCHNUM=`cat .patchnum`" fi : Can we perhaps use $ansi2knr here diff --git a/make_patchnun.sh b/make_patchnun.sh new file mode 100644 index 0000000000..2306fa892b --- /dev/null +++ b/make_patchnun.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +Existing=`cat .patchnum 2>/dev/null` +Current=`git describe` + +if [ "$Existing" != "$Current" ]; then + echo "Updating .patchnum" + echo $Current > .patchnum +else + echo "Reusing .patchnum" +fi |