From: Steve Hay Date: Fri, 15 Jul 2005 10:35:55 +0000 (+0000) Subject: Fix static extensions when building with nmake on Win32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=322fd6428c9575b8e35cb16655e86ca0378af1cf;p=p5sagit%2Fp5-mst-13.2.git Fix static extensions when building with nmake on Win32 They were broken because change 24806 forgot to add -DWITH_STATIC to the recipe for compiling perllib.c which meant that perllibst.h was not included and hence although they built OK, the static extensions could not actually be used! In fact, since perllibst.h is always created (it is more or less empty when static extensions are not being used), there is no need for -DWITH_STATIC at all. So rather than adding it to Makefile, just drop it from makefile.mk and perllib.c. Also add the missing cleanup of perllibst.h to Makefile. p4raw-id: //depot/perl@25150 --- diff --git a/win32/Makefile b/win32/Makefile index 22f2f44..a5bba57 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -1184,6 +1184,7 @@ distclean: realclean -del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new -del /f $(CONFIGPM) -del /f bin\*.bat + -del /f perllibst.h -del /f $(PERLEXE_ICO) perl.base -cd .. && del /s *.lib *.map *.pdb *.ilk *.bs *$(o) .exists pm_to_blib -cd $(EXTDIR) && del /s *.def Makefile Makefile.old diff --git a/win32/makefile.mk b/win32/makefile.mk index f06ca6f..0a8bd5b 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1062,9 +1062,9 @@ $(MINIWIN32_OBJ) : $(CORE_NOCFG_H) perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h .IF "$(USE_IMP_SYS)" == "define" - $(CC) -c -I. -DWITH_STATIC $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c + $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c .ELSE - $(CC) -c -I. -DWITH_STATIC $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c + $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c .ENDIF # 1. we don't want to rebuild miniperl.exe when config.h changes diff --git a/win32/perllib.c b/win32/perllib.c index 5bd7ee8..3acfca1 100644 --- a/win32/perllib.c +++ b/win32/perllib.c @@ -17,19 +17,15 @@ char *staticlinkmodules[] = { "DynaLoader", /* other similar records will be included from "perllibst.h" */ -#ifdef WITH_STATIC #define STATIC1 #include "perllibst.h" -#endif NULL, }; EXTERN_C void boot_DynaLoader (pTHX_ CV* cv); /* other similar records will be included from "perllibst.h" */ -#ifdef WITH_STATIC #define STATIC2 #include "perllibst.h" -#endif static void xs_init(pTHX) @@ -38,10 +34,8 @@ xs_init(pTHX) dXSUB_SYS; newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); /* other similar records will be included from "perllibst.h" */ -#ifdef WITH_STATIC #define STATIC3 #include "perllibst.h" -#endif } #ifdef PERL_IMPLICIT_SYS