diff options
author | Yves Orton <demerphq@dromedary.booking.com> | 2008-12-20 20:37:09 +0100 |
---|---|---|
committer | Yves Orton <demerphq@dromedary.booking.com> | 2008-12-20 20:37:09 +0100 |
commit | f6a80292c3db127d1561c118f409c1cffd1b55d9 (patch) | |
tree | bb2ddb6368fc9986178098352e2c5c3748c1b967 /cflags.SH | |
parent | 4ebeba21ba7387a4d2a07427df3fd36f9377c62d (diff) | |
download | perl-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-x | cflags.SH | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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 |