1 #
   2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 defalt: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include NativeCompilation.gmk
  31 
  32 # Setup the java compilers for the JDK build.
  33 include Setup.gmk
  34 
  35 # Build tools
  36 include Tools.gmk
  37 
  38 BUILD_LAUNCHERS=
  39 
  40 # When building a legacy overlay image (on solaris 64 bit), the launchers 
  41 # need to be built with a different rpath and a different output dir.
  42 ifeq ($(OVERLAY_IMAGES),true)
  43     ORIGIN_ROOT:=/../..
  44     OUTPUT_SUBDIR:=$(OPENJDK_TARGET_CPU_ISADIR)
  45 else
  46     ORIGIN_ROOT:=/..
  47 endif
  48 
  49 ifeq ($(OPENJDK_TARGET_OS), macosx)
  50     ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN)
  51 else
  52     ORIGIN_ARG:=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli) \
  53                 $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli)
  54 endif
  55 
  56 #
  57 # Applications expect to be able to link against libjawt without invoking
  58 # System.loadLibrary("jawt") first. This was the behaviour described in the
  59 # devloper documentation of JAWT and what worked with OpenJDK6.
  60 #
  61 ifneq ($(findstring $(OPENJDK_TARGET_OS), linux solaris),)
  62     ORIGIN_ARG+=$(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/lib$(OPENJDK_TARGET_CPU_LIBDIR)) \
  63                 $(call SET_EXECUTABLE_ORIGIN,$(ORIGIN_ROOT)/jre/lib$(OPENJDK_TARGET_CPU_LIBDIR)) 
  64 endif
  65 
  66 define SetupLauncher
  67     # TODO: Fix mapfile on solaris. Won't work with ld as linker.
  68     # Parameter 1 is the name of the launcher (java,javac,jar...)
  69     # Parameter 2 is extra CFLAGS
  70     # Parameter 3 is extra LDFLAGS
  71     # Parameter 4 is extra LDFLAGS_SUFFIX_posix
  72     # Parameter 5 is extra LDFLAGS_SUFFIX_windows
  73     # Parameter 6 is optional Windows JLI library (full path)
  74     # Parameter 7 is optional Windows resource (RC) flags
  75     # Parameter 8 is optional Windows version resource file (.rc)
  76     # Parameter 9  is different output dir
  77     # Parameter 10 if set, link statically with c runtime on windows.
  78     # Parameter 11 if set, override plist file on macosx.
  79 
  80     $1_WINDOWS_JLI_LIB:=$(JDK_OUTPUTDIR)/objs/libjli/jli.lib
  81     ifneq ($6,)
  82         $1_WINDOWS_JLI_LIB:=$6
  83     endif
  84     $1_VERSION_INFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc
  85     ifneq ($8,)
  86         $1_VERSION_INFO_RESOURCE:=$8
  87     endif
  88 
  89     $1_LDFLAGS := $3
  90     $1_LDFLAGS_SUFFIX :=
  91     ifeq ($(OPENJDK_TARGET_OS), macosx)
  92         $1_PLIST_FILE:=Info-cmdline.plist
  93         ifneq ($(11),)
  94             $1_PLIST_FILE:=$(11)
  95         endif
  96 
  97         $1_LDFLAGS += -Wl,-all_load $(JDK_OUTPUTDIR)/objs/libjli_static.a \
  98                       -framework Cocoa -framework Security -framework ApplicationServices \
  99                       -sectcreate __TEXT __info_plist $(JDK_TOPDIR)/src/macosx/lib/$$($1_PLIST_FILE)
 100         $1_LDFLAGS_SUFFIX += -pthread
 101     endif
 102 
 103     ifeq ($(USE_EXTERNAL_LIBZ), true)
 104         $1_LDFLAGS_SUFFIX += -lz
 105     endif
 106 
 107     $1_OUTPUT_DIR_ARG:=$9
 108     ifeq (,$$($1_OUTPUT_DIR_ARG))
 109         $1_OUTPUT_DIR_ARG:=$(JDK_OUTPUTDIR)/bin
 110     endif
 111 
 112     # TODO: maybe it's better to move this if-statement out of this function
 113     ifeq ($1,java)
 114         $1_OPTIMIZATION_ARG:=HIGH
 115         $1_LDFLAGS_solaris:=-R$(OPENWIN_HOME)/lib$(OPENJDK_TARGET_CPU_ISADIR)
 116     else
 117         $1_OPTIMIZATION_ARG:=LOW
 118     endif
 119 
 120     $1_CFLAGS:=$(CFLAGS_JDKEXE)
 121     ifeq ($(10),true)
 122         $1_CFLAGS:=$(filter-out -MD,$(CFLAGS_JDKEXE))
 123     endif
 124 
 125     ifneq ($(wildcard $(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)),)
 126         $1_MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/launchers/mapfile-$(OPENJDK_TARGET_CPU)
 127     else
 128         $1_MAPFILE:=
 129     endif
 130 
 131     $(call SetupNativeCompilation,BUILD_LAUNCHER_$1,\
 132         SRC:=$(JDK_TOPDIR)/src/share/bin,\
 133         INCLUDE_FILES:=main.c,\
 134         LANG:=C,\
 135         OPTIMIZATION:=$$($1_OPTIMIZATION_ARG), \
 136         CFLAGS:=$$($1_CFLAGS) \
 137                 -I$(JDK_TOPDIR)/src/share/bin \
 138                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/bin \
 139                 -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS)/bin \
 140                 -DFULL_VERSION='"$(FULL_VERSION)"' \
 141                 -DJDK_MAJOR_VERSION='"$(JDK_MAJOR_VERSION)"' \
 142                 -DJDK_MINOR_VERSION='"$(JDK_MINOR_VERSION)"' \
 143                 -DLIBARCHNAME='"$(OPENJDK_TARGET_CPU_LEGACY)"' \
 144                 -DLAUNCHER_NAME='"$(LAUNCHER_NAME)"' \
 145                 -DPROGNAME='"$1"' $(DPACKAGEPATH) \
 146                 $2,\
 147         CFLAGS_linux:=-fPIC,\
 148         CFLAGS_solaris:=-KPIC -DHAVE_GETHRTIME,\
 149         LDFLAGS:=$(LDFLAGS_JDKEXE) \
 150                  $(ORIGIN_ARG) \
 151                  $$($1_LDFLAGS),\
 152         LDFLAGS_macosx:=$(call SET_SHARED_LIBRARY_NAME,$1),\
 153         LDFLAGS_linux:=-lpthread \
 154                        $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)),\
 155         LDFLAGS_solaris:=$$($1_LDFLAGS_solaris) \
 156                        $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)),\
 157         MAPFILE := $$($1_MAPFILE), \
 158         LDFLAGS_SUFFIX:=$(LDFLAGS_JDKEXE_SUFFIX) $$($1_LDFLAGS_SUFFIX),\
 159         LDFLAGS_SUFFIX_posix:=$4,\
 160         LDFLAGS_SUFFIX_windows:=$$($1_WINDOWS_JLI_LIB) \
 161                                $(JDK_OUTPUTDIR)/objs/libjava/java.lib advapi32.lib $5,\
 162         LDFLAGS_SUFFIX_linux:=-L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli $(LIBDL) -lc, \
 163         LDFLAGS_SUFFIX_solaris:=-L$(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)/jli -ljli -lthread $(LIBDL) -lc, \
 164         OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/$1_objs$(OUTPUT_SUBDIR),\
 165         OUTPUT_DIR:=$$($1_OUTPUT_DIR_ARG)$(OUTPUT_SUBDIR),\
 166         PROGRAM:=$1,\
 167         DEBUG_SYMBOLS:=true,\
 168         VERSIONINFO_RESOURCE:=$$($1_VERSION_INFO_RESOURCE),\
 169         RC_FLAGS:=$(RC_FLAGS)\
 170                   -D "JDK_FNAME=$1$(EXE_SUFFIX)" \
 171                   -D "JDK_INTERNAL_NAME=$1" \
 172                   -D "JDK_FTYPE=0x1L" \
 173                   $7,\
 174         MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/java.manifest)
 175 
 176     BUILD_LAUNCHERS += $$(BUILD_LAUNCHER_$1)
 177 
 178     ifeq ($(OPENJDK_TARGET_OS),macosx)
 179         $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjli_static.a
 180     endif
 181 
 182     ifeq ($(OPENJDK_TARGET_OS),windows)
 183         $$(BUILD_LAUNCHER_$1) : $(JDK_OUTPUTDIR)/objs/libjava/java.lib \
 184                                 $$($1_WINDOWS_JLI_LIB)
 185     endif        
 186 endef
 187 
 188 ##########################################################################################
 189 
 190 XLIBS:=$(X_LIBS) -lX11
 191 ifeq ($(OPENJDK_TARGET_OS),macosx)
 192     DPACKAGEPATH:=-DPACKAGE_PATH='"$(PACKAGE_PATH)"'
 193     XLIBS:=
 194 endif
 195 
 196 ifdef OPENJDK
 197     JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/windows/resource/icons"
 198 else
 199     JAVA_RC_FLAGS += -i "$(JDK_TOPDIR)/src/closed/windows/native/sun/windows"
 200 endif
 201 
 202 # On windows, the debuginfo files get the same name as for java.dll. Build
 203 # into another dir and copy selectively so debuginfo for java.dll isn't
 204 # overwritten.
 205 $(eval $(call SetupLauncher,java,\
 206     -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
 207     $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
 208     $(JDK_TOPDIR)/src/windows/resource/java.rc,$(JDK_OUTPUTDIR)/objs/java_objs,true))
 209 
 210 $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX): $(BUILD_LAUNCHER_java)
 211         $(MKDIR) -p $(@D)
 212         $(RM) $@
 213         $(CP) $(JDK_OUTPUTDIR)/objs/java_objs$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX) $@
 214 
 215 BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java$(EXE_SUFFIX)
 216 
 217 ifeq ($(OPENJDK_TARGET_OS),windows)
 218     $(eval $(call SetupLauncher,javaw,\
 219         -DJAVAW -DEXPAND_CLASSPATH_WILDCARDS,,,user32.lib comctl32.lib,\
 220         $(JDK_OUTPUTDIR)/objs/jli_static.lib,$(JAVA_RC_FLAGS),\
 221         $(JDK_TOPDIR)/src/windows/resource/java.rc,,true))
 222 endif
 223 
 224 
 225 ifndef BUILD_HEADLESS_ONLY
 226 $(eval $(call SetupLauncher,appletviewer,\
 227     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.applet.Main"$(COMMA) }',,\
 228     $(XLIBS)))
 229 endif
 230 
 231 $(eval $(call SetupLauncher,extcheck,\
 232     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.extcheck.Main"$(COMMA) }'))
 233 
 234 $(eval $(call SetupLauncher,idlj,\
 235     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.corba.se.idl.toJavaPortable.Compile"$(COMMA) }'))
 236 
 237 $(eval $(call SetupLauncher,jar,\
 238     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jar.Main"$(COMMA) }'))
 239 
 240 $(eval $(call SetupLauncher,jarsigner,\
 241     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
 242 
 243 $(eval $(call SetupLauncher,javac,\
 244     -DEXPAND_CLASSPATH_WILDCARDS \
 245     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
 246     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javac.Main"$(COMMA) }'))
 247 
 248 ifeq ($(ENABLE_SJAVAC),yes)
 249 $(eval $(call SetupLauncher,sjavac,\
 250     -DEXPAND_CLASSPATH_WILDCARDS \
 251     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
 252     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.sjavac.Main"$(COMMA) }'))
 253 endif
 254 
 255 $(eval $(call SetupLauncher,javadoc,\
 256     -DEXPAND_CLASSPATH_WILDCARDS \
 257     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
 258     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javadoc.Main"$(COMMA) }'))
 259 
 260 $(eval $(call SetupLauncher,javah,\
 261     -DEXPAND_CLASSPATH_WILDCARDS \
 262     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
 263     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javah.Main"$(COMMA) }'))
 264 
 265 $(eval $(call SetupLauncher,javap,\
 266     -DEXPAND_CLASSPATH_WILDCARDS \
 267     -DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
 268     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.javap.Main"$(COMMA) }'))
 269 
 270 BUILD_LAUNCHER_jconsole_CFLAGS_windows:=-DJAVAW
 271 BUILD_LAUNCHER_jconsole_LDFLAGS_windows:=user32.lib
 272 
 273 $(eval $(call SetupLauncher,jconsole,\
 274     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "-J-Djconsole.showOutputViewer"$(COMMA) "sun.tools.jconsole.JConsole"$(COMMA) }' \
 275     -DAPP_CLASSPATH='{ "/lib/jconsole.jar"$(COMMA) "/lib/tools.jar"$(COMMA) "/classes" }'))
 276 
 277 $(eval $(call SetupLauncher,jdb,\
 278     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.example.debug.tty.TTY"$(COMMA) }' \
 279     -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }'))
 280 
 281 $(eval $(call SetupLauncher,jhat,\
 282     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.hat.Main"$(COMMA) }'))
 283 
 284 $(eval $(call SetupLauncher,jinfo,\
 285     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
 286                    "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
 287                    "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
 288                    "sun.tools.jinfo.JInfo"$(COMMA) }' \
 289     -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
 290     ,,,,,,,,,Info-privileged.plist))
 291 
 292 $(eval $(call SetupLauncher,jmap,\
 293     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
 294                    "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
 295                    "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
 296                    "sun.tools.jmap.JMap"$(COMMA) }' \
 297     -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
 298     ,,,,,,,,,Info-privileged.plist))
 299 
 300 $(eval $(call SetupLauncher,jps,\
 301     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jps.Jps"$(COMMA) }'))
 302 
 303 $(eval $(call SetupLauncher,jrunscript,\
 304     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.script.shell.Main"$(COMMA) }'))
 305 
 306 $(eval $(call SetupLauncher,jsadebugd,\
 307     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.jvm.hotspot.jdi.SADebugServer"$(COMMA) }' \
 308     -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
 309     ,,,,,,,,,Info-privileged.plist))
 310 
 311 $(eval $(call SetupLauncher,jstack,\
 312     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) \
 313                    "-J-Dsun.jvm.hotspot.debugger.useProcDebugger"$(COMMA) \
 314                    "-J-Dsun.jvm.hotspot.debugger.useWindbgDebugger"$(COMMA) \
 315                    "sun.tools.jstack.JStack"$(COMMA) }' \
 316     -DAPP_CLASSPATH='{ "/lib/tools.jar"$(COMMA) "/lib/sa-jdi.jar"$(COMMA) "/classes" }' \
 317     ,,,,,,,,,Info-privileged.plist))
 318 
 319 $(eval $(call SetupLauncher,jstat,\
 320     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstat.Jstat"$(COMMA) }'))
 321 
 322 $(eval $(call SetupLauncher,jstatd,\
 323     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.jstatd.Jstatd"$(COMMA) }'))
 324 
 325 $(eval $(call SetupLauncher,keytool,\
 326     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.keytool.Main"$(COMMA) }'))
 327 
 328 $(eval $(call SetupLauncher,native2ascii,\
 329     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.native2ascii.Main"$(COMMA) }'))
 330 
 331 ifndef BUILD_HEADLESS_ONLY
 332 $(eval $(call SetupLauncher,policytool,\
 333     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',,\
 334     $(XLIBS)))
 335 endif
 336 
 337 $(eval $(call SetupLauncher,rmic,\
 338     -DEXPAND_CLASSPATH_WILDCARDS \
 339     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.rmi.rmic.Main"$(COMMA) }'))
 340 
 341 $(eval $(call SetupLauncher,schemagen,\
 342     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.jxc.SchemaGenerator"$(COMMA) }'))
 343 
 344 $(eval $(call SetupLauncher,serialver,\
 345     -DEXPAND_CLASSPATH_WILDCARDS \
 346     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.tools.serialver.SerialVer"$(COMMA) }'))
 347 
 348 $(eval $(call SetupLauncher,xjc,\
 349     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.xjc.Driver"$(COMMA) }'))
 350 
 351 $(eval $(call SetupLauncher,wsgen,\
 352     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsGen"$(COMMA) }'))
 353 
 354 $(eval $(call SetupLauncher,wsimport,\
 355     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.tools.internal.ws.WsImport"$(COMMA) }'))
 356 
 357 $(eval $(call SetupLauncher,orbd,\
 358     -DJAVA_ARGS='{      "-J-ms8m"$(COMMA) \
 359                         "-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
 360                         "-J-Dcom.sun.CORBA.activation.Port=1049"$(COMMA) \
 361                         "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
 362                         "com.sun.corba.se.impl.activation.ORBD"$(COMMA) }'))
 363 
 364 $(eval $(call SetupLauncher,servertool,\
 365     -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.corba.se.impl.activation.ServerTool"$(COMMA) }'))
 366 
 367 $(eval $(call SetupLauncher,tnameserv,\
 368     -DJAVA_ARGS='{      "-J-ms8m"$(COMMA) \
 369                         "-J-Dcom.sun.CORBA.activation.DbDir=./orb.db"$(COMMA) \
 370                         "-J-Djava.util.logging.LoggingPermission=contol"$(COMMA) \
 371                         "-J-Dcom.sun.CORBA.POA.ORBServerId=1"$(COMMA) \
 372                         "com.sun.corba.se.impl.naming.cosnaming.TransientNameServer"$(COMMA) }'))
 373 
 374 $(eval $(call SetupLauncher,pack200,\
 375     -DJAVA_ARGS='{      "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) "--pack" }'))
 376 
 377 $(eval $(call SetupLauncher,rmid,\
 378     -DJAVA_ARGS='{      "-J-ms8m"$(COMMA) "sun.rmi.server.Activation"$(COMMA) }'))
 379 
 380 $(eval $(call SetupLauncher,rmiregistry,\
 381     -DJAVA_ARGS='{      "-J-ms8m"$(COMMA) "sun.rmi.registry.RegistryImpl"$(COMMA) }'))
 382 
 383 $(eval $(call SetupLauncher,jcmd,\
 384     -DJAVA_ARGS='{      "-J-ms8m"$(COMMA) "sun.tools.jcmd.JCmd"$(COMMA) }'))
 385 
 386 ifeq ($(OPENJDK_TARGET_OS),windows)
 387     $(eval $(call SetupLauncher,kinit,\
 388         -DJAVA_ARGS='{  "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Kinit"$(COMMA) }'))
 389 
 390     $(eval $(call SetupLauncher,klist,\
 391         -DJAVA_ARGS='{  "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Klist"$(COMMA) }'))
 392 
 393     $(eval $(call SetupLauncher,ktab,\
 394         -DJAVA_ARGS='{  "-J-ms8m"$(COMMA) "sun.security.krb5.internal.tools.Ktab"$(COMMA) }'))
 395 endif
 396 
 397 ##########################################################################################
 398 # The order of the object files on the link command line affects the size of the resulting
 399 # binary (at least on linux) which causes the size to differ between old and new build.
 400 ifeq ($(USE_EXTERNAL_LIBZ), true)
 401 UNPACKEXE_CFLAGS := -DSYSTEM_ZLIB
 402 UNPACKEXE_ZIPOBJS := -lz
 403 else
 404 UNPACKEXE_CFLAGS := -I$(JDK_TOPDIR)/src/share/native/java/util/zip/zlib-1.2.5
 405 UNPACKEXE_ZIPOBJS :=    $(JDK_OUTPUTDIR)/objs/libzip/zcrc32$(OBJ_SUFFIX) \
 406                         $(JDK_OUTPUTDIR)/objs/libzip/deflate$(OBJ_SUFFIX) \
 407                         $(JDK_OUTPUTDIR)/objs/libzip/trees$(OBJ_SUFFIX) \
 408                         $(JDK_OUTPUTDIR)/objs/libzip/zadler32$(OBJ_SUFFIX) \
 409                         $(JDK_OUTPUTDIR)/objs/libzip/compress$(OBJ_SUFFIX) \
 410                         $(JDK_OUTPUTDIR)/objs/libzip/zutil$(OBJ_SUFFIX) \
 411                         $(JDK_OUTPUTDIR)/objs/libzip/inflate$(OBJ_SUFFIX) \
 412                         $(JDK_OUTPUTDIR)/objs/libzip/infback$(OBJ_SUFFIX) \
 413                         $(JDK_OUTPUTDIR)/objs/libzip/inftrees$(OBJ_SUFFIX) \
 414                         $(JDK_OUTPUTDIR)/objs/libzip/inffast$(OBJ_SUFFIX)
 415 
 416 endif
 417 
 418 ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
 419     UNPACKEXE_CFLAGS += -xregs=no%appl
 420     UNPACKEXE_LDFLAGS_solaris += -xmemalign=4s
 421 endif
 422 
 423 UNPACKEXE_LANG:=C
 424 ifeq ($(OPENJDK_TARGET_OS),solaris)
 425     UNPACKEXE_LANG:=C++
 426 endif
 427 # On windows, unpack200 is linked completely differently to all other
 428 # executables, using the compiler with the compiler arguments.
 429 # It's also linked incrementally, producing a .ilk file that needs to 
 430 # be kept away.
 431 ifeq ($(OPENJDK_TARGET_OS),windows)
 432     BUILD_UNPACKEXE_LDEXE:=$(CC)
 433     EXE_OUT_OPTION_save:=$(EXE_OUT_OPTION)
 434     EXE_OUT_OPTION:=-Fe
 435 endif
 436 $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE,\
 437                 SRC:=$(JDK_TOPDIR)/src/share/native/com/sun/java/util/jar/pack,\
 438                 EXCLUDE_FILES:=jni.cpp,\
 439                 LANG:=$(UNPACKEXE_LANG),\
 440                 OPTIMIZATION:=LOW, \
 441                 CFLAGS:=$(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE)\
 442                         -DFULL, \
 443                 CFLAGS_release:=-DPRODUCT,\
 444                 CFLAGS_linux:=-fPIC,\
 445                 CFLAGS_solaris:=-KPIC, \
 446                 CFLAGS_macosx:=-fPIC, \
 447                 MAPFILE:=$(JDK_TOPDIR)/makefiles/mapfiles/libunpack/mapfile-vers-unpack200,\
 448                 LDFLAGS:=$(UNPACKEXE_ZIPOBJS),\
 449                 LDFLAGS_windows:=$(CXXFLAGS_JDKEXE),\
 450                 LDFLAGS_posix:=$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
 451                          $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
 452                          $(call SET_SHARED_LIBRARY_ORIGIN),\
 453                 LDFLAGS_linux:=-lc,\
 454                 LDFLAGS_solaris:=$(UNPACKEXE_LDFLAGS_solaris) -lc,\
 455                 LDFLAGS_SUFFIX:=$(LIBCXX),\
 456                 OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
 457                 OUTPUT_DIR:=$(JDK_OUTPUTDIR)/objs/unpackexe$(OUTPUT_SUBDIR),\
 458                 PROGRAM:=unpack200,\
 459                 VERSIONINFO_RESOURCE:=$(JDK_TOPDIR)/src/windows/resource/version.rc,\
 460                 RC_FLAGS:=$(RC_FLAGS)\
 461                           -D "JDK_FNAME=unpack200.exe" \
 462                           -D "JDK_INTERNAL_NAME=unpack200" \
 463                           -D "JDK_FTYPE=0x1L",\
 464                 MANIFEST:=$(JDK_TOPDIR)/src/windows/resource/unpack200_proto.exe.manifest))
 465 
 466 ifeq ($(OPENJDK_TARGET_OS),windows)
 467     EXE_OUT_OPTION:=$(EXE_OUT_OPTION_save)
 468 endif
 469 
 470 ifneq ($(USE_EXTERNAL_LIBZ), true)
 471 
 472 $(BUILD_UNPACKEXE) : $(UNPACKEXE_ZIPOBJS)
 473 
 474 endif
 475 
 476 # Build into object dir and copy executable afterwards to avoid .ilk file in
 477 # image. The real fix would be clean up linking of unpack200 using 
 478 # -link -incremental:no
 479 # like all other launchers.
 480 $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
 481         $(MKDIR) -p $(@D)
 482         $(CP) '$<' '$@'
 483 
 484 BUILD_LAUNCHERS += $(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/unpack200$(EXE_SUFFIX)
 485 
 486 ##########################################################################################
 487 
 488 
 489 BUILD_JEXEC := 
 490 BUILD_JEXEC_SRC :=
 491 BUILD_JEXEC_INC :=
 492 BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
 493 
 494 #
 495 # UNHANDLED:
 496 # - COMPILE_APPROACH = normal
 497 #
 498 
 499 #
 500 # jdk/make/java/Makefile
 501 #
 502 ifeq ($(OPENJDK_TARGET_OS), solaris)
 503     ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
 504         BUILD_JEXEC := 1
 505     endif
 506 endif
 507 
 508 ifeq ($(OPENJDK_TARGET_OS), linux)
 509     BUILD_JEXEC := 1
 510 endif # OPENJDK_TARGET_OS
 511 
 512 #
 513 # jdk/make/java/jexec/Makefile
 514 #
 515 ifeq ($(BUILD_JEXEC), 1)
 516 
 517     ifeq ($(OPENJDK_TARGET_OS),windows)
 518     else ifeq ($(OPENJDK_TARGET_OS),macosx)
 519         BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/macosx/bin
 520     else
 521         BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/solaris/bin
 522     endif
 523 
 524     ifeq ($(OPENJDK_TARGET_OS), linux)
 525                 BUILD_JEXEC_DST_DIR := $(JDK_OUTPUTDIR)/lib
 526         BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/share/bin
 527     endif
 528 endif
 529 
 530 #
 531 # Note that the two Makefile's seems to contradict each other,
 532 #   and that src/macosx/bin/jexec.c seems unused
 533 #
 534 ifneq ($(BUILD_JEXEC_SRC),)
 535         $(eval $(call SetupNativeCompilation,BUILD_JEXEC,\
 536         SRC:=$(BUILD_JEXEC_SRC),\
 537         INCLUDE_FILES:=jexec.c,\
 538         LANG:=C,\
 539         OPTIMIZATION := LOW, \
 540         CFLAGS:=$(CFLAGS_JDKEXE)\
 541                         $(BUILD_JEXEC_INC), \
 542         CFLAGS_linux:=-fPIC,\
 543         CFLAGS_solaris:=-KPIC,\
 544         LDFLAGS:=$(LDFLAGS_JDKEXE) \
 545              $(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
 546         OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jexec_obj,\
 547         OUTPUT_DIR:=$(BUILD_JEXEC_DST_DIR),\
 548         PROGRAM:=jexec))
 549 
 550     BUILD_LAUNCHERS += $(BUILD_JEXEC)
 551 endif
 552 
 553 ##########################################################################################
 554 
 555 #
 556 # The java-rmi.cgi script in bin/ only gets delivered in certain situations
 557 #
 558 JAVA_RMI_CGI:=$(JDK_OUTPUTDIR)/bin$(OUTPUT_SUBDIR)/java-rmi.cgi
 559 ifeq ($(OPENJDK_TARGET_OS), linux)
 560   BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
 561 endif
 562 ifeq ($(OPENJDK_TARGET_OS), solaris)
 563   ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
 564     BUILD_LAUNCHERS += $(JAVA_RMI_CGI)
 565   endif
 566 endif
 567 
 568 # TODO: 
 569 # On windows java-rmi.cgi shouldn't be bundled since Java 1.2, but has been built all
 570 # this time anyway. Since jdk6, it has been built from the wrong source and resulted
 571 # in a (almost) copy of the standard java launcher named "java-rmi.exe" ending up in 
 572 # the final images bin dir. This weird behavior is mimicked here in the converted 
 573 # makefiles for now. Should probably just be deleted.
 574 # http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6512052
 575 ifeq ($(OPENJDK_TARGET_OS),windows)
 576     $(eval $(call SetupLauncher,java-rmi,,\
 577         $(call SET_SHARED_LIBRARY_MAPFILE,$(JDK_TOPDIR)/makefiles/java/main/java/mapfile-$(OPENJDK_TARGET_CPU))))
 578 else
 579     $(JAVA_RMI_CGI): $(JDK_TOPDIR)/src/solaris/bin/java-rmi.cgi.sh
 580         $(MKDIR) -p $(@D)
 581         $(CP) $< $@
 582         $(CHMOD) a+x $@
 583 endif
 584 
 585 ##########################################################################################
 586 
 587 BUILD_JSPAWNHELPER := 
 588 BUILD_JSPAWNHELPER_SRC := $(JDK_TOPDIR)/src/solaris/native/java/lang
 589 BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib$(OPENJDK_TARGET_CPU_LIBDIR)
 590 LINK_JSPAWNHELPER_OBJECTS := $(JDK_OUTPUTDIR)/objs/libjava/childproc.o
 591 LINK_JSPAWNHELPER_FLAGS :=
 592 
 593 #
 594 # jdk/make/java/java/Makefile
 595 #
 596 ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris),)
 597     BUILD_JSPAWNHELPER := 1
 598 endif
 599 
 600 ifeq ($(OPENJDK_TARGET_OS), macosx)
 601     BUILD_JSPAWNHELPER := 1
 602     BUILD_JSPAWNHELPER_DST_DIR := $(JDK_OUTPUTDIR)/lib
 603 endif
 604 
 605 ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
 606     LINK_JSPAWNHELPER_FLAGS += -m64
 607 endif
 608 
 609 ifeq ($(BUILD_JSPAWNHELPER), 1)
 610         $(eval $(call SetupNativeCompilation,BUILD_JSPAWNHELPER,\
 611         SRC:=$(BUILD_JSPAWNHELPER_SRC),\
 612         INCLUDE_FILES:=jspawnhelper.c,\
 613         LANG:=C,\
 614         OPTIMIZATION := LOW, \
 615         CFLAGS:=$(CFLAGS_JDKEXE), \
 616         LDFLAGS:=$(LDFLAGS_JDKEXE) $(LINK_JSPAWNHELPER_FLAGS), \
 617         LDFLAGS_SUFFIX:= $(LINK_JSPAWNHELPER_OBJECTS), \
 618         OBJECT_DIR:=$(JDK_OUTPUTDIR)/objs/jspawnhelper,\
 619         OUTPUT_DIR:=$(BUILD_JSPAWNHELPER_DST_DIR),\
 620         PROGRAM:=jspawnhelper))
 621 
 622     BUILD_LAUNCHERS += $(BUILD_JSPAWNHELPER)
 623 endif
 624 
 625 ##########################################################################################
 626 
 627 $(BUILD_LAUNCHERS) : $(JDK_TOPDIR)/makefiles/CompileLaunchers.gmk
 628 
 629 all: $(BUILD_LAUNCHERS)
 630 
 631 .PHONY: all
--- EOF ---