From: Steve Hay Date: Thu, 6 Jun 2013 22:28:07 +0000 (+0100) Subject: Fix creation of libperl519s.a on Win32 with MinGW X-Git-Tag: upstream/5.20.0~3217 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cc0b589ad6053fdbc488399fc8b8fe992abd9e3b;p=platform%2Fupstream%2Fperl.git Fix creation of libperl519s.a on Win32 with MinGW The "ar rc" command created an invalid static perl library by putting the static extension libraries themselves into the library rather than putting the objects from each static extension library into it as intended (like the VC++ "link -lib" command does). We now extract each static extension library's objects into a temporary directory and put the objects from there into the static perl library. --- diff --git a/win32/makefile.mk b/win32/makefile.mk index 68d2f32..f071513 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -641,6 +641,7 @@ MINIDIR = .\mini PERLEXE = ..\perl.exe WPERLEXE = ..\wperl.exe PERLEXESTATIC = ..\perl-static.exe +STATICDIR = .\static.tmp GLOBEXE = ..\perlglob.exe CONFIGPM = ..\lib\Config.pm ..\lib\Config_heavy.pl MINIMOD = ..\lib\ExtUtils\Miniperl.pm @@ -1154,16 +1155,13 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static .ENDIF $(XCOPY) $(PERLIMPLIB) $(COREDIR) -$(PERLSTATICLIB): Extensions_static +$(PERLSTATICLIB): $(PERLDLL_OBJ) Extensions_static .IF "$(CCTYPE)" == "GCC" -# XXX: It would be nice if MinGW's ar accepted a temporary file, but this -# doesn't seem to work: -# $(LIB32) $(LIB_FLAGS) $@ \ -# $(mktmp $(LKPRE) $(shell @type Extensions_static) \ -# $(PERLDLL_OBJ) $(LKPOST)) - $(LIB32) $(LIB_FLAGS) $@ \ - $(shell @type Extensions_static) \ - $(PERLDLL_OBJ) + if exist $(STATICDIR) rmdir /s /q $(STATICDIR) + mkdir $(STATICDIR) + cd $(STATICDIR) && for %i in ($(shell @type Extensions_static)) do $(ARCHPREFIX)ar x ..\%i + $(LIB32) $(LIB_FLAGS) $@ $(STATICDIR)\*$(o) $(PERLDLL_OBJ) + rmdir /s /q $(STATICDIR) .ELSE $(LIB32) $(LIB_FLAGS) -out:$@ @Extensions_static \ @$(mktmp $(PERLDLL_OBJ))