Skip to content

Commit dbf787c

Browse files
committed
8368326: Don't export unresolved make variables from configure
Reviewed-by: erikj
1 parent e122f4d commit dbf787c

File tree

2 files changed

+25
-38
lines changed

2 files changed

+25
-38
lines changed

make/autoconf/boot-jdk.m4

Lines changed: 7 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -597,51 +597,25 @@ AC_DEFUN([BOOTJDK_SETUP_BUILD_JDK],
597597
AC_ARG_WITH(build-jdk, [AS_HELP_STRING([--with-build-jdk],
598598
[path to JDK of same version as is being built@<:@the newly built JDK@:>@])])
599599
600-
CREATE_BUILDJDK=false
601-
EXTERNAL_BUILDJDK=false
602-
BUILD_JDK_FOUND="no"
600+
EXTERNAL_BUILDJDK_PATH=""
603601
if test "x$with_build_jdk" != "x"; then
602+
BUILD_JDK_FOUND=no
604603
BOOTJDK_CHECK_BUILD_JDK([
605604
if test "x$with_build_jdk" != x; then
606605
BUILD_JDK=$with_build_jdk
607606
BUILD_JDK_FOUND=maybe
608607
AC_MSG_NOTICE([Found potential Build JDK using configure arguments])
609608
fi
610609
])
611-
EXTERNAL_BUILDJDK=true
612-
else
613-
if test "x$COMPILE_TYPE" = "xcross"; then
614-
BUILD_JDK="\$(BUILDJDK_OUTPUTDIR)/jdk"
615-
BUILD_JDK_FOUND=yes
616-
CREATE_BUILDJDK=true
617-
AC_MSG_CHECKING([for Build JDK])
618-
AC_MSG_RESULT([yes, will build it for the host platform])
619-
else
620-
BUILD_JDK="\$(JDK_OUTPUTDIR)"
621-
BUILD_JDK_FOUND=yes
610+
if test "x$BUILD_JDK_FOUND" != "xyes"; then
622611
AC_MSG_CHECKING([for Build JDK])
623-
AC_MSG_RESULT([yes, will use output dir])
612+
AC_MSG_RESULT([no])
613+
AC_MSG_ERROR([Could not find a suitable Build JDK])
624614
fi
615+
EXTERNAL_BUILDJDK_PATH="$BUILD_JDK"
625616
fi
626617
627-
# Since these tools do not yet exist, we cannot use UTIL_FIXUP_EXECUTABLE to
628-
# detect the need of fixpath
629-
JMOD="$BUILD_JDK/bin/jmod"
630-
UTIL_ADD_FIXPATH(JMOD)
631-
JLINK="$BUILD_JDK/bin/jlink"
632-
UTIL_ADD_FIXPATH(JLINK)
633-
AC_SUBST(JMOD)
634-
AC_SUBST(JLINK)
635-
636-
if test "x$BUILD_JDK_FOUND" != "xyes"; then
637-
AC_MSG_CHECKING([for Build JDK])
638-
AC_MSG_RESULT([no])
639-
AC_MSG_ERROR([Could not find a suitable Build JDK])
640-
fi
641-
642-
AC_SUBST(CREATE_BUILDJDK)
643-
AC_SUBST(BUILD_JDK)
644-
AC_SUBST(EXTERNAL_BUILDJDK)
618+
AC_SUBST(EXTERNAL_BUILDJDK_PATH)
645619
])
646620

647621
# The docs-reference JDK is used to run javadoc for the docs-reference targets.

make/autoconf/spec.gmk.template

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,22 @@ CAPSTONE_ARCH_AARCH64_NAME := @CAPSTONE_ARCH_AARCH64_NAME@
386386
# it in sync.
387387
BOOT_JDK := @BOOT_JDK@
388388

389-
BUILD_JDK := @BUILD_JDK@
390-
CREATE_BUILDJDK := @CREATE_BUILDJDK@
391-
EXTERNAL_BUILDJDK := @EXTERNAL_BUILDJDK@
389+
EXTERNAL_BUILDJDK_PATH := @EXTERNAL_BUILDJDK_PATH@
390+
391+
ifneq ($(EXTERNAL_BUILDJDK_PATH), )
392+
EXTERNAL_BUILDJDK := true
393+
CREATE_BUILDJDK := false
394+
BUILD_JDK := $(EXTERNAL_BUILDJDK_PATH)
395+
else
396+
EXTERNAL_BUILDJDK := false
397+
ifeq ($(COMPILE_TYPE), cross)
398+
CREATE_BUILDJDK := true
399+
BUILD_JDK := $(BUILDJDK_OUTPUTDIR)/jdk
400+
else
401+
CREATE_BUILDJDK := false
402+
BUILD_JDK := $(JDK_OUTPUTDIR)
403+
endif
404+
endif
392405

393406
# Whether the boot jdk jar supports --date=TIMESTAMP
394407
BOOT_JDK_JAR_SUPPORTS_DATE := @BOOT_JDK_JAR_SUPPORTS_DATE@
@@ -647,8 +660,8 @@ JAVA_CMD := @JAVA@
647660
JAVAC_CMD := @JAVAC@
648661
JAVADOC_CMD := @JAVADOC@
649662
JAR_CMD := @JAR@
650-
JLINK_CMD := @JLINK@
651-
JMOD_CMD := @JMOD@
663+
JLINK_CMD := @FIXPATH@ $(BUILD_JDK)/bin/jlink
664+
JMOD_CMD := @FIXPATH@ $(BUILD_JDK)/bin/jmod
652665
# These variables are meant to be used. They are defined with = instead of := to make
653666
# it possible to override only the *_CMD variables.
654667
JAVA = $(JAVA_CMD) $(JAVA_FLAGS_BIG) $(JAVA_FLAGS)

0 commit comments

Comments
 (0)