BSD port initial load
authormr
Wed Aug 20 10:30:27 2008 -0700 (17 months ago)
changeset 243be94a5de4d32
parent 2425cce2302cc1e
child 2442ebedfae3e0a
BSD port initial load
Contributed-by: Greg Lewis <glewis@eyesbeyond.com>,
Kurt Miller <kurt@intricatesoftware.com>,
Landon Fuller <landonf@bikemonkey.org>,
Jung-uk Kim <jkim@freebsd.org>,
Christos Zoulas <christos@zoulas.com>,
FreeBSD Foundation <board@freebsdfoundation.org>
make/Makefile
make/bsd/Makefile
make/bsd/README
make/bsd/adlc_updater
make/bsd/build.sh
make/bsd/makefiles/adjust-mflags.sh
make/bsd/makefiles/adlc.make
make/bsd/makefiles/amd64.make
make/bsd/makefiles/buildtree.make
make/bsd/makefiles/compiler1.make
make/bsd/makefiles/compiler2.make
make/bsd/makefiles/core.make
make/bsd/makefiles/cscope.make
make/bsd/makefiles/debug.make
make/bsd/makefiles/defs.make
make/bsd/makefiles/dtrace.make
make/bsd/makefiles/fastdebug.make
make/bsd/makefiles/gcc.make
make/bsd/makefiles/hp.make
make/bsd/makefiles/hp1.make
make/bsd/makefiles/i486.make
make/bsd/makefiles/ia64.make
make/bsd/makefiles/jsig.make
make/bsd/makefiles/jvmg.make
make/bsd/makefiles/jvmti.make
make/bsd/makefiles/launcher.make
make/bsd/makefiles/makedeps.make
make/bsd/makefiles/mapfile-vers-debug
make/bsd/makefiles/mapfile-vers-jsig
make/bsd/makefiles/mapfile-vers-product
make/bsd/makefiles/optimized.make
make/bsd/makefiles/product.make
make/bsd/makefiles/profiled.make
make/bsd/makefiles/rules.make
make/bsd/makefiles/sa.make
make/bsd/makefiles/saproc.make
make/bsd/makefiles/sparc.make
make/bsd/makefiles/sparcWorks.make
make/bsd/makefiles/sparcv9.make
make/bsd/makefiles/tiered.make
make/bsd/makefiles/top.make
make/bsd/makefiles/vm.make
make/bsd/platform_amd64
make/bsd/platform_amd64.suncc
make/bsd/platform_i486
make/bsd/platform_i486.suncc
make/bsd/platform_ia64
make/bsd/platform_sparc
make/bsd/platform_sparcv9
make/defs.make
src/cpu/x86/vm/jni_x86.h
src/os/bsd/launcher/java.c
src/os/bsd/launcher/java.h
src/os/bsd/launcher/java_md.c
src/os/bsd/launcher/java_md.h
src/os/bsd/vm/attachListener_bsd.cpp
src/os/bsd/vm/c1_globals_bsd.hpp
src/os/bsd/vm/c2_globals_bsd.hpp
src/os/bsd/vm/chaitin_bsd.cpp
src/os/bsd/vm/dtraceJSDT_bsd.cpp
src/os/bsd/vm/globals_bsd.hpp
src/os/bsd/vm/hpi_bsd.cpp
src/os/bsd/vm/hpi_bsd.hpp
src/os/bsd/vm/interfaceSupport_bsd.hpp
src/os/bsd/vm/jsig.c
src/os/bsd/vm/jvm_bsd.cpp
src/os/bsd/vm/jvm_bsd.h
src/os/bsd/vm/mutex_bsd.cpp
src/os/bsd/vm/mutex_bsd.inline.hpp
src/os/bsd/vm/objectMonitor_bsd.cpp
src/os/bsd/vm/objectMonitor_bsd.hpp
src/os/bsd/vm/objectMonitor_bsd.inline.hpp
src/os/bsd/vm/osThread_bsd.cpp
src/os/bsd/vm/osThread_bsd.hpp
src/os/bsd/vm/os_bsd.cpp
src/os/bsd/vm/os_bsd.hpp
src/os/bsd/vm/os_bsd.inline.hpp
src/os/bsd/vm/os_share_bsd.hpp
src/os/bsd/vm/perfMemory_bsd.cpp
src/os/bsd/vm/stubRoutines_bsd.cpp
src/os/bsd/vm/threadCritical_bsd.cpp
src/os/bsd/vm/thread_bsd.inline.hpp
src/os/bsd/vm/vmError_bsd.cpp
src/os/bsd/vm/vtune_bsd.cpp
src/os_cpu/bsd_x86/vm/assembler_bsd_x86_32.cpp
src/os_cpu/bsd_x86/vm/assembler_bsd_x86_64.cpp
src/os_cpu/bsd_x86/vm/atomic_bsd_x86.inline.hpp
src/os_cpu/bsd_x86/vm/bsd_x86_32.ad
src/os_cpu/bsd_x86/vm/bsd_x86_32.s
src/os_cpu/bsd_x86/vm/bsd_x86_64.ad
src/os_cpu/bsd_x86/vm/bsd_x86_64.s
src/os_cpu/bsd_x86/vm/bytes_bsd_x86.inline.hpp
src/os_cpu/bsd_x86/vm/copy_bsd_x86.inline.hpp
src/os_cpu/bsd_x86/vm/globals_bsd_x86.hpp
src/os_cpu/bsd_x86/vm/orderAccess_bsd_x86.inline.hpp
src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
src/os_cpu/bsd_x86/vm/os_bsd_x86.hpp
src/os_cpu/bsd_x86/vm/prefetch_bsd_x86.inline.hpp
src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.cpp
src/os_cpu/bsd_x86/vm/threadLS_bsd_x86.hpp
src/os_cpu/bsd_x86/vm/thread_bsd_x86.cpp
src/os_cpu/bsd_x86/vm/thread_bsd_x86.hpp
src/os_cpu/bsd_x86/vm/vmStructs_bsd_x86.hpp
src/os_cpu/bsd_x86/vm/vm_version_bsd_x86.cpp
src/share/vm/adlc/adlc.hpp
src/share/vm/includeDB_compiler2
src/share/vm/includeDB_core
src/share/vm/interpreter/bytecodeTracer.cpp
src/share/vm/prims/forte.cpp
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/os.cpp
src/share/vm/runtime/vm_version.cpp
src/share/vm/utilities/globalDefinitions_gcc.hpp
src/share/vm/utilities/macros.hpp
src/share/vm/utilities/ostream.cpp
src/share/vm/utilities/vmError.cpp
--- a/make/Makefile Wed Aug 20 10:18:41 2008 -0700
+++ b/make/Makefile Wed Aug 20 10:30:27 2008 -0700
@@ -265,6 +265,19 @@ endif
# Shared Library
ifneq ($(OSNAME),windows)
+ifeq ($(OSNAME),bsd)
+# BSD-specific LIBRARY_SUFFIX build option
+$(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+$(EXPORT_CLIENT_DIR)/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+$(EXPORT_CLIENT_DIR)/64/%.$(LIBRARY_SUFFIX): $(C1_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+$(EXPORT_SERVER_DIR)/64/%.$(LIBRARY_SUFFIX): $(C2_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+else
$(EXPORT_JRE_LIB_ARCH_DIR)/%.so: $(C2_DIR)/%.so
$(install-file)
$(EXPORT_CLIENT_DIR)/%.so: $(C1_DIR)/%.so
@@ -275,6 +288,7 @@ ifneq ($(OSNAME),windows)
$(install-file)
$(EXPORT_SERVER_DIR)/64/%.so: $(C2_DIR)/%.so
$(install-file)
+endif
endif
# Jar file (sa-jdi.jar)
--- a/make/defs.make Wed Aug 20 10:18:41 2008 -0700
+++ b/make/defs.make Wed Aug 20 10:30:27 2008 -0700
@@ -119,13 +119,23 @@ endif
# Windows should have OS predefined
ifeq ($(OS),)
OS := $(shell uname -s)
+ ifneq ($(findstring BSD,$(OS)),)
+ OS=bsd
+ endif
+ ifeq ($(OS), Darwin)
+ OS=bsd
+ endif
HOST := $(shell uname -n)
endif
-# If not SunOS and not Linux, assume Windows
+# If not SunOS, not Linux and not BSD, assume Windows
ifneq ($(OS), Linux)
ifneq ($(OS), SunOS)
- OSNAME=windows
+ ifneq ($(OS), bsd)
+ OSNAME=windows
+ else
+ OSNAME=bsd
+ endif
else
OSNAME=solaris
endif
--- a/src/cpu/x86/vm/jni_x86.h Wed Aug 20 10:18:41 2008 -0700
+++ b/src/cpu/x86/vm/jni_x86.h Wed Aug 20 10:30:27 2008 -0700
@@ -26,7 +26,7 @@
#ifndef _JAVASOFT_JNI_MD_H_
#define _JAVASOFT_JNI_MD_H_
-#if defined(SOLARIS) || defined(LINUX)
+#if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE)
#define JNIEXPORT
#define JNIIMPORT
#define JNICALL
--- a/src/share/vm/adlc/adlc.hpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/adlc/adlc.hpp Wed Aug 20 10:30:27 2008 -0700
@@ -69,9 +69,9 @@ typedef unsigned int uintptr_t;
#endif
#endif // _WIN32
-#ifdef LINUX
+#if defined(LINUX) || defined(_ALLBSD_SOURCE)
#include <inttypes.h>
-#endif // LINUX
+#endif // LINUX || _ALLBSD_SOURCE
// Macros
#define uint32 unsigned int
--- a/src/share/vm/includeDB_compiler2 Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/includeDB_compiler2 Wed Aug 20 10:30:27 2008 -0700
@@ -140,6 +140,7 @@ c2_globals_<os_family>.hpp
c2_globals_<os_family>.hpp macros.hpp
c2_init_<arch>.cpp compile.hpp
+c2_init_<arch>.cpp node.hpp
c2compiler.cpp ad_<arch_model>.hpp
c2compiler.cpp c2compiler.hpp
@@ -161,6 +162,7 @@ callGenerator.hpp
callGenerator.hpp callnode.hpp
callGenerator.hpp compile.hpp
callGenerator.hpp deoptimization.hpp
+callGenerator.hpp node.hpp
callGenerator.hpp type.hpp
callnode.cpp callnode.hpp
@@ -477,6 +479,7 @@ graphKit.hpp
graphKit.hpp ciEnv.hpp
graphKit.hpp compile.hpp
graphKit.hpp deoptimization.hpp
+graphKit.hpp node.hpp
graphKit.hpp phaseX.hpp
graphKit.hpp type.hpp
@@ -521,6 +524,7 @@ indexSet.cpp
indexSet.hpp allocation.hpp
indexSet.hpp compile.hpp
+indexSet.hpp node.hpp
indexSet.hpp regmask.hpp
indexSet.hpp resourceArea.hpp
@@ -833,6 +837,7 @@ phase.cpp
phase.cpp compile.hpp
phase.cpp compileBroker.hpp
phase.cpp nmethod.hpp
+phase.cpp node.hpp
phase.cpp phase.hpp
phase.hpp port.hpp
--- a/src/share/vm/includeDB_core Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/includeDB_core Wed Aug 20 10:30:27 2008 -0700
@@ -469,7 +469,7 @@ cardTableModRefBS.cpp
cardTableModRefBS.cpp java.hpp
cardTableModRefBS.cpp mutexLocker.hpp
cardTableModRefBS.cpp sharedHeap.hpp
-cardTableModRefBS.cpp space.hpp
+cardTableModRefBS.cpp space.inline.hpp
cardTableModRefBS.cpp universe.hpp
cardTableModRefBS.cpp virtualspace.hpp
@@ -1803,7 +1803,7 @@ generation.hpp
generation.inline.hpp genCollectedHeap.hpp
generation.inline.hpp generation.hpp
-generation.inline.hpp space.hpp
+generation.inline.hpp space.inline.hpp
generationSpec.cpp compactPermGen.hpp
generationSpec.cpp defNewGeneration.hpp
@@ -2518,6 +2518,7 @@ klass.hpp
klass.inline.hpp klass.hpp
klass.inline.hpp markOop.hpp
+klass.inline.hpp markOop.inline.hpp
klassKlass.cpp collectedHeap.hpp
klassKlass.cpp collectedHeap.inline.hpp
@@ -3731,6 +3732,7 @@ space.hpp
space.hpp cardTableModRefBS.hpp
space.hpp iterator.hpp
space.hpp markOop.hpp
+space.hpp markOop.inline.hpp
space.hpp memRegion.hpp
space.hpp mutexLocker.hpp
space.hpp os_<os_family>.inline.hpp
@@ -3933,6 +3935,7 @@ synchronizer.cpp
synchronizer.hpp handles.hpp
synchronizer.hpp markOop.hpp
+synchronizer.hpp markOop.inline.hpp
synchronizer.hpp perfData.hpp
synchronizer.hpp top.hpp
--- a/src/share/vm/interpreter/bytecodeTracer.cpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/interpreter/bytecodeTracer.cpp Wed Aug 20 10:30:27 2008 -0700
@@ -74,7 +74,7 @@ class BytecodePrinter: public BytecodeCl
// the incoming method. We could lose a line of trace output.
// This is acceptable in a debug-only feature.
st->cr();
- st->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
+ st->print("[%ld] ", (long) Thread::current()->osthread()->thread_id());
method->print_name(st);
st->cr();
_current_method = method();
@@ -87,7 +87,7 @@ class BytecodePrinter: public BytecodeCl
code = Bytecodes::code_at(bcp);
}
int bci = bcp - method->code_base();
- st->print("[%d] ", (int) Thread::current()->osthread()->thread_id());
+ st->print("[%ld] ", (long) Thread::current()->osthread()->thread_id());
if (Verbose) {
st->print("%8d %4d " INTPTR_FORMAT " " INTPTR_FORMAT " %s",
BytecodeCounter::counter_value(), bci, tos, tos2, Bytecodes::name(code));
--- a/src/share/vm/prims/forte.cpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/prims/forte.cpp Wed Aug 20 10:30:27 2008 -0700
@@ -626,6 +626,11 @@ void AsyncGetCallTrace(ASGCT_CallTrace *
// Method to let libcollector know about a dynamically loaded function.
// Because it is weakly bound, the calls become NOP's when the library
// isn't present.
+#ifdef __APPLE__
+// XXXDARWIN: Link errors occur even when __attribute__((weak_import))
+// is added
+#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) (0)
+#else
void collector_func_load(char* name,
void* null_argument_1,
void* null_argument_2,
@@ -636,6 +641,7 @@ void collector_func_load(char* name,
#pragma weak collector_func_load
#define collector_func_load(x0,x1,x2,x3,x4,x5,x6) \
( collector_func_load ? collector_func_load(x0,x1,x2,x3,x4,x5,x6),0 : 0 )
+#endif // __APPLE__
#endif // !_WINDOWS
} // end extern "C"
--- a/src/share/vm/runtime/globals.hpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/runtime/globals.hpp Wed Aug 20 10:30:27 2008 -0700
@@ -297,7 +297,7 @@ class CommandLineFlags {
/* UseMembar is theoretically a temp flag used for memory barrier \
* removal testing. It was supposed to be removed before FCS but has \
* been re-added (see 6401008) */ \
- product(bool, UseMembar, false, \
+ product(bool, UseMembar, true, \
"(Unstable) Issues membars on thread state transitions") \
\
product(bool, PrintCommandLineFlags, false, \
--- a/src/share/vm/runtime/os.cpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/runtime/os.cpp Wed Aug 20 10:30:27 2008 -0700
@@ -81,7 +81,11 @@ char* os::iso8601_time(char* buffer, siz
}
// Save the results of localtime
const struct tm time_struct = *time_struct_temp;
+#if defined(_ALLBSD_SOURCE)
+ const time_t zone = (time_t) time_struct_temp->tm_gmtoff;
+#else
const time_t zone = timezone;
+#endif
// If daylight savings time is in effect,
// we are 1 hour East of our time zone
--- a/src/share/vm/runtime/vm_version.cpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/runtime/vm_version.cpp Wed Aug 20 10:30:27 2008 -0700
@@ -140,7 +140,8 @@ const char* Abstract_VM_Version::vm_rele
#define OS LINUX_ONLY("linux") \
WINDOWS_ONLY("windows") \
- SOLARIS_ONLY("solaris")
+ SOLARIS_ONLY("solaris") \
+ BSD_ONLY("bsd")
#define CPU IA32_ONLY("x86") \
IA64_ONLY("ia64") \
--- a/src/share/vm/utilities/globalDefinitions_gcc.hpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/utilities/globalDefinitions_gcc.hpp Wed Aug 20 10:30:27 2008 -0700
@@ -71,12 +71,25 @@
# include <sys/procfs.h>
# endif
-#ifdef LINUX
+#if defined(LINUX) || defined(_ALLBSD_SOURCE)
#include <inttypes.h>
#include <signal.h>
+#ifndef __OpenBSD__
#include <ucontext.h>
+#endif
+#ifdef __APPLE__
+ #include <AvailabilityMacros.h>
+ #if (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4)
+ // Mac OS X 10.4 defines EFL_AC and EFL_ID,
+ // which conflict with hotspot variable names.
+ //
+ // This has been fixed in Mac OS X 10.5.
+ #undef EFL_AC
+ #undef EFL_ID
+ #endif
+#endif
#include <sys/time.h>
-#endif // LINUX
+#endif // LINUX || _ALLBSD_SOURCE
// 4810578: varargs unsafe on 32-bit integer/64-bit pointer architectures
// When __cplusplus is defined, NULL is defined as 0 (32-bit constant) in
@@ -112,7 +125,7 @@
// pointer is stored as integer value. On some platforms, sizeof(intptr_t) >
// sizeof(void*), so here we want something which is integer type, but has the
// same size as a pointer.
-#ifdef LINUX
+#ifdef __GNUC__
#ifdef _LP64
#define NULL_WORD 0L
#else
@@ -122,7 +135,7 @@
#define NULL_WORD NULL
#endif
-#ifndef LINUX
+#if !defined(LINUX) && !defined(_ALLBSD_SOURCE)
// Compiler-specific primitive types
typedef unsigned short uint16_t;
#ifndef _UINT32_T
@@ -142,7 +155,7 @@ typedef unsigned int uintptr_
// prior definition of intptr_t, and add "&& !defined(XXX)" above.
#endif // _SYS_INT_TYPES_H
-#endif // !LINUX
+#endif // !LINUX && !_ALLBSD_SOURCE
// Additional Java basic types
@@ -226,7 +239,9 @@ inline int g_isnan(float f) { return is
inline int g_isnan(float f) { return isnand(f); }
#endif
inline int g_isnan(double f) { return isnand(f); }
-#elif LINUX
+#elif defined(__APPLE__)
+inline int g_isnan(double f) { return isnan(f); }
+#elif defined(LINUX) || defined(_ALLBSD_SOURCE)
inline int g_isnan(float f) { return isnanf(f); }
inline int g_isnan(double f) { return isnan(f); }
#else
--- a/src/share/vm/utilities/macros.hpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/utilities/macros.hpp Wed Aug 20 10:30:27 2008 -0700
@@ -144,6 +144,14 @@
#define NOT_WINDOWS(code) code
#endif
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
+#define BSD_ONLY(code) code
+#define NOT_BSD(code)
+#else
+#define BSD_ONLY(code)
+#define NOT_BSD(code) code
+#endif
+
#ifdef IA32
#define IA32_ONLY(code) code
#define NOT_IA32(code)
--- a/src/share/vm/utilities/ostream.cpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/utilities/ostream.cpp Wed Aug 20 10:30:27 2008 -0700
@@ -810,7 +810,7 @@ bufferedStream::~bufferedStream() {
#ifndef PRODUCT
-#if defined(SOLARIS) || defined(LINUX)
+#if defined(SOLARIS) || defined(LINUX) || defined(_ALLBSD_SOURCE)
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
--- a/src/share/vm/utilities/vmError.cpp Wed Aug 20 10:18:41 2008 -0700
+++ b/src/share/vm/utilities/vmError.cpp Wed Aug 20 10:30:27 2008 -0700
@@ -31,12 +31,17 @@ const char *env_list[] = {
"JAVA_HOME", "JRE_HOME", "JAVA_TOOL_OPTIONS", "_JAVA_OPTIONS", "CLASSPATH",
"JAVA_COMPILER", "PATH", "USERNAME",
- // Env variables that are defined on Solaris/Linux
+ // Env variables that are defined on Solaris/Linux/BSD
"LD_LIBRARY_PATH", "LD_PRELOAD", "SHELL", "DISPLAY",
"HOSTTYPE", "OSTYPE", "ARCH", "MACHTYPE",
// defined on Linux
"LD_ASSUME_KERNEL", "_JAVA_SR_SIGNUM",
+
+ // defined on Darwin
+ "DYLD_LIBRARY_PATH", "DYLD_FALLBACK_LIBRARY_PATH",
+ "DYLD_FRAMEWORK_PATH", "DYLD_FALLBACK_FRAMEWORK_PATH",
+ "DYLD_INSERT_LIBRARIES",
// defined on Windows
"OS", "PROCESSOR_IDENTIFIER", "_ALT_JAVA_HOME_DIR",
@@ -792,7 +797,7 @@ void VMError::report_and_die() {
const char* ptr = OnError;
while ((cmd = next_OnError_command(buffer, sizeof(buffer), &ptr)) != NULL){
out.print_raw ("# Executing ");
-#if defined(LINUX)
+#if defined(LINUX) || defined(_ALLBSD_SOURCE)
out.print_raw ("/bin/sh -c ");
#elif defined(SOLARIS)
out.print_raw ("/usr/bin/sh -c ");
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/Makefile Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,313 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# This makefile creates a build tree and lights off a build.
+# You can go back into the build tree and perform rebuilds or
+# incremental builds as desired. Be sure to reestablish
+# environment variable settings for LD_LIBRARY_PATH and JAVA_HOME.
+
+# The make process now relies on java and javac. These can be
+# specified either implicitly on the PATH, by setting the
+# (JDK-inherited) ALT_BOOTDIR environment variable to full path to a
+# JDK in which bin/java and bin/javac are present and working (e.g.,
+# /usr/local/java/jdk1.3/solaris), or via the (JDK-inherited)
+# default BOOTDIR path value. Note that one of ALT_BOOTDIR
+# or BOOTDIR has to be set. We do *not* search javac, javah, rmic etc.
+# from the PATH.
+#
+# One can set ALT_BOOTDIR or BOOTDIR to point to a jdk that runs on
+# an architecture that differs from the target architecture, as long
+# as the bootstrap jdk runs under the same flavor of OS as the target
+# (i.e., if the target is linux, point to a jdk that runs on a linux
+# box). In order to use such a bootstrap jdk, set the make variable
+# REMOTE to the desired remote command mechanism, e.g.,
+#
+# make REMOTE="rsh -l me myotherlinuxbox"
+
+# Along with VM, Serviceability Agent (SA) is built for SA/JDI binding.
+# JDI binding on SA produces two binaries:
+# 1. sa-jdi.jar - This is build before building libjvm[_g].so
+# Please refer to ./makefiles/sa.make
+# 2. libsa[_g].so - Native library for SA - This is built after
+# libjsig[_g].so (signal interposition library)
+# Please refer to ./makefiles/vm.make
+# If $(GAMMADIR)/agent dir is not present, SA components are not built.
+
+ifeq ($(GAMMADIR),)
+include ../../make/defs.make
+else
+include $(GAMMADIR)/make/defs.make
+endif
+include $(GAMMADIR)/make/$(OSNAME)/makefiles/rules.make
+
+ifndef LP64
+ifndef CC_INTERP
+FORCE_TIERED=1
+endif
+endif
+
+ifdef LP64
+ ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
+ _JUNK_ := $(shell echo >&2 \
+ $(OSNAME) $(ARCH) "*** ERROR: this platform does not support 64-bit compilers!")
+ @exit 1
+ endif
+endif
+
+# we need to set up LP64 correctly to satisfy sanity checks in adlc
+ifneq ("$(filter $(LP64_ARCH),$(BUILDARCH))","")
+ MFLAGS += " LP64=1 "
+endif
+
+# pass USE_SUNCC further, through MFLAGS
+ifdef USE_SUNCC
+ MFLAGS += " USE_SUNCC=1 "
+endif
+
+# The following renders pathnames in generated Makefiles valid on
+# machines other than the machine containing the build tree.
+#
+# For example, let's say my build tree lives on /files12 on
+# exact.east.sun.com. This logic will cause GAMMADIR to begin with
+# /net/exact/files12/...
+#
+# We only do this on SunOS variants, for a couple of reasons:
+# * It is extremely rare that source trees exist on other systems
+# * It has been claimed that the Linux automounter is flakey, so
+# changing GAMMADIR in a way that exercises the automounter could
+# prove to be a source of unreliability in the build process.
+# Obviously, this Makefile is only relevant on SunOS boxes to begin
+# with, but the SunOS conditionalization will make it easier to
+# combine Makefiles in the future (assuming we ever do that).
+
+ifeq ($(OSNAME),solaris)
+
+ # prepend current directory to relative pathnames.
+ NEW_GAMMADIR := \
+ $(shell echo $(GAMMADIR) | \
+ sed -e "s=^\([^/].*\)=$(shell pwd)/\1=" \
+ )
+ unexport NEW_GAMMADIR
+
+ # If NEW_GAMMADIR doesn't already start with "/net/":
+ ifeq ($(strip $(filter /net/%,$(NEW_GAMMADIR))),)
+ # prepend /net/$(HOST)
+ # remove /net/$(HOST) if name already began with /home/
+ # remove /net/$(HOST) if name already began with /java/
+ # remove /net/$(HOST) if name already began with /lab/
+ NEW_GAMMADIR := \
+ $(shell echo $(NEW_GAMMADIR) | \
+ sed -e "s=^\(.*\)=/net/$(HOST)\1=" \
+ -e "s=^/net/$(HOST)/home/=/home/=" \
+ -e "s=^/net/$(HOST)/java/=/java/=" \
+ -e "s=^/net/$(HOST)/lab/=/lab/=" \
+ )
+ # Don't use the new value for GAMMADIR unless a file with the new
+ # name actually exists.
+ ifneq ($(wildcard $(NEW_GAMMADIR)),)
+ GAMMADIR := $(NEW_GAMMADIR)
+ endif
+ endif
+
+endif
+
+
+# There is a (semi-) regular correspondence between make targets and actions:
+#
+# Target Tree Type Build Dir
+#
+# debug compiler2 <os>_<arch>_compiler2/debug
+# fastdebug compiler2 <os>_<arch>_compiler2/fastdebug
+# jvmg compiler2 <os>_<arch>_compiler2/jvmg
+# optimized compiler2 <os>_<arch>_compiler2/optimized
+# profiled compiler2 <os>_<arch>_compiler2/profiled
+# product compiler2 <os>_<arch>_compiler2/product
+#
+# debug1 compiler1 <os>_<arch>_compiler1/debug
+# fastdebug1 compiler1 <os>_<arch>_compiler1/fastdebug
+# jvmg1 compiler1 <os>_<arch>_compiler1/jvmg
+# optimized1 compiler1 <os>_<arch>_compiler1/optimized
+# profiled1 compiler1 <os>_<arch>_compiler1/profiled
+# product1 compiler1 <os>_<arch>_compiler1/product
+#
+# debugcore core <os>_<arch>_core/debug
+# fastdebugcore core <os>_<arch>_core/fastdebug
+# jvmgcore core <os>_<arch>_core/jvmg
+# optimizedcore core <os>_<arch>_core/optimized
+# profiledcore core <os>_<arch>_core/profiled
+# productcore core <os>_<arch>_core/product
+#
+# What you get with each target:
+#
+# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
+# fastdebug* - optimized compile, but with asserts enabled
+# jvmg* - "fat" libjvm_g - debug info linked into libjvm_g.so
+# optimized* - optimized compile, no asserts
+# profiled* - gprof
+# product* - the shippable thing: optimized compile, no asserts, -DPRODUCT
+
+# This target list needs to be coordinated with the usage message
+# in the build.sh script:
+TARGETS = debug jvmg fastdebug optimized profiled product
+
+SUBDIR_DOCS = $(OSNAME)_$(BUILDARCH)_docs
+SUBDIRS_C1 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler1/,$(TARGETS))
+SUBDIRS_C2 = $(addprefix $(OSNAME)_$(BUILDARCH)_compiler2/,$(TARGETS))
+SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
+SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
+
+TARGETS_C2 = $(TARGETS)
+TARGETS_C1 = $(addsuffix 1,$(TARGETS))
+TARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
+TARGETS_CORE = $(addsuffix core,$(TARGETS))
+
+BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
+BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
+BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
+
+BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS)
+
+#-------------------------------------------------------------------------------
+
+# Could make everything by default, but that would take a while.
+all:
+ @echo "Try '$(MAKE) <target> ...' where <target> is one or more of"
+ @echo " $(TARGETS_C2)"
+ @echo " $(TARGETS_C1)"
+ @echo " $(TARGETS_CORE)"
+
+checks: check_os_version check_j2se_version
+
+# We do not want people accidentally building on old systems (e.g. Linux 2.2.x,
+# Solaris 2.5.1, 2.6).
+# Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
+
+#SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.7%
+DISABLE_HOTSPOT_OS_VERSION_CHECK = ok
+OS_VERSION := $(shell uname -r)
+EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
+
+check_os_version:
+ifeq ($(DISABLE_HOTSPOT_OS_VERSION_CHECK)$(EMPTY_IF_NOT_SUPPORTED),)
+ $(QUIETLY) >&2 echo "*** This OS is not supported:" `uname -a`; exit 1;
+endif
+
+# jvmti.make requires XSLT (J2SE 1.4.x or newer):
+XSLT_CHECK = $(REMOTE) $(RUN.JAVAP) javax.xml.transform.TransformerFactory
+# If not found then fail fast.
+check_j2se_version:
+ $(QUIETLY) $(XSLT_CHECK) > /dev/null 2>&1; \
+ if [ $$? -ne 0 ]; then \
+ $(REMOTE) $(RUN.JAVA) -version; \
+ echo "*** An XSLT processor (J2SE 1.4.x or newer) is required" \
+ "to bootstrap this build" 1>&2; \
+ exit 1; \
+ fi
+
+$(SUBDIRS_TIERED): $(BUILDTREE_MAKE)
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=tiered
+
+$(SUBDIRS_C2): $(BUILDTREE_MAKE)
+ifdef FORCE_TIERED
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=tiered FORCE_TIERED=1
+else
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=compiler2
+endif
+
+$(SUBDIRS_C1): $(BUILDTREE_MAKE)
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=compiler1
+
+$(SUBDIRS_CORE): $(BUILDTREE_MAKE)
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=core
+
+# Define INSTALL=y at command line to automatically copy JVM into JAVA_HOME
+
+$(TARGETS_C2): $(SUBDIRS_C2)
+ cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
+ cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
+ifdef INSTALL
+ cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
+endif
+
+$(TARGETS_TIERED): $(SUBDIRS_TIERED)
+ cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
+ cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
+ifdef INSTALL
+ cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
+$(TARGETS_C1): $(SUBDIRS_C1)
+ cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
+ cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
+ifdef INSTALL
+ cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
+$(TARGETS_CORE): $(SUBDIRS_CORE)
+ cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
+ cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
+ifdef INSTALL
+ cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
+# Just build the tree, and nothing else:
+tree: $(SUBDIRS_C2)
+tree1: $(SUBDIRS_C1)
+treecore: $(SUBDIRS_CORE)
+
+# Doc target. This is the same for all build options.
+# Hence create a docs directory beside ...$(ARCH)_[...]
+docs: checks
+ $(QUIETLY) mkdir -p $(SUBDIR_DOCS)
+ $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/makefiles/jvmti.make $(MFLAGS) $(BUILDTREE_VARS) JvmtiOutDir=$(SUBDIR_DOCS) jvmtidocs
+
+# Synonyms for win32-like targets.
+compiler2: jvmg product
+
+compiler1: jvmg1 product1
+
+core: jvmgcore productcore
+
+clean_docs:
+ rm -rf $(SUBDIR_DOCS)
+
+clean_compiler1 clean_compiler2 clean_core:
+ rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
+
+clean: clean_compiler2 clean_compiler1 clean_core clean_docs
+
+include $(GAMMADIR)/make/$(OSNAME)/makefiles/cscope.make
+
+#-------------------------------------------------------------------------------
+
+.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE)
+.PHONY: tree tree1 treecore
+.PHONY: all compiler1 compiler2 core
+.PHONY: clean clean_compiler1 clean_compiler2 clean_core docs clean_docs
+.PHONY: checks check_os_version check_j2se_version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/README Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,26 @@
+Copyright (c) 2007 Sun Microsystems, Inc. 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.
+
+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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+CA 95054 USA or visit www.sun.com if you need additional information or
+have any questions.
+
+________________________________________________________________________
+
+Please refer to the comments in the Makefile in this directory
+for instructions how to build the Solaris versions.
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/adlc_updater Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,11 @@
+#! /bin/sh
+#
+# This file is used by adlc.make to selectively update generated
+# adlc files. Because source and target diretories are relative
+# paths, this file is copied to the target build directory before
+# use.
+#
+# adlc-updater <file> <source-dir> <target-dir>
+#
+[ -f $3/$1 ] && cmp -s $2/$1 $3/$1 || \
+( [ -f $3/$1 ]; echo Updating $3/$1 ; touch $2/made-change ; mv $2/$1 $3/$1 )
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/build.sh Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,95 @@
+#! /bin/sh
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Make sure the variable JAVA_HOME is set before running this script.
+
+set -u
+
+
+if [ $# != 2 ]; then
+ echo "Usage : $0 Build_Options Location"
+ echo "Build Options : debug or optimized or basicdebug or basic or clean"
+ echo "Location : specify any workspace which has gamma sources"
+ exit 1
+fi
+
+# Just in case:
+case ${JAVA_HOME} in
+/*) true;;
+?*) JAVA_HOME=`( cd $JAVA_HOME; pwd )`;;
+esac
+
+case `uname -m` in
+ i386|i486|i586|i686)
+ mach=i386
+ ;;
+ *)
+ echo "Unsupported machine: " `uname -m`
+ exit 1
+ ;;
+esac
+
+if [ "${JAVA_HOME}" = "" -o ! -d "${JAVA_HOME}" -o ! -d ${JAVA_HOME}/jre/lib/${mach} ]; then
+ echo "JAVA_HOME needs to be set to a valid JDK path"
+ echo "ksh : export JAVA_HOME=/net/tetrasparc/export/gobi/JDK1.2_fcs_V/bsd"
+ echo "csh : setenv JAVA_HOME /net/tetrasparc/export/gobi/JDK1.2_fcs_V/bsd"
+ exit 1
+fi
+
+
+LD_LIBRARY_PATH=${JAVA_HOME}/jre/lib/`uname -p`:\
+${JAVA_HOME}/jre/lib/`uname -p`/native_threads:${LD_LIBRARY_PATH-.}
+
+# This is necessary as long as we are using the old launcher
+# with the new distribution format:
+CLASSPATH=${JAVA_HOME}/jre/lib/rt.jar:${CLASSPATH-.}
+
+
+for gm in gmake gnumake
+do
+ if [ "${GNUMAKE-}" != "" ]; then break; fi
+ ($gm --version >/dev/null) 2>/dev/null && GNUMAKE=$gm
+done
+: ${GNUMAKE:?'Cannot locate the gnumake program. Stop.'}
+
+
+echo "### ENVIRONMENT SETTINGS:"
+export JAVA_HOME ; echo "JAVA_HOME=$JAVA_HOME"
+export LD_LIBRARY_PATH ; echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
+export CLASSPATH ; echo "CLASSPATH=$CLASSPATH"
+export GNUMAKE ; echo "GNUMAKE=$GNUMAKE"
+echo "###"
+
+Build_Options=$1
+Location=$2
+
+case ${Location} in
+/*) true;;
+?*) Location=`(cd ${Location}; pwd)`;;
+esac
+
+echo \
+${GNUMAKE} -f ${Location}/make/bsd/Makefile $Build_Options GAMMADIR=${Location}
+${GNUMAKE} -f ${Location}/make/bsd/Makefile $Build_Options GAMMADIR=${Location}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/adjust-mflags.sh Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,87 @@
+#! /bin/sh
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# This script is used only from top.make.
+# The macro $(MFLAGS-adjusted) calls this script to
+# adjust the "-j" arguments to take into account
+# the HOTSPOT_BUILD_JOBS variable. The default
+# handling of the "-j" argument by gnumake does
+# not meet our needs, so we must adjust it ourselves.
+
+# This argument adjustment applies to two recursive
+# calls to "$(MAKE) $(MFLAGS-adjusted)" in top.make.
+# One invokes adlc.make, and the other invokes vm.make.
+# The adjustment propagates the desired concurrency
+# level down to the sub-make (of the adlc or vm).
+# The default behavior of gnumake is to run all
+# sub-makes without concurrency ("-j1").
+
+# Also, we use a make variable rather than an explicit
+# "-j<N>" argument to control this setting, so that
+# the concurrency setting (which must be tuned separately
+# for each MP system) can be set via an environment variable.
+# The recommended setting is 1.5x to 2x the number of available
+# CPUs on the MP system, which is large enough to keep the CPUs
+# busy (even though some jobs may be I/O bound) but not too large,
+# we may presume, to overflow the system's swap space.
+
+set -eu
+
+default_build_jobs=4
+
+case $# in
+[12]) true;;
+*) >&2 echo "Usage: $0 ${MFLAGS} ${HOTSPOT_BUILD_JOBS}"; exit 2;;
+esac
+
+MFLAGS=$1
+HOTSPOT_BUILD_JOBS=${2-}
+
+# Normalize any -jN argument to the form " -j${HBJ}"
+MFLAGS=`
+ echo "$MFLAGS" \
+ | sed '
+ s/^-/ -/
+ s/ -\([^ ][^ ]*\)j/ -\1 -j/
+ s/ -j[0-9][0-9]*/ -j/
+ s/ -j\([^ ]\)/ -j -\1/
+ s/ -j/ -j'${HOTSPOT_BUILD_JOBS:-${default_build_jobs}}'/
+ ' `
+
+case ${HOTSPOT_BUILD_JOBS} in \
+
+'') case ${MFLAGS} in
+ *\ -j*)
+ >&2 echo "# Note: -jN is ineffective for setting parallelism in this makefile."
+ >&2 echo "# please set HOTSPOT_BUILD_JOBS=${default_build_jobs} in the command line or environment."
+ esac;;
+
+?*) case ${MFLAGS} in
+ *\ -j*) true;;
+ *) MFLAGS="-j${HOTSPOT_BUILD_JOBS} ${MFLAGS}";;
+ esac;;
+esac
+
+echo "${MFLAGS}"
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/adlc.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,201 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# This makefile (adlc.make) is included from the adlc.make in the
+# build directories.
+# It knows how to compile, link, and run the adlc.
+
+include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/rules.make
+
+# #########################################################################
+
+# OUTDIR must be the same as AD_Dir = $(GENERATED)/adfiles in top.make:
+GENERATED = ../generated
+OUTDIR = $(GENERATED)/adfiles
+
+ARCH = $(Platform_arch)
+OS = $(Platform_os_family)
+
+SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad
+
+SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \
+ $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad
+
+Src_Dirs += $(GAMMADIR)/src/share/vm/adlc
+
+EXEC = $(OUTDIR)/adlc
+
+# set VPATH so make knows where to look for source files
+Src_Dirs_V = ${Src_Dirs} $(GENERATED)/incls
+VPATH += $(Src_Dirs_V:%=%:)
+
+# set INCLUDES for C preprocessor
+Src_Dirs_I = ${Src_Dirs} $(GENERATED)
+INCLUDES += $(Src_Dirs_I:%=-I%)
+
+# Force assertions on.
+SYSDEFS += -DASSERT
+CPPFLAGS = $(SYSDEFS) $(INCLUDES)
+
+# CFLAGS_WARN holds compiler options to suppress/enable warnings.
+# Suppress warnings (for now)
+CFLAGS_WARN = -w
+CFLAGS += $(CFLAGS_WARN)
+
+OBJECTNAMES = \
+ adlparse.o \
+ archDesc.o \
+ arena.o \
+ dfa.o \
+ dict2.o \
+ filebuff.o \
+ forms.o \
+ formsopt.o \
+ formssel.o \
+ main.o \
+ adlc-opcodes.o \
+ output_c.o \
+ output_h.o \
+
+OBJECTS = $(OBJECTNAMES:%=$(OUTDIR)/%)
+
+GENERATEDNAMES = \
+ ad_$(Platform_arch_model).cpp \
+ ad_$(Platform_arch_model).hpp \
+ ad_$(Platform_arch_model)_clone.cpp \
+ ad_$(Platform_arch_model)_expand.cpp \
+ ad_$(Platform_arch_model)_format.cpp \
+ ad_$(Platform_arch_model)_gen.cpp \
+ ad_$(Platform_arch_model)_misc.cpp \
+ ad_$(Platform_arch_model)_peephole.cpp \
+ ad_$(Platform_arch_model)_pipeline.cpp \
+ adGlobals_$(Platform_arch_model).hpp \
+ dfa_$(Platform_arch_model).cpp \
+
+GENERATEDFILES = $(GENERATEDNAMES:%=$(OUTDIR)/%)
+
+# #########################################################################
+
+all: $(EXEC)
+
+$(EXEC) : $(OBJECTS)
+ @echo Making adlc
+ $(QUIETLY) $(LINK_NOPROF.CC) -o $(EXEC) $(OBJECTS)
+
+# Random dependencies:
+$(OBJECTS): opcodes.hpp classes.hpp adlc.hpp adlcVMDeps.hpp adlparse.hpp archDesc.hpp arena.hpp dict2.hpp filebuff.hpp forms.hpp formsopt.hpp formssel.hpp
+
+# The source files refer to ostream.h, which sparcworks calls iostream.h
+$(OBJECTS): ostream.h
+
+ostream.h :
+ @echo >$@ '#include <iostream.h>'
+
+dump:
+ : OUTDIR=$(OUTDIR)
+ : OBJECTS=$(OBJECTS)
+ : products = $(GENERATEDFILES)
+
+all: $(GENERATEDFILES)
+
+$(GENERATEDFILES): refresh_adfiles
+
+# Get a unique temporary directory name, so multiple makes can run in parallel.
+# Note that product files are updated via "mv", which is atomic.
+TEMPDIR := $(OUTDIR)/mktmp$(shell echo $$$$)
+
+ADLCFLAGS = -q -T
+
+ifdef LP64
+ADLCFLAGS += -D_LP64
+else
+ADLCFLAGS += -U_LP64
+endif
+
+#
+# adlc_updater is a simple sh script, under sccs control. It is
+# used to selectively update generated adlc files. This should
+# provide a nice compilation speed improvement.
+#
+ADLC_UPDATER_DIRECTORY = $(GAMMADIR)/make/$(OS)
+ADLC_UPDATER = adlc_updater
+
+# This action refreshes all generated adlc files simultaneously.
+# The way it works is this:
+# 1) create a scratch directory to work in.
+# 2) if the current working directory does not have $(ADLC_UPDATER), copy it.
+# 3) run the compiled adlc executable. This will create new adlc files in the scratch directory.
+# 4) call $(ADLC_UPDATER) on each generated adlc file. It will selectively update changed or missing files.
+# 5) If we actually updated any files, echo a notice.
+#
+refresh_adfiles: $(EXEC) $(SOURCE.AD)
+ @rm -rf $(TEMPDIR); mkdir $(TEMPDIR)
+ $(QUIETLY) [ -f $(ADLC_UPDATER) ] || ( cp $(ADLC_UPDATER_DIRECTORY)/$(ADLC_UPDATER) . ; chmod +x $(ADLC_UPDATER) )
+ $(QUIETLY) $(EXEC) $(ADLCFLAGS) $(SOURCE.AD) \
+ -c$(TEMPDIR)/ad_$(Platform_arch_model).cpp -h$(TEMPDIR)/ad_$(Platform_arch_model).hpp -a$(TEMPDIR)/dfa_$(Platform_arch_model).cpp -v$(TEMPDIR)/adGlobals_$(Platform_arch_model).hpp \
+ || { rm -rf $(TEMPDIR); exit 1; }
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_clone.cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_expand.cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_format.cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_gen.cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_misc.cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_peephole.cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) ad_$(Platform_arch_model)_pipeline.cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) adGlobals_$(Platform_arch_model).hpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) ./$(ADLC_UPDATER) dfa_$(Platform_arch_model).cpp $(TEMPDIR) $(OUTDIR)
+ $(QUIETLY) [ -f $(TEMPDIR)/made-change ] \
+ || echo "Rescanned $(SOURCE.AD) but encountered no changes."
+ $(QUIETLY) rm -rf $(TEMPDIR)
+
+
+# #########################################################################
+
+$(SOURCE.AD): $(SOURCES.AD)
+ $(QUIETLY) cat $(SOURCES.AD) > $(SOURCE.AD)
+
+$(OUTDIR)/%.o: %.cpp
+ @echo Compiling $<
+ $(QUIETLY) $(REMOVE_TARGET)
+ $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+
+# Some object files are given a prefix, to disambiguate
+# them from objects of the same name built for the VM.
+$(OUTDIR)/adlc-%.o: %.cpp
+ @echo Compiling $<
+ $(QUIETLY) $(REMOVE_TARGET)
+ $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+
+# #########################################################################
+
+clean :
+ rm $(OBJECTS)
+
+cleanall :
+ rm $(OBJECTS) $(EXEC)
+
+# #########################################################################
+
+.PHONY: all dump refresh_adfiles clean cleanall
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/amd64.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,42 @@
+#
+# Copyright 2003-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Not included in includeDB because it has no dependencies
+Obj_Files += bsd_x86_64.o
+
+# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
+OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
+# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
+OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
+# Must also specify if CPU is little endian
+CFLAGS += -DVM_LITTLE_ENDIAN
+
+CFLAGS += -D_LP64=1
+
+# The serviceability agent relies on frame pointer (%rbp) to walk thread stack
+ifndef USE_SUNCC
+ CFLAGS += -fno-omit-frame-pointer
+endif
+
+OPT_CFLAGS/compactingPermGenGen.o = -O1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/buildtree.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,352 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Usage:
+#
+# $(MAKE) -f buildtree.make ARCH=arch BUILDARCH=buildarch LIBARCH=libarch
+# GAMMADIR=dir OS_FAMILY=os VARIANT=variant
+#
+# The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the
+# environment or on the command-line:
+#
+# ARCH - sparc, i486, ... HotSpot cpu and os_cpu source directory
+# BUILDARCH - build directory
+# LIBARCH - the corresponding directory in JDK/JRE
+# GAMMADIR - top of workspace
+# OS_FAMILY - operating system
+# VARIANT - core, compiler1, compiler2, or tiered
+# HOTSPOT_RELEASE_VERSION - <major>.<minor>-b<nn> (11.0-b07)
+# HOTSPOT_BUILD_VERSION - internal, PRTjob ID, JPRTjob ID
+# JRE_RELEASE_VERSION - <major>.<minor>.<micro> (1.7.0)
+#
+# Builds the directory trees with makefiles plus some convenience files in
+# each directory:
+#
+# Makefile - for "make foo"
+# flags.make - with macro settings
+# vm.make - to support making "$(MAKE) -v vm.make" in makefiles
+# adlc.make -
+# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
+# sa.make - generate SA jar file and natives
+# env.[ck]sh - environment settings
+# test_gamma - script to run the Queens program
+#
+# The makefiles are split this way so that "make foo" will run faster by not
+# having to read the dependency files for the vm.
+
+include $(GAMMADIR)/make/scm.make
+
+# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
+QUIETLY$(MAKE_VERBOSE) = @
+
+# For now, until the compiler is less wobbly:
+TESTFLAGS = -Xbatch -showversion
+
+ifdef USE_SUNCC
+PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).suncc
+else
+PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH)
+endif
+
+ifdef FORCE_TIERED
+ifeq ($(VARIANT),tiered)
+PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_compiler2
+else
+PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_$(VARIANT)
+endif
+else
+PLATFORM_DIR = $(OS_FAMILY)_$(BUILDARCH)_$(VARIANT)
+endif
+
+#
+# We do two levels of exclusion in the shared directory.
+# TOPLEVEL excludes are pruned, they are not recursively searched,
+# but lower level directories can be named without fear of collision.
+# ALWAYS excludes are excluded at any level in the directory tree.
+#
+
+ALWAYS_EXCLUDE_DIRS = $(SCM_DIRS)
+
+ifeq ($(VARIANT),tiered)
+TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name agent
+else
+ifeq ($(VARIANT),compiler2)
+TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name c1 -o -name agent
+else
+# compiler1 and core use the same exclude list
+TOPLEVEL_EXCLUDE_DIRS = $(ALWAYS_EXCLUDE_DIRS) -o -name adlc -o -name opto -o -name libadt -o -name agent
+endif
+endif
+
+# Get things from the platform file.
+COMPILER = $(shell sed -n 's/^compiler[ ]*=[ ]*//p' $(PLATFORM_FILE))
+
+SIMPLE_DIRS = \
+ $(PLATFORM_DIR)/generated/incls \
+ $(PLATFORM_DIR)/generated/adfiles \
+ $(PLATFORM_DIR)/generated/jvmtifiles
+
+TARGETS = debug fastdebug jvmg optimized product profiled
+SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
+
+# For dependencies and recursive makes.
+BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
+
+BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
+ env.sh env.csh .dbxrc test_gamma
+
+BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
+ ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
+
+# Define variables to be set in flags.make.
+# Default values are set in make/defs.make.
+ifeq ($(HOTSPOT_BUILD_VERSION),)
+ HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)
+else
+ HS_BUILD_VER=$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)
+endif
+# Set BUILD_USER from system-dependent hints: $LOGNAME, $(whoami)
+ifndef HOTSPOT_BUILD_USER
+ HOTSPOT_BUILD_USER := $(shell echo $$LOGNAME)
+endif
+ifndef HOTSPOT_BUILD_USER
+ HOTSPOT_BUILD_USER := $(shell whoami)
+endif
+# Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro
+# or make/hotspot_distro.
+ifndef HOTSPOT_VM_DISTRO
+ CLOSED_DIR_EXISTS := $(shell \
+ if [ -d $(GAMMADIR)/src/closed ] ; then \
+ echo true; \
+ else \
+ echo false; \
+ fi)
+ ifeq ($(CLOSED_DIR_EXISTS), true)
+ include $(GAMMADIR)/make/hotspot_distro
+ else
+ include $(GAMMADIR)/make/openjdk_distro
+ endif
+endif
+
+BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
+
+BUILDTREE = \
+ $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_TARGETS) $(BUILDTREE_VARS)
+
+BUILDTREE_COMMENT = echo "\# Generated by $(BUILDTREE_MAKE)"
+
+all: $(SUBMAKE_DIRS)
+
+# Run make in each subdirectory recursively.
+$(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE
+ $(QUIETLY) [ -d $@ ] || { mkdir -p $@; }
+ $(QUIETLY) cd $@ && $(BUILDTREE) TARGET=$(@F)
+ $(QUIETLY) touch $@
+
+$(SIMPLE_DIRS):
+ $(QUIETLY) mkdir -p $@
+
+flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo; \
+ echo "Platform_file = $(PLATFORM_FILE)" | sed 's|$(GAMMADIR)|$$(GAMMADIR)|'; \
+ sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \
+ echo; \
+ echo "GAMMADIR = $(GAMMADIR)"; \
+ echo "SYSDEFS = \$$(Platform_sysdefs)"; \
+ echo "SRCARCH = $(ARCH)"; \
+ echo "BUILDARCH = $(BUILDARCH)"; \
+ echo "LIBARCH = $(LIBARCH)"; \
+ echo "TARGET = $(TARGET)"; \
+ echo "HS_BUILD_VER = $(HS_BUILD_VER)"; \
+ echo "JRE_RELEASE_VER = $(JRE_RELEASE_VERSION)"; \
+ echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
+ echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
+ echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
+ echo; \
+ echo "Src_Dirs = \\"; \
+ sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \
+ echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \
+ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \
+ echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \
+ [ -n "$(CFLAGS_BROWSE)" ] && \
+ echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \
+ [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \
+ echo && \
+ echo "HOTSPOT_EXTRA_SYSDEFS\$$(HOTSPOT_EXTRA_SYSDEFS) = $(HOTSPOT_EXTRA_SYSDEFS)" && \
+ echo "SYSDEFS += \$$(HOTSPOT_EXTRA_SYSDEFS)"; \
+ echo; \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
+ ) > $@
+
+flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo; \
+ [ "$(TARGET)" = profiled ] && \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/optimized.make"; \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(TARGET).make"; \
+ ) > $@
+
+../shared_dirs.lst: $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm
+ @echo Creating directory list $@
+ $(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \
+ -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \
+ \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@
+
+Makefile: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo; \
+ echo include flags.make; \
+ echo; \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/top.make"; \
+ ) > $@
+
+vm.make: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo; \
+ echo include flags.make; \
+ echo include flags_vm.make; \
+ echo; \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
+ ) > $@
+
+adlc.make: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo; \
+ echo include flags.make; \
+ echo; \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
+ ) > $@
+
+jvmti.make: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo; \
+ echo include flags.make; \
+ echo; \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
+ ) > $@
+
+sa.make: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ echo; \
+ echo include flags.make; \
+ echo; \
+ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \
+ ) > $@
+
+env.sh: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
+ { \
+ echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
+ echo "DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
+ echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
+ } | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
+ echo "HOTSPOT_BUILD_USER=\"$${LOGNAME:-$$USER} in `basename $(GAMMADIR)`\""; \
+ echo "export JAVA_HOME LD_LIBRARY_PATH DYLD_LIBRARY_PATH CLASSPATH HOTSPOT_BUILD_USER"; \
+ ) > $@
+
+env.csh: env.sh
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ $(BUILDTREE_COMMENT); \
+ [ -n "$$JAVA_HOME" ] && \
+ { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
+ sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
+ ) > $@
+
+.dbxrc: $(BUILDTREE_MAKE)
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
+ echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
+ echo "then"; \
+ echo " source \"\$${HOTSPOT_DBXWARE}\""; \
+ echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
+ echo "then"; \
+ echo " source \"\$$HOME/.dbxrc\""; \
+ echo "fi"; \
+ ) > $@
+
+# Skip the test for product builds (which only work when installed in a JDK), to
+# avoid exiting with an error and causing make to halt.
+NO_TEST_MSG = \
+ echo "$@: skipping the test--this build must be tested in a JDK."
+
+NO_JAVA_HOME_MSG = \
+ echo "JAVA_HOME must be set to run this test."
+
+DATA_MODE = $(DATA_MODE/$(BUILDARCH))
+JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
+
+DATA_MODE/i486 = 32
+DATA_MODE/sparc = 32
+DATA_MODE/sparcv9 = 64
+DATA_MODE/amd64 = 64
+DATA_MODE/ia64 = 64
+
+JAVA_FLAG/32 = -d32
+JAVA_FLAG/64 = -d64
+
+WRONG_DATA_MODE_MSG = \
+ echo "JAVA_HOME must point to $(DATA_MODE)bit JDK."
+
+test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
+ @echo Creating $@ ...
+ $(QUIETLY) ( \
+ echo '#!/bin/sh'; \
+ $(BUILDTREE_COMMENT); \
+ echo '. ./env.sh'; \
+ echo "if [ -z \$$JAVA_HOME ]; then { $(NO_JAVA_HOME_MSG); exit 0; }; fi"; \
+ echo "if ! \$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion 2>&1 > /dev/null"; \
+ echo "then"; \
+ echo " $(WRONG_DATA_MODE_MSG); exit 0;"; \
+ echo "fi"; \
+ echo "rm -f Queens.class"; \
+ echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
+ echo '[ -f gamma_g ] && { gamma=gamma_g; }'; \
+ echo './$${gamma:-gamma} $(TESTFLAGS) Queens < /dev/null'; \
+ ) > $@
+ $(QUIETLY) chmod +x $@
+
+FORCE:
+
+.PHONY: all FORCE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/compiler1.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,31 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making client version of VM
+
+TYPE=COMPILER1
+
+VM_SUBDIR = client
+
+CFLAGS += -DCOMPILER1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/compiler2.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,31 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making server version of VM
+
+TYPE=COMPILER2
+
+VM_SUBDIR = server
+
+CFLAGS += -DCOMPILER2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/core.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,34 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making core version of VM
+
+# Note the effect on includeDB lists in top.make:
+# includeDB_compiler* and ad_<arch>.*pp are excluded from the build,
+TYPE=CORE
+
+# There is no "core" directory in JDK. Install core build in server directory.
+VM_SUBDIR = server
+
+# Note: macros.hpp defines CORE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/cscope.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,160 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+#
+# The cscope.out file is made in the current directory and spans the entire
+# source tree.
+#
+# Things to note:
+# 1. We use relative names for cscope.
+# 2. We *don't* remove the old cscope.out file, because cscope is smart
+# enough to only build what has changed. It can be confused, however,
+# if files are renamed or removed, so it may be necessary to manually
+# remove cscope.out if a lot of reorganization has occurred.
+#
+
+include $(GAMMADIR)/make/scm.make
+
+NAWK = awk
+RM = rm -f
+HG = hg
+CS_TOP = ../..
+
+CSDIRS = $(CS_TOP)/src $(CS_TOP)/build
+CSINCS = $(CSDIRS:%=-I%)
+
+CSCOPE = cscope
+CSCOPE_FLAGS = -b
+
+# Allow .java files to be added from the environment (CSCLASSES=yes).
+ifdef CSCLASSES
+ADDCLASSES= -o -name '*.java'
+endif
+
+# Adding CClassHeaders also pushes the file count of a full workspace up about
+# 200 files (these files also don't exist in a new workspace, and thus will
+# cause the recreation of the database as they get created, which might seem
+# a little confusing). Thus allow these files to be added from the environment
+# (CSHEADERS=yes).
+ifndef CSHEADERS
+RMCCHEADERS= -o -name CClassHeaders
+endif
+
+# Use CS_GENERATED=x to include auto-generated files in the build directories.
+ifdef CS_GENERATED
+CS_ADD_GENERATED = -o -name '*.incl'
+else
+CS_PRUNE_GENERATED = -o -name '${OS}_*_core' -o -name '${OS}_*_compiler?'
+endif
+
+# OS-specific files for other systems are excluded by default. Use CS_OS=yes
+# to include platform-specific files for other platforms.
+ifndef CS_OS
+CS_OS = linux macos solaris win32 bsd
+CS_PRUNE_OS = $(patsubst %,-o -name '*%*',$(filter-out ${OS},${CS_OS}))
+endif
+
+# Processor-specific files for other processors are excluded by default. Use
+# CS_CPU=x to include platform-specific files for other platforms.
+ifndef CS_CPU
+CS_CPU = i486 sparc amd64 ia64
+CS_PRUNE_CPU = $(patsubst %,-o -name '*%*',$(filter-out ${SRCARCH},${CS_CPU}))
+endif
+
+# What files should we include? A simple rule might be just those files under
+# SCCS control, however this would miss files we create like the opcodes and
+# CClassHeaders. The following attempts to find everything that is *useful*.
+# (.del files are created by sccsrm, demo directories contain many .java files
+# that probably aren't useful for development, and the pkgarchive may contain
+# duplicates of files within the source hierarchy).
+
+# Directories to exclude.
+CS_PRUNE_STD = $(SCM_DIRS) \
+ -o -name '.del-*' \
+ -o -name '*demo' \
+ -o -name pkgarchive
+
+CS_PRUNE = $(CS_PRUNE_STD) \
+ $(CS_PRUNE_OS) \
+ $(CS_PRUNE_CPU) \
+ $(CS_PRUNE_GENERATED) \
+ $(RMCCHEADERS)
+
+# File names to include.
+CSFILENAMES = -name '*.[ch]pp' \
+ -o -name '*.[Ccshlxy]' \
+ $(CS_ADD_GENERATED) \
+ -o -name '*.il' \
+ -o -name '*.cc' \
+ -o -name '*[Mm]akefile*' \
+ -o -name '*.gmk' \
+ -o -name '*.make' \
+ -o -name '*.ad' \
+ $(ADDCLASSES)
+
+.PRECIOUS: cscope.out
+
+cscope cscope.out: cscope.files FORCE
+ $(CSCOPE) $(CSCOPE_FLAGS)
+
+# The .raw file is reordered here in an attempt to make cscope display the most
+# relevant files first.
+cscope.files: .cscope.files.raw
+ echo "$(CSINCS)" > $@
+ -egrep -v "\.java|\/make\/" $< >> $@
+ -fgrep ".java" $< >> $@
+ -fgrep "/make/" $< >> $@
+
+.cscope.files.raw: .nametable.files
+ -find $(CSDIRS) -type d \( $(CS_PRUNE) \) -prune -o \
+ -type f \( $(CSFILENAMES) \) -print > $@
+
+cscope.clean: nametable.clean
+ -$(RM) cscope.out cscope.files .cscope.files.raw
+
+TAGS: cscope.files FORCE
+ egrep -v '^-|^$$' $< | etags --members -
+
+TAGS.clean: nametable.clean
+ -$(RM) TAGS
+
+# .nametable.files and .nametable.files.tmp are used to determine if any files
+# were added to/deleted from/renamed in the workspace. If not, then there's
+# normally no need to rebuild the cscope database. To force a rebuild of
+# the cscope database: gmake nametable.clean.
+.nametable.files: .nametable.files.tmp
+ ( cmp -s $@ $< ) || ( cp $< $@ )
+ -$(RM) $<
+
+# `hg status' is slightly faster than `hg fstatus'. Both are
+# quite a bit slower on an NFS mounted file system, so this is
+# really geared towards repos on local file systems.
+.nametable.files.tmp:
+ -$(HG) fstatus -acmn > $@
+nametable.clean:
+ -$(RM) .nametable.files .nametable.files.tmp
+
+FORCE:
+
+.PHONY: cscope cscope.clean TAGS.clean nametable.clean FORCE
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/debug.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,44 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making debug version of VM
+
+# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
+DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
+DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
+CFLAGS += $(DEBUG_CFLAGS/BYFILE)
+
+# Linker mapfile
+MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
+
+_JUNK_ := $(shell echo -e >&2 ""\
+ "----------------------------------------------------------------------\n" \
+ "WARNING: 'make debug' is deprecated. It will be removed in the future.\n" \
+ "Please use 'make jvmg' to build debug JVM. \n" \
+ "----------------------------------------------------------------------\n")
+
+G_SUFFIX =
+VERSION = debug
+SYSDEFS += -DASSERT -DDEBUG
+PICFLAGS = DEFAULT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/defs.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,138 @@
+#
+# Copyright 2006-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# The common definitions for hotspot bsd builds.
+# Include the top level defs.make under make directory instead of this one.
+# This file is included into make/defs.make.
+
+SLASH_JAVA ?= /java
+
+# Library suffix
+OS_VENDOR:=$(shell uname -s)
+ifeq ($(OS_VENDOR),Darwin)
+ LIBRARY_SUFFIX=dylib
+else
+ LIBRARY_SUFFIX=so
+endif
+
+# Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
+ARCH:=$(shell uname -m)
+PATH_SEP = :
+ifeq ($(LP64), 1)
+ ARCH_DATA_MODEL ?= 64
+else
+ ARCH_DATA_MODEL ?= 32
+endif
+
+# ia64
+ifeq ($(ARCH), ia64)
+ ARCH_DATA_MODEL = 64
+ MAKE_ARGS += LP64=1
+ PLATFORM = bsd-ia64
+ VM_PLATFORM = bsd_ia64
+ HS_ARCH = ia64
+endif
+
+# sparc
+ifeq ($(ARCH), sparc64)
+ ifeq ($(ARCH_DATA_MODEL), 64)
+ ARCH_DATA_MODEL = 64
+ MAKE_ARGS += LP64=1
+ PLATFORM = bsd-sparcv9
+ VM_PLATFORM = bsd_sparcv9
+ else
+ ARCH_DATA_MODEL = 32
+ PLATFORM = bsd-sparc
+ VM_PLATFORM = bsd_sparc
+ endif
+ HS_ARCH = sparc
+endif
+
+# x86_64
+ifeq ($(ARCH), x86_64)
+ ifeq ($(ARCH_DATA_MODEL), 64)
+ ARCH_DATA_MODEL = 64
+ MAKE_ARGS += LP64=1
+ PLATFORM = bsd-amd64
+ VM_PLATFORM = bsd_amd64
+ HS_ARCH = x86
+ else
+ ARCH_DATA_MODEL = 32
+ PLATFORM = bsd-i586
+ VM_PLATFORM = bsd_i486
+ HS_ARCH = x86
+ # We have to reset ARCH to i686 since SRCARCH relies on it
+ ARCH = i686
+ endif
+endif
+
+# amd64
+ifeq ($(ARCH), amd64)
+ ARCH_DATA_MODEL = 64
+ MAKE_ARGS += LP64=1
+ PLATFORM = bsd-amd64
+ VM_PLATFORM = bsd_amd64
+ HS_ARCH = x86
+endif
+
+# i386
+ifeq ($(ARCH), i386)
+ ARCH_DATA_MODEL = 32
+ PLATFORM = bsd-i586
+ VM_PLATFORM = bsd_i486
+ HS_ARCH = x86
+endif
+
+# i486
+ifeq ($(ARCH), i486)
+ ARCH_DATA_MODEL = 32
+ PLATFORM = bsd-i586
+ VM_PLATFORM = bsd_i486
+ HS_ARCH = x86
+endif
+
+# i686
+ifeq ($(ARCH), i686)
+ ARCH_DATA_MODEL = 32
+ PLATFORM = bsd-i586
+ VM_PLATFORM = bsd_i486
+ HS_ARCH = x86
+endif
+
+JDK_INCLUDE_SUBDIR=bsd
+
+# FIXUP: The subdirectory for a debug build is NOT the same on all platforms
+VM_DEBUG=jvmg
+
+EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
+EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
+EXPORT_LIST += $(EXPORT_SERVER_DIR)/Xusage.txt
+EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjsig.$(LIBRARY_SUFFIX)
+EXPORT_LIST += $(EXPORT_SERVER_DIR)/libjvm.$(LIBRARY_SUFFIX)
+ifeq ($(ARCH_DATA_MODEL), 32)
+ EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/Xusage.txt
+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjsig.$(LIBRARY_SUFFIX)
+ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
+endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/dtrace.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,27 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Bsd does not build jvm_db
+LIBJVM_DB =
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/fastdebug.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,64 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making debug version of VM
+
+# Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make
+OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS)
+OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@))
+
+# (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files)
+
+ifeq ($(BUILDARCH), ia64)
+ # Bug in GCC, causes hang. -O1 will override the -O3 specified earlier
+ OPT_CFLAGS/callGenerator.o += -O1
+ OPT_CFLAGS/ciTypeFlow.o += -O1
+ OPT_CFLAGS/compile.o += -O1
+ OPT_CFLAGS/concurrentMarkSweepGeneration.o += -O1
+ OPT_CFLAGS/doCall.o += -O1
+ OPT_CFLAGS/generateOopMap.o += -O1
+ OPT_CFLAGS/generateOptoStub.o += -O1
+ OPT_CFLAGS/graphKit.o += -O1
+ OPT_CFLAGS/instanceKlass.o += -O1
+ OPT_CFLAGS/interpreterRT_ia64.o += -O1
+ OPT_CFLAGS/output.o += -O1
+ OPT_CFLAGS/parse1.o += -O1
+ OPT_CFLAGS/runtime.o += -O1
+ OPT_CFLAGS/synchronizer.o += -O1
+endif
+
+
+# If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings
+CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE)
+
+# Set the environment variable HOTSPARC_GENERIC to "true"
+# to inhibit the effect of the previous line on CFLAGS.
+
+# Linker mapfile
+MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
+
+G_SUFFIX =
+VERSION = optimized
+SYSDEFS += -DASSERT -DFASTDEBUG
+PICFLAGS = DEFAULT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/gcc.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,197 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+OS_VENDOR = $(shell uname -s)
+
+#------------------------------------------------------------------------
+# CC, CPP & AS
+
+CXX ?= g++
+CPP = $(CXX)
+CC ?= gcc
+AS = $(CC) -c -x assembler-with-cpp
+
+# -dumpversion in gcc-2.91 shows "egcs-2.91.66". In later version, it only
+# prints the numbers (e.g. "2.95", "3.2.1")
+CC_VER_MAJOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f1)
+CC_VER_MINOR := $(shell $(CC) -dumpversion | sed 's/egcs-//' | cut -d'.' -f2)
+
+# check for precompiled headers support
+ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 3 \) \| \( \( $(CC_VER_MAJOR) = 3 \) \& \( $(CC_VER_MINOR) \>= 4 \) \))" "0"
+USE_PRECOMPILED_HEADER=1
+PRECOMPILED_HEADER_DIR=.
+PRECOMPILED_HEADER=$(PRECOMPILED_HEADER_DIR)/incls/_precompiled.incl.gch
+endif
+
+
+#------------------------------------------------------------------------
+# Compiler flags
+
+# position-independent code
+PICFLAG = -fPIC
+
+VM_PICFLAG/LIBJVM = $(PICFLAG)
+VM_PICFLAG/AOUT =
+VM_PICFLAG = $(VM_PICFLAG/$(LINK_INTO))
+
+CFLAGS += $(VM_PICFLAG)
+CFLAGS += -fno-rtti
+CFLAGS += -fno-exceptions
+CFLAGS += -pthread
+CFLAGS += -fcheck-new
+
+ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
+ARCHFLAG/i486 = -m32 -march=i586
+ARCHFLAG/amd64 = -m64
+ARCHFLAG/ia64 =
+ARCHFLAG/sparc = -m32 -mcpu=v9
+ARCHFLAG/sparcv9 = -m64 -mcpu=v9
+
+# Darwin-specific build flags
+ifeq ($(OS_VENDOR), Darwin)
+ # Ineffecient 16-byte stack re-alignment on Darwin/IA32
+ ARCHFLAG/i486 += -mstackrealign
+
+ # -arch compiler flag required for x64_64
+ ARCHFLAGS/amd64 += -arch x86_64
+endif
+
+CFLAGS += $(ARCHFLAG)
+AOUT_FLAGS += $(ARCHFLAG)
+LFLAGS += $(ARCHFLAG)
+ASFLAGS += $(ARCHFLAG)
+
+# Use C++ Interpreter
+ifdef CC_INTERP
+ CFLAGS += -DCC_INTERP
+endif
+
+# Keep temporary files (.ii, .s)
+ifdef NEED_ASM
+ CFLAGS += -save-temps
+else
+ CFLAGS += -pipe
+endif
+
+# Compiler warnings are treated as errors
+#WARNINGS_ARE_ERRORS = -Werror
+
+# Except for a few acceptable ones
+# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
+# conversions which might affect the values. To avoid that, we need to turn
+# it off explicitly.
+ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0"
+ACCEPTABLE_WARNINGS = -Wpointer-arith -Wsign-compare
+else
+ACCEPTABLE_WARNINGS = -Wpointer-arith -Wconversion -Wsign-compare
+endif
+
+CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
+# Special cases
+CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
+# XXXDARWIN: for _dyld_bind_fully_image_containing_address
+ifeq ($(OS_VENDOR), Darwin)
+ CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
+endif
+
+
+# The flags to use for an Optimized g++ build
+OPT_CFLAGS += -O3
+
+# Hotspot uses very unstrict aliasing turn this optimization off
+OPT_CFLAGS += -fno-strict-aliasing
+
+# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
+# if we use expensive-optimizations
+ifeq ($(BUILDARCH), ia64)
+OPT_CFLAGS += -fno-expensive-optimizations
+endif
+
+OPT_CFLAGS/NOOPT=-O0
+
+#------------------------------------------------------------------------
+# Linker flags
+
+# statically link libstdc++.so, work with gcc but ignored by g++
+STATIC_STDCXX = -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic
+
+# statically link libgcc and/or libgcc_s, libgcc does not exist before gcc-3.x.
+ifneq ("${CC_VER_MAJOR}", "2")
+STATIC_LIBGCC += -static-libgcc
+endif
+
+ifeq ($(BUILDARCH), ia64)
+LFLAGS += -Wl,-relax
+endif
+
+# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
+MAPFLAG = -Xlinker --version-script=FILENAME
+
+#
+# Shared Library
+#
+ifeq ($(OS_VENDOR), Darwin)
+ # Standard linker flags
+ LFLAGS +=
+
+ # Darwin doesn't use ELF and doesn't support version scripts
+ LDNOMAP = true
+
+ # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
+ SONAMEFLAG =
+
+ # Build shared library
+ SHARED_FLAG = -dynamiclib $(VM_PICFLAG)
+
+ # Keep symbols even they are not used
+ #AOUT_FLAGS += -export-dynamic
+else
+ # Enable linker optimization
+ LFLAGS += -Xlinker -O1
+
+ # Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
+ SONAMEFLAG = -Xlinker -soname=SONAME
+
+ # Build shared library
+ SHARED_FLAG = -shared $(VM_PICFLAG)
+
+ # Keep symbols even they are not used
+ AOUT_FLAGS += -export-dynamic
+endif
+
+#------------------------------------------------------------------------
+# Debug flags
+
+# Use the stabs format for debugging information (this is the default
+# on gcc-2.91). It's good enough, has all the information about line
+# numbers and local variables, and libjvm_g.so is only about 16M.
+# Change this back to "-g" if you want the most expressive format.
+# (warning: that could easily inflate libjvm_g.so to 150M!)
+# Note: The Itanium gcc compiler crashes when using -gstabs.
+DEBUG_CFLAGS/ia64 = -g
+DEBUG_CFLAGS/amd64 = -g
+DEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
+ifeq ($(DEBUG_CFLAGS/$(BUILDARCH)),)
+DEBUG_CFLAGS += -gstabs
+endif
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/hp.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,29 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making premium version of VM
+
+TYPE=HP
+
+CFLAGS += -DCOMPILER2
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/hp1.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,29 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making premium version of VM
+
+TYPE=HP1
+
+CFLAGS += -DCOMPILER1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/i486.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,36 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# TLS helper, assembled from .s file
+# Not included in includeDB because it has no dependencies
+Obj_Files += bsd_x86_32.o
+
+# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
+OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
+# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
+OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
+# Must also specify if CPU is little endian
+CFLAGS += -DVM_LITTLE_ENDIAN
+
+OPT_CFLAGS/compactingPermGenGen.o = -O1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/ia64.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,43 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+#
+# IA64 only uses c++ based interpreter
+CFLAGS += -DCC_INTERP -D_LP64=1 -DVM_LITTLE_ENDIAN
+# Hotspot uses very unstrict aliasing turn this optimization off
+OPT_CFLAGS += -fno-strict-aliasing
+ifeq ($(VERSION),debug)
+ASM_FLAGS= -DDEBUG
+else
+ASM_FLAGS=
+endif
+# workaround gcc bug in compiling varargs
+OPT_CFLAGS/jni.o = -O0
+
+# gcc/ia64 has a bug that internal gcc functions linked with libjvm.so
+# are made public. Hiding those symbols will cause undefined symbol error
+# when VM is dropped into older JDK. We probably will need an IA64
+# mapfile to include those symbols as a workaround. Disable linker mapfile
+# for now.
+LDNOMAP=true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/jsig.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,58 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Rules to build signal interposition library, used by vm.make
+
+# libjsig[_g].so: signal interposition library
+JSIG = jsig$(G_SUFFIX)
+
+ifeq ($(OS_VENDOR), Darwin)
+ LIBJSIG = lib$(JSIG).dylib
+else
+ LIBJSIG = lib$(JSIG).so
+endif
+
+JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
+
+DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG)
+
+LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig
+
+# On Bsd we really dont want a mapfile, as this library is small
+# and preloaded using LD_PRELOAD, making functions private will
+# cause problems with interposing. See CR: 6466665
+# LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE))
+
+LFLAGS_JSIG += -D_GNU_SOURCE -pthread
+
+$(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
+ @echo Making signal interposition lib...
+ $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
+ $(LFLAGS_JSIG) -o $@ $<
+
+install_jsig: $(LIBJSIG)
+ @echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
+ $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done"
+
+.PHONY: install_jsig
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/jvmg.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,41 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making debug version of VM
+
+# Compiler specific DEBUG_CFLAGS are passed in from gcc.make, sparcWorks.make
+DEBUG_CFLAGS/DEFAULT= $(DEBUG_CFLAGS)
+DEBUG_CFLAGS/BYFILE = $(DEBUG_CFLAGS/$@)$(DEBUG_CFLAGS/DEFAULT$(DEBUG_CFLAGS/$@))
+CFLAGS += $(DEBUG_CFLAGS/BYFILE)
+
+# Set the environment variable HOTSPARC_GENERIC to "true"
+# to inhibit the effect of the previous line on CFLAGS.
+
+# Linker mapfile
+MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
+
+G_SUFFIX =
+VERSION = debug
+SYSDEFS += -DASSERT -DDEBUG
+PICFLAGS = DEFAULT
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/jvmti.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,118 @@
+#
+# Copyright 2003-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# This makefile (jvmti.make) is included from the jvmti.make in the
+# build directories.
+#
+# It knows how to build and run the tools to generate jvmti.
+
+include $(GAMMADIR)/make/bsd/makefiles/rules.make
+
+# #########################################################################
+
+TOPDIR = $(shell echo `pwd`)
+GENERATED = $(TOPDIR)/../generated
+JvmtiOutDir = $(GENERATED)/jvmtifiles
+
+JvmtiSrcDir = $(GAMMADIR)/src/share/vm/prims
+InterpreterSrcDir = $(GAMMADIR)/src/share/vm/interpreter
+Src_Dirs += $(JvmtiSrcDir)
+
+# set VPATH so make knows where to look for source files
+Src_Dirs_V = ${Src_Dirs}
+VPATH += $(Src_Dirs_V:%=%:)
+
+JvmtiGeneratedNames = \
+ jvmtiEnv.hpp \
+ jvmtiEnter.cpp \
+ jvmtiEnterTrace.cpp \
+ jvmtiEnvRecommended.cpp \
+ bytecodeInterpreterWithChecks.cpp \
+ jvmti.h \
+
+JvmtiEnvFillSource = $(JvmtiSrcDir)/jvmtiEnvFill.java
+JvmtiEnvFillClass = $(JvmtiOutDir)/jvmtiEnvFill.class
+
+JvmtiGenSource = $(JvmtiSrcDir)/jvmtiGen.java
+JvmtiGenClass = $(JvmtiOutDir)/jvmtiGen.class
+
+JvmtiGeneratedFiles = $(JvmtiGeneratedNames:%=$(JvmtiOutDir)/%)
+
+XSLT = $(QUIETLY) $(REMOTE) $(RUN.JAVA) -classpath $(JvmtiOutDir) jvmtiGen
+
+.PHONY: all jvmtidocs clean cleanall
+
+# #########################################################################
+
+all: $(JvmtiGeneratedFiles)
+
+both = $(JvmtiGenClass) $(JvmtiSrcDir)/jvmti.xml $(JvmtiSrcDir)/jvmtiLib.xsl
+
+$(JvmtiGenClass): $(JvmtiGenSource)
+ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -g -d $(JvmtiOutDir) $(JvmtiGenSource)
+
+$(JvmtiEnvFillClass): $(JvmtiEnvFillSource)
+ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -g -d $(JvmtiOutDir) $(JvmtiEnvFillSource)
+
+$(JvmtiOutDir)/jvmtiEnter.cpp: $(both) $(JvmtiSrcDir)/jvmtiEnter.xsl
+ @echo Generating $@
+ $(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiEnter.xsl -OUT $(JvmtiOutDir)/jvmtiEnter.cpp -PARAM interface jvmti
+
+$(JvmtiOutDir)/bytecodeInterpreterWithChecks.cpp: $(JvmtiGenClass) $(InterpreterSrcDir)/bytecodeInterpreter.cpp $(InterpreterSrcDir)/bytecodeInterpreterWithChecks.xml $(InterpreterSrcDir)/bytecodeInterpreterWithChecks.xsl
+ @echo Generating $@
+ $(XSLT) -IN $(InterpreterSrcDir)/bytecodeInterpreterWithChecks.xml -XSL $(InterpreterSrcDir)/bytecodeInterpreterWithChecks.xsl -OUT $(JvmtiOutDir)/bytecodeInterpreterWithChecks.cpp
+
+$(JvmtiOutDir)/jvmtiEnterTrace.cpp: $(both) $(JvmtiSrcDir)/jvmtiEnter.xsl
+ @echo Generating $@
+ $(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiEnter.xsl -OUT $(JvmtiOutDir)/jvmtiEnterTrace.cpp -PARAM interface jvmti -PARAM trace Trace
+
+$(JvmtiOutDir)/jvmtiEnvRecommended.cpp: $(both) $(JvmtiSrcDir)/jvmtiEnv.xsl $(JvmtiSrcDir)/jvmtiEnv.cpp $(JvmtiEnvFillClass)
+ @echo Generating $@
+ $(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiEnv.xsl -OUT $(JvmtiOutDir)/jvmtiEnvStub.cpp
+ $(QUIETLY) $(REMOTE) $(RUN.JAVA) -classpath $(JvmtiOutDir) jvmtiEnvFill $(JvmtiSrcDir)/jvmtiEnv.cpp $(JvmtiOutDir)/jvmtiEnvStub.cpp $(JvmtiOutDir)/jvmtiEnvRecommended.cpp
+
+$(JvmtiOutDir)/jvmtiEnv.hpp: $(both) $(JvmtiSrcDir)/jvmtiHpp.xsl
+ @echo Generating $@
+ $(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiHpp.xsl -OUT $(JvmtiOutDir)/jvmtiEnv.hpp
+
+$(JvmtiOutDir)/jvmti.h: $(both) $(JvmtiSrcDir)/jvmtiH.xsl
+ @echo Generating $@
+ $(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmtiH.xsl -OUT $(JvmtiOutDir)/jvmti.h
+
+jvmtidocs: $(JvmtiOutDir)/jvmti.html
+
+$(JvmtiOutDir)/jvmti.html: $(both) $(JvmtiSrcDir)/jvmti.xsl
+ @echo Generating $@
+ $(XSLT) -IN $(JvmtiSrcDir)/jvmti.xml -XSL $(JvmtiSrcDir)/jvmti.xsl -OUT $(JvmtiOutDir)/jvmti.html
+
+# #########################################################################
+
+clean :
+ rm $(JvmtiGenClass) $(JvmtiEnvFillClass) $(JvmtiGeneratedFiles)
+
+cleanall :
+ rm $(JvmtiGenClass) $(JvmtiEnvFillClass) $(JvmtiGeneratedFiles)
+
+# #########################################################################
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/launcher.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,73 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Rules to build gamma launcher, used by vm.make
+
+# gamma[_g]: launcher
+LAUNCHER = gamma$(G_SUFFIX)
+
+LAUNCHERDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/launcher
+LAUNCHERFLAGS = $(ARCHFLAG) \
+ -I$(LAUNCHERDIR) -I$(GAMMADIR)/src/share/vm/prims \
+ -DFULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
+ -DARCH=\"$(LIBARCH)\" \
+ -DGAMMA \
+ -DLAUNCHER_TYPE=\"gamma\" \
+ -DLINK_INTO_$(LINK_INTO)
+
+ifeq ($(LINK_INTO),AOUT)
+ LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
+ LAUNCHER_MAPFILE = mapfile_reorder
+ LFLAGS_LAUNCHER$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LAUNCHER_MAPFILE))
+ LFLAGS_LAUNCHER += $(SONAMEFLAG:SONAME=$(LIBJVM)) $(STATIC_LIBGCC)
+ LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS)
+else
+ LAUNCHER.o = launcher.o
+ LFLAGS_LAUNCHER += -L`pwd`
+ LIBS_LAUNCHER += -l$(JVM) $(LIBS)
+endif
+
+LINK_LAUNCHER = $(LINK.c)
+
+LINK_LAUNCHER/PRE_HOOK = $(LINK_LIB.CC/PRE_HOOK)
+LINK_LAUNCHER/POST_HOOK = $(LINK_LIB.CC/POST_HOOK)
+
+launcher.o: launcher.c $(LAUNCHERDIR)/java.c $(LAUNCHERDIR)/java_md.c
+ $(CC) -g -c -o $@ launcher.c $(LAUNCHERFLAGS) $(CPPFLAGS)
+
+launcher.c:
+ @echo Generating $@
+ $(QUIETLY) { \
+ echo '#define debug launcher_debug'; \
+ echo '#include "java.c"'; \
+ echo '#include "java_md.c"'; \
+ } > $@
+
+$(LAUNCHER): $(LAUNCHER.o) $(LIBJVM) $(LAUNCHER_MAPFILE)
+ $(QUIETLY) { \
+ echo Linking launcher...; \
+ $(LINK_LAUNCHER/PRE_HOOK) \
+ $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(LAUNCHER.o) $(LIBS_LAUNCHER); \
+ $(LINK_LAUNCHER/POST_HOOK) \
+ }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/makedeps.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,43 @@
+#
+# Copyright 2000-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+include $(GAMMADIR)/make/bsd/makefiles/rules.make
+
+COMPILE.JAVAC.FLAGS += -d $(OUTDIR)
+
+MakeDepsSources=\
+ $(GAMMADIR)/src/share/tools/MakeDeps/Database.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTree.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/DirectoryTreeNode.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/FileFormatException.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/FileList.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/FileName.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/Macro.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/MacroDefinitions.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/MakeDeps.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/MetroWerksMacPlatform.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/Platform.java \
+ $(GAMMADIR)/src/share/tools/MakeDeps/UnixPlatform.java
+
+MakeDepsOptions=
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/mapfile-vers-debug Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,295 @@
+#
+# @(#)mapfile-vers-debug 1.18 07/10/25 16:47:35
+#
+
+#
+# Copyright 2002-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Define public interface.
+
+SUNWprivate_1.1 {
+ global:
+ # JNI
+ JNI_CreateJavaVM;
+ JNI_GetCreatedJavaVMs;
+ JNI_GetDefaultJavaVMInitArgs;
+
+ # JVM
+ JVM_Accept;
+ JVM_ActiveProcessorCount;
+ JVM_AllocateNewArray;
+ JVM_AllocateNewObject;
+ JVM_ArrayCopy;
+ JVM_AssertionStatusDirectives;
+ JVM_Available;
+ JVM_Bind;
+ JVM_ClassDepth;
+ JVM_ClassLoaderDepth;
+ JVM_Clone;
+ JVM_Close;
+ JVM_CX8Field;
+ JVM_CompileClass;
+ JVM_CompileClasses;
+ JVM_CompilerCommand;
+ JVM_Connect;
+ JVM_ConstantPoolGetClassAt;
+ JVM_ConstantPoolGetClassAtIfLoaded;
+ JVM_ConstantPoolGetDoubleAt;
+ JVM_ConstantPoolGetFieldAt;
+ JVM_ConstantPoolGetFieldAtIfLoaded;
+ JVM_ConstantPoolGetFloatAt;
+ JVM_ConstantPoolGetIntAt;
+ JVM_ConstantPoolGetLongAt;
+ JVM_ConstantPoolGetMethodAt;
+ JVM_ConstantPoolGetMethodAtIfLoaded;
+ JVM_ConstantPoolGetMemberRefInfoAt;
+ JVM_ConstantPoolGetSize;
+ JVM_ConstantPoolGetStringAt;
+ JVM_ConstantPoolGetUTF8At;
+ JVM_CountStackFrames;
+ JVM_CurrentClassLoader;
+ JVM_CurrentLoadedClass;
+ JVM_CurrentThread;
+ JVM_CurrentTimeMillis;
+ JVM_DefineClass;
+ JVM_DefineClassWithSource;
+ JVM_DesiredAssertionStatus;
+ JVM_DisableCompiler;
+ JVM_DoPrivileged;
+ JVM_DTraceGetVersion;
+ JVM_DTraceActivate;
+ JVM_DTraceIsProbeEnabled;
+ JVM_DTraceIsSupported;
+ JVM_DTraceDispose;
+ JVM_DumpAllStacks;
+ JVM_DumpThreads;
+ JVM_EnableCompiler;
+ JVM_Exit;
+ JVM_FillInStackTrace;
+ JVM_FindClassFromClass;
+ JVM_FindClassFromClassLoader;
+ JVM_FindClassFromBootLoader;
+ JVM_FindLibraryEntry;
+ JVM_FindLoadedClass;
+ JVM_FindPrimitiveClass;
+ JVM_FindSignal;
+ JVM_FreeMemory;
+ JVM_GC;
+ JVM_GetAllThreads;
+ JVM_GetArrayElement;
+ JVM_GetArrayLength;
+ JVM_GetCPClassNameUTF;
+ JVM_GetCPFieldClassNameUTF;
+ JVM_GetCPFieldModifiers;
+ JVM_GetCPFieldNameUTF;
+ JVM_GetCPFieldSignatureUTF;
+ JVM_GetCPMethodClassNameUTF;
+ JVM_GetCPMethodModifiers;
+ JVM_GetCPMethodNameUTF;
+ JVM_GetCPMethodSignatureUTF;
+ JVM_GetCallerClass;
+ JVM_GetClassAccessFlags;
+ JVM_GetClassAnnotations;
+ JVM_GetClassCPEntriesCount;
+ JVM_GetClassCPTypes;
+ JVM_GetClassConstantPool;
+ JVM_GetClassContext;
+ JVM_GetClassDeclaredConstructors;
+ JVM_GetClassDeclaredFields;
+ JVM_GetClassDeclaredMethods;
+ JVM_GetClassFieldsCount;
+ JVM_GetClassInterfaces;
+ JVM_GetClassLoader;
+ JVM_GetClassMethodsCount;
+ JVM_GetClassModifiers;
+ JVM_GetClassName;
+ JVM_GetClassNameUTF;
+ JVM_GetClassSignature;
+ JVM_GetClassSigners;
+ JVM_GetComponentType;
+ JVM_GetDeclaredClasses;
+ JVM_GetDeclaringClass;
+ JVM_GetEnclosingMethodInfo;
+ JVM_GetFieldAnnotations;
+ JVM_GetFieldIxModifiers;
+ JVM_GetHostName;
+ JVM_GetInheritedAccessControlContext;
+ JVM_GetInterfaceVersion;
+ JVM_GetLastErrorString;
+ JVM_GetManagement;
+ JVM_GetMethodAnnotations;
+ JVM_GetMethodDefaultAnnotationValue;
+ JVM_GetMethodIxArgsSize;
+ JVM_GetMethodIxByteCode;
+ JVM_GetMethodIxByteCodeLength;
+ JVM_GetMethodIxExceptionIndexes;
+ JVM_GetMethodIxExceptionTableEntry;
+ JVM_GetMethodIxExceptionTableLength;
+ JVM_GetMethodIxExceptionsCount;
+ JVM_GetMethodIxLocalsCount;
+ JVM_GetMethodIxMaxStack;
+ JVM_GetMethodIxModifiers;
+ JVM_GetMethodIxNameUTF;
+ JVM_GetMethodIxSignatureUTF;
+ JVM_GetMethodParameterAnnotations;
+ JVM_GetPrimitiveArrayElement;
+ JVM_GetProtectionDomain;
+ JVM_GetSockName;
+ JVM_GetSockOpt;
+ JVM_GetStackAccessControlContext;
+ JVM_GetStackTraceDepth;
+ JVM_GetStackTraceElement;
+ JVM_GetSystemPackage;
+ JVM_GetSystemPackages;
+ JVM_GetThreadStateNames;
+ JVM_GetThreadStateValues;
+ JVM_GetVersionInfo;
+ JVM_Halt;
+ JVM_HoldsLock;
+ JVM_IHashCode;
+ JVM_InitAgentProperties;
+ JVM_InitProperties;
+ JVM_InitializeCompiler;
+ JVM_InitializeSocketLibrary;
+ JVM_InternString;
+ JVM_Interrupt;
+ JVM_InvokeMethod;
+ JVM_IsArrayClass;
+ JVM_IsConstructorIx;
+ JVM_IsInterface;
+ JVM_IsInterrupted;
+ JVM_IsNaN;
+ JVM_IsPrimitiveClass;
+ JVM_IsSameClassPackage;
+ JVM_IsSilentCompiler;
+ JVM_IsSupportedJNIVersion;
+ JVM_IsThreadAlive;
+ JVM_LatestUserDefinedLoader;
+ JVM_Listen;
+ JVM_LoadClass0;
+ JVM_LoadLibrary;
+ JVM_Lseek;
+ JVM_MaxObjectInspectionAge;
+ JVM_MaxMemory;
+ JVM_MonitorNotify;
+ JVM_MonitorNotifyAll;
+ JVM_MonitorWait;
+ JVM_NanoTime;
+ JVM_NativePath;
+ JVM_NewArray;
+ JVM_NewInstanceFromConstructor;
+ JVM_NewMultiArray;
+ JVM_OnExit;
+ JVM_Open;
+ JVM_PrintStackTrace;
+ JVM_RaiseSignal;
+ JVM_RawMonitorCreate;
+ JVM_RawMonitorDestroy;
+ JVM_RawMonitorEnter;
+ JVM_RawMonitorExit;
+ JVM_Read;
+ JVM_Recv;
+ JVM_RecvFrom;
+ JVM_RegisterSignal;
+ JVM_ReleaseUTF;
+ JVM_ResolveClass;
+ JVM_ResumeThread;
+ JVM_Send;
+ JVM_SendTo;
+ JVM_SetArrayElement;
+ JVM_SetClassSigners;
+ JVM_SetLength;
+ JVM_SetPrimitiveArrayElement;
+ JVM_SetProtectionDomain;
+ JVM_SetSockOpt;
+ JVM_SetThreadPriority;
+ JVM_Sleep;
+ JVM_Socket;
+ JVM_SocketAvailable;
+ JVM_SocketClose;
+ JVM_SocketShutdown;
+ JVM_StartThread;
+ JVM_StopThread;
+ JVM_SuspendThread;
+ JVM_SupportsCX8;
+ JVM_Sync;
+ JVM_Timeout;
+ JVM_TotalMemory;
+ JVM_TraceInstructions;
+ JVM_TraceMethodCalls;
+ JVM_UnloadLibrary;
+ JVM_Write;
+ JVM_Yield;
+ JVM_handle_bsd_signal;
+
+ # Old reflection routines
+ # These do not need to be present in the product build in JDK 1.4
+ # but their code has not been removed yet because there will not
+ # be a substantial code savings until JVM_InvokeMethod and
+ # JVM_NewInstanceFromConstructor can also be removed; see
+ # reflectionCompat.hpp.
+ JVM_GetClassConstructor;
+ JVM_GetClassConstructors;
+ JVM_GetClassField;
+ JVM_GetClassFields;
+ JVM_GetClassMethod;
+ JVM_GetClassMethods;
+ JVM_GetField;
+ JVM_GetPrimitiveField;
+ JVM_NewInstance;
+ JVM_SetField;
+ JVM_SetPrimitiveField;
+
+ # Needed for dropping VM into JDK 1.3.x, 1.4
+ _JVM_native_threads;
+ jdk_sem_init;
+ jdk_sem_post;
+ jdk_sem_wait;
+ jdk_pthread_sigmask;
+ jdk_waitpid;
+
+ # debug JVM
+ JVM_AccessVMBooleanFlag;
+ JVM_AccessVMIntFlag;
+ JVM_VMBreakPoint;
+
+ # miscellaneous functions
+ jio_fprintf;
+ jio_printf;
+ jio_snprintf;
+ jio_vfprintf;
+ jio_vsnprintf;
+ fork1;
+ numa_warn;
+ numa_error;
+
+ # Needed because there is no JVM interface for this.
+ sysThreadAvailableStackWithSlack;
+
+ # This is for Forte Analyzer profiling support.
+ AsyncGetCallTrace;
+ local:
+ *;
+};
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/mapfile-vers-jsig Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,40 @@
+#
+
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Define library interface.
+
+SUNWprivate_1.1 {
+ global:
+ JVM_begin_signal_setting;
+ JVM_end_signal_setting;
+ JVM_get_libjsig_version;
+ JVM_get_signal_action;
+ sigaction;
+ signal;
+ sigset;
+ local:
+ *;
+};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/mapfile-vers-product Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,290 @@
+#
+# @(#)mapfile-vers-product 1.19 08/02/12 10:56:37
+#
+
+#
+# Copyright 2002-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Define public interface.
+
+SUNWprivate_1.1 {
+ global:
+ # JNI
+ JNI_CreateJavaVM;
+ JNI_GetCreatedJavaVMs;
+ JNI_GetDefaultJavaVMInitArgs;
+
+ # JVM
+ JVM_Accept;
+ JVM_ActiveProcessorCount;
+ JVM_AllocateNewArray;
+ JVM_AllocateNewObject;
+ JVM_ArrayCopy;
+ JVM_AssertionStatusDirectives;
+ JVM_Available;
+ JVM_Bind;
+ JVM_ClassDepth;
+ JVM_ClassLoaderDepth;
+ JVM_Clone;
+ JVM_Close;
+ JVM_CX8Field;
+ JVM_CompileClass;
+ JVM_CompileClasses;
+ JVM_CompilerCommand;
+ JVM_Connect;
+ JVM_ConstantPoolGetClassAt;
+ JVM_ConstantPoolGetClassAtIfLoaded;
+ JVM_ConstantPoolGetDoubleAt;
+ JVM_ConstantPoolGetFieldAt;
+ JVM_ConstantPoolGetFieldAtIfLoaded;
+ JVM_ConstantPoolGetFloatAt;
+ JVM_ConstantPoolGetIntAt;
+ JVM_ConstantPoolGetLongAt;
+ JVM_ConstantPoolGetMethodAt;
+ JVM_ConstantPoolGetMethodAtIfLoaded;
+ JVM_ConstantPoolGetMemberRefInfoAt;
+ JVM_ConstantPoolGetSize;
+ JVM_ConstantPoolGetStringAt;
+ JVM_ConstantPoolGetUTF8At;
+ JVM_CountStackFrames;
+ JVM_CurrentClassLoader;
+ JVM_CurrentLoadedClass;
+ JVM_CurrentThread;
+ JVM_CurrentTimeMillis;
+ JVM_DefineClass;
+ JVM_DefineClassWithSource;
+ JVM_DesiredAssertionStatus;
+ JVM_DisableCompiler;
+ JVM_DoPrivileged;
+ JVM_DTraceGetVersion;
+ JVM_DTraceActivate;
+ JVM_DTraceIsProbeEnabled;
+ JVM_DTraceIsSupported;
+ JVM_DTraceDispose;
+ JVM_DumpAllStacks;
+ JVM_DumpThreads;
+ JVM_EnableCompiler;
+ JVM_Exit;
+ JVM_FillInStackTrace;
+ JVM_FindClassFromClass;
+ JVM_FindClassFromClassLoader;
+ JVM_FindClassFromBootLoader;
+ JVM_FindLibraryEntry;
+ JVM_FindLoadedClass;
+ JVM_FindPrimitiveClass;
+ JVM_FindSignal;
+ JVM_FreeMemory;
+ JVM_GC;
+ JVM_GetAllThreads;
+ JVM_GetArrayElement;
+ JVM_GetArrayLength;
+ JVM_GetCPClassNameUTF;
+ JVM_GetCPFieldClassNameUTF;
+ JVM_GetCPFieldModifiers;
+ JVM_GetCPFieldNameUTF;
+ JVM_GetCPFieldSignatureUTF;
+ JVM_GetCPMethodClassNameUTF;
+ JVM_GetCPMethodModifiers;
+ JVM_GetCPMethodNameUTF;
+ JVM_GetCPMethodSignatureUTF;
+ JVM_GetCallerClass;
+ JVM_GetClassAccessFlags;
+ JVM_GetClassAnnotations;
+ JVM_GetClassCPEntriesCount;
+ JVM_GetClassCPTypes;
+ JVM_GetClassConstantPool;
+ JVM_GetClassContext;
+ JVM_GetClassDeclaredConstructors;
+ JVM_GetClassDeclaredFields;
+ JVM_GetClassDeclaredMethods;
+ JVM_GetClassFieldsCount;
+ JVM_GetClassInterfaces;
+ JVM_GetClassLoader;
+ JVM_GetClassMethodsCount;
+ JVM_GetClassModifiers;
+ JVM_GetClassName;
+ JVM_GetClassNameUTF;
+ JVM_GetClassSignature;
+ JVM_GetClassSigners;
+ JVM_GetComponentType;
+ JVM_GetDeclaredClasses;
+ JVM_GetDeclaringClass;
+ JVM_GetEnclosingMethodInfo;
+ JVM_GetFieldAnnotations;
+ JVM_GetFieldIxModifiers;
+ JVM_GetHostName;
+ JVM_GetInheritedAccessControlContext;
+ JVM_GetInterfaceVersion;
+ JVM_GetLastErrorString;
+ JVM_GetManagement;
+ JVM_GetMethodAnnotations;
+ JVM_GetMethodDefaultAnnotationValue;
+ JVM_GetMethodIxArgsSize;
+ JVM_GetMethodIxByteCode;
+ JVM_GetMethodIxByteCodeLength;
+ JVM_GetMethodIxExceptionIndexes;
+ JVM_GetMethodIxExceptionTableEntry;
+ JVM_GetMethodIxExceptionTableLength;
+ JVM_GetMethodIxExceptionsCount;
+ JVM_GetMethodIxLocalsCount;
+ JVM_GetMethodIxMaxStack;
+ JVM_GetMethodIxModifiers;
+ JVM_GetMethodIxNameUTF;
+ JVM_GetMethodIxSignatureUTF;
+ JVM_GetMethodParameterAnnotations;
+ JVM_GetPrimitiveArrayElement;
+ JVM_GetProtectionDomain;
+ JVM_GetSockName;
+ JVM_GetSockOpt;
+ JVM_GetStackAccessControlContext;
+ JVM_GetStackTraceDepth;
+ JVM_GetStackTraceElement;
+ JVM_GetSystemPackage;
+ JVM_GetSystemPackages;
+ JVM_GetThreadStateNames;
+ JVM_GetThreadStateValues;
+ JVM_GetVersionInfo;
+ JVM_Halt;
+ JVM_HoldsLock;
+ JVM_IHashCode;
+ JVM_InitAgentProperties;
+ JVM_InitProperties;
+ JVM_InitializeCompiler;
+ JVM_InitializeSocketLibrary;
+ JVM_InternString;
+ JVM_Interrupt;
+ JVM_InvokeMethod;
+ JVM_IsArrayClass;
+ JVM_IsConstructorIx;
+ JVM_IsInterface;
+ JVM_IsInterrupted;
+ JVM_IsNaN;
+ JVM_IsPrimitiveClass;
+ JVM_IsSameClassPackage;
+ JVM_IsSilentCompiler;
+ JVM_IsSupportedJNIVersion;
+ JVM_IsThreadAlive;
+ JVM_LatestUserDefinedLoader;
+ JVM_Listen;
+ JVM_LoadClass0;
+ JVM_LoadLibrary;
+ JVM_Lseek;
+ JVM_MaxObjectInspectionAge;
+ JVM_MaxMemory;
+ JVM_MonitorNotify;
+ JVM_MonitorNotifyAll;
+ JVM_MonitorWait;
+ JVM_NanoTime;
+ JVM_NativePath;
+ JVM_NewArray;
+ JVM_NewInstanceFromConstructor;
+ JVM_NewMultiArray;
+ JVM_OnExit;
+ JVM_Open;
+ JVM_PrintStackTrace;
+ JVM_RaiseSignal;
+ JVM_RawMonitorCreate;
+ JVM_RawMonitorDestroy;
+ JVM_RawMonitorEnter;
+ JVM_RawMonitorExit;
+ JVM_Read;
+ JVM_Recv;
+ JVM_RecvFrom;
+ JVM_RegisterSignal;
+ JVM_ReleaseUTF;
+ JVM_ResolveClass;
+ JVM_ResumeThread;
+ JVM_Send;
+ JVM_SendTo;
+ JVM_SetArrayElement;
+ JVM_SetClassSigners;
+ JVM_SetLength;
+ JVM_SetPrimitiveArrayElement;
+ JVM_SetProtectionDomain;
+ JVM_SetSockOpt;
+ JVM_SetThreadPriority;
+ JVM_Sleep;
+ JVM_Socket;
+ JVM_SocketAvailable;
+ JVM_SocketClose;
+ JVM_SocketShutdown;
+ JVM_StartThread;
+ JVM_StopThread;
+ JVM_SuspendThread;
+ JVM_SupportsCX8;
+ JVM_Sync;
+ JVM_Timeout;
+ JVM_TotalMemory;
+ JVM_TraceInstructions;
+ JVM_TraceMethodCalls;
+ JVM_UnloadLibrary;
+ JVM_Write;
+ JVM_Yield;
+ JVM_handle_bsd_signal;
+
+ # Old reflection routines
+ # These do not need to be present in the product build in JDK 1.4
+ # but their code has not been removed yet because there will not
+ # be a substantial code savings until JVM_InvokeMethod and
+ # JVM_NewInstanceFromConstructor can also be removed; see
+ # reflectionCompat.hpp.
+ JVM_GetClassConstructor;
+ JVM_GetClassConstructors;
+ JVM_GetClassField;
+ JVM_GetClassFields;
+ JVM_GetClassMethod;
+ JVM_GetClassMethods;
+ JVM_GetField;
+ JVM_GetPrimitiveField;
+ JVM_NewInstance;
+ JVM_SetField;
+ JVM_SetPrimitiveField;
+
+ # Needed for dropping VM into JDK 1.3.x, 1.4
+ _JVM_native_threads;
+ jdk_sem_init;
+ jdk_sem_post;
+ jdk_sem_wait;
+ jdk_pthread_sigmask;
+ jdk_waitpid;
+
+ # miscellaneous functions
+ jio_fprintf;
+ jio_printf;
+ jio_snprintf;
+ jio_vfprintf;
+ jio_vsnprintf;
+ fork1;
+ numa_warn;
+ numa_error;
+
+ # Needed because there is no JVM interface for this.
+ sysThreadAvailableStackWithSlack;
+
+ # This is for Forte Analyzer profiling support.
+ AsyncGetCallTrace;
+ local:
+ *;
+};
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/optimized.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,44 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making optimized version of Gamma VM
+# (This is the "product", not the "release" version.)
+
+# Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make
+OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS)
+OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@))
+
+# (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files)
+
+# If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings
+CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE)
+
+# Set the environment variable HOTSPARC_GENERIC to "true"
+# to inhibit the effect of the previous line on CFLAGS.
+
+# Linker mapfile
+MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug
+
+G_SUFFIX =
+VERSION = optimized
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/product.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,54 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making optimized version of Gamma VM
+# (This is the "product", not the "release" version.)
+
+# Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make
+OPT_CFLAGS/DEFAULT= $(OPT_CFLAGS)
+OPT_CFLAGS/BYFILE = $(OPT_CFLAGS/$@)$(OPT_CFLAGS/DEFAULT$(OPT_CFLAGS/$@))
+
+# (OPT_CFLAGS/SLOWER is also available, to alter compilation of buggy files)
+
+# If you set HOTSPARC_GENERIC=yes, you disable all OPT_CFLAGS settings
+CFLAGS$(HOTSPARC_GENERIC) += $(OPT_CFLAGS/BYFILE)
+
+# Set the environment variable HOTSPARC_GENERIC to "true"
+# to inhibit the effect of the previous line on CFLAGS.
+
+# Linker mapfile
+MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-product
+
+G_SUFFIX =
+SYSDEFS += -DPRODUCT
+VERSION = optimized
+
+# use -g to strip library as -x will discard its symbol table; -x is fine for
+# executables.
+STRIP = strip
+STRIP_LIBJVM = $(STRIP) -g $@ || exit 1;
+STRIP_AOUT = $(STRIP) -x $@ || exit 1;
+
+# Don't strip in VM build; JDK build will strip libraries later
+# LINK_LIB.CC/POST_HOOK += $(STRIP_$(LINK_INTO))
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/profiled.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,30 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making profiled version of Gamma VM
+# (It is also optimized.)
+
+CFLAGS += -pg
+AOUT_FLAGS += -pg
+LDNOMAP = true
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/rules.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,198 @@
+#
+# Copyright 2003-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Common rules/macros for the vm, adlc.
+
+# Tell make that .cpp is important
+.SUFFIXES: .cpp $(SUFFIXES)
+
+# For now. Other makefiles use CPP as the c++ compiler, but that should really
+# name the preprocessor.
+ifeq ($(CCC),)
+CCC = $(CPP)
+endif
+
+DEMANGLER = c++filt
+DEMANGLE = $(DEMANGLER) < $@ > .$@ && mv -f .$@ $@
+
+# $(CC) is the c compiler (cc/gcc), $(CCC) is the c++ compiler (CC/g++).
+C_COMPILE = $(CC) $(CPPFLAGS) $(CFLAGS)
+CC_COMPILE = $(CCC) $(CPPFLAGS) $(CFLAGS)
+
+AS.S = $(AS) $(ASFLAGS)
+
+COMPILE.c = $(C_COMPILE) -c
+GENASM.c = $(C_COMPILE) -S
+LINK.c = $(CC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)
+LINK_LIB.c = $(CC) $(LFLAGS) $(SHARED_FLAG)
+PREPROCESS.c = $(C_COMPILE) -E
+
+COMPILE.CC = $(CC_COMPILE) -c
+GENASM.CC = $(CC_COMPILE) -S
+LINK.CC = $(CCC) $(LFLAGS) $(AOUT_FLAGS) $(PROF_AOUT_FLAGS)
+LINK_NOPROF.CC = $(CCC) $(LFLAGS) $(AOUT_FLAGS)
+LINK_LIB.CC = $(CCC) $(LFLAGS) $(SHARED_FLAG)
+PREPROCESS.CC = $(CC_COMPILE) -E
+
+# Effect of REMOVE_TARGET is to delete out-of-date files during "gnumake -k".
+REMOVE_TARGET = rm -f $@
+
+# Synonyms.
+COMPILE.cpp = $(COMPILE.CC)
+GENASM.cpp = $(GENASM.CC)
+LINK.cpp = $(LINK.CC)
+LINK_LIB.cpp = $(LINK_LIB.CC)
+PREPROCESS.cpp = $(PREPROCESS.CC)
+
+# Note use of ALT_BOOTDIR to explicitly specify location of java and
+# javac; this is the same environment variable used in the J2SE build
+# process for overriding the default spec, which is BOOTDIR.
+# Note also that we fall back to using JAVA_HOME if neither of these is
+# specified.
+
+ifdef ALT_BOOTDIR
+
+RUN.JAVA = $(ALT_BOOTDIR)/bin/java
+RUN.JAVAP = $(ALT_BOOTDIR)/bin/javap
+RUN.JAVAH = $(ALT_BOOTDIR)/bin/javah
+RUN.JAR = $(ALT_BOOTDIR)/bin/jar
+COMPILE.JAVAC = $(ALT_BOOTDIR)/bin/javac
+COMPILE.RMIC = $(ALT_BOOTDIR)/bin/rmic
+BOOT_JAVA_HOME = $(ALT_BOOTDIR)
+
+else
+
+ifdef BOOTDIR
+
+RUN.JAVA = $(BOOTDIR)/bin/java
+RUN.JAVAP = $(BOOTDIR)/bin/javap
+RUN.JAVAH = $(BOOTDIR)/bin/javah
+RUN.JAR = $(BOOTDIR)/bin/jar
+COMPILE.JAVAC = $(BOOTDIR)/bin/javac
+COMPILE.RMIC = $(BOOTDIR)/bin/rmic
+BOOT_JAVA_HOME = $(BOOTDIR)
+
+else
+
+ifdef JAVA_HOME
+
+RUN.JAVA = $(JAVA_HOME)/bin/java
+RUN.JAVAP = $(JAVA_HOME)/bin/javap
+RUN.JAVAH = $(JAVA_HOME)/bin/javah
+RUN.JAR = $(JAVA_HOME)/bin/jar
+COMPILE.JAVAC = $(JAVA_HOME)/bin/javac
+COMPILE.RMIC = $(JAVA_HOME)/bin/rmic
+BOOT_JAVA_HOME = $(JAVA_HOME)
+
+else
+
+# take from the PATH, if ALT_BOOTDIR, BOOTDIR and JAVA_HOME are not defined
+# note that this is to support hotspot build without SA. To build
+# SA along with hotspot, you need to define ALT_BOOTDIR, BOOTDIR or JAVA_HOME
+
+RUN.JAVA = java
+RUN.JAVAP = javap
+RUN.JAVAH = javah
+RUN.JAR = jar
+COMPILE.JAVAC = javac
+COMPILE.RMIC = rmic
+
+endif
+endif
+endif
+
+SUM = /usr/bin/sum
+
+# 'gmake MAKE_VERBOSE=y' gives all the gory details.
+QUIETLY$(MAKE_VERBOSE) = @
+RUN.JAR$(MAKE_VERBOSE) += >/dev/null
+
+# With parallel makes, print a message at the end of compilation.
+ifeq ($(findstring j,$(MFLAGS)),j)
+COMPILE_DONE = && { echo Done with $<; }
+endif
+
+# Include $(NONPIC_OBJ_FILES) definition
+ifndef LP64
+include $(GAMMADIR)/make/pic.make
+endif
+
+# The non-PIC object files are only generated for 32 bit platforms.
+ifdef LP64
+%.o: %.cpp
+ @echo Compiling $<
+ $(QUIETLY) $(REMOVE_TARGET)
+ $(QUIETLY) $(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+else
+%.o: %.cpp
+ @echo Compiling $<
+ $(QUIETLY) $(REMOVE_TARGET)
+ $(QUIETLY) $(if $(findstring $@, $(NONPIC_OBJ_FILES)), \
+ $(subst $(VM_PICFLAG), ,$(COMPILE.CC)) -o $@ $< $(COMPILE_DONE), \
+ $(COMPILE.CC) -o $@ $< $(COMPILE_DONE))
+endif
+
+%.o: %.s
+ @echo Assembling $<
+ $(QUIETLY) $(REMOVE_TARGET)
+ $(QUIETLY) $(AS.S) -o $@ $< $(COMPILE_DONE)
+
+%.s: %.cpp
+ @echo Generating assembly for $<
+ $(QUIETLY) $(GENASM.CC) -o $@ $<
+ $(QUIETLY) $(DEMANGLE) $(COMPILE_DONE)
+
+# Intermediate files (for debugging macros)
+%.i: %.cpp
+ @echo Preprocessing $< to $@
+ $(QUIETLY) $(PREPROCESS.CC) $< > $@ $(COMPILE_DONE)
+
+# Override gnumake built-in rules which do sccs get operations badly.
+# (They put the checked out code in the current directory, not in the
+# directory of the original file.) Since this is a symptom of a teamware
+# failure, and since not all problems can be detected by gnumake due
+# to incomplete dependency checking... just complain and stop.
+%:: s.%
+ @echo "========================================================="
+ @echo File $@
+ @echo is out of date with respect to its SCCS file.
+ @echo This file may be from an unresolved Teamware conflict.
+ @echo This is also a symptom of a Teamware bringover/putback failure
+ @echo in which SCCS files are updated but not checked out.
+ @echo Check for other out of date files in your workspace.
+ @echo "========================================================="
+ @exit 666
+
+%:: SCCS/s.%
+ @echo "========================================================="
+ @echo File $@
+ @echo is out of date with respect to its SCCS file.
+ @echo This file may be from an unresolved Teamware conflict.
+ @echo This is also a symptom of a Teamware bringover/putback failure
+ @echo in which SCCS files are updated but not checked out.
+ @echo Check for other out of date files in your workspace.
+ @echo "========================================================="
+ @exit 666
+
+.PHONY: default
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/sa.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,87 @@
+#
+# Copyright 2003-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# This makefile (sa.make) is included from the sa.make in the
+# build directories.
+
+# This makefile is used to build Serviceability Agent java code
+# and generate JNI header file for native methods.
+
+include $(GAMMADIR)/make/bsd/makefiles/rules.make
+
+AGENT_DIR = $(GAMMADIR)/agent
+
+include $(GAMMADIR)/make/sa.files
+
+TOPDIR = $(shell echo `pwd`)
+GENERATED = $(TOPDIR)/../generated
+
+# tools.jar is needed by the JDI - SA binding
+SA_CLASSPATH = $(BOOT_JAVA_HOME)/lib/tools.jar
+
+# gnumake 3.78.1 does not accept the *s that
+# are in AGENT_ALLFILES, so use the shell to expand them
+AGENT_ALLFILES := $(shell /bin/test -d $(AGENT_DIR) && /bin/ls $(AGENT_ALLFILES))
+
+SA_CLASSDIR = $(GENERATED)/saclasses
+
+SA_BUILD_VERSION_PROP = "sun.jvm.hotspot.runtime.VM.saBuildVersion=$(SA_BUILD_VERSION)"
+
+SA_PROPERTIES = $(SA_CLASSDIR)/sa.properties
+
+# if $(AGENT_DIR) does not exist, we don't build SA
+# also, we don't build SA on Itanium.
+
+all:
+ if [ -d $(AGENT_DIR) -a "$(SRCARCH)" != "ia64" ] ; then \
+ $(MAKE) -f sa.make $(GENERATED)/sa-jdi.jar; \
+ fi
+
+$(GENERATED)/sa-jdi.jar: $(AGENT_ALLFILES)
+ $(QUIETLY) echo "Making $@"
+ $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
+ echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
+ exit 1; \
+ fi
+ $(QUIETLY) if [ ! -f $(SA_CLASSPATH) ] ; then \
+ echo "Missing $(SA_CLASSPATH) file. Use 1.6.0 or later version of JDK";\
+ echo ""; \
+ exit 1; \
+ fi
+ $(QUIETLY) if [ ! -d $(SA_CLASSDIR) ] ; then \
+ mkdir -p $(SA_CLASSDIR); \
+ fi
+ $(QUIETLY) $(REMOTE) $(COMPILE.JAVAC) -source 1.4 -classpath $(SA_CLASSPATH) -g -d $(SA_CLASSDIR) $(AGENT_ALLFILES)
+ $(QUIETLY) $(REMOTE) $(COMPILE.RMIC) -classpath $(SA_CLASSDIR) -d $(SA_CLASSDIR) sun.jvm.hotspot.debugger.remote.RemoteDebuggerServer
+ $(QUIETLY) echo "$(SA_BUILD_VERSION_PROP)" > $(SA_PROPERTIES)
+ $(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
+ $(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
+ $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
+ $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
+ $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
+ $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext
+
+clean:
+ rm -rf $(SA_CLASSDIR)
+ rm -rf $(GENERATED)/sa-jdi.jar
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/saproc.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,84 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Rules to build serviceability agent library, used by vm.make
+
+# libsaproc[_g].so: serviceability agent
+SAPROC = saproc$(G_SUFFIX)
+
+ifeq ($(OS_VENDOR), Darwin)
+ LIBSAPROC = lib$(SAPROC).dylib
+else
+ LIBSAPROC = lib$(SAPROC).so
+endif
+
+AGENT_DIR = $(GAMMADIR)/agent
+
+SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
+
+SASRCFILES = $(SASRCDIR)/salibelf.c \
+ $(SASRCDIR)/symtab.c \
+ $(SASRCDIR)/libproc_impl.c \
+ $(SASRCDIR)/ps_proc.c \
+ $(SASRCDIR)/ps_core.c \
+ $(SASRCDIR)/BsdDebuggerLocal.c
+
+SAMAPFILE = $(SASRCDIR)/mapfile
+
+DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
+
+# if $(SASRCDIR) does not exist, we don't build SA
+# also, we don't build SA on Itanium.
+
+checkAndBuildSA:
+ $(QUIETLY) if [ -d $(SASRCDIR) -a "$(SRCARCH)" != "ia64" ] ; then \
+ $(MAKE) -f vm.make $(LIBSAPROC); \
+ fi
+
+SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE))
+
+$(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE)
+ $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
+ echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
+ exit 1; \
+ fi
+ @echo Making SA debugger back-end...
+ $(QUIETLY) $(CC) -D$(BUILDARCH) -D_GNU_SOURCE \
+ $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
+ -I$(SASRCDIR) \
+ -I$(GENERATED) \
+ -I$(BOOT_JAVA_HOME)/include \
+ -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
+ $(SASRCFILES) \
+ $(SA_LFLAGS) \
+ -o $@ \
+ -lthread_db
+
+install_saproc: checkAndBuildSA
+ $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \
+ echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \
+ cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \
+ fi
+
+.PHONY: checkAndBuildSA install_saproc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/sparc.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,27 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Not included in includeDB because it has no dependencies
+Obj_Files += bsd_sparc.o
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/sparcWorks.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,93 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+#------------------------------------------------------------------------
+# CC, CPP & AS
+
+CPP = CC
+CC = cc
+AS = $(CC) -c
+
+ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
+ARCHFLAG/i486 = -m32
+ARCHFLAG/amd64 = -m64
+
+CFLAGS += $(ARCHFLAG)
+AOUT_FLAGS += $(ARCHFLAG)
+LFLAGS += $(ARCHFLAG)
+ASFLAGS += $(ARCHFLAG)
+
+#------------------------------------------------------------------------
+# Compiler flags
+
+# position-independent code
+PICFLAG = -KPIC
+
+CFLAGS += $(PICFLAG)
+# no more exceptions
+CFLAGS += -features=no%except
+# Reduce code bloat by reverting back to 5.0 behavior for static initializers
+CFLAGS += -features=no%split_init
+# allow zero sized arrays
+CFLAGS += -features=zla
+
+# Use C++ Interpreter
+ifdef CC_INTERP
+ CFLAGS += -DCC_INTERP
+endif
+
+# We don't need libCstd.so and librwtools7.so, only libCrun.so
+CFLAGS += -library=Crun
+LIBS += -lCrun
+
+CFLAGS += -mt
+LFLAGS += -mt
+
+# Compiler warnings are treated as errors
+#WARNINGS_ARE_ERRORS = -errwarn=%all
+CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS)
+# Special cases
+CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
+
+# The flags to use for an Optimized build
+OPT_CFLAGS+=-xO4
+OPT_CFLAGS/NOOPT=-xO0
+
+#------------------------------------------------------------------------
+# Linker flags
+
+# Use $(MAPFLAG:FILENAME=real_file_name) to specify a map file.
+MAPFLAG = -Wl,--version-script=FILENAME
+
+# Use $(SONAMEFLAG:SONAME=soname) to specify the intrinsic name of a shared obj
+SONAMEFLAG = -h SONAME
+
+# Build shared library
+SHARED_FLAG = -G
+
+#------------------------------------------------------------------------
+# Debug flags
+DEBUG_CFLAGS += -g
+FASTDEBUG_CFLAGS = -g0
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/sparcv9.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,31 @@
+#
+# Copyright 2005-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+
+#
+# Not included in includeDB because it has no dependencies
+Obj_Files += bsd_sparc.o
+
+# gcc 4.0 miscompiles this code in -m64
+OPT_CFLAGS/macro.o = -O0
+
+CFLAGS += -D_LP64=1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/tiered.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,31 @@
+#
+# Copyright 2006-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Sets make macros for making tiered version of VM
+
+TYPE=TIERED
+
+VM_SUBDIR = server
+
+CFLAGS += -DCOMPILER2 -DCOMPILER1
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/top.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,189 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# top.make is included in the Makefile in the build directories.
+# It DOES NOT include the vm dependency info in order to be faster.
+# It's main job is to implement the incremental form of make lists.
+# It also:
+# -builds and runs adlc via adlc.make
+# -generates JVMTI source and docs via jvmti.make (JSR-163)
+# -generate sa-jdi.jar (JDI binding to core files)
+
+# It assumes the following flags are set:
+# CFLAGS Platform_file, Src_Dirs, SYSDEFS, AOUT, Obj_Files
+
+# -- D. Ungar (5/97) from a file by Bill Bush
+
+# Don't override the built-in $(MAKE).
+# Instead, use "gmake" (or "gnumake") from the command line. --Rose
+#MAKE = gmake
+
+TOPDIR = $(shell echo `pwd`)
+GENERATED = $(TOPDIR)/../generated
+VM = $(GAMMADIR)/src/share/vm
+Plat_File = $(Platform_file)
+CDG = cd $(GENERATED);
+
+# Pick up MakeDeps' sources and definitions
+include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/makedeps.make
+MakeDepsClass = MakeDeps.class
+
+ifdef USE_PRECOMPILED_HEADER
+PrecompiledOption = -DUSE_PRECOMPILED_HEADER
+UpdatePCH = $(MAKE) -f vm.make $(PRECOMPILED_HEADER) $(MFLAGS)
+else
+UpdatePCH = \# precompiled header is not used
+PrecompiledOption =
+endif
+
+MakeDeps = $(RUN.JAVA) $(PrecompiledOption) -classpath $(GENERATED) MakeDeps
+
+Include_DBs/GC = $(VM)/includeDB_gc \
+ $(VM)/includeDB_gc_parallel \
+ $(VM)/gc_implementation/includeDB_gc_parallelScavenge \
+ $(VM)/gc_implementation/includeDB_gc_concurrentMarkSweep \
+ $(VM)/gc_implementation/includeDB_gc_parNew \
+ $(VM)/gc_implementation/includeDB_gc_serial \
+ $(VM)/gc_implementation/includeDB_gc_shared
+
+Include_DBs/CORE = $(VM)/includeDB_core $(Include_DBs/GC) \
+ $(VM)/includeDB_jvmti \
+ $(VM)/includeDB_features
+Include_DBs/COMPILER1 = $(Include_DBs/CORE) $(VM)/includeDB_compiler1
+Include_DBs/COMPILER2 = $(Include_DBs/CORE) $(VM)/includeDB_compiler2
+Include_DBs/TIERED = $(Include_DBs/CORE) $(VM)/includeDB_compiler1 $(VM)/includeDB_compiler2
+Include_DBs = $(Include_DBs/$(TYPE))
+
+Cached_plat = $(GENERATED)/platform.current
+Cached_db = $(GENERATED)/includeDB.current
+
+Incremental_Lists = $(Cached_db)
+# list generation also creates $(GENERATED)/$(Cached_plat)
+
+
+AD_Dir = $(GENERATED)/adfiles
+ADLC = $(AD_Dir)/adlc
+AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch).ad
+AD_Src = $(GAMMADIR)/src/share/vm/adlc
+AD_Names = ad_$(Platform_arch).hpp ad_$(Platform_arch).cpp
+AD_Files = $(AD_Names:%=$(AD_Dir)/%)
+
+# AD_Files_If_Required/COMPILER1 = ad_stuff
+AD_Files_If_Required/COMPILER2 = ad_stuff
+AD_Files_If_Required/TIERED = ad_stuff
+AD_Files_If_Required = $(AD_Files_If_Required/$(TYPE))
+
+# Wierd argument adjustment for "gnumake -j..."
+adjust-mflags = $(GENERATED)/adjust-mflags
+MFLAGS-adjusted = -r `$(adjust-mflags) "$(MFLAGS)" "$(HOTSPOT_BUILD_JOBS)"`
+
+
+# default target: make makeDeps, update lists, make vm
+# done in stages to force sequential order with parallel make
+#
+
+default: vm_build_preliminaries the_vm
+ @echo All done.
+
+# This is an explicit dependency for the sake of parallel makes.
+vm_build_preliminaries: checks $(Incremental_Lists) $(AD_Files_If_Required) jvmti_stuff sa_stuff
+ @# We need a null action here, so implicit rules don't get consulted.
+
+# make makeDeps: (and zap the cached db files to force a nonincremental run)
+
+$(GENERATED)/$(MakeDepsClass): $(MakeDepsSources)
+ @$(REMOTE) $(COMPILE.JAVAC) -classpath $(GAMMADIR)/src/share/tools/MakeDeps -g -d $(GENERATED) $(MakeDepsSources)
+ @echo Removing $(Incremental_Lists) to force regeneration.
+ @rm -f $(Incremental_Lists)
+ @$(CDG) echo >$(Cached_plat)
+
+# make incremental_lists, if cached files out of date, run makeDeps
+
+$(Incremental_Lists): $(Include_DBs) $(Plat_File) $(GENERATED)/$(MakeDepsClass)
+ $(CDG) cat $(Include_DBs) > $(GENERATED)/includeDB
+ $(CDG) if [ ! -r incls ] ; then \
+ mkdir incls ; \
+ fi
+ $(CDG) (echo $(CDG) echo $(MakeDeps) diffs UnixPlatform $(Cached_plat) $(Cached_db) $(Plat_File) $(GENERATED)/includeDB $(MakeDepsOptions)) > makeDeps.sh
+ $(CDG) $(REMOTE) sh $(GENERATED)/makeDeps.sh
+ $(CDG) cp includeDB $(Cached_db)
+ $(CDG) cp $(Plat_File) $(Cached_plat)
+
+# symbolic target for command lines
+lists: $(Incremental_Lists)
+ @: lists are now up to date
+
+# make AD files as necessary
+ad_stuff: $(Incremental_Lists) $(adjust-mflags)
+ @$(MAKE) -f adlc.make $(MFLAGS-adjusted)
+
+# generate JVMTI files from the spec
+jvmti_stuff: $(Incremental_Lists) $(adjust-mflags)
+ @$(MAKE) -f jvmti.make $(MFLAGS-adjusted)
+
+# generate SA jar files and native header
+sa_stuff:
+ @$(MAKE) -f sa.make $(MFLAGS-adjusted)
+
+# and the VM: must use other makefile with dependencies included
+
+# We have to go to great lengths to get control over the -jN argument
+# to the recursive invocation of vm.make. The problem is that gnumake
+# resets -jN to -j1 for recursive runs. (How helpful.)
+# Note that the user must specify the desired parallelism level via a
+# command-line or environment variable name HOTSPOT_BUILD_JOBS.
+$(adjust-mflags): $(GAMMADIR)/make/$(Platform_os_family)/makefiles/adjust-mflags.sh
+ @+rm -f $@ $@+
+ @+cat $< > $@+
+ @+chmod +x $@+
+ @+mv $@+ $@
+
+the_vm: vm_build_preliminaries $(adjust-mflags)
+ @$(UpdatePCH)
+ @$(MAKE) -f vm.make $(MFLAGS-adjusted)
+
+install: the_vm
+ @$(MAKE) -f vm.make install
+
+# next rules support "make foo.[oi]"
+
+%.o %.i %.s:
+ $(UpdatePCH)
+ $(MAKE) -f vm.make $(MFLAGS) $@
+ #$(MAKE) -f vm.make $@
+
+# this should force everything to be rebuilt
+clean:
+ rm -f $(GENERATED)/*.class
+ $(MAKE) $(MFLAGS) $(GENERATED)/$(MakeDepsClass)
+ $(MAKE) -f vm.make $(MFLAGS) clean
+
+# just in case it doesn't, this should do it
+realclean:
+ $(MAKE) -f vm.make $(MFLAGS) clean
+ rm -fr $(GENERATED)
+
+.PHONY: default vm_build_preliminaries
+.PHONY: lists ad_stuff jvmti_stuff sa_stuff the_vm clean realclean
+.PHONY: checks check_os_version install
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/makefiles/vm.make Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,218 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc. 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.
+#
+# 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#
+#
+
+# Rules to build JVM and related libraries, included from vm.make in the build
+# directory.
+
+# Common build rules.
+MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles
+include $(MAKEFILES_DIR)/rules.make
+
+default: build
+
+#----------------------------------------------------------------------
+# Defs
+
+GENERATED = ../generated
+
+# read a generated file defining the set of .o's and the .o .h dependencies
+include $(GENERATED)/Dependencies
+
+# read machine-specific adjustments (%%% should do this via buildtree.make?)
+include $(MAKEFILES_DIR)/$(BUILDARCH).make
+
+# set VPATH so make knows where to look for source files
+# Src_Dirs is everything in src/share/vm/*, plus the right os/*/vm and cpu/*/vm
+# The incls directory contains generated header file lists for inclusion.
+# The adfiles directory contains ad_<arch>.[ch]pp.
+# The jvmtifiles directory contains jvmti*.[ch]pp
+Src_Dirs_V = $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)/incls
+VPATH += $(Src_Dirs_V:%=%:)
+
+# set INCLUDES for C preprocessor
+Src_Dirs_I = $(PRECOMPILED_HEADER_DIR) $(GENERATED)/adfiles $(GENERATED)/jvmtifiles ${Src_Dirs} $(GENERATED)
+INCLUDES += $(Src_Dirs_I:%=-I%)
+
+ifeq (${VERSION}, debug)
+ SYMFLAG = -g
+else
+ SYMFLAG =
+endif
+
+# HOTSPOT_RELEASE_VERSION and HOTSPOT_BUILD_VERSION are defined
+# in $(GAMMADIR)/make/defs.make
+ifeq ($(HOTSPOT_BUILD_VERSION),)
+ BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)\""
+else
+ BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HOTSPOT_RELEASE_VERSION)-$(HOTSPOT_BUILD_VERSION)\""
+endif
+
+# The following variables are defined in the generated flags.make file.
+BUILD_VERSION = -DHOTSPOT_RELEASE_VERSION="\"$(HS_BUILD_VER)\""
+JRE_VERSION = -DJRE_RELEASE_VERSION="\"$(JRE_RELEASE_VER)\""
+HS_LIB_ARCH = -DHOTSPOT_LIB_ARCH=\"$(LIBARCH)\"
+BUILD_TARGET = -DHOTSPOT_BUILD_TARGET="\"$(TARGET)\""
+BUILD_USER = -DHOTSPOT_BUILD_USER="\"$(HOTSPOT_BUILD_USER)\""
+VM_DISTRO = -DHOTSPOT_VM_DISTRO="\"$(HOTSPOT_VM_DISTRO)\""
+
+CPPFLAGS = \
+ ${SYSDEFS} \
+ ${INCLUDES} \
+ ${BUILD_VERSION} \
+ ${BUILD_TARGET} \
+ ${BUILD_USER} \
+ ${HS_LIB_ARCH} \
+ ${JRE_VERSION} \
+ ${VM_DISTRO}
+
+# CFLAGS_WARN holds compiler options to suppress/enable warnings.
+CFLAGS += $(CFLAGS_WARN/BYFILE)
+
+# Do not use C++ exception handling
+CFLAGS += $(CFLAGS/NOEX)
+
+# Extra flags from gnumake's invocation or environment
+CFLAGS += $(EXTRA_CFLAGS)
+
+LIBS += -lm -pthread
+
+# By default, link the *.o into the library, not the executable.
+LINK_INTO$(LINK_INTO) = LIBJVM
+
+JDK_LIBDIR = $(JAVA_HOME)/jre/lib/$(LIBARCH)
+
+#----------------------------------------------------------------------
+# jvm_db & dtrace
+include $(MAKEFILES_DIR)/dtrace.make
+
+#----------------------------------------------------------------------
+# JVM
+
+JVM = jvm$(G_SUFFIX)
+ifeq ($(OS_VENDOR), Darwin)
+ LIBJVM = lib$(JVM).dylib
+else
+ LIBJVM = lib$(JVM).so
+endif
+
+JVM_OBJ_FILES = $(Obj_Files)
+
+vm_version.o: $(filter-out vm_version.o,$(JVM_OBJ_FILES))
+
+mapfile : $(MAPFILE)
+ rm -f $@
+ cat $^ > $@
+
+mapfile_reorder : mapfile $(REORDERFILE)
+ rm -f $@
+ cat $^ > $@
+
+STATIC_CXX = false
+
+ifeq ($(LINK_INTO),AOUT)
+ LIBJVM.o =
+ LIBJVM_MAPFILE =
+ LIBS_VM = $(LIBS)
+else
+ LIBJVM.o = $(JVM_OBJ_FILES)
+ LIBJVM_MAPFILE$(LDNOMAP) = mapfile_reorder
+ LFLAGS_VM$(LDNOMAP) += $(MAPFLAG:FILENAME=$(LIBJVM_MAPFILE))
+ LFLAGS_VM += $(SONAMEFLAG:SONAME=$(LIBJVM))
+
+ # JVM is statically linked with libgcc[_s] and libstdc++; this is needed to
+ # get around library dependency and compatibility issues. Must use gcc not
+ # g++ to link.
+ ifeq ($(STATIC_CXX), true)
+ LFLAGS_VM += $(STATIC_LIBGCC)
+ LIBS_VM += $(STATIC_STDCXX)
+ else
+ LIBS_VM += -lstdc++
+ endif
+
+ LIBS_VM += $(LIBS)
+endif
+
+LINK_VM = $(LINK_LIB.c)
+
+# rule for building precompiled header
+$(PRECOMPILED_HEADER): $(Precompiled_Files)
+ $(QUIETLY) echo Generating precompiled header $@
+ $(QUIETLY) mkdir -p $(PRECOMPILED_HEADER_DIR)/incls
+ $(QUIETLY) $(COMPILE.CC) -x c++-header -c $(GENERATED)/incls/_precompiled.incl -o $@ $(COMPILE_DONE)
+
+# making the library:
+
+ifneq ($(JVM_BASE_ADDR),)
+# By default shared library is linked at base address == 0. Modify the
+# linker script if JVM prefers a different base location. It can also be
+# implemented with 'prelink -r'. But 'prelink' is not (yet) available on
+# our build platform (AS-2.1).
+LD_SCRIPT = libjvm.so.lds
+$(LD_SCRIPT): $(LIBJVM_MAPFILE)
+ $(QUIETLY) { \
+ rm -rf $@; \
+ $(LINK_VM) -Wl,--verbose $(LFLAGS_VM) 2>&1 | \
+ sed -e '/^======/,/^======/!d' \
+ -e '/^======/d' \
+ -e 's/0\( + SIZEOF_HEADERS\)/$(JVM_BASE_ADDR)\1/' \
+ > $@; \
+ }
+LD_SCRIPT_FLAG = -Wl,-T,$(LD_SCRIPT)
+endif
+
+$(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
+ $(QUIETLY) { \
+ echo Linking vm...; \
+ $(LINK_LIB.CC/PRE_HOOK) \
+ $(LINK_VM) $(LD_SCRIPT_FLAG) \
+ $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \
+ $(LINK_LIB.CC/POST_HOOK) \
+ rm -f $@.1; ln -s $@ $@.1; \
+ }
+
+DEST_JVM = $(JDK_LIBDIR)/$(VM_SUBDIR)/$(LIBJVM)
+
+install_jvm: $(LIBJVM)
+ @echo "Copying $(LIBJVM) to $(DEST_JVM)"
+ $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done"
+
+#----------------------------------------------------------------------
+# Other files
+
+# Gamma launcher
+include $(MAKEFILES_DIR)/launcher.make
+
+# Signal interposition library
+include $(MAKEFILES_DIR)/jsig.make
+
+# Serviceability agent
+include $(MAKEFILES_DIR)/saproc.make
+
+#----------------------------------------------------------------------
+
+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) checkAndBuildSA
+
+install: install_jvm install_jsig install_saproc
+
+.PHONY: default build install install_jvm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/platform_amd64 Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,15 @@
+os_family = bsd
+
+arch = x86
+
+arch_model = x86_64
+
+os_arch = bsd_x86
+
+os_arch_model = bsd_x86_64
+
+lib_arch = amd64
+
+compiler = gcc
+
+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DAMD64
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/platform_amd64.suncc Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,17 @@
+os_family = bsd
+
+arch = x86
+
+arch_model = x86_64
+
+os_arch = bsd_x86
+
+os_arch_model = bsd_x86_64
+
+lib_arch = amd64
+
+compiler = sparcWorks
+
+gnu_dis_arch = amd64
+
+sysdefs = -DLINUX -DSPARC_WORKS -D_GNU_SOURCE -DAMD64
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/platform_i486 Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,15 @@
+os_family = bsd
+
+arch = x86
+
+arch_model = x86_32
+
+os_arch = bsd_x86
+
+os_arch_model = bsd_x86_32
+
+lib_arch = i386
+
+compiler = gcc
+
+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DIA32
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/platform_i486.suncc Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,17 @@
+os_family = bsd
+
+arch = x86
+
+arch_model = x86_32
+
+os_arch = bsd_x86
+
+os_arch_model = bsd_x86_32
+
+lib_arch = i386
+
+compiler = sparcWorks
+
+gnu_dis_arch = i386
+
+sysdefs = -DLINUX -DSPARC_WORKS -D_GNU_SOURCE -DIA32
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/platform_ia64 Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,15 @@
+os_family = bsd
+
+arch = ia64
+
+os_arch = bsd_ia64
+
+lib_arch = ia64
+
+compiler = gcc
+
+gnu_dis_arch = ia64
+
+sysdefs = -DLINUX -D_GNU_SOURCE -DIA64 -DCC_INTERP
+
+mark_style = alignment
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/platform_sparc Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,15 @@
+os_family = bsd
+
+arch = sparc
+
+arch_model = sparc
+
+os_arch = bsd_sparc
+
+os_arch_model = bsd_sparc
+
+lib_arch = sparc
+
+compiler = gcc
+
+sysdefs = -D_ALLBSD_SOURCE -D_GNU_SOURCE -DSPARC
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/make/bsd/platform_sparcv9 Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,15 @@
+os_family = bsd
+
+arch = sparc
+
+arch_model = sparc
+
+os_arch = bsd_sparc
+
+os_arch_model = bsd_sparc
+
+lib_arch = sparcv9
+
+compiler = gcc
+
+sysdefs = -DLINUX -D_GNU_SOURCE -DSPARC
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/os/bsd/launcher/java.c Wed Aug 20 10:30:27 2008 -0700
@@ -0,0 +1,1841 @@
+/*
+ * Copyright 1999-2006 Sun Microsystems, Inc. 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.
+ *
+ * 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ */
+
+/*
+ * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK,
+ * search "GAMMA" for gamma specific changes.
+ *
+ * GAMMA: gamma launcher is much simpler than regular java launcher in that
+ * JVM is either statically linked in or it is installed in the
+ * same directory where the launcher exists, so we don't have to
+ * worry about choosing the right JVM based on command line flag, jar
+ * file and/or ergonomics. Intead of removing unused logic from source
+ * they are commented out with #ifndef GAMMA, hopefully it'll be easier
+ * to maintain this file in sync with regular JDK launcher.
+ */
+
+/*
+ * Shared source for 'java' command line tool.
+ *
+ * If JAVA_ARGS is defined, then acts as a launcher for applications. For
+ * instance, the JDK command line tools such as javac and javadoc (see
+ * makefiles for more details) are built with this program. Any arguments
+ * prefixed with '-J' will be passed directly to the 'java' command.
+ */
+
+#ifdef GAMMA
+# ifdef JAVA_ARGS
+# error Do NOT define JAVA_ARGS when building gamma launcher
+# endif
+# if !defined(LINK_INTO_AOUT) && !defined(LINK_INTO_LIBJVM)
+# error Either LINK_INTO_AOUT or LINK_INTO_LIBJVM must be defined
+# endif
+#endif
+
+/*
+ * One job of the launcher is to remove command line options which the
+ * vm does not understand and will not process. These options include
+ * options which select which style of vm is run (e.g. -client and
+ * -server) as well as options which select the data model to use.
+ * Additionally, for tools which invoke an underlying vm "-J-foo"
+ * options are turned into "-foo" options to the vm. This option
+ * filtering is handled in a number of places in the launcher, some of
+ * it in machine-dependent code. In this file, the function
+ * CheckJVMType removes vm style options and TranslateDashJArgs
+ * removes "-J" prefixes. On unix platforms, the
+ * CreateExecutionEnvironment function from the unix java_md.c file
+ * processes and removes -d<n> options. However, in case
+ * CreateExecutionEnvironment does not need to exec because
+ * LD_LIBRARY_PATH is set acceptably and the data model does not need
+ * to be changed, ParseArguments will screen out the redundant -d<n>
+ * options and prevent them from being passed to the vm; this is done
+ * by using the machine-dependent call
+ * RemovableMachineDependentOption.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <jni.h>
+#include "java.h"
+
+#ifndef GAMMA
+#include "manifest_info.h"
+#include "version_comp.h"
+#endif
+
+#ifndef FULL_VERSION
+#define FULL_VERSION JDK_MAJOR_VERSION "." JDK_MINOR_VERSION
+#endif
+
+/*
+ * The following environment variable is used to influence the behavior
+ * of the jre exec'd through the SelectVersion routine. The command line
+ * options which specify the version are not passed to the exec'd version,
+ * because that jre may be an older version which wouldn't recognize them.
+ * This environment variable is known to this (and later) version and serves
+ * to suppress the version selection code. This is not only for efficiency,
+ * but also for correctness, since any command line options have been
+ * removed which would cause any value found in the manifest to be used.
+ * This would be incorrect because the command line options are defined
+ * to take precedence.
+ *
+ * The value associated with this environment variable is the MainClass
+ * name from within the executable jar file (if any). This is strictly a
+ * performance enhancement to avoid re-reading the jar file manifest.
+ *
+ * A NOTE TO DEVELOPERS: For performance reasons it is important that
+ * the program image remain relatively small until after SelectVersion
+ * CreateExecutionEnvironment have finished their possibly recursive
+ * processing. Watch everything, but resist all temptations to use Java
+ * interfaces.
+ */
+#define ENV_ENTRY "_JAVA_VERSION_SET"
+
+static jboolean printVersion = JNI_FALSE; /* print and exit */
+static jboolean showVersion = JNI_FALSE; /* print but continue */
+static char *progname;
+jboolean _launcher_debug = JNI_FALSE;
+
+/*
+ * List of VM options to be specified when the VM is created.
+ */
+static JavaVMOption *options;
+static int numOptions, maxOptions;
+
+/*
+ * Prototypes for functions internal to launcher.
+ */
+static void AddOption(char *str, void *info);
+static void SetClassPath(char *s);
+static void SelectVersion(int argc, char **argv, char **main_class);
+static jboolean ParseArguments(int *pargc, char ***pargv, char **pjarfile,
+ char **pclassname, int *pret);
+static jboolean InitializeJVM(JavaVM **pvm, JNIEnv **penv,
+ InvocationFunctions *ifn);
+static jstring NewPlatformString(JNIEnv *env, char *s);
+static jobjectArray NewPlatformStringArray(JNIEnv *env, char **strv, int strc);
+static jclass LoadClass(JNIEnv *env, char *name);
+static jstring GetMainClassName(JNIEnv *env, char *jarname);
+static void SetJavaCommandLineProp(char* classname, char* jarfile, int argc, char** argv);
+#ifdef GAMMA
+static void SetJavaLauncherProp(void);
+#endif
+
+#ifdef JAVA_ARGS
+static void TranslateDashJArgs(int *pargc, char ***pargv);
+static jboolean AddApplicationOptions(void);
+#endif
+
+static void PrintJavaVersion(JNIEnv *env);
+static void PrintUsage(void);
+static jint PrintXUsage(void);
+
+static void SetPaths(int argc, char **argv);
+
+/* Maximum supported entries from jvm.cfg. */
+#define INIT_MAX_KNOWN_VMS 10
+/* Values for vmdesc.flag */
+#define VM_UNKNOWN -1
+#define VM_KNOWN 0
+#define VM_ALIASED_TO 1
+#define VM_WARN 2
+#define VM_ERROR 3
+#define VM_IF_SERVER_CLASS 4
+#define VM_IGNORE 5
+struct vmdesc {
+ char *name;
+ int flag;
+ char *alias;
+ char *server_class;
+};
+static struct vmdesc *knownVMs = NULL;
+static int knownVMsCount = 0;
+static int knownVMsLimit = 0;
+
+static void GrowKnownVMs();
+static int KnownVMIndex(const char* name);
+static void FreeKnownVMs();
+
+jboolean ServerClassMachine();
+
+/* flag which if set suppresses error messages from the launcher */
+static int noExitErrorMessage = 0;
+
+/*
+ * Entry point.
+ */
+int
+main(int argc, char ** argv)
+{
+ JavaVM *vm = 0;
+ JNIEnv *env = 0;
+ char *jarfile = 0;
+ char *classname = 0;
+ char *s = 0;
+ char *main_class = NULL;
+ jstring mainClassName;
+ jclass mainClass;
+ jmethodID mainID;
+ jobjectArray mainArgs;
+ int ret;
+ InvocationFunctions ifn;
+ jlong start, end;
+ char jrepath[MAXPATHLEN], jvmpath[MAXPATHLEN];
+ char ** original_argv = argv;
+
+ /*
+ * Error message to print or display; by default the message will
+ * only be displayed in a window.
+ */
+ char * message = "Fatal exception occurred. Program will exit.";
+ jboolean messageDest = JNI_FALSE;
+
+ if (getenv("_JAVA_LAUNCHER_DEBUG") != 0) {
+ _launcher_debug = JNI_TRUE;
+ printf("----_JAVA_LAUNCHER_DEBUG----\n");
+ }
+
+#ifndef GAMMA
+ /*
+ * Make sure the specified version of the JRE is running.
+ *
+ * There are three things to note about the SelectVersion() routine:
+ * 1) If the version running isn't correct, this routine doesn't
+ * return (either the correct version has been exec'd or an error
+ * was issued).
+ * 2) Argc and Argv in this scope are *not* altered by this routine.
+ * It is the responsibility of subsequent code to ignore the
+ * arguments handled by this routine.
+ * 3) As a side-effect, the variable "main_class" is guaranteed to
+ * be set (if it should ever be set). This isn't exactly the
+ * poster child for structured programming, but it is a small
+ * price to pay for not processing a jar file operand twice.
+ * (Note: This side effect has been disabled. See comment on
+ * bugid 5030265 below.)
+ */
+ SelectVersion(argc, argv, &main_class);
+#endif /* ifndef GAMMA */
+
+ /* copy original argv */
+ {
+ int i;
+ original_argv = (char**)MemAlloc(sizeof(char*)*(argc+1));
+ for(i = 0; i < argc+1; i++)
+ original_argv[i] = argv[i];
+ }
+
+ CreateExecutionEnvironment(&argc, &argv,
+ jrepath, sizeof(jrepath),
+ jvmpath, sizeof(jvmpath),
+ original_argv);
+ ifn.CreateJavaVM = 0;
+ ifn.GetDefaultJavaVMInitArgs = 0;
+
+ if (_launcher_debug)
+ start = CounterGet();
+ if (!LoadJavaVM(jvmpath, &ifn)) {
+ exit(6);
+ }
+ if (_launcher_debug) {
+ end = CounterGet();
+ printf("%ld micro seconds to LoadJavaVM\n",
+ (long)(jint)Counter2Micros(end-start));
+ }
+
+#ifdef JAVA_ARGS /* javac, jar and friends. */
+ progname = "java";
+#else /* java, oldjava, javaw and friends */
+#ifdef PROGNAME
+ progname = PROGNAME;
+#else
+ progname = *argv;
+ if ((s = strrchr(progname, FILE_SEPARATOR)) != 0) {
+ progname = s + 1;
+ }
+#endif /* PROGNAME */
+#endif /* JAVA_ARGS */
+ ++argv;
+ --argc;
+
+#ifdef JAVA_ARGS
+ /* Preprocess wrapper arguments */
+ TranslateDashJArgs(&argc, &argv);
+ if (!AddApplicationOptions()) {
+ exit(1);
+ }
+#endif
+
+ /* Set default CLASSPATH */
+ if ((s = getenv("CLASSPATH")) == 0) {
+ s = ".";
+ }
+#ifndef JAVA_ARGS
+ SetClassPath(s);
+#endif
+
+ /*
+ * Parse command line options; if the return value of
+ * ParseArguments is false, the program should exit.
+ */
+ if (!ParseArguments(&argc, &argv, &jarfile, &classname, &ret)) {
+ exit(ret);
+ }
+
+ /* Override class path if -jar flag was specified */
+ if (jarfile != 0) {
+ SetClassPath(jarfile);
+ }
+
+ /* set the -Dsun.java.command pseudo property */
+ SetJavaCommandLineProp(classname, jarfile, argc, argv);
+
+#ifdef GAMMA
+ /* Set the -Dsun.java.launcher pseudo property */
+ SetJavaLauncherProp();
+#endif
+
+ /*
+ * Done with all command line processing and potential re-execs so
+ * clean up the environment.
+ */
+ (void)UnsetEnv(ENV_ENTRY);
+
+ /* Initialize the virtual machine */
+
+ if (_launcher_debug)
+ start = CounterGet();
+ if (!InitializeJVM(&vm, &env, &ifn)) {
+ ReportErrorMessage("Could not create the Java virtual machine.",
+ JNI_TRUE);
+ exit(1);
+ }
+
+ if (printVersion || showVersion) {
+ PrintJavaVersion(env);
+ if ((*env)->ExceptionOccurred(env)) {
+ ReportExceptionDescription(env);
+ goto leave;
+ }
+ if (printVersion) {
+ ret = 0;
+ message = NULL;
+ goto leave;
+ }
+ if (showVersion) {
+ fprintf(stderr, "\n");
+ }
+ }
+
+ /* If the user specified neither a class name nor a JAR file */
+ if (jarfile == 0 && classname == 0) {
+ PrintUsage();
+ message = NULL;
+ goto leave;
+ }
+
+#ifndef GAMMA
+ FreeKnownVMs(); /* after last possible PrintUsage() */
+#endif
+
+ if (_launcher_debug) {
+ end = CounterGet();
+ printf("%ld micro seconds to InitializeJVM\n",
+ (long)(jint)Counter2Micros(end-start));
+ }
+
+ /* At this stage, argc/argv have the applications' arguments */
+ if (_launcher_debug) {
+ int i = 0;
+ printf("Main-Class is '%s'\n", classname ? classname : "");
+ printf("Apps' argc is %d\n", argc);
+ for (; i < argc; i++) {
+ printf(" argv[%2d] = '%s'\n", i, argv[i]);
+ }
+ }
+
+ ret = 1;
+
+ /*
+ * Get the application's main class.
+ *
+ * See bugid 5030265. The Main-Class name has already been parsed
+ * from the manifest, but not parsed properly for UTF-8 support.
+ * Hence the code here ignores the value previously extracted and
+ * uses the pre-existing code to reextract the value. This is
+ * possibly an end of release cycle expedient. However, it has
+ * also been discovered that passing some character sets through
+ * the environment has "strange" behavior on some variants of
+ * Windows. Hence, maybe the manifest parsing code local to the
+ * launcher should never be enhanced.
+ *
+ * Hence, future work should either:
+ * 1) Correct the local parsing code and verify that the
+ * Main-Class attribute gets properly passed through
+ * all environments,
+ * 2) Remove the vestages of maintaining main_class through
+ * the environment (and remove these comments).
+ */
+ if (jarfile != 0) {
+ mainClassName = GetMainClassName(env, jarfile);
+ if ((*env)->ExceptionOccurred(env)) {
+ ReportExceptionDescription(env);
+ goto leave;
+ }
+ if (mainClassName == NULL) {
+ const char * format = "Failed to load Main-Class manifest "
+ "attribute from\n%s";
+ message = (char*)MemAlloc((strlen(format) + strlen(jarfile)) *
+ sizeof(char));
+ sprintf(message, format, jarfile);
+ messageDest = JNI_TRUE;
+ goto leave;
+ }
+ classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
+ if (classname == NULL) {
+ ReportExceptionDescription(env);
+ goto leave;
+ }
+ mainClass = LoadClass(env, classname);
+ if(mainClass == NULL) { /* exception occured */
+ ReportExceptionDescription(env);
+ message = "Could not find the main class. Program will exit.";
+ goto leave;
+ }
+ (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
+ } else {
+ mainClassName = NewPlatformString(env, classname);
+ if (mainClassName == NULL) {
+ const char * format = "Failed to load Main Class: %s";
+ message = (char *)MemAlloc((strlen(format) + strlen(classname)) *
+ sizeof(char) );
+ sprintf(message, format, classname);
+ messageDest = JNI_TRUE;
+ goto leave;
+ }
+ classname = (char *)(*env)->GetStringUTFChars(env, mainClassName, 0);
+ if (classname == NULL) {
+ ReportExceptionDescription(env);
+ goto leave;
+ }
+ mainClass = LoadClass(env, classname);
+ if(mainClass == NULL) { /* exception occured */
+ ReportExceptionDescription(env);
+ message = "Could not find the main class. Program will exit.";
+ goto leave;
+ }
+ (*env)->ReleaseStringUTFChars(env, mainClassName, classname);
+ }
+
+ /* Get the application's main method */
+ mainID = (*env)->GetStaticMethodID(env, mainClass, "main",
+ "([Ljava/lang/String;)V");
+ if (mainID == NULL) {
+ if ((*env)->ExceptionOccurred(env)) {
+ ReportExceptionDescription(env);
+ } else {
+ message = "No main method found in specified class.";
+ messageDest = JNI_TRUE;
+ }
+ goto leave;
+ }
+
+ { /* Make sure the main method is public */
+ jint mods;
+ jmethodID mid;
+ jobject obj = (*env)->ToReflectedMethod(env, mainClass,
+ mainID, JNI_TRUE);
+
+ if( obj == NULL) { /* exception occurred */
+ ReportExceptionDescription(env);
+ goto leave;
+ }
+
+ mid =
+ (*env)->GetMethodID(env,
+ (*env)->GetObjectClass(env, obj),
+ "getModifiers", "()I");
+ if ((*env)->ExceptionOccurred(env)) {
+ ReportExceptionDescription(env);
+ goto leave;
+ }
+
+ mods = (*env)->CallIntMethod(env, obj, mid);
+ if ((mods & 1) == 0) { /* if (!Modifier.isPublic(mods)) ... */
+ message = "Main method not public.";
+ messageDest = JNI_TRUE;
+ goto leave;
+ }
+ }
+
+ /* Build argument array */
+ mainArgs = NewPlatformStringArray(env, argv, argc);
+ if (mainArgs == NULL) {
+ ReportExceptionDescription(env);
+ goto leave;
+ }
+
+ /* Invoke main method. */
+ (*env)->CallStaticVoidMethod(env, mainClass, mainID, mainArgs);
+
+ /*
+ * The launcher's exit code (in the absence of calls to
+ * System.exit) will be non-zero if main threw an exception.
+ */
+ ret = (*env)->ExceptionOccurred(env) == NULL ? 0 : 1;
+
+ /*
+ * Detach the main thread so that it appears to have ended when
+ * the application's main method exits. This will invoke the
+ * uncaught exception handler machinery if main threw an
+ * exception. An uncaught exception handler cannot change the
+ * launcher's return code except by calling System.exit.
+ */
+ if ((*vm)->DetachCurrentThread(vm) != 0) {
+ message = "Could not detach main thread.";
+ messageDest = JNI_TRUE;
+ ret = 1;
+ goto leave;
+ }
+
+ message = NULL;
+
+ leave:
+ /*
+ * Wait for all non-daemon threads to end, then destroy the VM.
+ * This will actually create a trivial new Java waiter thread
+ * named "DestroyJavaVM", but this will be seen as a different
+ * thread from the one that executed main, even though they are
+ * the same C thread. This allows mainThread.join() and
+ * mainThread.isAlive() to work as expected.
+ */
+ (*vm)->DestroyJavaVM(vm);
+
+ if(message != NULL && !noExitErrorMessage)
+ ReportErrorMessage(message, messageDest);
+ return ret;
+}
+
+
+#ifndef GAMMA
+/*
+ * Checks the command line options to find which JVM type was
+ * specified. If no command line option was given for the JVM type,
+ * the default type is used. The environment variable
+ * JDK_ALTERNATE_VM and the command line option -XXaltjvm= are also
+ * checked as ways of specifying which JVM type to invoke.
+ */
+char *
+CheckJvmType(int *pargc, char ***argv, jboolean speculative) {
+ int i, argi;
+ int argc;
+ char **newArgv;
+ int newArgvIdx = 0;
+ int isVMType;
+ int jvmidx = -1;
+ char *jvmtype = getenv("JDK_ALTERNATE_VM");
+
+ argc = *pargc;
+
+ /* To make things simpler we always copy the argv array */
+ newArgv = MemAlloc((argc + 1) * sizeof(char *));
+
+ /* The program name is always present */
+ newArgv[newArgvIdx++] = (*argv)[0];
+
+ for (argi = 1; argi < argc; argi++) {
+ char *arg = (*argv)[argi];
+ isVMType = 0;
+
+#ifdef JAVA_ARGS
+ if (arg[0] != '-') {
+ newArgv[newArgvIdx++] = arg;
+ continue;
+ }
+#else
+ if (strcmp(arg, "-classpath") == 0 ||
+ strcmp(arg, "-cp") == 0) {
+ newArgv[newArgvIdx++] = arg;
+ argi++;
+ if (argi < argc) {
+ newArgv[newArgvIdx++] = (*argv)[argi];
+ }
+ continue;
+ }
+ if (arg[0] != '-') break;
+#endif
+
+ /* Did the user pass an explicit VM type? */
+ i = KnownVMIndex(arg);
+ if (i >= 0) {
+ jvmtype = knownVMs[jvmidx = i].name + 1; /* skip the - */
+ isVMType = 1;
+ *pargc = *pargc - 1;
+ }
+
+ /* Did the user specify an "alternate" VM? */
+ else if (strncmp(arg, "-XXaltjvm=", 10) == 0 || strncmp(arg, "-J-XXaltjvm=", 12) == 0) {
+ isVMType = 1;
+ jvmtype = arg+((arg[1]=='X')? 10 : 12);
+ jvmidx = -1;
+ }
+
+ if (!isVMType) {
+ newArgv[newArgvIdx++] = arg;
+ }
+ }
+
+ /*
+ * Finish copying the arguments if we aborted the above loop.
+ * NOTE that if we aborted via "break" then we did NOT copy the
+ * last argument above, and in addition argi will be less than
+ * argc.
+ */
+ while (argi < argc) {
+ newArgv[newArgvIdx++] = (*argv)[argi];
+ argi++;
+ }
+
+ /* argv is null-terminated */
+ newArgv[newArgvIdx] = 0;
+
+ /* Copy back argv */
+ *argv = newArgv;
+ *pargc = newArgvIdx;
+
+ /* use the default VM type if not specified (no alias processing) */
+ if (jvmtype == NULL) {
+ char* result = knownVMs[0].name+1;
+ /* Use a different VM type if we are on a server class machine? */
+ if ((knownVMs[0].flag == VM_IF_SERVER_CLASS) &&
+ (ServerClassMachine() == JNI_TRUE)) {
+ result = knownVMs[0].server_class+1;
+ }
+ if (_launcher_debug) {
+ printf("Default VM: %s\n", result);
+ }
+ return result;
+ }
+
+ /* if using an alternate VM, no alias processing */
+ if (jvmidx < 0)
+ return jvmtype;
+
+ /* Resolve aliases first */
+ {
+ int loopCount = 0;
+ while (knownVMs[jvmidx].flag == VM_ALIASED_TO) {
+ int nextIdx = KnownVMIndex(knownVMs[jvmidx].alias);
+
+ if (loopCount > knownVMsCount) {
+ if (!speculative) {
+ ReportErrorMessage("Error: Corrupt jvm.cfg file; cycle in alias list.",
+ JNI_TRUE);
+ exit(1);
+ } else {
+ return "ERROR";
+ /* break; */
+ }
+ }
+
+ if (nextIdx < 0) {
+ if (!speculative) {
+ ReportErrorMessage2("Error: Unable to resolve VM alias %s",
+ knownVMs[jvmidx].alias, JNI_TRUE);
+ exit(1);
+ } else {
+ return "ERROR";
+ }
+ }
+ jvmidx = nextIdx;
+ jvmtype = knownVMs[jvmidx].name+1;
+ loopCount++;
+ }
+ }
+
+ switch (knownVMs[jvmidx].flag) {
+ case VM_WARN:
+ if (!speculative) {
+ fprintf(stderr, "Warning: %s VM not supported; %s VM will be used\n",
+ jvmtype, knownVMs[0].name + 1);
+ }
+ /* fall through */
+ case VM_IGNORE:
+ jvmtype = knownVMs[jvmidx=0].name + 1;
+ /* fall through */
+ case VM_KNOWN:
+ break;
+ case VM_ERROR:
+ if (!speculative) {
+ ReportErrorMessage2("Error: %s VM not supported", jvmtype, JNI_TRUE);
+ exit(1);
+ } else {
+ return "ERROR";
+ }
+ }
+
+ return jvmtype;
+}
+#endif /* ifndef GAMMA */
+
+/*
+ * Adds a new VM option with the given given name and value.
+ */
+static void
+AddOption(char *str, void *info)
+{
+ /*
+ * Expand options array if needed to accommodate at least one more
+ * VM option.
+ */
+ if (numOptions >= maxOptions) {
+ if (options == 0) {
+ maxOptions = 4;
+ options = MemAlloc(maxOptions * sizeof(JavaVMOption));
+ } else {
+ JavaVMOption *tmp;
+ maxOptions *= 2;
+ tmp = MemAlloc(maxOptions * sizeof(JavaVMOption));
+ memcpy(tmp, options, numOptions * sizeof(JavaVMOption));
+ free(options);
+ options = tmp;
+ }
+ }
+ options[numOptions].optionString = str;
+ options[numOptions++].extraInfo = info;
+}
+
+static void
+SetClassPath(char *s)
+{
+ char *def = MemAlloc(strlen(s) + 40);
+ sprintf(def, "-Djava.class.path=%s", s);
+ AddOption(def, NULL);
+}
+
+#ifndef GAMMA
+/*
+ * The SelectVersion() routine ensures that an appropriate version of
+ * the JRE is running. The specification for the appropriate version
+ * is obtained from either the manifest of a jar file (preferred) or
+ * from command line options.
+ */
+static void
+SelectVersion(int argc, char **argv, char **main_class)
+{
+ char *arg;
+ char **new_argv;
+ char **new_argp;
+ char *operand;
+ char *version = NULL;
+ char *jre = NULL;
+ int jarflag = 0;
+ int restrict_search = -1; /* -1 implies not known */
+ manifest_info info;
+ char env_entry[MAXNAMELEN + 24] = ENV_ENTRY "=";
+ char *env_in;
+ int res;
+
+ /*
+ * If the version has already been selected, set *main_class
+ * with the value passed through the environment (if any) and
+ * simply return.
+ */
+ if ((env_in = getenv(ENV_ENTRY)) != NULL) {
+ if (*env_in != '\0')
+ *main_class = strdup(env_in);
+ return;
+ }
+
+ /*
+ * Scan through the arguments for options relevant to multiple JRE
+ * support. For reference, the command line syntax is defined as:
+ *
+ * SYNOPSIS
+ * java [options] class [argument...]
+ *
+ * java [options] -jar file.jar [argument...]
+ *
+ * As the scan is performed, make a copy of the argument list with
+ * the version specification options (new to 1.5) removed, so that
+ * a version less than 1.5 can be exec'd.
+ */
+ new_argv = MemAlloc((argc + 1) * sizeof(char*));
+ new_argv[0] = argv[0];
+ new_argp = &new_argv[1];
+ argc--;
+ argv++;
+ while ((arg = *argv) != 0 && *arg == '-') {
+ if (strncmp(arg, "-version:", 9) == 0) {
+ version = arg + 9;
+ } else if (strcmp(arg, "-jre-restrict-search") == 0) {
+ restrict_search = 1;
+ } else if (strcmp(arg, "-no-jre-restrict-search") == 0) {
+ restrict_search = 0;
+ } else {
+ if (strcmp(arg, "-jar") == 0)
+ jarflag = 1;
+ /* deal with "unfortunate" classpath syntax */
+ if ((strcmp(arg, "-classpath") == 0 || strcmp(arg, "-cp") == 0) &&
+ (argc >= 2)) {
+ *new_argp++ = arg;
+ argc--;
+ argv++;
+ arg = *argv;
+ }
+ *new_argp++ = arg;
+ }
+ argc--;
+ argv++;
+ }
+ if (argc <= 0) { /* No operand? Possibly legit with -[full]version */
+ operand = NULL;
+ } else {
+ argc--;
+ *new_argp++ = operand = *argv++;
+ }
+ while (argc-- > 0) /* Copy over [argument...] */
+ *new_argp++ = *argv++;
+ *new_argp = NULL;
+
+ /*
+ * If there is a jar file, read the manifest. If the jarfile can't be
+ * read, the manifest can't be read from the jar file, or the manifest
+ * is corrupt, issue the appropriate error messages and exit.
+ *
+ * Even if there isn't a jar file, construct a manifest_info structure
+ * containing the command line information. It's a convenient way to carry
+ * this data around.
+ */
+ if (jarflag && operand) {
+ if ((res = parse_manifest(operand, &info)) != 0) {
+ if (res == -1)
+ ReportErrorMessage2("Unable to access jarfile %s",
+ operand, JNI_TRUE);
+ else
+ ReportErrorMessage2("Invalid or corrupt jarfile %s",
+ operand, JNI_TRUE);
+ exit(1);
+ }
+ } else {
+ info.manifest_version = NULL;
+ info.main_class = NULL;
+ info.jre_version = NULL;
+ info.jre_restrict_search = 0;
+ }
+
+ /*
+ * The JRE-Version and JRE-Restrict-Search values (if any) from the
+ * manifest are overwritten by any specified on the command line.
+ */
+ if (version != NULL)
+ info.jre_version = version;
+ if (restrict_search != -1)
+ info.jre_restrict_search = restrict_search;
+
+ /*
+ * "Valid" returns (other than unrecoverable errors) follow. Set
+ * main_class as a side-effect of this routine.
+ */
+ if (info.main_class != NULL)
+ *main_class = strdup(info.main_class);
+
+ /*
+ * If no version selection information is found either on the command
+ * line or in the manifest, simply return.
+ */
+ if (info.jre_version == NULL) {
+ free_manifest();
+ free(new_argv);
+ return;
+ }
+
+ /*
+ * Check for correct syntax of the version specification (JSR 56).
+ */
+ if (!valid_version_string(info.jre_version)) {
+ ReportErrorMessage2("Syntax error in version specification \"%s\"",
+ info.jre_version, JNI_TRUE);
+ exit(1);