From: Nicholas Clark Date: Fri, 23 Jan 2009 16:41:31 +0000 (+0000) Subject: Amend patchlevel.h so that git_version.h is only #include""ed for perl. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=486cd780047ff22471c5cbe417911a042ae23962;p=p5sagit%2Fp5-mst-13.2.git Amend patchlevel.h so that git_version.h is only #include""ed for perl. miniperl builds with canned data equivalent to stock_git_version.h. git_version.h becomes an explicit dependency for perl.o, make_patchnum.pl is explicitly run to create it, and no sub-makes are spawned with their inherent race conditions and consequent strange build failures. --- diff --git a/Makefile.SH b/Makefile.SH index fb1bf7f..563aae1 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -407,7 +407,7 @@ esac ## In the following dollars and backticks do not need the extra backslash. $spitshell >>$Makefile <<'!NO!SUBS!' -private = preplibrary $(CONFIGPM) $(CONFIGPOD) make_patchnum lib/ExtUtils/Miniperl.pm +private = preplibrary $(CONFIGPM) $(CONFIGPOD) lib/ExtUtils/Miniperl.pm # Files to be built with variable substitution before miniperl # is available. @@ -541,13 +541,10 @@ sperl$(OBJ_EXT): perl.c $(h) sperl.i: perl.c $(h) $(CCCMDSRC) -DIAMSUID -E perl.c > sperl.i -.PHONY: all translators utilities make_patchnum +.PHONY: all translators utilities -make_patchnum: miniperl$(EXE_EXT) - $(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_patchnum.pl || $(MAKE) miniperl - -git_version.h: stock_git_version.h - cp stock_git_version.h git_version.h +git_version.h: miniperl$(EXE_EXT) make_patchnum.pl + -$(LDLIBPTH) $(RUN) ./miniperl$(EXE_EXT) -Ilib make_patchnum.pl # make sure that we recompile perl.c if the git version changes perl$(OBJ_EXT): git_version.h @@ -604,7 +601,7 @@ miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h perlmain.c: miniperlmain.c config.sh $(FIRSTMAKEFILE) sh writemain $(DYNALOADER) $(static_ext) > perlmain.c -perlmain$(OBJ_EXT): perlmain.c git_version.h +perlmain$(OBJ_EXT): perlmain.c $(CCCMD) $(PLDLFLAGS) $*.c # The file ext.libs is a list of libraries that must be linked in @@ -816,7 +813,7 @@ miniperl$(EXE_EXT): $& miniperlmain$(OBJ_EXT) $(mini_obj) opmini$(OBJ_EXT) perlm $spitshell >>$Makefile <<'!NO!SUBS!' -perl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) make_patchnum +perl$(EXE_EXT): $& perlmain$(OBJ_EXT) $(LIBPERL) $(static_ext) ext.libs $(PERLEXPORT) -@rm -f miniperl.xok $(SHRPENV) $(LDLIBPTH) $(CC) -o perl$(PERL_SUFFIX) $(PERL_PROFILE_LDFLAGS) $(CLDFLAGS) $(CCDLFLAGS) perlmain$(OBJ_EXT) $(static_ext) $(LLIBPERL) `cat ext.libs` $(libs) diff --git a/makedepend.SH b/makedepend.SH index e4f8252..3630087 100755 --- a/makedepend.SH +++ b/makedepend.SH @@ -150,6 +150,7 @@ for file in `$cat .clist`; do $sed \ -e '/^#.*/d' \ -e '/^#.*"-"/d' \ + -e '/^#.*git_version\.h/d' \ -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ -e 's/^[ ]*#[ ]*line/#/' \ -e '/^# *[0-9][0-9]* *[".\/]/!d' \ @@ -170,6 +171,7 @@ for file in `$cat .clist`; do -e '/^#.*"-"/d' \ -e '/^#.*"\/.*\/"/d' \ -e '/: file path prefix .* never used$/d' \ + -e '/^#.*git_version\.h/d' \ -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ -e 's/^[ ]*#[ ]*line/#/' \ -e '/^# *[0-9][0-9]* *[".\/]/!d' \ diff --git a/patchlevel.h b/patchlevel.h index 68c4d3c..96066f5 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -116,7 +116,13 @@ hunk. */ #if !defined(PERL_PATCHLEVEL_H_IMPLICIT) && !defined(LOCAL_PATCH_COUNT) +# if defined(PERL_IS_MINIPERL) +# define PERL_PATCHNUM "UNKNOWN-miniperl" +# define PERL_GIT_UNCOMMITTED_CHANGES ,"UNKNOWN" +# define PERL_GIT_UNPUSHED_COMMITS /*leave-this-comment*/ +# else #include "git_version.h" +# endif static const char * const local_patches[] = { NULL PERL_GIT_UNPUSHED_COMMITS /* do not remove this line */