Bug 44432 - Ant-based port installs should use Jikes if available
Summary: Ant-based port installs should use Jikes if available
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Herve Quiroz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-24 12:50 UTC by Ernst de Haan
Modified: 2004-11-09 02:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ernst de Haan freebsd_committer freebsd_triage 2002-10-24 12:50:03 UTC
It should be possible for ports that use an Ant-based build to use Jikes if it
installed. Port that do this include textproc/ant-xinclude-task and java/jump.
Comment 1 Ernst de Haan freebsd_committer freebsd_triage 2003-03-31 13:07:03 UTC
Responsible Changed
From-To: freebsd-java->znerd

I'll handle this.
Comment 2 Hervé Quiroz 2004-08-08 14:39:28 UTC
Ernst,

Given the recent additions to bsd.java.mk (Ant support) it is now
possible to implement this feature using MAKE_ARGS the following way:

  MAKE_ARGS+=   -Dbuild.compiler=jikes

And we could use USE_JIKES to enforce this behavior.

I know you're quite busy ATM, so do you wish me to takeover this PR and
implement what you requested?

Herve
Comment 3 Ernst de Haan freebsd_committer freebsd_triage 2004-08-09 06:20:03 UTC
Herve,

If you could take this over, it would be greatly appreciated. Thanks,

Ernst

On zondag 8 augustus 2004 15:39, Herve Quiroz wrote:
> Ernst,
>
> Given the recent additions to bsd.java.mk (Ant support) it is now
> possible to implement this feature using MAKE_ARGS the following way:
>
>   MAKE_ARGS+=   -Dbuild.compiler=jikes
>
> And we could use USE_JIKES to enforce this behavior.
>
> I know you're quite busy ATM, so do you wish me to takeover this PR and
> implement what you requested?
>
> Herve
Comment 4 Herve Quiroz freebsd_committer freebsd_triage 2004-08-09 13:20:22 UTC
Responsible Changed
From-To: znerd->hq

I'll handle that.
Comment 5 Hervé Quiroz 2004-08-10 16:09:37 UTC
Greg,

Here is a quick implementation of this feature. It's quite a simple one
as I expected but I could have forgotten something.

To test it, use the bundled patch for java/jump. If you have jikes
installed, it should be used to compile sources. You may notice it as it
will output some syntaxic warning while compiling (something former
javac wouldn't do).

You may force the build with jikes (and thus the BUILD_DEPENDS on
devel/jikes) using USE_JIKES=yes as an argument to make(1). The same
way, you may forbid the use of jikes (even if present on your system)
using USE_JIKES=no. Actually, the logic behind this is the same as for
JAVAC.

IMHO, we should work on this ASAP. Indeed, there are currently very
few ports that use USE_ANT and thus we won't have to hunt down ports
that need explicit USE_JIKES=no.

Herve

PS: There seem to be some problem with BUILD_DEPENDS not correctly set
when jikes is already installed. Jikes is indeed used for building
(JAVAC=/usr/local/bin/jikes) but is not part of BUILD_DEPENDS. I will
investigate further and send a separate PR for that if needed.


Index: Mk/bsd.java.mk
===================================================================
RCS file: /var/fcvs/ports/Mk/bsd.java.mk,v
retrieving revision 1.51
diff -u -r1.51 bsd.java.mk
--- Mk/bsd.java.mk	2 Aug 2004 21:44:17 -0000	1.51
+++ Mk/bsd.java.mk	10 Aug 2004 14:47:49 -0000
@@ -422,6 +422,10 @@
 .		if defined(USE_ANT)
 ANT?=				${LOCALBASE}/bin/ant
 MAKE_ENV+=			JAVA_HOME=${JAVA_HOME}
+.			if (exists(${_JIKES_PATH}) && (!defined(USE_JIKES) || (${USE_JIKES:U} == "YES"))) \
+				|| (defined(USE_JIKES) && (${USE_JIKES:U} == "YES"))
+MAKE_ARGS+=			-Dbuild.compiler=jikes
+.			endif
 BUILD_DEPENDS+=		${ANT}:${PORTSDIR}/devel/apache-ant
 ALL_TARGET?=
 .			if !target(do-build)
Index: java/jump/Makefile
===================================================================
RCS file: /var/fcvs/ports/java/jump/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- java/jump/Makefile	15 Apr 2004 22:07:40 -0000	1.16
+++ java/jump/Makefile	10 Aug 2004 13:48:14 -0000
@@ -14,15 +14,13 @@
 MAINTAINER=	znerd@FreeBSD.org
 COMMENT=	Java library for arbitrary precision computations
 
-BUILD_DEPENDS=	${ANT}:${PORTSDIR}/devel/apache-ant
-
 USE_JAVA=	1.2+
+USE_ANT=	yes
 
-ANT?=		${LOCALBASE}/bin/ant
 .if defined(NOPORTDOCS)
-ANT_TARGET=	jar
+ALL_TARGET=	jar
 .else
-ANT_TARGET=	jar apidocs
+ALL_TARGET=	jar apidocs
 .endif
 JAVASHAREDIR=	${PREFIX}/share/java
 JARDIR=		${JAVASHAREDIR}/classes
@@ -32,9 +30,6 @@
 .if !defined(NOPORTDOCS)
 PORTDOCS=	${WRKSRC}/build/apidocs
 .endif
-
-do-build:
-	cd ${WRKSRC} && ${ANT} ${ANT_TARGET}
 
 do-install:
 	@${ECHO} -n ">> Installing JAR as ${JARDIR}/${DESTJARFILE}..."
Comment 6 Herve Quiroz freebsd_committer freebsd_triage 2004-11-09 02:27:00 UTC
State Changed
From-To: open->closed

Feature implemented.