summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-01-23 16:41:31 +0000
committerNicholas Clark <nick@ccl4.org>2009-01-23 17:03:45 +0000
commit486cd780047ff22471c5cbe417911a042ae23962 (patch)
tree5389041539c3d18c988fdc6b88105f51f328620a
parentbf799c6455f928b1043103098647499d1b2e96ff (diff)
downloadperl-486cd780047ff22471c5cbe417911a042ae23962.tar.gz
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.
-rw-r--r--Makefile.SH15
-rwxr-xr-xmakedepend.SH2
-rw-r--r--patchlevel.h6
3 files changed, 14 insertions, 9 deletions
diff --git a/Makefile.SH b/Makefile.SH
index fb1bf7f4c0..563aae126c 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 e4f82529ae..3630087e60 100755
--- a/makedepend.SH
+++ b/makedepend.SH
@@ -150,6 +150,7 @@ for file in `$cat .clist`; do
$sed \
-e '/^#.*<stdin>/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 68c4d3cb37..96066f542a 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 */