From f6a80292c3db127d1561c118f409c1cffd1b55d9 Mon Sep 17 00:00:00 2001 From: Yves Orton Date: Sat, 20 Dec 2008 20:37:09 +0100 Subject: 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. --- cflags.SH | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cflags.SH') 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 -- cgit v1.2.1