提交 5f9f3ffa 编写于 作者: S sla

7006354: Updates to Visual Studio project creation and development launcher

Summary: Updates to Visual Studio project creation and development launcher
Reviewed-by: stefank, coleenp
上级 2e446a0b
......@@ -124,7 +124,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
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
env.sh env.csh jdkpath.sh .dbxrc test_gamma
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
......@@ -318,6 +318,13 @@ env.csh: env.sh
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
) > $@
jdkpath.sh: $(BUILDTREE_MAKE)
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
echo "JDK=${JAVA_HOME}"; \
) > $@
.dbxrc: $(BUILDTREE_MAKE)
@echo Creating $@ ...
$(QUIETLY) ( \
......
......@@ -117,7 +117,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
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.ksh env.csh .dbxrc test_gamma
env.ksh env.csh jdkpath.sh .dbxrc test_gamma
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
......@@ -314,6 +314,13 @@ env.csh: env.ksh
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
) > $@
jdkpath.sh: $(BUILDTREE_MAKE)
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
echo "JDK=${JAVA_HOME}"; \
) > $@
.dbxrc: $(BUILDTREE_MAKE)
@echo Creating $@ ...
$(QUIETLY) ( \
......
#
# Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -45,6 +45,9 @@ fi
echo "EXPORTS" > vm1.def
AWK="$MKS_HOME/awk.exe"
if [ ! -e $AWK ]; then
AWK="$MKS_HOME/gawk.exe"
fi
GREP="$MKS_HOME/grep.exe"
SORT="$MKS_HOME/sort.exe"
UNIQ="$MKS_HOME/uniq.exe"
......@@ -57,7 +60,7 @@ if [ "x$1" != "x" ]; then
LINK_VER="$1"
fi
if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" ]; then
if [ "x$LINK_VER" != "x800" -a "x$LINK_VER" != "x900" -a "x$LINK_VER" != "x1000" ]; then
$DUMPBIN /symbols *.obj | "$GREP" "??_7.*@@6B@" | "$GREP" -v "type_info" | "$AWK" '{print $7}' | "$SORT" | "$UNIQ" > vm2.def
else
# Can't use pipes when calling cl.exe or link.exe from IDE. Using transit file vm3.def
......
......@@ -36,6 +36,20 @@ REM
REM Note: Running this batch file from the Windows command shell requires
REM that "grep" be accessible on the PATH. An MKS install does this.
REM
cl 2>NUL >NUL
if %errorlevel% == 0 goto nexttest
echo Make sure cl.exe is in your PATH before running this script.
goto end
:nexttest
grep -V 2>NUL >NUL
if %errorlevel% == 0 goto testit
echo Make sure grep.exe is in your PATH before running this script. Either cygwin or MKS should work.
goto end
:testit
cl 2>&1 | grep "IA-64" >NUL
if %errorlevel% == 0 goto isia64
cl 2>&1 | grep "AMD64" >NUL
......@@ -44,37 +58,40 @@ set ARCH=x86
set BUILDARCH=i486
set Platform_arch=x86
set Platform_arch_model=x86_32
goto end
goto done
:amd64
set ARCH=x86
set BUILDARCH=amd64
set Platform_arch=x86
set Platform_arch_model=x86_64
goto end
goto done
:isia64
set ARCH=ia64
set BUILDARCH=ia64
set Platform_arch=ia64
set Platform_arch_model=ia64
:end
:done
setlocal
if "%1" == "" goto usage
if not "%4" == "" goto usage
if not "%2" == "" goto usage
REM Set HotSpotWorkSpace to the directy two steps above this script
for %%i in ("%~dp0..") do ( set HotSpotWorkSpace=%%~dpi)
set HotSpotBuildRoot=%HotSpotWorkSpace%build
set HotSpotBuildSpace=%HotSpotBuildRoot%\vs
set HotSpotJDKDist=%1
set HotSpotWorkSpace=%1
set HotSpotBuildSpace=%2
set HotSpotJDKDist=%3
REM figure out MSC version
for /F %%i in ('sh %HotSpotWorkSpace%/make/windows/get_msc_ver.sh') do set %%i
echo **************************************************************
set ProjectFile=vm.vcproj
set ProjectFile=jvm.vcproj
if "%MSC_VER%" == "1200" (
set ProjectFile=vm.dsp
set ProjectFile=jvm.dsp
echo Will generate VC6 project {unsupported}
) else (
if "%MSC_VER%" == "1400" (
......@@ -83,10 +100,16 @@ echo Will generate VC8 {Visual Studio 2005}
if "%MSC_VER%" == "1500" (
echo Will generate VC9 {Visual Studio 2008}
) else (
if "%MSC_VER%" == "1600" (
echo Detected Visual Studio 2010, but
echo will generate VC9 {Visual Studio 2008}
echo Use conversion wizard in VS 2010.
) else (
echo Will generate VC7 project {Visual Studio 2003 .NET}
)
)
)
)
echo %ProjectFile%
echo **************************************************************
......@@ -118,6 +141,8 @@ goto usage
:test3
if not "%HOTSPOTMKSHOME%" == "" goto makedir
if exist c:\cygwin\bin set HOTSPOTMKSHOME=c:\cygwin\bin
if not "%HOTSPOTMKSHOME%" == "" goto makedir
echo Warning: please set variable HOTSPOTMKSHOME to place where
echo your MKS/Cygwin installation is
echo.
......@@ -133,21 +158,24 @@ echo HotSpotJDKDist=%HotSpotJDKDist%
REM This is now safe to do.
:copyfiles
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
if NOT EXIST %HotSpotBuildSpace%\%%i mkdir %HotSpotBuildSpace%\%%i
copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\ > NUL
if NOT EXIST %HotSpotBuildSpace%\%%i\generated mkdir %HotSpotBuildSpace%\%%i\generated
copy %HotSpotWorkSpace%\make\windows\projectfiles\%%i\* %HotSpotBuildSpace%\%%i\generated > NUL
)
REM force regneration of ProjectFile
if exist %HotSpotBuildSpace%\%ProjectFile% del %HotSpotBuildSpace%\%ProjectFile%
for /D %%i in (compiler1, compiler2, tiered, core, kernel) do (
echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
echo -- %%i --
echo # Generated file! > %HotSpotBuildSpace%\%%i\local.make
echo # Changing a variable below and then deleting %ProjectFile% will cause >> %HotSpotBuildSpace%\%%i\local.make
echo # %ProjectFile% to be regenerated with the new values. Changing the >> %HotSpotBuildSpace%\%%i\local.make
echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make
echo # version requires rerunning create.bat. >> %HotSpotBuildSpace%\%%i\local.make
echo. >> %HotSpotBuildSpace%\%%i\local.make
echo Variant=%%i >> %HotSpotBuildSpace%\%%i\local.make
echo WorkSpace=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> %HotSpotBuildSpace%\%%i\local.make
echo HOTSPOTBUILDROOT=%HotSpotBuildRoot% >> %HotSpotBuildSpace%\%%i\local.make
echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> %HotSpotBuildSpace%\%%i\local.make
echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> %HotSpotBuildSpace%\%%i\local.make
echo ARCH=%ARCH% >> %HotSpotBuildSpace%\%%i\local.make
......@@ -155,42 +183,35 @@ echo BUILDARCH=%BUILDARCH% >> %HotSpotBuildSpace%\%%i\local.m
echo Platform_arch=%Platform_arch% >> %HotSpotBuildSpace%\%%i\local.make
echo Platform_arch_model=%Platform_arch_model% >> %HotSpotBuildSpace%\%%i\local.make
pushd %HotSpotBuildSpace%\%%i
for /D %%j in (debug, fastdebug, product) do (
if NOT EXIST %HotSpotBuildSpace%\%%i\%%j mkdir %HotSpotBuildSpace%\%%i\%%j
)
pushd %HotSpotBuildSpace%\%%i\generated
nmake /nologo
popd
)
pushd %HotSpotBuildSpace%
pushd %HotSpotBuildRoot%
echo # Generated file! > local.make
echo # Changing a variable below and then deleting %ProjectFile% will cause >> local.make
echo # %ProjectFile% to be regenerated with the new values. Changing the >> local.make
echo # version requires rerunning create.bat. >> local.make
echo. >> local.make
echo HOTSPOTWORKSPACE=%HotSpotWorkSpace% >> local.make
echo HOTSPOTBUILDSPACE=%HotSpotBuildSpace% >> local.make
echo HOTSPOTJDKDIST=%HotSpotJDKDist% >> local.make
echo ARCH=%ARCH% >> local.make
echo BUILDARCH=%BUILDARCH% >> local.make
echo Platform_arch=%Platform_arch% >> local.make
echo Platform_arch_model=%Platform_arch_model% >> local.make
nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile %HotSpotBuildSpace%/%ProjectFile%
REM It doesn't matter which variant we use here, "compiler1" is as good as any of the others - we need the common variables
nmake /nologo /F %HotSpotWorkSpace%/make/windows/projectfiles/common/Makefile LOCAL_MAKE=%HotSpotBuildSpace%\compiler1\local.make %HotSpotBuildRoot%/%ProjectFile%
popd
goto end
:usage
echo Usage: create HotSpotWorkSpace HotSpotBuildSpace HotSpotJDKDist
echo Usage: create HotSpotJDKDist
echo.
echo This is the interactive build setup script (as opposed to the batch
echo build execution script). It creates HotSpotBuildSpace if necessary,
echo copies the appropriate files out of HotSpotWorkSpace into it, and
echo This is the VS build setup script (as opposed to the batch
echo build execution script). It creates a build directory if necessary,
echo copies the appropriate files out of the workspace into it, and
echo builds and runs ProjectCreator in it. This has the side-effect of creating
echo the %ProjectFile% file in the build space, which is then used in Visual C++.
echo The HotSpotJDKDist defines place where JVM binaries should be placed.
echo.
echo The HotSpotJDKDist defines the JDK that should be used when running the JVM.
echo Environment variable FORCE_MSC_VER allows to override MSVC version autodetection.
echo.
echo NOTE that it is now NOT safe to modify any of the files in the build
......
......@@ -22,7 +22,6 @@
#
#
!include $(WorkSpace)/make/windows/makefiles/compile.make
# Rules for building adlc.exe
......@@ -46,15 +45,7 @@ ADLCFLAGS=-q -T -D_LP64
ADLCFLAGS=-q -T -U_LP64
!endif
CPP_FLAGS=$(CPP_FLAGS) \
/D TARGET_OS_FAMILY_windows \
/D TARGET_ARCH_$(Platform_arch) \
/D TARGET_ARCH_MODEL_$(Platform_arch_model) \
/D TARGET_OS_ARCH_windows_$(Platform_arch) \
/D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model) \
/D TARGET_COMPILER_visCPP
CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
ADLC_CPP_FLAGS=$(CPP_FLAGS) /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE
CPP_INCLUDE_DIRS=\
/I "..\generated" \
......@@ -92,10 +83,10 @@ GENERATED_NAMES_IN_DIR=\
$(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
{$(WorkSpace)\src\share\vm\adlc}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
$(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
{$(WorkSpace)\src\share\vm\opto}.cpp.obj::
$(CPP) $(CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
$(CPP) $(ADLC_CPP_FLAGS) $(EXH_FLAGS) $(CPP_INCLUDE_DIRS) /c $<
adlc.exe: main.obj adlparse.obj archDesc.obj arena.obj dfa.obj dict2.obj filebuff.obj \
forms.obj formsopt.obj formssel.obj opcodes.obj output_c.obj output_h.obj
......
#
# Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -80,6 +80,20 @@ CPP_FLAGS=$(CPP_FLAGS) /D "IA32"
CPP=ARCH_ERROR
!endif
CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS"
# Must specify this for sharedRuntimeTrig.cpp
CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN"
# Used for platform dispatching
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_FAMILY_windows
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_$(Platform_arch)
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model)
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch)
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_COMPILER_visCPP
# MSC_VER is a 4 digit number that tells us what compiler is being used
# and is generated when the local.make file is created by build.make
# via the script get_msc_ver.sh
......
......@@ -26,7 +26,6 @@ HS_INTERNAL_NAME=jvm
HS_FNAME=$(HS_INTERNAL_NAME).dll
AOUT=$(HS_FNAME)
SAWINDBG=sawindbg.dll
LAUNCHER_NAME=hotspot.exe
GENERATED=../generated
# Allow the user to turn off precompiled headers from the command line.
......@@ -34,7 +33,7 @@ GENERATED=../generated
BUILD_PCH_FILE=_build_pch_file.obj
!endif
default:: $(BUILD_PCH_FILE) $(AOUT) $(LAUNCHER_NAME) checkAndBuildSA
default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
!include ../local.make
!include compile.make
......@@ -49,8 +48,10 @@ HS_BUILD_ID=$(HS_BUILD_VER)-debug
# Force resources to be rebuilt every time
$(Res_Files): FORCE
$(AOUT): $(Res_Files) $(Obj_Files)
vm.def: $(Obj_Files)
sh $(WorkSpace)/make/windows/build_vm_def.sh
$(AOUT): $(Res_Files) $(Obj_Files) vm.def
$(LINK) @<<
$(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
<<
......
......@@ -26,7 +26,6 @@ HS_INTERNAL_NAME=jvm
HS_FNAME=$(HS_INTERNAL_NAME).dll
AOUT=$(HS_FNAME)
SAWINDBG=sawindbg.dll
LAUNCHER_NAME=hotspot.exe
GENERATED=../generated
# Allow the user to turn off precompiled headers from the command line.
......@@ -34,7 +33,7 @@ GENERATED=../generated
BUILD_PCH_FILE=_build_pch_file.obj
!endif
default:: $(BUILD_PCH_FILE) $(AOUT) $(LAUNCHER_NAME) checkAndBuildSA
default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
!include ../local.make
!include compile.make
......@@ -49,8 +48,10 @@ HS_BUILD_ID=$(HS_BUILD_VER)-fastdebug
# Force resources to be rebuilt every time
$(Res_Files): FORCE
$(AOUT): $(Res_Files) $(Obj_Files)
vm.def: $(Obj_Files)
sh $(WorkSpace)/make/windows/build_vm_def.sh
$(AOUT): $(Res_Files) $(Obj_Files) vm.def
$(LINK) @<<
$(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
<<
......
......@@ -51,6 +51,7 @@ classes/ProjectCreator.class: $(ProjectCreatorSources)
!if ("$(Variant)" == "compiler2") || ("$(Variant)" == "tiered")
!include $(WorkSpace)/make/windows/makefiles/compile.make
!include $(WorkSpace)/make/windows/makefiles/adlc.make
!endif
......
......@@ -22,7 +22,8 @@
#
#
LAUNCHER_FLAGS=$(ARCHFLAG) \
LAUNCHER_FLAGS=$(CPP_FLAGS) $(ARCHFLAG) \
/D FULL_VERSION=\"$(HOTSPOT_RELEASE_VERSION)\" \
/D JDK_MAJOR_VERSION=\"$(JDK_MAJOR_VERSION)\" \
/D JDK_MINOR_VERSION=\"$(JDK_MINOR_VERSION)\" \
......@@ -32,9 +33,11 @@ LAUNCHER_FLAGS=$(ARCHFLAG) \
/D _CRT_SECURE_NO_DEPRECATE \
/D LINK_INTO_LIBJVM \
/I $(WorkSpace)\src\os\windows\launcher \
/I $(WorkSpace)\src\share\tools\launcher
CPP_FLAGS=$(CPP_FLAGS) $(LAUNCHER_FLAGS)
/I $(WorkSpace)\src\share\tools\launcher \
/I $(WorkSpace)\src\share\vm\prims \
/I $(WorkSpace)\src\share\vm \
/I $(WorkSpace)\src\cpu\$(Platform_arch)\vm \
/I $(WorkSpace)\src\os\windows\vm
LINK_FLAGS=/manifest $(HS_INTERNAL_NAME).lib kernel32.lib user32.lib /nologo /machine:$(MACHINE) /map /debug /subsystem:console
......@@ -46,22 +49,23 @@ BUFFEROVERFLOWLIB = bufferoverflowU.lib
LINK_FLAGS = $(LINK_FLAGS) $(BUFFEROVERFLOWLIB)
!endif
LAUNCHERDIR = $(GAMMADIR)/src/os/windows/launcher
LAUNCHERDIR_SHARE = $(GAMMADIR)/src/share/tools/launcher
LAUNCHERDIR = $(WorkSpace)/src/os/windows/launcher
LAUNCHERDIR_SHARE = $(WorkSpace)/src/share/tools/launcher
OUTDIR = launcher
{$(LAUNCHERDIR)}.c{$(OUTDIR)}.obj:
-mkdir $(OUTDIR)
$(CPP) $(CPP_FLAGS) /c /Fo$@ $<
-mkdir $(OUTDIR) 2>NUL >NUL
$(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
{$(LAUNCHERDIR_SHARE)}.c{$(OUTDIR)}.obj:
-mkdir $(OUTDIR)
$(CPP) $(CPP_FLAGS) /c /Fo$@ $<
-mkdir $(OUTDIR) 2>NUL >NUL
$(CPP) $(LAUNCHER_FLAGS) /c /Fo$@ $<
$(OUTDIR)\*.obj: $(LAUNCHERDIR)\*.c $(LAUNCHERDIR)\*.h $(LAUNCHERDIR_SHARE)\*.c $(LAUNCHERDIR_SHARE)\*.h
$(LAUNCHER_NAME): $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj
$(LINK) $(LINK_FLAGS) /out:$@ $**
launcher: $(OUTDIR)\java.obj $(OUTDIR)\java_md.obj $(OUTDIR)\jli_util.obj
echo $(JAVA_HOME) > jdkpath.txt
$(LINK) $(LINK_FLAGS) /out:hotspot.exe $**
......@@ -25,7 +25,6 @@
HS_INTERNAL_NAME=jvm
HS_FNAME=$(HS_INTERNAL_NAME).dll
AOUT=$(HS_FNAME)
LAUNCHER_NAME=hotspot.exe
GENERATED=../generated
# Allow the user to turn off precompiled headers from the command line.
......@@ -33,7 +32,7 @@ GENERATED=../generated
BUILD_PCH_FILE=_build_pch_file.obj
!endif
default:: $(BUILD_PCH_FILE) $(AOUT) $(LAUNCHER_NAME) checkAndBuildSA
default:: $(BUILD_PCH_FILE) $(AOUT) launcher checkAndBuildSA
!include ../local.make
!include compile.make
......@@ -59,8 +58,10 @@ $(AOUT): $(Res_Files) $(Obj_Files)
$(LINK_FLAGS) /out:$@ /implib:$*.lib $(Obj_Files) $(Res_Files)
<<
!else
$(AOUT): $(Res_Files) $(Obj_Files)
vm.def: $(Obj_Files)
sh $(WorkSpace)/make/windows/build_vm_def.sh
$(AOUT): $(Res_Files) $(Obj_Files) vm.def
$(LINK) @<<
$(LINK_FLAGS) /out:$@ /implib:$*.lib /def:vm.def $(Obj_Files) $(Res_Files)
<<
......
......@@ -84,11 +84,12 @@ ProjectCreatorIDEOptions=\
-buildBase $(HOTSPOTBUILDSPACE)\%f\%b \
-startAt src \
-compiler $(VcVersion) \
-projectFileName $(HOTSPOTBUILDSPACE)\$(ProjectFile) \
-projectFileName $(HOTSPOTBUILDROOT)\$(ProjectFile) \
-jdkTargetRoot $(HOTSPOTJDKDIST) \
-define ALIGN_STACK_FRAMES \
-define VM_LITTLE_ENDIAN \
-prelink "" "Generating vm.def..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) $(HOTSPOTMKSHOME)\sh $(HOTSPOTWORKSPACE)\make\windows\build_vm_def.sh $(LINK_VER)" \
-postbuild "" "Building hotspot.exe..." "cd $(HOTSPOTBUILDSPACE)\%f\%b set HOTSPOTMKSHOME=$(HOTSPOTMKSHOME) nmake -f $(HOTSPOTWORKSPACE)\make\windows\projectfiles\common\Makefile LOCAL_MAKE=$(HOTSPOTBUILDSPACE)\%f\local.make JAVA_HOME=$(HOTSPOTJDKDIST) launcher" \
-ignoreFile jsig.c \
-ignoreFile jvmtiEnvRecommended.cpp \
-ignoreFile jvmtiEnvStub.cpp \
......
#
# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -48,7 +48,7 @@ BOOT_TARGET_CLASS_VERSION=6
JAVAC_FLAGS=-g -encoding ascii
BOOTSTRAP_JAVAC_FLAGS=$(JAVAC_FLAGS) -source $(BOOT_SOURCE_LANGUAGE_VERSION) -target $(BOOT_TARGET_CLASS_VERSION)
ProjectFile=vm.vcproj
ProjectFile=jvm.vcproj
!if "$(MSC_VER)" == "1200"
......@@ -63,6 +63,11 @@ VcVersion=VC8
VcVersion=VC9
!elseif "$(MSC_VER)" == "1600"
# for compatibility - we don't yet have a ProjectCreator for VC10
VcVersion=VC9
!else
VcVersion=VC7
......
......@@ -71,22 +71,11 @@ CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_TARGET=\"$(BUILD_FLAVOR)\""
CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_BUILD_USER=\"$(BuildUser)\""
CPP_FLAGS=$(CPP_FLAGS) /D "HOTSPOT_VM_DISTRO=\"$(HOTSPOT_VM_DISTRO)\""
CPP_FLAGS=$(CPP_FLAGS) /D "WIN32" /D "_WINDOWS" $(CPP_INCLUDE_DIRS)
# Must specify this for sharedRuntimeTrig.cpp
CPP_FLAGS=$(CPP_FLAGS) /D "VM_LITTLE_ENDIAN"
CPP_FLAGS=$(CPP_FLAGS) $(CPP_INCLUDE_DIRS)
# Define that so jni.h is on correct side
CPP_FLAGS=$(CPP_FLAGS) /D "_JNI_IMPLEMENTATION_"
# Used for platform dispatching
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_FAMILY_windows
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_$(Platform_arch)
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_ARCH_MODEL_$(Platform_arch_model)
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_windows_$(Platform_arch)
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_OS_ARCH_MODEL_windows_$(Platform_arch_model)
CPP_FLAGS=$(CPP_FLAGS) /D TARGET_COMPILER_visCPP
!if "$(BUILDARCH)" == "ia64"
STACK_SIZE="/STACK:1048576,262144"
!else
......@@ -104,6 +93,8 @@ AGCT_EXPORT=/export:AsyncGetCallTrace
!endif
!endif
# If you modify exports below please do the corresponding changes in
# src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \
/export:JNI_GetDefaultJavaVMInitArgs \
/export:JNI_CreateJavaVM \
......
......@@ -22,7 +22,10 @@
#
#
!include local.make
!ifdef LOCAL_MAKE
!include $(LOCAL_MAKE)
!endif
WorkSpace=$(HOTSPOTWORKSPACE)
......@@ -34,11 +37,18 @@ BootStrapDir=$(BOOTDIR)
!else
!ifdef JAVA_HOME
BootStrapDir=$(JAVA_HOME)
!else
!ifdef HOTSPOTJDKDIST
BootStrapDir=$(HOTSPOTJDKDIST)
!endif
!endif
!endif
!endif
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/projectcreator.make
!include $(WorkSpace)/make/windows/makefiles/compile.make
# Pick up rules for building JVMTI (JSR-163)
JvmtiOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\jvmtifiles
......@@ -56,6 +66,9 @@ Platform=$(HOTSPOTWORKSPACE)/make/windows/platform_$(BUILDARCH)
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/adlc.make
!endif
HS_INTERNAL_NAME=jvm
!include $(HOTSPOTWORKSPACE)/make/windows/makefiles/launcher.make
default:: $(AdditionalTargets) $(JvmtiGeneratedFiles)
!include $(HOTSPOTWORKSPACE)/make/hotspot_version
......@@ -97,7 +110,7 @@ ProjectCreatorIDEOptions = $(ProjectCreatorIDEOptions) \
-define JRE_RELEASE_VERSION=\\\"$(JRE_RELEASE_VERSION)\\\" \
-define HOTSPOT_VM_DISTRO=\\\"$(HOTSPOT_VM_DISTRO)\\\"
$(HOTSPOTBUILDSPACE)/$(ProjectFile): local.make $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
$(HOTSPOTBUILDROOT)/$(ProjectFile): $(HOTSPOTBUILDSPACE)/classes/ProjectCreator.class
@$(RUN_JAVA) -Djava.class.path=$(HOTSPOTBUILDSPACE)/classes ProjectCreator WinGammaPlatform$(VcVersion) $(ProjectCreatorIDEOptions)
clean:
......
#
# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -22,7 +22,6 @@
#
#
Variant=compiler1
!include local.make
!include ../local.make
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
......@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
; make\windows\makefiles\makedeps.make (esp. the "-prelink"
; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
......@@ -22,8 +22,7 @@
#
#
Variant=compiler2
!include local.make
!include ../local.make
AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles
AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
......
......@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
; make\windows\makefiles\makedeps.make (esp. the "-prelink"
; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
#
# Copyright (c) 1998, 2008, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -22,7 +22,6 @@
#
#
Variant=core
!include local.make
!include ../local.make
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
......@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
; make\windows\makefiles\makedeps.make (esp. the "-prelink"
; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
#
# Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2007, 2010 Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
......@@ -22,7 +22,6 @@
#
#
Variant=kernel
!include local.make
!include ../local.make
!include $(HOTSPOTWORKSPACE)/make/windows/projectfiles/common/Makefile
......@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
; make\windows\makefiles\makedeps.make (esp. the "-prelink"
; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
......@@ -22,8 +22,7 @@
#
#
Variant=tiered
!include local.make
!include ../local.make
AdlcOutDir=$(HOTSPOTBUILDSPACE)\$(Variant)\generated\adfiles
AdditionalTargets=$(AdlcOutDir)\ad_$(Platform_arch_model).cpp $(AdlcOutDir)\dfa_$(Platform_arch_model).cpp
......
......@@ -2,6 +2,6 @@
; This .DEF file is a placeholder for one which is automatically
; generated during the build process. See
; make\windows\build_vm_def.sh and
; make\windows\makefiles\makedeps.make (esp. the "-prelink"
; make\windows\makefiles\projectcreator.make (esp. the "-prelink"
; options).
;
......@@ -28,6 +28,7 @@
#include <dlfcn.h>
#include <fcntl.h>
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
......@@ -812,13 +813,10 @@ GetApplicationHome(char *buf, jint bufsize)
#ifdef GAMMA
{
/* gamma launcher uses JAVA_HOME or ALT_JAVA_HOME environment variable to find JDK/JRE */
char* java_home_var = getenv("ALT_JAVA_HOME");
/* gamma launcher uses JAVA_HOME environment variable to find JDK/JRE */
char* java_home_var = getenv("JAVA_HOME");
if (java_home_var == NULL) {
java_home_var = getenv("JAVA_HOME");
}
if (java_home_var == NULL) {
printf("JAVA_HOME or ALT_JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
printf("JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
return JNI_FALSE;
}
snprintf(buf, bufsize, "%s", java_home_var);
......@@ -1837,7 +1835,7 @@ ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void
if (pthread_create(&tid, &attr, (void *(*)(void*))continuation, (void*)args) == 0) {
void * tmp;
pthread_join(tid, &tmp);
rslt = (int)tmp;
rslt = (int)(intptr_t)tmp;
} else {
/*
* Continue execution in current thread if for some reason (e.g. out of
......@@ -1855,7 +1853,7 @@ ContinueInNewThread(int (JNICALL *continuation)(void *), jlong stack_size, void
if (thr_create(NULL, stack_size, (void *(*)(void *))continuation, args, flags, &tid) == 0) {
void * tmp;
thr_join(tid, NULL, &tmp);
rslt = (int)tmp;
rslt = (int)(intptr_t)tmp;
} else {
/* See above. Continue in current thread if thr_create() failed */
rslt = continuation(args);
......
......@@ -95,17 +95,21 @@ case "$1" in
;;
esac
# Find out the absolute path to this script
MYDIR=$(cd $(dirname $SCRIPT) && pwd)
JDK=
if [ "${ALT_JAVA_HOME}" = "" ]; then
if [ "${JAVA_HOME}" = "" ]; then
echo "Neither ALT_JAVA_HOME nor JAVA_HOME is set. Aborting.";
exit 1;
else
JDK=${JAVA_HOME%%/jre};
fi
source ${MYDIR}/jdkpath.sh
else
JDK=${ALT_JAVA_HOME%%/jre};
fi
if [ "${JDK}" = "" ]; then
echo Failed to find JDK. ALT_JAVA_HOME is not set or ./jdkpath.sh is empty or not found.
exit 1
fi
# We will set the LD_LIBRARY_PATH as follows:
# o $JVMPATH (directory portion only)
# o $JRE/lib/$ARCH
......
......@@ -22,6 +22,7 @@
*
*/
#include <ctype.h>
#include <windows.h>
#include <io.h>
#include <process.h>
......@@ -486,16 +487,62 @@ GetApplicationHome(char *buf, jint bufsize)
#else /* ifndef GAMMA */
/* gamma launcher uses JAVA_HOME or ALT_JAVA_HOME environment variable to find JDK/JRE */
char* java_home_var = getenv("ALT_JAVA_HOME");
if (java_home_var == NULL) {
java_home_var = getenv("JAVA_HOME");
char env[MAXPATHLEN + 1];
/* gamma launcher uses ALT_JAVA_HOME environment variable or jdkpath.txt file to find JDK/JRE */
if (getenv("ALT_JAVA_HOME") != NULL) {
snprintf(buf, bufsize, "%s", getenv("ALT_JAVA_HOME"));
}
if (java_home_var == NULL) {
printf("JAVA_HOME or ALT_JAVA_HOME must point to a valid JDK/JRE to run gamma\n");
return JNI_FALSE;
else {
char path[MAXPATHLEN + 1];
char* p;
int len;
FILE* fp;
// find the path to the currect executable
len = GetModuleFileName(NULL, path, MAXPATHLEN + 1);
if (len == 0 || len > MAXPATHLEN) {
printf("Could not get directory of current executable.");
return JNI_FALSE;
}
// remove last path component ("hotspot.exe")
p = strrchr(path, '\\');
if (p == NULL) {
printf("Could not parse directory of current executable.\n");
return JNI_FALSE;
}
*p = '\0';
// open jdkpath.txt and read JAVA_HOME from it
if (strlen(path) + strlen("\\jdkpath.txt") + 1 >= MAXPATHLEN) {
printf("Path too long: %s\n", path);
return JNI_FALSE;
}
strcat(path, "\\jdkpath.txt");
fp = fopen(path, "r");
if (fp == NULL) {
printf("Could not open file %s to get path to JDK.\n", path);
return JNI_FALSE;
}
if (fgets(buf, bufsize, fp) == NULL) {
printf("Could not read from file %s to get path to JDK.\n", path);
fclose(fp);
return JNI_FALSE;
}
// trim the buffer
p = buf + strlen(buf) - 1;
while(isspace(*p)) {
*p = '\0';
p--;
}
fclose(fp);
}
snprintf(buf, bufsize, "%s", java_home_var);
_snprintf(env, MAXPATHLEN, "JAVA_HOME=%s", buf);
_putenv(env);
return JNI_TRUE;
#endif /* ifndef GAMMA */
}
......
......@@ -1711,14 +1711,11 @@ void os::jvm_path(char *buf, jint buflen) {
buf[0] = '\0';
if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
// Support for the gamma launcher. Check for an
// ALT_JAVA_HOME or JAVA_HOME environment variable
// JAVA_HOME environment variable
// and fix up the path so it looks like
// libjvm.so is installed there (append a fake suffix
// hotspot/libjvm.so).
char* java_home_var = ::getenv("ALT_JAVA_HOME");
if (java_home_var == NULL) {
java_home_var = ::getenv("JAVA_HOME");
}
char* java_home_var = ::getenv("JAVA_HOME");
if (java_home_var != NULL && java_home_var[0] != 0) {
strncpy(buf, java_home_var, buflen);
......
......@@ -22,8 +22,11 @@
*
*/
import java.util.*;
import java.io.File;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Vector;
class BuildConfig {
Hashtable vars;
......@@ -57,7 +60,6 @@ class BuildConfig {
// ones mentioned above were needed to expand format
String buildBase = expandFormat(getFieldString(null, "BuildBase"));
String jdkDir = getFieldString(null, "JdkTargetRoot");
String sourceBase = getFieldString(null, "SourceBase");
String outDir = buildBase;
......@@ -65,7 +67,7 @@ class BuildConfig {
put("OutputDir", outDir);
put("SourceBase", sourceBase);
put("BuildBase", buildBase);
put("OutputDll", jdkDir + Util.sep + outDll);
put("OutputDll", outDir + Util.sep + outDll);
context = new String [] {flavourBuild, flavour, build, null};
}
......@@ -537,68 +539,75 @@ abstract class GenericDebugConfig extends BuildConfig {
}
}
class C1DebugConfig extends GenericDebugConfig {
abstract class GenericDebugNonKernelConfig extends GenericDebugConfig {
protected void init(Vector includes, Vector defines) {
super.init(includes, defines);
getCI().getAdditionalNonKernelLinkerFlags(getV("LinkerFlags"));
}
}
class C1DebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getNoOptFlag();
}
C1DebugConfig() {
initNames("compiler1", "debug", "fastdebug\\jre\\bin\\client\\jvm.dll");
initNames("compiler1", "debug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class C1FastDebugConfig extends GenericDebugConfig {
class C1FastDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getOptFlag();
}
C1FastDebugConfig() {
initNames("compiler1", "fastdebug", "fastdebug\\jre\\bin\\client\\jvm.dll");
initNames("compiler1", "fastdebug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class C2DebugConfig extends GenericDebugConfig {
class C2DebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getNoOptFlag();
}
C2DebugConfig() {
initNames("compiler2", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll");
initNames("compiler2", "debug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class C2FastDebugConfig extends GenericDebugConfig {
class C2FastDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getOptFlag();
}
C2FastDebugConfig() {
initNames("compiler2", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll");
initNames("compiler2", "fastdebug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class TieredDebugConfig extends GenericDebugConfig {
class TieredDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getNoOptFlag();
}
TieredDebugConfig() {
initNames("tiered", "debug", "fastdebug\\jre\\bin\\server\\jvm.dll");
initNames("tiered", "debug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class TieredFastDebugConfig extends GenericDebugConfig {
class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getOptFlag();
}
TieredFastDebugConfig() {
initNames("tiered", "fastdebug", "fastdebug\\jre\\bin\\server\\jvm.dll");
initNames("tiered", "fastdebug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
......@@ -618,45 +627,45 @@ abstract class ProductConfig extends BuildConfig {
class C1ProductConfig extends ProductConfig {
C1ProductConfig() {
initNames("compiler1", "product", "jre\\bin\\client\\jvm.dll");
initNames("compiler1", "product", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class C2ProductConfig extends ProductConfig {
C2ProductConfig() {
initNames("compiler2", "product", "jre\\bin\\server\\jvm.dll");
initNames("compiler2", "product", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class TieredProductConfig extends ProductConfig {
TieredProductConfig() {
initNames("tiered", "product", "jre\\bin\\server\\jvm.dll");
initNames("tiered", "product", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class CoreDebugConfig extends GenericDebugConfig {
class CoreDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getNoOptFlag();
}
CoreDebugConfig() {
initNames("core", "debug", "fastdebug\\jre\\bin\\core\\jvm.dll");
initNames("core", "debug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
class CoreFastDebugConfig extends GenericDebugConfig {
class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getOptFlag();
}
CoreFastDebugConfig() {
initNames("core", "fastdebug", "fastdebug\\jre\\bin\\core\\jvm.dll");
initNames("core", "fastdebug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
......@@ -664,7 +673,7 @@ class CoreFastDebugConfig extends GenericDebugConfig {
class CoreProductConfig extends ProductConfig {
CoreProductConfig() {
initNames("core", "product", "jre\\bin\\core\\jvm.dll");
initNames("core", "product", "jvm.dll");
init(getIncludes(), getDefines());
}
}
......@@ -675,7 +684,7 @@ class KernelDebugConfig extends GenericDebugConfig {
}
KernelDebugConfig() {
initNames("kernel", "debug", "fastdebug\\jre\\bin\\kernel\\jvm.dll");
initNames("kernel", "debug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
......@@ -687,7 +696,7 @@ class KernelFastDebugConfig extends GenericDebugConfig {
}
KernelFastDebugConfig() {
initNames("kernel", "fastdebug", "fastdebug\\jre\\bin\\kernel\\jvm.dll");
initNames("kernel", "fastdebug", "jvm.dll");
init(getIncludes(), getDefines());
}
}
......@@ -695,7 +704,7 @@ class KernelFastDebugConfig extends GenericDebugConfig {
class KernelProductConfig extends ProductConfig {
KernelProductConfig() {
initNames("kernel", "product", "jre\\bin\\kernel\\jvm.dll");
initNames("kernel", "product", "jvm.dll");
init(getIncludes(), getDefines());
}
}
......@@ -704,6 +713,7 @@ abstract class CompilerInterface {
abstract Vector getBaseLinkerFlags(String outDir, String outDll);
abstract Vector getDebugCompilerFlags(String opt);
abstract Vector getDebugLinkerFlags();
abstract void getAdditionalNonKernelLinkerFlags(Vector rv);
abstract Vector getProductCompilerFlags();
abstract Vector getProductLinkerFlags();
abstract String getOptFlag();
......@@ -713,4 +723,14 @@ abstract class CompilerInterface {
void addAttr(Vector receiver, String attr, String value) {
receiver.add(attr); receiver.add(value);
}
void extAttr(Vector receiver, String attr, String value) {
int attr_pos=receiver.indexOf(attr) ;
if ( attr_pos == -1) {
// If attr IS NOT present in the Vector - add it
receiver.add(attr); receiver.add(value);
} else {
// If attr IS present in the Vector - append value to it
receiver.set(attr_pos+1,receiver.get(attr_pos+1)+value);
}
}
}
......@@ -22,8 +22,15 @@
*
*/
import java.io.*;
import java.util.*;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import java.util.Vector;
abstract class HsArgHandler extends ArgHandler {
static final int STRING = 1;
......@@ -345,11 +352,23 @@ public abstract class WinGammaPlatform {
new ArgsParser(args,
new ArgRule[]
{
new HsArgRule("-sourceBase",
"SourceBase",
" (Did you set the HotSpotWorkSpace environment variable?)",
HsArgHandler.STRING
),
new ArgRule("-sourceBase",
new HsArgHandler() {
public void handle(ArgIterator it) {
String cfg = getCfg(it.get());
if (nextNotKey(it)) {
String sb = (String) it.get();
if (sb.endsWith(Util.sep)) {
sb = sb.substring(0, sb.length() - 1);
}
BuildConfig.putField(cfg, "SourceBase", sb);
it.next();
} else {
empty("-sourceBase", null);
}
}
}
),
new HsArgRule("-buildBase",
"BuildBase",
......@@ -512,7 +531,6 @@ public abstract class WinGammaPlatform {
new HsArgHandler() {
public void handle(ArgIterator it) {
if (nextNotKey(it)) {
String build = it.get();
if (nextNotKey(it)) {
String description = it.get();
if (nextNotKey(it)) {
......@@ -528,7 +546,28 @@ public abstract class WinGammaPlatform {
empty(null, "** Error: wrong number of args to -prelink");
}
}
)
),
new ArgRule("-postbuild",
new HsArgHandler() {
public void handle(ArgIterator it) {
if (nextNotKey(it)) {
if (nextNotKey(it)) {
String description = it.get();
if (nextNotKey(it)) {
String command = it.get();
BuildConfig.putField(null, "PostbuildDescription", description);
BuildConfig.putField(null, "PostbuildCommand", command);
it.next();
return;
}
}
}
empty(null, "** Error: wrong number of args to -postbuild");
}
}
),
},
new ArgHandler() {
public void handle(ArgIterator it) {
......@@ -618,10 +657,6 @@ public abstract class WinGammaPlatform {
public int compareTo(Object o) {
FileInfo oo = (FileInfo)o;
// Don't squelch identical short file names where the full
// paths are different
if (!attr.shortName.equals(oo.attr.shortName))
return attr.shortName.compareTo(oo.attr.shortName);
return full.compareTo(oo.full);
}
......
......@@ -260,6 +260,8 @@ class CompilerInterfaceVC6 extends CompilerInterface {
return rv;
}
void getAdditionalNonKernelLinkerFlags(Vector rv) {}
Vector getProductCompilerFlags() {
Vector rv = new Vector();
......
......@@ -22,8 +22,13 @@
*
*/
import java.io.*;
import java.util.*;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.TreeSet;
import java.util.Vector;
public class WinGammaPlatformVC7 extends WinGammaPlatform {
......@@ -104,7 +109,9 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
boolean match(FileInfo fi) {
return fi.full.regionMatches(true, baseLen, dir, 0, dirLen);
int lastSlashIndex = fi.full.lastIndexOf('/');
String fullDir = fi.full.substring(0, lastSlashIndex);
return fullDir.endsWith(dir);
}
}
......@@ -217,65 +224,41 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
// - container filter just provides a container to group together real filters
// - real filter can select elements from the set according to some rule, put it into XML
// and remove from the list
Vector makeFilters(TreeSet files) {
Vector makeFilters(TreeSet<FileInfo> files) {
Vector rv = new Vector();
String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/");
ContainerFilter rt = new ContainerFilter("Runtime");
rt.add(new DirectoryFilter("share/vm/prims", sbase));
rt.add(new DirectoryFilter("share/vm/runtime", sbase));
rt.add(new DirectoryFilter("share/vm/oops", sbase));
rv.add(rt);
ContainerFilter gc = new ContainerFilter("GC");
gc.add(new DirectoryFilter("share/vm/memory", sbase));
gc.add(new DirectoryFilter("share/vm/gc_interface", sbase));
ContainerFilter gc_impl = new ContainerFilter("Implementations");
gc_impl.add(new DirectoryFilter("CMS",
"share/vm/gc_implementation/concurrentMarkSweep",
sbase));
gc_impl.add(new DirectoryFilter("Parallel Scavenge",
"share/vm/gc_implementation/parallelScavenge",
sbase));
gc_impl.add(new DirectoryFilter("Shared",
"share/vm/gc_implementation/shared",
sbase));
// for all leftovers
gc_impl.add(new DirectoryFilter("Misc",
"share/vm/gc_implementation",
sbase));
gc.add(gc_impl);
rv.add(gc);
rv.add(new DirectoryFilter("C1", "share/vm/c1", sbase));
rv.add(new DirectoryFilter("C2", "share/vm/opto", sbase));
ContainerFilter comp = new ContainerFilter("Compiler Common");
comp.add(new DirectoryFilter("share/vm/asm", sbase));
comp.add(new DirectoryFilter("share/vm/ci", sbase));
comp.add(new DirectoryFilter("share/vm/code", sbase));
comp.add(new DirectoryFilter("share/vm/compiler", sbase));
rv.add(comp);
rv.add(new DirectoryFilter("Interpreter",
"share/vm/interpreter",
sbase));
ContainerFilter misc = new ContainerFilter("Misc");
misc.add(new DirectoryFilter("share/vm/libadt", sbase));
misc.add(new DirectoryFilter("share/vm/services", sbase));
misc.add(new DirectoryFilter("share/vm/utilities", sbase));
misc.add(new DirectoryFilter("share/vm/classfile", sbase));
rv.add(misc);
rv.add(new DirectoryFilter("os_cpu", sbase));
rv.add(new DirectoryFilter("cpu", sbase));
rv.add(new DirectoryFilter("os", sbase));
String currentDir = "";
DirectoryFilter container = null;
for(FileInfo fileInfo : files) {
if (!fileInfo.full.startsWith(sbase)) {
continue;
}
int lastSlash = fileInfo.full.lastIndexOf('/');
String dir = fileInfo.full.substring(sbase.length(), lastSlash);
if(dir.equals("share/vm")) {
// skip files directly in share/vm - should only be precompiled.hpp which is handled below
continue;
}
if (!dir.equals(currentDir)) {
currentDir = dir;
if (container != null) {
rv.add(container);
}
// remove "share/vm/" from names
String name = dir;
if (dir.startsWith("share/vm/")) {
name = dir.substring("share/vm/".length(), dir.length());
}
container = new DirectoryFilter(name, dir, sbase);
}
}
if (container != null) {
rv.add(container);
}
ContainerFilter generated = new ContainerFilter("Generated");
ContainerFilter c1Generated = new ContainerFilter("C1");
......@@ -397,7 +380,6 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
"Name", cfg,
"ExcludedFromBuild", "TRUE"
});
tag("Tool", new String[] {"Name", "VCCLCompilerTool"});
endTag("FileConfiguration");
}
......@@ -441,7 +423,11 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
tag("Tool",
new String[] {
"Name", "VCPostBuildEventTool"
"Name", "VCPostBuildEventTool",
"Description", BuildConfig.getFieldString(null, "PostbuildDescription"),
//Caution: String.replace(String,String) is available from JDK5 onwards only
"CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace
("\t", "&#x0D;&#x0A;"))
}
);
......@@ -469,33 +455,6 @@ public class WinGammaPlatformVC7 extends WinGammaPlatform {
"Culture", "1033"
}
);
tag("Tool",
new String[] {
"Name", "VCWebServiceProxyGeneratorTool"
}
);
tag ("Tool",
new String[] {
"Name", "VCXMLDataGeneratorTool"
}
);
tag("Tool",
new String[] {
"Name", "VCWebDeploymentTool"
}
);
tag("Tool",
new String[] {
"Name", "VCManagedWrapperGeneratorTool"
}
);
tag("Tool",
new String[] {
"Name", "VCAuxiliaryManagedWrapperGeneratorTool"
}
);
tag("Tool",
new String[] {
......@@ -597,7 +556,7 @@ class CompilerInterfaceVC7 extends CompilerInterface {
addAttr(rv, "PrecompiledHeaderFile", outDir+Util.sep+"vm.pch");
addAttr(rv, "AssemblerListingLocation", outDir);
addAttr(rv, "ObjectFile", outDir+Util.sep);
addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"vm.pdb");
addAttr(rv, "ProgramDataBaseFileName", outDir+Util.sep+"jvm.pdb");
// Set /nologo optin
addAttr(rv, "SuppressStartupBanner", "TRUE");
// Surpass the default /Tc or /Tp. 0 is compileAsDefault
......@@ -631,17 +590,22 @@ class CompilerInterfaceVC7 extends CompilerInterface {
addAttr(rv, "AdditionalOptions",
"/export:JNI_GetDefaultJavaVMInitArgs " +
"/export:JNI_CreateJavaVM " +
"/export:JVM_FindClassFromBootLoader "+
"/export:JNI_GetCreatedJavaVMs "+
"/export:jio_snprintf /export:jio_printf "+
"/export:jio_fprintf /export:jio_vfprintf "+
"/export:jio_vsnprintf ");
"/export:jio_vsnprintf "+
"/export:JVM_GetVersionInfo "+
"/export:JVM_GetThreadStateNames "+
"/export:JVM_GetThreadStateValues "+
"/export:JVM_InitAgentProperties ");
addAttr(rv, "AdditionalDependencies", "Wsock32.lib winmm.lib");
addAttr(rv, "OutputFile", outDll);
// Set /INCREMENTAL option. 1 is linkIncrementalNo
addAttr(rv, "LinkIncremental", "1");
addAttr(rv, "SuppressStartupBanner", "TRUE");
addAttr(rv, "ModuleDefinitionFile", outDir+Util.sep+"vm.def");
addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"vm.pdb");
addAttr(rv, "ProgramDatabaseFile", outDir+Util.sep+"jvm.pdb");
// Set /SUBSYSTEM option. 2 is subSystemWindows
addAttr(rv, "SubSystem", "2");
addAttr(rv, "BaseAddress", "0x8000000");
......@@ -682,6 +646,11 @@ class CompilerInterfaceVC7 extends CompilerInterface {
return rv;
}
void getAdditionalNonKernelLinkerFlags(Vector rv) {
extAttr(rv, "AdditionalOptions",
"/export:AsyncGetCallTrace ");
}
void getProductCompilerFlags_common(Vector rv) {
// Set /O2 option. 2 is optimizeMaxSpeed
addAttr(rv, "Optimization", "2");
......
......@@ -22,7 +22,7 @@
*
*/
import java.util.*;
import java.util.Vector;
public class WinGammaPlatformVC8 extends WinGammaPlatformVC7 {
......@@ -41,6 +41,9 @@ class CompilerInterfaceVC8 extends CompilerInterfaceVC7 {
// Set /EHsc- option. 0 is cppExceptionHandlingNo
addAttr(rv, "ExceptionHandling", "0");
// enable multi process builds
extAttr(rv, "AdditionalOptions", "/MP");
return rv;
}
......
......@@ -275,6 +275,8 @@ main(int argc, char ** argv)
jvmpath, sizeof(jvmpath),
original_argv);
printf("Using java runtime at: %s\n", jrepath);
ifn.CreateJavaVM = 0;
ifn.GetDefaultJavaVMInitArgs = 0;
......
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
......@@ -27,7 +28,7 @@
#include "jli_util.h"
#ifdef GAMMA
#ifdef _WINDOWS
#ifdef TARGET_OS_FAMILY_windows
#define strdup _strdup
#endif
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册