Skip to content

Commit

Permalink
Setup paths without FIXPATH to OMR configure
Browse files Browse the repository at this point in the history
Pass JAVA_SPEC_VERSION to buildj9tools.mk to accommodate JDK16+ specific
change;
Setup paths without FIXPATH such as CC_NOFIXPATH,
CXX_NOFIXPATH, VS_INCLUDE_NOFIXPATH, and VS_LIB_NOFIXPATH.

Signed-off-by: Jason Feng <[email protected]>
  • Loading branch information
JasonFengJ9 committed Dec 30, 2020
1 parent 340b5d3 commit b725e4a
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 54 deletions.
1 change: 1 addition & 0 deletions closed/GensrcJ9JCL.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ $(J9JCL_SOURCES_DONEFILE) : $(AllJclSource)
@$(ECHO) Building OpenJ9 Java Preprocessor
@$(MKDIR) -p $(J9TOOLS_DIR)
$(MAKE) $(MAKE_ARGS) -C $(OPENJ9_TOPDIR)/sourcetools -f buildj9tools.mk \
JAVA_SPEC_VERSION=$(VERSION_FEATURE) \
BOOT_JDK=$(BOOT_JDK) \
DEST_DIR=$(call FixPath,$(J9TOOLS_DIR)) \
JAVA_HOME=$(BOOT_JDK) \
Expand Down
4 changes: 2 additions & 2 deletions closed/OpenJ9.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ SedUmaCommand = -e '/<property name="uma_make_cmd_$(strip $2)"/s|value="[^"]*"|v

# Copy configured values to relevant UMA properties in .spec files.
SPEC_SED_SCRIPT := \
$(call SedUmaCommand, CC, cc) \
$(call SedUmaCommand, CXX, cxx) \
$(call SedUmaCommand, CC_NOFIXPATH, cc) \
$(call SedUmaCommand, CXX_NOFIXPATH, cxx) \
$(call SedUmaCommand, CXX, interp_gcc) \
$(call SedUmaCommand, CXX, ppc_gcc_cxx) \
#
Expand Down
10 changes: 7 additions & 3 deletions closed/autoconf/custom-hook.m4
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ AC_DEFUN([OPENJ9_CONFIGURE_CUDA],
if test -f "$cuda_home/include/cuda.h" ; then
if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin ; then
# UTIL_FIXUP_PATH yields a Unix-style path, but we need a mixed-mode path
cuda_home="`$CYGPATH -m $cuda_home`"
cuda_home="`cygpath -m $cuda_home`"
fi
if test "$cuda_home" = "$with_cuda" ; then
AC_MSG_RESULT([$with_cuda])
Expand All @@ -190,7 +190,7 @@ AC_DEFUN([OPENJ9_CONFIGURE_CUDA],
if test -f "$gdk_home/include/nvml.h" ; then
if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin ; then
# UTIL_FIXUP_PATH yields a Unix-style path, but we need a mixed-mode path
gdk_home="`$CYGPATH -m $gdk_home`"
gdk_home="`cygpath -m $gdk_home`"
fi
if test "$gdk_home" = "$with_gdk" ; then
AC_MSG_RESULT([$with_gdk])
Expand Down Expand Up @@ -464,7 +464,7 @@ AC_DEFUN([OPENJ9_THIRD_PARTY_REQUIREMENTS],
fi
if test "x$OPENJDK_BUILD_OS_ENV" = xwindows.cygwin ; then
FREEMARKER_JAR=`$CYGPATH -m "$with_freemarker_jar"`
FREEMARKER_JAR=`cygpath -m "$with_freemarker_jar"`
else
FREEMARKER_JAR=$with_freemarker_jar
fi
Expand Down Expand Up @@ -515,6 +515,10 @@ AC_DEFUN_ONCE([CUSTOM_LATE_HOOK],
CLOSED_AUTOCONF_DIR="$TOPDIR/closed/autoconf"
AC_SUBST(VS_INCLUDE_NOFIXPATH)
AC_SUBST(VS_LIB_NOFIXPATH)
AC_SUBST(PATH)
# Create the custom-spec.gmk
AC_CONFIG_FILES([$OUTPUTDIR/custom-spec.gmk:$CLOSED_AUTOCONF_DIR/custom-spec.gmk.in])
Expand Down
5 changes: 3 additions & 2 deletions closed/autoconf/custom-spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,9 @@ export ac_cv_prog_CXX := @CXX@
ifeq ($(OPENJDK_TARGET_OS), windows)
# Set environment variables for Microsoft Visual Studio toolchain.
# Note that PATH is set in spec.gmk.
export INCLUDE := "@VS_INCLUDE@"
export LIB := "@VS_LIB@"
export INCLUDE := "@VS_INCLUDE_NOFIXPATH@"
export LIB := "@VS_LIB_NOFIXPATH@"
export PATH := @PATH@
export MSVC_VERSION := @TOOLCHAIN_VERSION@
endif

Expand Down
7 changes: 7 additions & 0 deletions make/autoconf/basic.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
# questions.
#

# ===========================================================================
# (c) Copyright IBM Corp. 2020, 2020 All Rights Reserved
# ===========================================================================

m4_include([basic_tools.m4])
m4_include([basic_windows.m4])

Expand Down Expand Up @@ -390,6 +394,9 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
AC_SUBST(OUTPUTDIR)
AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
AC_SUBST(CC_NOFIXPATH)
AC_SUBST(CXX_NOFIXPATH)
# The spec.gmk file contains all variables for the make system.
AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
# The bootcycle-spec.gmk file contains support for boot cycle builds.
Expand Down
6 changes: 6 additions & 0 deletions make/autoconf/spec.gmk.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
# questions.
#

# ===========================================================================
# (c) Copyright IBM Corp. 2020, 2020 All Rights Reserved
# ===========================================================================

# Configured @DATE_WHEN_CONFIGURED@ to build
# for target system @OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU@
# (called @OPENJDK_TARGET_AUTOCONF_NAME@ by autoconf)
Expand Down Expand Up @@ -493,6 +497,8 @@ ADLC_LDFLAGS=@ADLC_LDFLAGS@

# Tools that potentially need to be cross compilation aware.
CC := @CCACHE@ @ICECC@ @CC@
CC_NOFIXPATH := @CC_NOFIXPATH@
CXX_NOFIXPATH := @CXX_NOFIXPATH@

# CFLAGS used to compile the jdk native libraries (C-code)
CFLAGS_JDKLIB:=@CFLAGS_JDKLIB@
Expand Down
10 changes: 10 additions & 0 deletions make/autoconf/util_paths.m4
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
# questions.
#

# ===========================================================================
# (c) Copyright IBM Corp. 2020, 2020 All Rights Reserved
# ===========================================================================

###############################################################################
# Appends a string to a path variable, only adding the : when needed.
AC_DEFUN([UTIL_APPEND_TO_PATH],
Expand Down Expand Up @@ -395,6 +399,12 @@ AC_DEFUN([UTIL_LOOKUP_PROGS],
$1="$full_path"
UTIL_FIXUP_EXECUTABLE($1, $3, $4)
result="[$]$1"
if test "x$1" == xPOTENTIAL_CC; then
CC_NOFIXPATH="$full_path"
fi
if test "x$1" == xPOTENTIAL_CXX; then
CXX_NOFIXPATH="$full_path"
fi
# If we have FIXPATH enabled, strip all instances of it and prepend
# a single one, to avoid double fixpath prefixing.
Expand Down
105 changes: 58 additions & 47 deletions make/scripts/extract-vs-env.cmd
Original file line number Diff line number Diff line change
@@ -1,47 +1,58 @@
@echo off
REM
REM Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
REM under the terms of the GNU General Public License version 2 only, as
REM published by the Free Software Foundation.
REM
REM This code is distributed in the hope that it will be useful, but WITHOUT
REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
REM version 2 for more details (a copy is included in the LICENSE file that
REM accompanied this code).
REM
REM You should have received a copy of the GNU General Public License version
REM 2 along with this work; if not, write to the Free Software Foundation,
REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
REM
REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
REM or visit www.oracle.com if you need additional information or have any
REM questions.
REM

set vcvarscmd=%1
set output=%2
if not "%3" == "auto" set version=-vcvars_ver=%3

set PATH_BEFORE=%PATH%

call %vcvarscmd% %version% %4 %5 %6 %7 %8 %9
if exist %output% del %output%

call :extract "%PATH_BEFORE%", PATH_BEFORE
call :extract "%PATH%", PATH_AFTER
call :extract "%INCLUDE%", VS_INCLUDE
call :extract "%LIB%", VS_LIB
call :extract "%VCINSTALLDIR%", VCINSTALLDIR
call :extract "%VCToolsRedistDir%", VCToolsRedistDir
call :extract "%WindowsSdkDir%", WindowsSdkDir
call :extract "%WINDOWSSDKDIR%", WINDOWSSDKDIR

exit /b 0

:extract
echo %~2=$($BASH $TOPDIR/make/scripts/fixpath.sh -i import '%~1 ') >> %output%
exit /b 0
@echo off
REM
REM Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
REM under the terms of the GNU General Public License version 2 only, as
REM published by the Free Software Foundation.
REM
REM This code is distributed in the hope that it will be useful, but WITHOUT
REM ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
REM FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
REM version 2 for more details (a copy is included in the LICENSE file that
REM accompanied this code).
REM
REM You should have received a copy of the GNU General Public License version
REM 2 along with this work; if not, write to the Free Software Foundation,
REM Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
REM
REM Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
REM or visit www.oracle.com if you need additional information or have any
REM questions.
REM

# ===========================================================================
# (c) Copyright IBM Corp. 2020, 2020 All Rights Reserved
# ===========================================================================

set vcvarscmd=%1
set output=%2
if not "%3" == "auto" set version=-vcvars_ver=%3

set PATH_BEFORE=%PATH%

call %vcvarscmd% %version% %4 %5 %6 %7 %8 %9
if exist %output% del %output%

call :extract "%PATH_BEFORE%", PATH_BEFORE
call :extract "%PATH%", PATH_AFTER
call :extract "%INCLUDE%", VS_INCLUDE
call :extract "%LIB%", VS_LIB
call :extract "%VCINSTALLDIR%", VCINSTALLDIR
call :extract "%VCToolsRedistDir%", VCToolsRedistDir
call :extract "%WindowsSdkDir%", WindowsSdkDir
call :extract "%WINDOWSSDKDIR%", WINDOWSSDKDIR

call :extractNoFix "%INCLUDE%", VS_INCLUDE_NOFIXPATH
call :extractNoFix "%LIB%", VS_LIB_NOFIXPATH

exit /b 0

:extractNoFix
echo %~2='%~1' >> %output%
exit /b 0

:extract
echo %~2=$($BASH $TOPDIR/make/scripts/fixpath.sh -i import '%~1 ') >> %output%
exit /b 0

0 comments on commit b725e4a

Please sign in to comment.