jdk/makefiles/CompileLaunchers.gmk
changeset 12892 3ef14bab6254
parent 12317 9670c1610c53
child 13164 72c5d01a857d
--- a/jdk/makefiles/CompileLaunchers.gmk	Thu Jun 07 20:40:02 2012 -0700
+++ b/jdk/makefiles/CompileLaunchers.gmk	Thu Jun 07 20:40:50 2012 -0700
@@ -41,6 +41,16 @@
     # Parameter 3 are extra LDFLAGS
     # Parameter 4 are extra LDFLAGS_SUFFIX_posix
     # Parameter 5 are extra LDFLAGS_SUFFIX_winapi
+
+    $1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/jli.lib
+    ifneq ($6,)
+        $1_WINDOWS_JLI_LIB:=$6
+    endif
+    $1_VERSION_INFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc
+    ifneq ($8,)
+        $1_VERSION_INFO_RESOURCE:=$8
+    endif
+
     $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
 	SRC:=$(JDK_TOPDIR)/src/share/bin,\
 	INCLUDE_FILES:=main.c,\
@@ -61,19 +71,22 @@
                  $(call SET_SHARED_LIBRARY_ORIGIN,../lib/$(LIBARCH)/jli) \
                  $(call SET_SHARED_LIBRARY_ORIGIN,../jre/lib/$(LIBARCH)/jli) \
 		 $3,\
-        LDFLAGS_linux:=$(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/launchers/mapfile-$(ARCH)),\
+	MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(ARCH), \
         LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX),\
 	LDFLAGS_SUFFIX_posix:=$4 -lc,\
-	LDFLAGS_SUFFIX_winapi:=$5,\
-	BIN:=$(JDK_OUTPUTDIR)/newobjs/$1_objs,\
-	EXE:=$(JDK_OUTPUTDIR)/newobjs/$1$(EXE_SUFFIX),\
-	VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
+	LDFLAGS_SUFFIX_winapi:=$$($1_WINDOWS_JLI_LIB) \
+			       $(JDK_OUTPUTDIR)/objs/java.lib advapi32.lib $5,\
+	BIN:=$(JDK_OUTPUTDIR)/objs/$1_objs,\
+	EXE:=$(JDK_OUTPUTDIR)/objs/$1$(EXE_SUFFIX),\
+	VERSIONINFO_RESOURCE:=$$($1_VERSION_INFO_RESOURCE),\
 	RC_FLAGS:=$(RC_FLAGS)\
 		  /D "JDK_FNAME=$1$(EXE_SUFFIX)" \
 		  /D "JDK_INTERNAL_NAME=$1" \
-		  /D "JDK_FTYPE=0x1L")
+		  /D "JDK_FTYPE=0x1L" \
+		  $7,\
+	MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest)
 
-    BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/newobjs/$1$(EXE_SUFFIX) $(JDK_OUTPUTDIR)/bin/$1$(EXE_SUFFIX)
+    BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/$1$(EXE_SUFFIX)
 endef
 
 ##########################################################################################
@@ -84,8 +97,23 @@
     XLIBS:=
 endif
 
+ifdef OPENJDK
+    JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/windows/resource/icons"
+else
+    JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
+endif
+
 $(eval $(call SetupLauncher,java,\
-    -DEXPAND_CLASSPATH_WILDCARDS))
+    -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
+    $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
+    $(JDK_TOPDIR)/src/windows/resource/java.rc))
+
+ifeq ($(HOST_OS),windows)
+    $(eval $(call SetupLauncher,javaw,\
+        -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
+        $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
+        $(JDK_TOPDIR)/src/windows/resource/java.rc))
+endif
 
 ifeq ($(PLATFORM),solaris)
     THREAD_LIB:=-lthread
@@ -257,58 +285,111 @@
 ##########################################################################################
 # The order of the object files on the link command line affects the size of the resulting
 # binary (at least on linux) which causes the size to differ between old and new build.
-UNPACKEXE_ZIPOBJS = 	$(JDK_OUTPUTDIR)/newobjs/libzip/zcrc32$(OBJ_SUFFIX) \
-		     	$(JDK_OUTPUTDIR)/newobjs/libzip/deflate$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/trees$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/zadler32$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/compress$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/zutil$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/inflate$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/infback$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/inftrees$(OBJ_SUFFIX) \
-			$(JDK_OUTPUTDIR)/newobjs/libzip/inffast$(OBJ_SUFFIX)
+ifeq ($(USE_EXTERNAL_LIBZ), true)
+UNPACKEXE_ZIPOBJS := -lz
+else
+UNPACKEXE_ZIPOBJS := 	$(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
+		     	$(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
+			$(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
+
+
+$(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX): $(UNPACKEXE_ZIPOBJS)
+
+endif
 
 $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
 		EXCLUDE_FILES:=jni.cpp,\
-		LANG:=C++,\
+		LANG:=C,\
 		CFLAGS:=$(CXXFLAGS_JDKEXE) $(CXX_O_FLAG_NORM) \
 			 -DFULL \
 			 -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5,\
 		CFLAGS_release:=-DPRODUCT,\
 		CFLAGS_linux:=-fPIC,\
+		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200, \
 		LDFLAGS:=$(LDFLAGS_JDKEXE) \
-			 $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/mapfiles/libunpack/mapfile-vers-unpack200) \
 			 $(call SET_SHARED_LIBRARY_ORIGIN), \
 		LDFLAGS_SUFFIX:=$(UNPACKEXE_ZIPOBJS) $(LIBCXX),\
 		LDFLAGS_SUFFIX_solaris:=-lc,\
-		BIN:=$(JDK_OUTPUTDIR)/newobjs/unpackexe,\
-		EXE:=$(JDK_OUTPUTDIR)/newobjs/unpack200$(EXE_SUFFIX),\
+		BIN:=$(JDK_OUTPUTDIR)/objs/unpackexe,\
+		EXE:=$(JDK_OUTPUTDIR)/objs/unpack200$(EXE_SUFFIX),\
 		VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 		RC_FLAGS:=$(RC_FLAGS)\
 			  /D "JDK_FNAME=unpack200.exe" \
 			  /D "JDK_INTERNAL_NAME=unpack200" \
-			  /D "JDK_FTYPE=0x1L"))
+			  /D "JDK_FTYPE=0x1L",\
+		MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
 
-$(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX): $(UNPACKEXE_ZIPOBJS)
+BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
 
-ifeq ($(HOST_OS_API),winapi)
-    UNPACK_MANIFEST:=$(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest
-    IMVERSIONVALUE=$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION).$(JDK_UPDATE_VERSION).$(COOKED_BUILD_NUMBER)
-    SED_ALL_MANIFEST=$(SED) -e 's%IMVERSION%$(IMVERSIONVALUE)%g'
+##########################################################################################
+
+
+BUILD_JEXEC := 
+BUILD_JEXEC_SRC :=
+BUILD_JEXEC_INC :=
+BUILD_JEXEC_DST := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)/jexec$(EXE_SUFFIX)
 
-    $(UNPACK_MANIFEST): $(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest
-	$(CAT) $< | $(SED_ALL_MANIFEST) > $@
+#
+# UNHANDLED:
+# - COMPILE_APPROACH = normal
+#
 
-    # Adding a dependency to spec file might be a good idea here, to force rerun on version change.
-    $(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest.mt: $(UNPACK_MANIFEST)
-	$(MT) /manifest $< /outputresource:$(JDK_OUTPUTDIR)/newobjs/unpack200$(EXE_SUFFIX);#1
-	touch $@
-
-    $(JDK_OUTPUTDIR)/newobjs/unpackexe/unpack200.exe.manifest.mt: $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
+#
+# jdk/make/java/Makefile
+#
+ifeq ($(PLATFORM), solaris)
+	ifeq ($(ARCH_DATA_MODEL), 32)
+		BUILD_JEXEC := 1
+	endif
 endif
 
-BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin/unpack200$(EXE_SUFFIX)
+ifeq ($(PLATFORM), linux)
+	BUILD_JEXEC := 1
+endif # PLATFORM
+
+#
+# jdk/make/java/jexec/Makefile
+#
+ifeq ($(BUILD_JEXEC), 1)
+
+	ifeq ($(PLATFORM),windows)
+	else ifeq ($(PLATFORM),macosx)
+		BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/macosx/bin
+	else
+		BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/solaris/bin
+	endif
+
+	ifeq ($(PLATFORM), linux)
+		BUILD_JEXEC_DST := $(JDK_OUTPUTDIR)/lib/jexec$(EXE_SUFFIX)
+		BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/share/bin
+	endif
+endif
+
+#
+# Note that the two Makefile's seems to contradict each other,
+#   and that src/macosx/bin/jexec.c seems unused
+#
+ifneq ($(BUILD_JEXEC_SRC),)
+        $(eval $(call SetupNativeCompilation,BUILD_JEXEC,\
+		SRC:=$(BUILD_JEXEC_SRC),\
+		INCLUDE_FILES:=jexec.c,\
+		LANG:=C,\
+		CFLAGS:=$(CFLAGS_JDKEXE) $(C_O_FLAG_NORM) \
+                        $(BUILD_JEXEC_INC), \
+		LDFLAGS:=$(LDFLAGS_JDKEXE), \
+		BIN:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
+		EXE:=$(BUILD_JEXEC_DST)))
+
+	BUILD_LAUNCHERS += $(BUILD_JEXEC_DST)
+endif
 
 ##########################################################################################
 
@@ -335,22 +416,25 @@
 ifeq ($(HOST_OS_API),winapi)
     $(eval $(call SetupLauncher,java-rmi,\
         -DEXPAND_CLASSPATH_WILDCARDS,\
-        $(call SET_SHARED_LIBRARY_MAPFILE,makefiles/java/main/java/mapfile-$(ARCH))))
+        $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(ARCH))))
 
-    $(JAVA_RMI_CGI): $(JDK_OUTPUTDIR)/newobjs/java-rmi$(EXE_SUFFIX)
+    $(JAVA_RMI_CGI): $(JDK_OUTPUTDIR)/objs/java-rmi$(EXE_SUFFIX)
+	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
     BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
 else
     $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
+	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 	$(CHMOD) a+x $@
 endif
 
 ##########################################################################################
 
-$(JDK_OUTPUTDIR)/bin/% : $(JDK_OUTPUTDIR)/newobjs/%
-	echo Copying $(@F)
+$(JDK_OUTPUTDIR)/bin/% : $(JDK_OUTPUTDIR)/objs/%
+	$(ECHO) Copying $(@F)
+	$(MKDIR) -p $(@D)
 	$(CP) $< $@
 
 $(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk