changeset 4849:94e5604022fa

6988099: jvmti demos missing Publisher (COMPANY resource) in dlls/exes on windows Summary: Add creation/linking of resource data to link step for demos on Windows Reviewed-by: dcubed, zgu, ngmr, ohair Contributed-by: Sean Chou <zhouyx@linux.vnet.ibm.com>
author ngmr
date Thu, 15 Sep 2011 19:29:07 +0100
parents 09fd2067f715
children 5791714b9472
files make/common/Demo.gmk
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/Demo.gmk	Fri Oct 28 17:49:02 2011 -0700
+++ b/make/common/Demo.gmk	Thu Sep 15 19:29:07 2011 +0100
@@ -158,6 +158,8 @@
     #       bit between them.
     LINK.demo   = $(LINK.c)
     LDLIBS.demo = $(EXTRA_LIBS) $(LFLAGS_$(COMPILER_VERSION))
+    DEMO_VERSION_INFO = $(OBJDIR)/$(LIBRARY).res
+    LDLIBS.demo += $(DEMO_VERSION_INFO)
   else
     ifneq ($(DEMO_NEEDS_CPP),)
       LINK.demo   = $(LINK.cpp)
@@ -288,6 +290,13 @@
 	$(install-file)
 endif
 
+ifeq ($(PLATFORM),windows)
+# JDK name required here
+RC_FLAGS += /D "JDK_FNAME=$(LIBRARY).dll" \
+            /D "JDK_INTERNAL_NAME=$(LIBRARY)" \
+            /D "JDK_FTYPE=0x2L"
+endif
+
 # Native library building
 ifdef DEMO_LIBRARY
 
@@ -308,6 +317,9 @@
   # Actual creation of the native shared library (C++ and C are different)
 $(DEMO_LIBRARY): $(DEMO_FULL_OBJECTS)
 	@$(prep-target)
+  ifeq ($(PLATFORM),windows)
+	$(RC) $(RC_FLAGS) $(CC_OBJECT_OUTPUT_FLAG)$(DEMO_VERSION_INFO) $(VERSIONINFO_RESOURCE)
+  endif
 	$(LINK.demo) $(SHARED_LIBRARY_FLAG) $(CC_PROGRAM_OUTPUT_FLAG)$@ \
 	    $(DEMO_FULL_OBJECTS) $(LDLIBS.demo)
 	@$(call binary_file_verification,$@)