diff options
author | Steve Hay <SteveHay@planit.com> | 2006-11-13 18:09:58 +0000 |
---|---|---|
committer | Steve Hay <SteveHay@planit.com> | 2006-11-13 18:09:58 +0000 |
commit | c8e599d3a7f82b1ac9916859e455d8fd113f5731 (patch) | |
tree | dec972223802273ca9d0a54dbb8a43ef6fc4a1e6 /win32 | |
parent | 4fedb12c1678bdd231ce59b2cf5398a8e3354c3b (diff) | |
download | perl-c8e599d3a7f82b1ac9916859e455d8fd113f5731.tar.gz |
Embed manifest files in EXEs and DLLs when building with VC++ 8.x
See the thread starting here for details:
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-11/msg00398.html
(Still need to do something for Module::Build somtime...)
p4raw-id: //depot/perl@29266
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile | 17 | ||||
-rw-r--r-- | win32/makefile.mk | 17 |
2 files changed, 34 insertions, 0 deletions
diff --git a/win32/Makefile b/win32/Makefile index e5faa76890..a8d1af14ab 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -358,6 +358,17 @@ ARCHNAME = $(ARCHNAME)-thread DELAYLOAD = -DELAYLOAD:ws2_32.dll -DELAYLOAD:shell32.dll delayimp.lib !ENDIF +# Visual C++ 2005 (VC++ 8.x) creates manifest files for EXEs and DLLs. These +# either need copying everywhere with the binaries, or else need embedding in +# them otherwise MSVCR80.dll won't be found. Embed them for simplicity, and +# delete them afterwards so that they don't get installed too. +!IF "$(CCTYPE)" == "MSVC80" || "$(CCTYPE)" == "MSVC80FREE" +EMBED_EXE_MANI = mt -nologo -manifest $@.manifest -outputresource:$@;1 && \ + del $@.manifest +EMBED_DLL_MANI = mt -nologo -manifest $@.manifest -outputresource:$@;2 && \ + del $@.manifest +!ENDIF + ARCHDIR = ..\lib\$(ARCHNAME) COREDIR = ..\lib\CORE AUTODIR = ..\lib\auto @@ -492,6 +503,7 @@ o = .obj $(o).dll: $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \ -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL) + $(EMBED_DLL_MANI) .rc.res: $(RSC) -i.. $< @@ -941,6 +953,7 @@ $(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c $(GLOBEXE) : perlglob$(o) $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \ perlglob$(o) setargv$(o) + $(EMBED_EXE_MANI) perlglob$(o) : perlglob.c @@ -984,6 +997,7 @@ $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(LINK32) -subsystem:console -out:$@ @<< $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ) << + $(EMBED_EXE_MANI) $(MINIDIR) : if not exist "$(MINIDIR)" mkdir "$(MINIDIR)" @@ -1019,6 +1033,7 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @Extensions_static @<< $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES) << + $(EMBED_DLL_MANI) $(XCOPY) $(PERLIMPLIB) $(COREDIR) $(PERLEXE_ICO): $(MINIPERL) makeico.pl @@ -1052,6 +1067,7 @@ $(X2P) : $(MINIPERL) $(X2P_OBJ) $(LINK32) -subsystem:console -out:$@ @<< $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ) << + $(EMBED_EXE_MANI) perlmain.c : runperl.c copy runperl.c perlmain.c @@ -1062,6 +1078,7 @@ perlmain$(o) : perlmain.c $(PERLEXE): $(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) copy $(PERLEXE) $(WPERLEXE) $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS copy splittree.pl .. diff --git a/win32/makefile.mk b/win32/makefile.mk index c1744f883b..db133afcb3 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -357,6 +357,17 @@ ARCHNAME !:= $(ARCHNAME)-thread DELAYLOAD *= -DELAYLOAD:ws2_32.dll -DELAYLOAD:shell32.dll delayimp.lib .ENDIF +# Visual C++ 2005 (VC++ 8.x) creates manifest files for EXEs and DLLs. These +# either need copying everywhere with the binaries, or else need embedding in +# them otherwise MSVCR80.dll won't be found. Embed them for simplicity, and +# delete them afterwards so that they don't get installed too. +.IF "$(CCTYPE)" == "MSVC80" || "$(CCTYPE)" == "MSVC80FREE" +EMBED_EXE_MANI = mt -nologo -manifest $@.manifest -outputresource:$@;1 && \ + del $@.manifest +EMBED_DLL_MANI = mt -nologo -manifest $@.manifest -outputresource:$@;2 && \ + del $@.manifest +.ENDIF + ARCHDIR = ..\lib\$(ARCHNAME) COREDIR = ..\lib\CORE AUTODIR = ..\lib\auto @@ -647,6 +658,7 @@ $(o).dll: .ELSE $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \ -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL) + $(EMBED_DLL_MANI) .ENDIF .rc.res: @@ -1041,6 +1053,7 @@ $(GLOBEXE) : perlglob$(o) .ELSE $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \ perlglob$(o) setargv$(o) + $(EMBED_EXE_MANI) .ENDIF perlglob$(o) : perlglob.c @@ -1092,6 +1105,7 @@ $(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS) .ELSE $(LINK32) -subsystem:console -out:$@ \ @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,$B,)) + $(EMBED_EXE_MANI) .ENDIF $(MINIDIR) : @@ -1159,6 +1173,7 @@ $(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES) Extensions_static @Extensions_static \ @$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \ $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,$B,)) + $(EMBED_DLL_MANI) .ENDIF $(XCOPY) $(PERLIMPLIB) $(COREDIR) @@ -1198,6 +1213,7 @@ $(X2P) : $(MINIPERL) $(X2P_OBJ) .ELSE $(LINK32) -subsystem:console -out:$@ \ @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,$B,)) + $(EMBED_EXE_MANI) .ENDIF perlmain.c : runperl.c @@ -1218,6 +1234,7 @@ $(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES) .ELSE $(LINK32) -subsystem:console -out:$@ -stack:0x1000000 $(BLINK_FLAGS) \ $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES) + $(EMBED_EXE_MANI) .ENDIF copy $(PERLEXE) $(WPERLEXE) $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS |