From: Vadim Konovalov Date: Wed, 13 Oct 2004 09:45:31 +0000 (+0400) Subject: RE: [PATCH-for-23358] enable statically linked exte nsions for Win32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8bcd5811450ad13819564acc4bb15a205239031f;p=p5sagit%2Fp5-mst-13.2.git RE: [PATCH-for-23358] enable statically linked exte nsions for Win32 From: "Konovalov, Vadim" Message-ID: <7DD1BE2C50259746ABB8683672D2089E08133C@itotest-1.spb.lucent.com> p4raw-id: //depot/perl@23363 --- diff --git a/win32/buildext.pl b/win32/buildext.pl index 50fe4c1..0ae9f74 100644 --- a/win32/buildext.pl +++ b/win32/buildext.pl @@ -60,7 +60,13 @@ if ($opts{'list-static-libs'} || $opts{'create-perllibst-h'}) { print $fh "#ifdef STATIC3\n",(map {" newXS(\"$statics2[$_]::bootstrap\", boot_$statics1[$_], file);\n"} 0 .. $#statics),"#undef STATIC3\n#endif\n"; } else { - print map {/([^\/]+)$/;"$_/$1.lib "} @statics; + my %extralibs; + for (@statics) { + open my $fh, "<..\\lib\\auto\\$_\\extralibs.ld" or die "can't open <..\\lib\\auto\\$_\\extralibs.ld: $!"; + $extralibs{$_}++ for grep {/\S/} split /\s+/, join '', <$fh>; + } + print map {/([^\/]+)$/;"..\\lib\\auto\\$_/$1.lib "} @statics; + print map {"$_ "} sort keys %extralibs; } exit; } diff --git a/win32/makefile.mk b/win32/makefile.mk index e030f2b..1117f28 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -155,7 +155,14 @@ CRYPT_SRC *= fcrypt.c # extensions if you change the default. Currently, this cannot be enabled # if you ask for USE_IMP_SYS above. # -#PERL_MALLOC *= define +PERL_MALLOC *= define + +# +# set this to enable debugging mstats +# This must be enabled to use the Devel::Peek::mstat() function. This cannot +# be enabled without PERL_MALLOC as well. +# +DEBUG_MSTATS = define # # set the install locations of the compiler include/libraries @@ -239,6 +246,19 @@ USE_PERLIO *= undef USE_LARGE_FILES *= undef USE_PERLCRT *= undef +.IF "$(PERL_MALLOC)" == "undef" +PERL_MALLOC = undef +DEBUG_MSTATS = undef +.ENDIF + +.IF "$(DEBUG_MSTATS)" == "undef" +DEBUG_MSTATS = undef +.ENDIF + +.IF "$(DEBUG_MSTATS)" == "define" +BUILDOPT += -DPERL_DEBUGGING_MSTATS +.ENDIF + .IF "$(USE_IMP_SYS)$(USE_MULTI)" == "defineundef" USE_MULTI != define .ENDIF @@ -1035,10 +1055,9 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static perl.exp $(LKPOST)) .ELSE $(LINK32) -dll -def:perldll.def -out:$@ \ - -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \ - $(foreach,i,$(shell $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --list-static-libs) \ - ..\lib\auto\$i) \ - $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\) + $(shell $(MINIPERL) -I..\lib buildext.pl --list-static-libs) \ + @$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \ + $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\)) .ENDIF $(XCOPY) $(PERLIMPLIB) $(COREDIR) @@ -1121,7 +1140,7 @@ Extensions : buildext.pl $(PERLDEP) $(CONFIGPM) $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --dynamic $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --dynamic -Extensions_static : buildext.pl $(PERLDEP) $(CONFIGPM) +Extensions_static : buildext.pl $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) ext --static $(MINIPERL) -I..\lib buildext.pl $(MAKE) $(PERLDEP) $(EXTDIR) --static