java/66349: [PATCH] net/javadc: fix build on bento

Herve Quiroz herve.quiroz at esil.univ-mrs.fr
Fri May 7 00:30:31 PDT 2004


>Number:         66349
>Category:       java
>Synopsis:       [PATCH] net/javadc: fix build on bento
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-java
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri May 07 00:30:29 PDT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Herve Quiroz
>Release:        FreeBSD 5.2.1-RELEASE-p5 i386
>Organization:
>Environment:
System: FreeBSD arabica.esil.univ-mrs.fr 5.2.1-RELEASE-p5 FreeBSD 5.2.1-RELEASE-p5 #2: Tue May  4 21:44:09 CEST
>Description:

- Now bsd.java.mk 2.0 compliant
- Enforce USE_JIKES=no as jikes won't let import statements contain no package
  name
- Enforce JAVA_VERSION=1.3 as JDK 1.4 won't let import statements contain no
  package name
- re-enabled error statements while compiling

NOTE: the patch will not work unless bsd.java.mk itself get patched (the patch
is attached). Indeed, I discovered a new flaw in bsd.java.mk 2.0: JAVAC setting
is done according to JAVA_BUILD but JAVA_BUILD is actually set after JAVAC is
defined. The ChangeLog for bsd.java.mk is the following:

- Switched stage 6 and 7 so JAVAC is no longer empty when not using jikes
- added '-bootclasspath ${JAVA_CLASSES}' to the command-line for JAVAC when
  jikes is used as a substitute for javac.

NOTE2: When jikes is used explicitely (USE_JIKES=yes), the port has to handle
bootclasspath itself.

Generated with FreeBSD Port Tools 0.50
>How-To-Repeat:
>Fix:

--- javadc-0.20.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/net/javadc.original/Makefile /usr/ports/net/javadc/Makefile
--- /usr/ports/net/javadc.original/Makefile	Fri May  7 08:34:53 2004
+++ /usr/ports/net/javadc/Makefile	Fri May  7 08:48:44 2004
@@ -14,8 +14,9 @@
 MAINTAINER=	ports at FreeBSD.org
 COMMENT=	Open source Java DirectConnect (TM) command-line client
 
-USE_JAVA=	1.2+
-NEED_JAVAC=	YES
+USE_JAVA=	yes
+JAVA_VERSION=	1.3
+USE_JIKES=	no
 WRKSRC=		${WRKDIR}/DirectConnect${PORTVERSION}
 BUILD_WRKSRC=	${WRKDIR}/classes
 PLIST_SUB=	JAR_DIR=${JAR_DIR} \
@@ -36,7 +37,7 @@
 # as far as build goes... ;)
 do-build:
 	@${MKDIR} ${BUILD_WRKSRC}
-	@${JAVAC} -d ${BUILD_WRKSRC} -classpath ${BUILD_WRKSRC} ${CLASS_SRCDIR}/*.java 2>/dev/null
+	@${JAVAC} -d ${BUILD_WRKSRC} -classpath ${BUILD_WRKSRC} ${CLASS_SRCDIR}/*.java
 	@${CP} ${CLASS_SRCDIR}/*.txt ${BUILD_WRKSRC}
 	@cd ${BUILD_WRKSRC} && ${JAR} -cmf ${JAR_MANIFEST} ${WRKDIR}/${JAR_FILE} *
 
--- javadc-0.20.patch ends here ---


--- bsd.java.mk.patch begins here ---
Index: bsd.java.mk
===================================================================
--- bsd.java.mk	(revision 139)
+++ bsd.java.mk	(working copy)
@@ -115,8 +115,8 @@
 #          suitable
 # Stage 4: <REMOVED> (merged in stage 3)
 # Stage 5: Decide the exact JDK to use (or install)
-# Stage 6: Define all settings for the port to use
-# Stage 7: Add any dependencies if necessary
+# Stage 6: Add any dependencies if necessary
+# Stage 7: Define all settings for the port to use
 #
 
 .	if defined(USE_JAVA)
@@ -371,8 +371,38 @@
 JAVA_PORT_VENDOR_DESCRIPTION:=	${JAVA_PORT_VENDOR:S/^/\${_JAVA_VENDOR_/:S/$/}/}
 JAVA_PORT_OS_DESCRIPTION:=		${JAVA_PORT_OS:S/^/\${_JAVA_OS_/:S/$/}/}
 
+#-------------------------------------------------------------------------------
+# Stage 6: Add any dependencies if necessary
+#
+
+# Add the JDK port to the dependencies
+DEPEND_JAVA=	${JAVA}:${PORTSDIR}/${JAVA_PORT}
+# When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre
+# (unless NO_BUILD is set)
+.		if !defined(JAVA_EXTRACT) && !defined(JAVA_BUILD) && !defined(JAVA_RUN)
+.			if !defined(NO_BUILD)
+JAVA_BUILD=	jdk
+.			endif
+JAVA_RUN=	jre
+.		endif
+.		if defined(JAVA_EXTRACT)
+EXTRACT_DEPENDS+=	${DEPEND_JAVA}
+.			endif
+.		if defined(JAVA_BUILD)
+.			if defined(NO_BUILD)
+.BEGIN:
+	@${ECHO_CMD} "${PKGNAME}: JAVA_BUILD and NO_BUILD cannot be set at the same time.";
+	@${FALSE}
+.				endif
+BUILD_DEPENDS+=		${DEPEND_JAVA}
+.			endif
+.		if defined(JAVA_RUN)
+RUN_DEPENDS+=		${DEPEND_JAVA}
+.		endif
+
+
 #-----------------------------------------------------------------------------
-# Stage 6: Define all settings for the port to use
+# Stage 7: Define all settings for the port to use
 #
 # At this stage both JAVA_HOME and JAVA_PORT are definitely given a value.
 #
@@ -401,7 +431,7 @@
 .			if (${JAVA_BUILD} == "jdk" || ${JAVA_BUILD} == "JDK") && !defined(JAVAC)
 # Use jikes if available and not explicitly forbidden
 .				if exists(${_JIKES_PATH}) && !defined(USE_JIKES)
-JAVAC=			${_JIKES_PATH}
+JAVAC=			${_JIKES_PATH} -bootclasspath ${JAVA_CLASSES}
 BUILD_DEPENDS+=	${DEPEND_JIKES}
 # Otherwise use 'javac'
 .				else
@@ -438,36 +468,6 @@
 
 
 #-------------------------------------------------------------------------------
-# Stage 7: Add any dependencies if necessary
-#
-
-# Add the JDK port to the dependencies
-DEPEND_JAVA=	${JAVA}:${PORTSDIR}/${JAVA_PORT}
-# When nothing is set, assume JAVA_BUILD=jdk and JAVA_RUN=jre
-# (unless NO_BUILD is set)
-.		if !defined(JAVA_EXTRACT) && !defined(JAVA_BUILD) && !defined(JAVA_RUN)
-.			if !defined(NO_BUILD)
-JAVA_BUILD=	jdk
-.			endif
-JAVA_RUN=	jre
-.		endif
-.		if defined(JAVA_EXTRACT)
-EXTRACT_DEPENDS+=	${DEPEND_JAVA}
-.			endif
-.		if defined(JAVA_BUILD)
-.			if defined(NO_BUILD)
-.BEGIN:
-	@${ECHO_CMD} "${PKGNAME}: JAVA_BUILD and NO_BUILD cannot be set at the same time.";
-	@${FALSE}
-.				endif
-BUILD_DEPENDS+=		${DEPEND_JAVA}
-.			endif
-.		if defined(JAVA_RUN)
-RUN_DEPENDS+=		${DEPEND_JAVA}
-.		endif
-
-
-#-------------------------------------------------------------------------------
 # Additional Java support
 
 # Debug target
--- bsd.java.mk.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-java mailing list