summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYves Orton <demerphq@dromedary.booking.com>2008-12-21 16:34:56 +0100
committerYves Orton <demerphq@dromedary.booking.com>2008-12-27 11:18:08 +0100
commit8565263ab8a47cda76538c0286536f59c53e155f (patch)
tree2469fe3585779259f05b8cf2522161bc39b2107f
parent6a71721dfccd239c818c4403e1d0f62568633088 (diff)
downloadperl-8565263ab8a47cda76538c0286536f59c53e155f.tar.gz
make sure that the perl -v/-V output corresponds to the latest commit
-rw-r--r--.gitignore5
-rw-r--r--Makefile.SH7
-rwxr-xr-xcflags.SH8
-rw-r--r--make_patchnun.sh11
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
diff --git a/cflags.SH b/cflags.SH
index 9e0494e671..b11966b831 100755
--- a/cflags.SH
+++ b/cflags.SH
@@ -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