summaryrefslogtreecommitdiff
path: root/cflags.SH
diff options
context:
space:
mode:
authorYves Orton <demerphq@dromedary.booking.com>2008-12-20 20:37:09 +0100
committerYves Orton <demerphq@dromedary.booking.com>2008-12-20 20:37:09 +0100
commitf6a80292c3db127d1561c118f409c1cffd1b55d9 (patch)
treebb2ddb6368fc9986178098352e2c5c3748c1b967 /cflags.SH
parent4ebeba21ba7387a4d2a07427df3fd36f9377c62d (diff)
downloadperl-f6a80292c3db127d1561c118f409c1cffd1b55d9.tar.gz
make perl use git-describe for PATCHNUM
This is just an initial attempt at getting something more useful into the -v / -V output. Currently "patchlevel" is really "version", and PATCHNUM is just a special string added to the patchlevel in perl.c via defines created by cflags.SH and its product file cflags, which happens very early in the build process. This means that for committers the -v output is likely to not be upto date unless they run make clean. Anyway, IMO we should rethink a reasonable amount about how we do this, this is just a crude step forward.
Diffstat (limited to 'cflags.SH')
-rwxr-xr-xcflags.SH6
1 files changed, 4 insertions, 2 deletions
diff --git a/cflags.SH b/cflags.SH
index 4e62f9200e..b429df672b 100755
--- a/cflags.SH
+++ b/cflags.SH
@@ -354,8 +354,10 @@ case "$cc" in
;;
esac
-if test -f .patch; then
- ccflags="-DPERL_PATCHNUM=`cat .patch` $ccflags"
+if test -d .git; then
+ ccflags="-DPERL_PATCHNUM=`git describe` $ccflags"
+elsif test -f .patch; then
+ ccflags="-DPERL_PATCHNUM=`awk '{print $4}' .patch` $ccflags"
fi
: Can we perhaps use $ansi2knr here