[Webfunds-commits] java build_env init init_java

Ian Grigg iang@cypherpunks.ai
Thu, 6 Jul 2000 21:54:31 -0400 (AST)


iang        00/07/06 21:54:31

  Modified:    .        build_env init init_java
  Log:
  some compatible (hopefully) mods to improve integration with makefiles

Revision  Changes    Path
1.10      +22 -15    java/build_env

Index: build_env
===================================================================
RCS file: /home/webfunds/cvsroot/java/build_env,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- build_env	2000/05/24 21:13:13	1.9
+++ build_env	2000/07/07 01:54:31	1.10
@@ -2,13 +2,16 @@
 # This script sorts out which compiler to use, and how to call it.
 # These env variables must be set:
 #
-#          JC       The compiler to be used
-#          list     directories where source to be compiled is found
-#          build    directory to put classes
+#          JC or JAVAC  The compiler to be used
+#          list         directories where source to be compiled is found
+#          build        directory to put classes
 #
 [ ! -d "${build:?}" ] && mkdir ${build}
 
-case "${JC}" in
+: ${JAVAC:=${JC}}
+
+case "${JAVAC}" in
+
     *javac)
 	for dir in ${list}
 	do
@@ -18,7 +21,7 @@
 		esac
 		echo ${dir}:
 
-		${JC} -g -d ${build} ${files} || exit 1
+		${JAVAC} ${JAVAC_FLAGS} -d ${build} ${files} || exit 1
 	done
 	;;
 
@@ -29,22 +32,26 @@
 	esac
 
 	def=/usr/local/java/lib/classes.zip
+	#
+	#	Classes.zip might already have been added.
+	#	For some reason, the jikes compiler requires dot at end
+	#
 	case "${CLASSPATH}" in
-	*classes.zip*) 
-        CLASSPATH=${CLASSPATH}:. 
-        ;;
-	*) 
-        CLASSPATH=${CLASSPATH}:${SUNCLASSES:-${def}}:.
-        ;;
+	    *classes.zip*) 
+        	CLASSPATH=${CLASSPATH}:. 
+        	;;
+	    *) 
+        	CLASSPATH=${CLASSPATH}:${SUNCLASSES:-${def}}:.
+        	;;
 	esac
-    export CLASSPATH
+	export CLASSPATH
 
-	# echo "${JC} +E -d ${build} ${files}"
-	${JC} -g +E -d ${build} ${files} || exit 1
+	# echo "${JAVAC} +E -d ${build} ${files}"
+	${JAVAC} ${JIKES_FLAGS} -d ${build} ${files} || exit 1
 	;;
 
     *)
-	echo 'No JC!'
+	echo 'No JC or JAVAC!'
 	;;
 esac
 



1.24      +1 -0      java/init

Index: init
===================================================================
RCS file: /home/webfunds/cvsroot/java/init,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- init	2000/06/07 20:51:59	1.23
+++ init	2000/07/07 01:54:31	1.24
@@ -57,6 +57,7 @@
 export soxjar
 if ${soxjar}
 then
+	# export is useful for makefiles, etc that cannot recurse
 	export classpath=$BUILD:$SWING:$SOX_JAR:$CRYPTIX
 else
 	export classpath=$BUILD:$SWING:$CRYPTIX



1.5       +9 -2      java/init_java

Index: init_java
===================================================================
RCS file: /home/webfunds/cvsroot/java/init_java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- init_java	2000/07/05 21:10:14	1.4
+++ init_java	2000/07/07 01:54:31	1.5
@@ -10,17 +10,20 @@
 
 local=./init_java_local
 #
-#	*DON'T* change these two, rather,
+#	*DON'T* change this file, rather,
 #
 #		+ create a file $local and make some mods there, OR
 #		+ set JAVA or SWING in the environment, OR
-#		+ add to the lists, and commit.
+#		+ add to the lists, and commit to cvs.
 #
 #	This file will get overwritten by new versions.
 #
 jdks="X_/usr/local/linux-jdk1.2.2 /usr/local/jdk/jdk1.1.8 /usr/local/jdk1.1.8"
 swings="/usr/local/share/java/classes/swingall.jar /usr/local/jdk/swingall.jar"
 
+JIKES_FLAGS="-g +E"
+JAVAC_FLAGS="-g"
+
 #
 #	You should set the location of JAVA and SWING in this
 #	file, which will never be overwritten by the distribution.
@@ -93,6 +96,10 @@
 		echo "Jikes Warning: No Sun classes found."
 	fi
 fi
+
+# standard name for this variable seems to be JAVAC, set it if unset
+: ${JAVAC:=${JC}}
+export JAVAC
 
 
 #