From 9c52fb434cdbca31bfad7684df043db4f3b0a49c Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 1 Sep 2009 08:42:33 -0600 Subject: [PATCH] add manifest to executables and DLLs when building with MSVC --- makefile | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index 94ced13def..b5216c950b 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,4 @@ -MAKEFLAGS = -s +#MAKEFLAGS = -s name = avian version = 0.2 @@ -237,17 +237,18 @@ ifdef msvc cxx = "$(msvc)/BIN/cl.exe" cc = $(cxx) ld = "$(msvc)/BIN/link.exe" + mt = "mt.exe" cflags = -nologo -DAVIAN_VERSION=\"$(version)\" -D_JNI_IMPLEMENTATION_ \ -Fd$(native-build)/$(name).pdb -I"$(zlib)/include" -I$(src) \ -I"$(native-build)" -I"$(windows-java-home)/include" \ -I"$(windows-java-home)/include/win32" shared = -dll lflags = -nologo -LIBPATH:"$(zlib)/lib" -DEFAULTLIB:ws2_32 \ - -DEFAULTLIB:zlib + -DEFAULTLIB:zlib -MANIFEST output = -Fo$(1) ifeq ($(mode),debug) - cflags += -Od -Zi + cflags += -Od -Zi -MDd lflags += -debug endif ifeq ($(mode),debug-fast) @@ -646,7 +647,9 @@ $(executable): \ @echo "linking $(@)" ifeq ($(platform),windows) ifdef msvc - $(ld) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb -IMPLIB:$(@).lib + $(ld) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb -IMPLIB:$(@).lib \ + -MANIFESTFILE:$(@).manifest + $(mt) -manifest $(@).manifest -outputresource:"$(@);1" else $(dlltool) -z $(@).def $(^) $(call gnu-objects) $(dlltool) -d $(@).def -e $(@).exp @@ -677,7 +680,9 @@ $(build-bootimage-generator): \ @echo "linking $(@)" ifeq ($(platform),windows) ifdef msvc - $(ld) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb -IMPLIB:$(@).lib + $(ld) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb -IMPLIB:$(@).lib \ + -MANIFESTFILE:$(@).manifest + $(mt) -manifest $(@).manifest -outputresource:"$(@);1" else $(dlltool) -z $(@).def $(^) $(dlltool) -d $(@).def -e $(@).exp @@ -694,7 +699,8 @@ $(dynamic-library): \ @echo "linking $(@)" ifdef msvc $(ld) $(shared) $(lflags) $(^) -out:$(@) -PDB:$(@).pdb \ - -IMPLIB:$(native-build)/$(name).lib + -IMPLIB:$(native-build)/$(name).lib -MANIFESTFILE:$(@).manifest + $(mt) -manifest $(@).manifest -outputresource:"$(@);2" else $(ld) $(^) $(call gnu-objects) $(shared) $(lflags) $(bootimage-lflags) \ -o $(@) @@ -705,7 +711,8 @@ $(executable-dynamic): $(driver-dynamic-object) $(dynamic-library) @echo "linking $(@)" ifdef msvc $(ld) $(lflags) -LIBPATH:$(native-build) -DEFAULTLIB:$(name) \ - -PDB:$(@).pdb -IMPLIB:$(@).lib $(<) -out:$(@) + -PDB:$(@).pdb -IMPLIB:$(@).lib $(<) -out:$(@) -MANIFESTFILE:$(@).manifest + $(mt) -manifest $(@).manifest -outputresource:"$(@);1" else $(ld) $(^) $(lflags) -o $(@) endif