--- a/jdk/make/common/shared/Defs.gmk Wed Jul 05 18:22:52 2017 +0200
+++ b/jdk/make/common/shared/Defs.gmk Fri Sep 21 12:22:52 2012 -0700
@@ -609,14 +609,18 @@
# 2) ant attempts to detect JDK location based on java.exe location
# This is fragile as developer may have JRE first on the PATH.
# To workaround this we will specify JAVA_HOME explicitly
+# 3) Sometimes we need to run ant with the boot jdk, sometimes with the import
+# jdk, sometimes with the jdk we are building (see deploy repo).
ANT_TMPDIR = $(ABS_OUTPUTDIR)/tmp
-ANT_WORKAROUNDS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)' JAVA_HOME='$(BOOTDIR)'
+ANT_WORKAROUNDS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)'
ifeq ($(ANT_HOME),)
- ANT = $(ANT_WORKAROUNDS) ant
+ ANT = $(ANT_WORKAROUNDS) JAVA_HOME='$(BOOTDIR)' ant
+ ANT_WITH_IMPORT = $(ANT_WORKAROUNDS) JAVA_HOME='$(JDK_IMPORT_PATH)' ant
else
- ANT = $(ANT_WORKAROUNDS) $(ANT_HOME)/bin/ant
+ ANT = $(ANT_WORKAROUNDS) JAVA_HOME='$(BOOTDIR)' $(ANT_HOME)/bin/ant
+ ANT_WITH_IMPORT = $(ANT_WORKAROUNDS) JAVA_HOME='$(JDK_IMPORT_PATH)' $(ANT_HOME)/bin/ant
endif
ifdef ALT_COPYRIGHT_YEAR
--- a/jdk/make/java/jobjc/Makefile Wed Jul 05 18:22:52 2017 +0200
+++ b/jdk/make/java/jobjc/Makefile Fri Sep 21 12:22:52 2012 -0700
@@ -62,15 +62,22 @@
ABS_OUTPUTDIR=$(realpath $(OUTPUTDIR))
ABS_STABLE_GEN_DIR=$(realpath $(STABLE_GEN_DIR))
+# How to run ant
+ifdef LANGTOOLS_DIST
+ ANT_CMD = $(ANT)
+else
+ ANT_CMD = $(ANT_WITH_IMPORT)
+endif
+
$(BUILT_DYLIB) $(BUILT_JAR): $(STABLE_METADATA_FILES) $(CORE_SRC) $(GENERATOR_SRC) $(ADDITIONS_SRC) $(BUILD_SRC)
@echo JObjC dylib or jar out of data wrt FRAMEWORKS '(' $(FRAMEWORKS) ')' or JObjC source '(' core, generator, additions, build ')'
@echo Running ant with java_home set to ${ALT_BOOTDIR}
- (cd $(SRCDIR); OBJROOT="$(ABS_OUTPUTDIR)/JObjC.build" DSTROOT="$(ABS_OUTPUTDIR)/JObjC.dst" JAVA_HOME=${ALT_BOOTDIR} STABLE_GEN_DIR="$(ABS_STABLE_GEN_DIR)" /usr/bin/ant -verbose all)
+ (cd $(SRCDIR); OBJROOT="$(ABS_OUTPUTDIR)/JObjC.build" DSTROOT="$(ABS_OUTPUTDIR)/JObjC.dst" JAVA_HOME=${ALT_BOOTDIR} STABLE_GEN_DIR="$(ABS_STABLE_GEN_DIR)" $(ANT_CMD) -verbose all)
all: $(BUILD_DYLIB) $(BUILT_JAR)
$(CP) $(BUILT_DYLIB) $(LIB_LOCATION)/libJObjC.dylib
clean clobber::
- (cd $(SRCDIR); export OBJROOT=$(OUTPUTDIR)/JObjC.build; export DSTROOT=$(OUTPUTDIR)/JObjC.dst; /usr/bin/ant clean)
+ (cd $(SRCDIR); export OBJROOT=$(OUTPUTDIR)/JObjC.build; export DSTROOT=$(OUTPUTDIR)/JObjC.dst; $(ANT_CMD) clean)
endif