If jdk-1.7 is already installed when apache-ant gets installed,
javaPathHelper -c apache-ant will use jdk-1.7, which is quite
confusing. For example, naddy reported a problem with postgresql-jdbc
which failed to build because the JDBC interfaces got some new
declarations since jdk-1.7. Yet, postgresql-jdbc ports-wise build
depends on jdk-1.6.

The diff below passes JAVA_HOME via MAKE_ENV whenever MODJAVA_BUILD=ant
is set.

It would be nice if someone could test this in a bulk build before
I commit it.

comments?

Ciao,
        Kili

Index: java.port.mk
===================================================================
RCS file: /cvs/ports/devel/jdk/java.port.mk,v
retrieving revision 1.29
diff -u -p -r1.29 java.port.mk
--- java.port.mk        7 Oct 2011 13:54:31 -0000       1.29
+++ java.port.mk        14 Dec 2011 19:16:59 -0000
@@ -93,6 +93,7 @@ CATEGORIES+=  java
 # respectively.
 .if defined(MODJAVA_BUILD) && ${MODJAVA_BUILD:L} == "ant"
     BUILD_DEPENDS += devel/apache-ant
+    MAKE_ENV += JAVA_HOME=${JAVA_HOME}
     MODJAVA_BUILD_TARGET ?=
     MODJAVA_BUILD_FILE ?= build.xml
     MODJAVA_BUILD_DIR ?= ${WRKSRC}

Reply via email to