jdk/makefiles/CompileLaunchers.gmk
author amurillo
Wed, 15 Aug 2012 16:49:38 -0700
changeset 13465 d3fc5d192448
parent 13164 72c5d01a857d
child 13702 efd6a05935b2
permissions -rw-r--r--
7191765: make jdk8 the default jprt release for hs24 Reviewed-by: jcoomes

#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

defalt: all

include $(SPEC)
include MakeBase.gmk
include NativeCompilation.gmk

# Setup the java compilers for the JDK build.
include Setup.gmk

# Build tools
include Tools.gmk

BUILD_LAUNCHERS=

define SetupLauncher
    # TODO: Fix mapfile on solaris. Won't work with ld as linker.
    # Parameter 1 is the name of the launcher (java,javac,jar...)
    # Parameter 2 is extra CFLAGS
    # Parameter 3 is extra LDFLAGS
    # Parameter 4 is extra LDFLAGS_SUFFIX_posix
    # Parameter 5 is extra LDFLAGS_SUFFIX_winapi
    # Parameter 6 is optional Windows JLI library (full path)
    # Parameter 7 is optional Windows resource (RC) flags
    # Parameter 8 is optional Windows version resource file (.rc)
    # Parameter 9  is different output dir
    # Parameter 10 is FULL DEBUG SYMBOLS (set value to turn OFF, since most(all) seems to have it)

    $1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/libjli/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

    $1_LDFLAGS := $3
    ifeq ($(OPENJDK_TARGET_OS), macosx)
        $1_LDFLAGS += -F/System/Library/Frameworks/JavaVM.framework/Frameworks \
                       -F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
    endif

    $1_LDFLAGS_SUFFIX :=
    ifeq ($(USE_EXTERNAL_LIBZ), true)
        $1_LDFLAGS_SUFFIX += -lz
    endif

    ifeq ($(OPENJDK_TARGET_OS), macosx)
        $1_LDFLAGS_SUFFIX += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
                             -framework Cocoa -framework Security -framework ApplicationServices \
                             -sectcreate __TEXT __info_plist $(JDK_TOPDIR)/src/macosx/lib/Info-cmdline.plist
    endif


    $1_OUTPUT_DIR_ARG:=$9
    ifeq (,$$($1_OUTPUT_DIR_ARG))
        $1_OUTPUT_DIR_ARG:=$(JDK_OUTPUTDIR)/bin
    endif

    $1_DEBUG_SYMBOLS:=yes
    ifneq (,$(10))
      $1_DEBUG_SYMBOLS:=
    endif

    $1_OPTIMIZATION:= LOW

    # TODO: maybe it's better to move this if-statement out of this function
    ifeq ($(1),java)
      $1_OPTIMIZATION:=HIGH
    endif

    $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
	SRC:=$(JDK_TOPDIR)/src/share/bin,\
	INCLUDE_FILES:=main.c,\
	LANG:=C,\
	OPTIMIZATION :=$$($1_OPTIMIZATION), \
	CFLAGS:=$(CFLAGS_JDKEXE) \
		-I$(JDK_TOPDIR)/src/share/bin \
		-I$(JDK_TOPDIR)/src/$(LEGACY_OPENJDK_TARGET_OS_API)/bin \
		-I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
                -DFULL_VERSION='"$(FULL_VERSION)"' \
                -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
                -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
		-DLIBARCHNAME='"$(ARCH)"' \
		-DLAUNCHER_NAME='"java"' \
		-DPROGNAME='"$1"' $(DPACKAGEPATH) \
		$2,\
	CFLAGS_linux:=-fPIC,\
        CFLAGS_solaris:=-KPIC -DHAVE_GETHRTIME,\
	LDFLAGS:=$(LDFLAGS_JDKEXE) \
                 $(call SET_SHARED_LIBRARY_ORIGIN,../lib/$(LIBARCH)/jli) \
                 $(call SET_SHARED_LIBRARY_ORIGIN,../jre/lib/$(LIBARCH)/jli) \
		 $$($1_LDFLAGS),\
	MAPFILE := $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(ARCH), \
        LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX),\
	LDFLAGS_SUFFIX_posix:=$4 -lc,\
	LDFLAGS_SUFFIX_winapi:=$$($1_WINDOWS_JLI_LIB) \
			       $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5,\
	LDFLAGS_SUFFIX_solaris := -lthread $(LIBDL), \
	OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/$1_objs,\
	OUTPUT_DIR:=$$($1_OUTPUT_DIR_ARG),\
	PROGRAM:=$1,\
	DEBUG_SYMBOLS:=$$($1_DEBUG_SYMBOLS),\
	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" \
		  $7,\
	MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest)

    BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)

    ifeq ($(OPENJDK_TARGET_OS),macosx)
        $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjli_static.a
    endif

    ifeq ($(OPENJDK_TARGET_OS),windows)
        $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
				$$($1_WINDOWS_JLI_LIB)
    endif    	 
endef

##########################################################################################

XLIBS:=$(X_LIBS) -lX11
ifeq ($(OPENJDK_TARGET_OS),macosx)
    DPACKAGEPATH:=-DPACKAGE_PATH='"$(PACKAGE_PATH)"'
    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,,,user32.lib comctl32.lib,\
    $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
    $(JDK_TOPDIR)/src/windows/resource/java.rc))

ifeq ($(OPENJDK_TARGET_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 ($(OPENJDK_TARGET_OS),solaris)
    THREAD_LIB:=-lthread
endif
ifeq ($(OPENJDK_TARGET_OS),linux)
    THREAD_LIB:=-lpthread
endif

ifndef BUILD_HEADLESS_ONLY
$(eval $(call SetupLauncher,appletviewer,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.applet.Main"$(COMMA) }',,\
    $(THREAD_LIB) $(XLIBS) -ldl))
endif

$(eval $(call SetupLauncher,extcheck,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.extcheck.Main"$(COMMA) }'))

$(eval $(call SetupLauncher,idlj,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.corba.se.idl.toJavaPortable.Compile"$(COMMA) }'))

$(eval $(call SetupLauncher,jar,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))

$(eval $(call SetupLauncher,jarsigner,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.JarSigner"$(COMMA) }'))

$(eval $(call SetupLauncher,javac,\
    -DEXPAND_CLASSPATH_WILDCARDS \
    -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }'))

$(eval $(call SetupLauncher,javadoc,\
    -DEXPAND_CLASSPATH_WILDCARDS \
    -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javadoc.Main"$(COMMA) }'))

$(eval $(call SetupLauncher,javah,\
    -DEXPAND_CLASSPATH_WILDCARDS \
    -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javah.Main"$(COMMA) }'))

$(eval $(call SetupLauncher,javap,\
    -DEXPAND_CLASSPATH_WILDCARDS \
    -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))

BUILD_LAUNCHER_jconsole_CPPFLAGS_windows:=-DJAVAW
BUILD_LAUNCHER_jconsole_LDFLAGS_windows:=user32.lib

$(eval $(call SetupLauncher,jconsole,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "-J-Djconsole.showOutputViewer"$(COMMA) "sun.tools.jconsole.JConsole"$(COMMA) }' \
    -DAPP_CLASSPATH='{ "/lib/jconsole.jar"$(COMMA) "/lib/tools.jar"$(COMMA) "/classes" }'))

$(eval $(call SetupLauncher,jdb,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.example.debug.tty.TTY"$(COMMA) }' \
    -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))

$(eval $(call SetupLauncher,jhat,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.hat.Main"$(COMMA) }'))

$(eval $(call SetupLauncher,jinfo,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
		   "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
		   "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
		   "sun.tools.jinfo.JInfo"$(COMMA) }' \
    -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))

$(eval $(call SetupLauncher,jmap,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
		   "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
		   "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
		   "sun.tools.jmap.JMap"$(COMMA) }' \
    -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))

$(eval $(call SetupLauncher,jps,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jps.Jps"$(COMMA) }'))

$(eval $(call SetupLauncher,jrunscript,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.script.shell.Main"$(COMMA) }'))

$(eval $(call SetupLauncher,jsadebugd,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.jdi.SADebugServer"$(COMMA) }' \
    -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))

$(eval $(call SetupLauncher,jstack,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
		   "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
		   "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
		   "sun.tools.jstack.JStack"$(COMMA) }' \
    -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))

$(eval $(call SetupLauncher,jstat,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstat.Jstat"$(COMMA) }'))

$(eval $(call SetupLauncher,jstatd,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstatd.Jstatd"$(COMMA) }'))

$(eval $(call SetupLauncher,keytool,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.KeyTool"$(COMMA) }'))

$(eval $(call SetupLauncher,native2ascii,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }'))

ifndef BUILD_HEADLESS_ONLY
$(eval $(call SetupLauncher,policytool,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }'))
endif

$(eval $(call SetupLauncher,rmic,\
    -DEXPAND_CLASSPATH_WILDCARDS \
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.rmic.Main"$(COMMA) }'))

$(eval $(call SetupLauncher,schemagen,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.jxc.SchemaGenerator"$(COMMA) }'))

$(eval $(call SetupLauncher,serialver,\
    -DEXPAND_CLASSPATH_WILDCARDS \
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }'))

$(eval $(call SetupLauncher,xjc,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.xjc.Driver"$(COMMA) }'))

$(eval $(call SetupLauncher,wsgen,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsGen"$(COMMA) }'))

$(eval $(call SetupLauncher,wsimport,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsImport"$(COMMA) }'))

$(eval $(call SetupLauncher,orbd,\
    -DJAVA_ARGS='{ 	"-J-ms8m"$(COMMA) \
			"-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
			"-J-Dcom.sun.CORBA.activation.Port=1049"$(COMMA) \
			"-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
			"com.sun.corba.se.impl.activation.ORBD"$(COMMA) }'))

$(eval $(call SetupLauncher,servertool,\
    -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.corba.se.impl.activation.ServerTool"$(COMMA) }'))

$(eval $(call SetupLauncher,tnameserv,\
    -DJAVA_ARGS='{ 	"-J-ms8m"$(COMMA) \
			"-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
			"-J-Djava.util.logging.LoggingPermission=contol"$(COMMA) \
			"-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
			"com.sun.corba.se.impl.naming.cosnaming.TransientNameServer"$(COMMA) }'))

$(eval $(call SetupLauncher,pack200,\
    -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) "--pack" }'))

$(eval $(call SetupLauncher,rmid,\
    -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.rmi.server.Activation"$(COMMA) }'))

$(eval $(call SetupLauncher,rmiregistry,\
    -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.rmi.registry.RegistryImpl"$(COMMA) }'))

$(eval $(call SetupLauncher,jcmd,\
    -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))

ifeq ($(OPENJDK_TARGET_OS),windows)
    $(eval $(call SetupLauncher,kinit,\
        -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }'))

    $(eval $(call SetupLauncher,klist,\
        -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Klist"$(COMMA) }'))

    $(eval $(call SetupLauncher,ktab,\
        -DJAVA_ARGS='{	"-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Ktab"$(COMMA) }'))
endif

##########################################################################################
# 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.
ifeq ($(USE_EXTERNAL_LIBZ), true)
UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
UNPACKEXE_ZIPOBJS := -lz
else
UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
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)

endif

ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
     UNPACKEXE_CFLAGS += -xregs=no%appl
endif

$(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
                SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
		EXCLUDE_FILES:=jni.cpp,\
		LANG:=C,\
		OPTIMIZATION := LOW, \
		CFLAGS:=$(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE)\
			 -DFULL, \
		CFLAGS_release:=-DPRODUCT,\
		CFLAGS_linux:=-fPIC,\
		CFLAGS_solaris := -KPIC, \
		CFLAGS_macosx := -fPIC, \
		MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200, \
		LDFLAGS:=$(LDFLAGS_JDKEXE) \
			 $(call SET_SHARED_LIBRARY_ORIGIN), \
		LDFLAGS_SUFFIX:=$(UNPACKEXE_ZIPOBJS) $(LIBCXX),\
		LDFLAGS_SUFFIX_solaris:=-lc,\
		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe,\
		OUTPUT_DIR:=$(JDK_OUTPUTDIR)/bin,\
		PROGRAM:=unpack200,\
		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",\
		MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))

ifneq ($(USE_EXTERNAL_LIBZ), true)

$(BUILD_UNPACKEXE) : $(UNPACKEXE_ZIPOBJS)

endif

BUILD_LAUNCHERS += $(BUILD_UNPACKEXE)

##########################################################################################


BUILD_JEXEC := 
BUILD_JEXEC_SRC :=
BUILD_JEXEC_INC :=
BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib/$(LIBARCH)

#
# UNHANDLED:
# - COMPILE_APPROACH = normal
#

#
# jdk/make/java/Makefile
#
ifeq ($(OPENJDK_TARGET_OS), solaris)
	ifeq ($(ARCH_DATA_MODEL), 32)
		BUILD_JEXEC := 1
	endif
endif

ifeq ($(OPENJDK_TARGET_OS), linux)
	BUILD_JEXEC := 1
endif # OPENJDK_TARGET_OS

#
# jdk/make/java/jexec/Makefile
#
ifeq ($(BUILD_JEXEC), 1)

	ifeq ($(OPENJDK_TARGET_OS),windows)
	else ifeq ($(OPENJDK_TARGET_OS),macosx)
		BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/macosx/bin
	else
		BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/solaris/bin
	endif

	ifeq ($(OPENJDK_TARGET_OS), linux)
                BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib
		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,\
		OPTIMIZATION := LOW, \
		CFLAGS:=$(CFLAGS_JDKEXE)\
                        $(BUILD_JEXEC_INC), \
		LDFLAGS:=$(LDFLAGS_JDKEXE), \
		OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
		OUTPUT_DIR:=$(BUILD_JEXEC_DST_DIR),\
		PROGRAM:=jexec))

	BUILD_LAUNCHERS += $(BUILD_JEXEC)
endif

##########################################################################################

#
# The java-rmi.cgi script in bin/ only gets delivered in certain situations
#
JAVA_RMI_CGI:=$(JDK_OUTPUTDIR)/bin/java-rmi.cgi
ifeq ($(OPENJDK_TARGET_OS), linux)
  BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
endif
ifeq ($(OPENJDK_TARGET_OS), solaris)
  ifeq ($(ARCH_DATA_MODEL), 32)
    BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
  endif
endif

# TODO: 
# On windows java-rmi.cgi shouldn't be bundled since Java 1.2, but has been built all
# this time anyway. Since jdk6, it has been built from the wrong source and resulted
# in a copy of the standard java launcher named "java-rmi.exe" ending up in the final
# images bin dir. This weird behavior is mimicked here in the converted makefiles for
# now. Should probably just be deleted.
# http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
ifeq ($(OPENJDK_TARGET_OS_API),winapi)
    $(eval $(call SetupLauncher,java-rmi,\
        -DEXPAND_CLASSPATH_WILDCARDS,\
        $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(ARCH)),\
        ,,,,,$(JDK_OUTPUTDIR)/objs))

    $(JAVA_RMI_CGI): $(BUILD_LAUNCHER_java-rmi)
	$(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

##########################################################################################

$(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk

all: $(BUILD_LAUNCHERS)

.PHONY: all