From: Steve Hay Date: Tue, 13 Jan 2009 14:57:07 +0000 (+0000) Subject: Restore Win32 build by creating git_version.h. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a148edb68fd0a08baf89e19b1468a7c646de7c2f;p=p5sagit%2Fp5-mst-13.2.git Restore Win32 build by creating git_version.h. This solution is based on what is done for config.h (which isn't perfect because it leaves miniperl.exe out-of-sync with the final perl.exe build, but that doesn't really matter). Also has a problem in that miniperl.exe is used in a couple of places before make_patchnum.pl has been run (to recreate git_version.h and create lib/Config_git.pl), causing the warning: Warning: failed to load Config_git.pl, something strange about this perl... The running of make_patchnum.pl also causes some warnings of its own if a ".git" directory is found but "git" isn't on the PATH: 'git' is not recognized as an internal or external command, operable program or batch file. These things will be hopefully ironed out later. --- diff --git a/win32/Makefile b/win32/Makefile index 1f1120c..409ca91 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -766,7 +766,7 @@ CORE_NOCFG_H = \ .\include\sys\socket.h \ .\win32.h -CORE_H = $(CORE_NOCFG_H) .\config.h +CORE_H = $(CORE_NOCFG_H) .\config.h ..\git_version.h UUDMAP_H = ..\uudmap.h @@ -838,8 +838,8 @@ CFG_VARS = \ # Top targets # -all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) MakePPPort \ - $(PERLEXE) $(X2P) Extensions $(PERLSTATIC) +all : .\config.h ..\git_version.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) \ + $(UNIDATAFILES) MakePPPort $(PERLEXE) $(X2P) Extensions $(PERLSTATIC) @echo Everything is up to date. '$(MAKE_BARE) test' to run test suite. ..\regcharclass.h : ..\Porting\regcharclass.pl @@ -853,8 +853,8 @@ regnodes : ..\regnodes.h ..\regexec$(o) : ..\regnodes.h ..\regcharclass.h -reonly : regnodes .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) \ - $(PERLEXE) $(X2P) Extensions_reonly +reonly : regnodes .\config.h ..\git_version.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) \ + $(UNIDATAFILES) $(PERLEXE) $(X2P) Extensions_reonly @echo Perl and 're' are up to date. $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c @@ -877,6 +877,17 @@ config.w32 : $(CFGSH_TMPL) -del /f config.h copy $(CFGH_TMPL) config.h +# ignore "errors" from make_patchnum.pl (it exits with status 1 when +# not rewriting its output files) +make_patchnum : $(MINIPERL) + cd .. + -miniperl -Ilib make_patchnum.pl + cd win32 + +..\git_version.h : ..\stock_git_version.h + -del /f ..\git_version.h + copy ..\stock_git_version.h ..\git_version.h + ..\config.sh : config.w32 $(MINIPERL) config_sh.PL $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh @@ -1015,7 +1026,7 @@ perlmainst.c : runperl.c perlmainst$(o) : perlmainst.c $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ -c perlmainst.c -$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) +$(PERLEXE): make_patchnum $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \ $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES) $(EMBED_EXE_MANI) @@ -1024,7 +1035,7 @@ $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) copy splittree.pl .. $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR) -$(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) +$(PERLEXESTATIC): make_patchnum $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(LINK_FLAGS) \ @Extensions_static $(PERLSTATICLIB) /PDB:NONE \ $(LIBFILES) $(PERLEXEST_OBJ) $(SETARGV_OBJ) $(PERLEXE_RES) @@ -1219,6 +1230,7 @@ distclean: realclean -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new \ perlmainst.c -del /f $(CONFIGPM) + -del /f ..\lib\Config_git.pl -del /f bin\*.bat -del /f perllibst.h -del /f $(PERLEXE_ICO) perl.base @@ -1314,6 +1326,7 @@ _clean : -@$(DEL) perlmainst$(o) -@$(DEL) config.w32 -@$(DEL) config.h + -@$(DEL) ..\git_version.h -@$(DEL) $(GLOBEXE) -@$(DEL) $(PERLEXE) -@$(DEL) $(WPERLEXE) diff --git a/win32/makefile.mk b/win32/makefile.mk index eac3619..9814d92 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -924,7 +924,7 @@ CORE_NOCFG_H = \ .\include\sys\socket.h \ .\win32.h -CORE_H = $(CORE_NOCFG_H) .\config.h +CORE_H = $(CORE_NOCFG_H) .\config.h ..\git_version.h UUDMAP_H = ..\uudmap.h @@ -1025,8 +1025,8 @@ ODBCCP32_DLL = $(windir)\system\odbccp32.dll # Top targets # -all : CHECKDMAKE .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \ - $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) MakePPPort \ +all : CHECKDMAKE .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL) $(MK2) \ + $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) MakePPPort \ $(PERLEXE) $(X2P) Extensions $(PERLSTATIC) ..\regcharclass.h : ..\Porting\regcharclass.pl @@ -1038,8 +1038,8 @@ regnodes : ..\regnodes.h ..\regexec$(o) : ..\regnodes.h ..\regcharclass.h -reonly : regnodes .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \ - $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) \ +reonly : regnodes .\config.h ..\git_version.h $(GLOBEXE) $(MINIPERL) $(MK2) \ + $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(UNIDATAFILES) $(PERLEXE) \ $(X2P) Extensions_reonly $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c @@ -1125,6 +1125,15 @@ config.w32 : $(CFGSH_TMPL) -del /f config.h copy $(CFGH_TMPL) config.h +# ignore "errors" from make_patchnum.pl (it exits with status 1 when +# not rewriting its output files) +make_patchnum : $(MINIPERL) + -cd .. && miniperl -Ilib make_patchnum.pl + +..\git_version.h : ..\stock_git_version.h + -del /f ..\git_version.h + copy ..\stock_git_version.h ..\git_version.h + ..\config.sh : config.w32 $(MINIPERL) config_sh.PL FindExt.pm $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \ $(mktmp $(CFG_VARS)) config.w32 > ..\config.sh @@ -1325,7 +1334,7 @@ perlmainst.c : runperl.c perlmainst$(o) : perlmainst.c $(CC) $(CFLAGS_O) $(OBJOUT_FLAG)$@ -c perlmainst.c -$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) +$(PERLEXE): make_patchnum $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) .IF "$(CCTYPE)" == "BORLAND" $(LINK32) -Tpe -ap $(BLINK_FLAGS) \ @$(mktmp c0x32$(o) $(PERLEXE_OBJ),$@,, \ @@ -1343,7 +1352,7 @@ $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) copy splittree.pl .. $(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR) -$(PERLEXESTATIC): $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) +$(PERLEXESTATIC): make_patchnum $(PERLSTATICLIB) $(CONFIGPM) $(PERLEXEST_OBJ) $(PERLEXE_RES) .IF "$(CCTYPE)" == "BORLAND" $(LINK32) -Tpe -ap $(BLINK_FLAGS) \ @$(mktmp c0x32$(o) $(PERLEXEST_OBJ),$@,, \ @@ -1543,6 +1552,7 @@ distclean: realclean -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new \ perlmainst.c -del /f $(CONFIGPM) + -del /f ..\lib\Config_git.pl -del /f bin\*.bat -del /f perllibst.h -del /f $(PERLEXE_ICO) perl.base @@ -1642,6 +1652,7 @@ _clean : -@erase perlmainst$(o) -@erase config.w32 -@erase /f config.h + -@erase /f ..\git_version.h -@erase $(GLOBEXE) -@erase $(PERLEXE) -@erase $(WPERLEXE)