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.
;;
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
PerlIO_printf(PerlIO_stdout(),
"\nThis is perl, %"SVf
#ifdef PERL_PATCHNUM
- " DEVEL" STRINGIFY(PERL_PATCHNUM)
+ " DEVEL:" STRINGIFY(PERL_PATCHNUM)
#endif
" built for %s",
SVfARG(vstringify(PL_patchlevel)),