[Webfunds-commits] java init_sox build build_sox build_src init init_java wf

Ian Grigg iang@cypherpunks.ai
Mon, 31 Jul 2000 20:02:10 -0400 (AST)


iang        00/07/31 20:02:10

  Modified:    .        build build_sox build_src init init_java wf
  Added:       .        init_sox
  Log:
  rewired to do the following:
     1. uses standard environment variables where known, to ease compatibility
        with makefiles
     2. separates sox toolkit into new init_sox script suitable for remote
        callers
     3. moves ricardian / store into sox toolkit regime so that that is all
        the remote callers need

Revision  Changes    Path
1.23      +7 -5      java/build

Index: build
===================================================================
RCS file: /home/webfunds/cvsroot/java/build,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- build	2000/04/22 22:17:41	1.22
+++ build	2000/08/01 00:02:09	1.23
@@ -9,7 +9,7 @@
     export build=${BUILD}wfjar
     [ -r "${build}" ] && echo "WARNING: ${build} exists!"
     # ouch.  pulls in all the SOX rubbish, needs SOX.jar in the path
-    classpath=${LIB:?}/SOX.jar
+    classpath=${WEBFUNDS_LIB:?}/SOX.jar
     export CLASSPATH=$classpath:$CLASSPATH
 else
     export build=${BUILD}
@@ -19,17 +19,19 @@
 # export list="${WF_DIRS}"
 if [ $# = 0 ]
 then
-	export list="${WF_DIRS}"
-	( cd ${build} && rm -rf ${list} ) 2>&-
+    export list="${WF_DIRS}"
+    # this tries to be careful, blows away only the directories that
+    # it knows about.  OTOH if the list changes, then there is trouble.
+    ( cd ${build} && rm -rf ${list} ) 2>&-
 else
-	export list="$@"
+    export list="$@"
 fi
 
 ./build_env || exit 1
 
 if ${wfjar}
 then
-    export outfile=${LIB:?}/WebFunds.jar
+    export outfile=${WEBFUNDS_LIB:?}/WebFunds.jar
     ./jar_env
     rm -rf ${build}
 else



1.13      +3 -12     java/build_sox

Index: build_sox
===================================================================
RCS file: /home/webfunds/cvsroot/java/build_sox,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- build_sox	2000/04/22 22:17:41	1.12
+++ build_sox	2000/08/01 00:02:09	1.13
@@ -5,26 +5,17 @@
 
 ${makejars} && soxjar=true
 
-if ${soxjar}
-then
-    export build=${BUILD}soxjar
-    [ -r "${build}" ] && echo "WARNING: ${build} exists!"
-else
-    export build=${BUILD}
-fi
-
-
-# [ ! -d ${build} ] && mkdir ${build}
+export build=${SOX_BUILD:?}
 
 export list="${SOX_DIRS}"
 ( cd ${build} && rm -rf ${list} ) 2>&-
-export CLASSPATH=$CRYPTIX:${build}
+export CLASSPATH=${CRYPTIX_CLASSPATH:?}:${build}
 
 ./build_env || exit 1
 
 if ${soxjar}
 then
-    export outfile=${LIB:?}/SOX.jar
+    export outfile=${SOX_JAR:?}
     ./jar_env
     rm -rf ${build}
 else



1.4       +1 -1      java/build_src

Index: build_src
===================================================================
RCS file: /home/webfunds/cvsroot/java/build_src,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- build_src	2000/04/13 21:22:29	1.3
+++ build_src	2000/08/01 00:02:09	1.4
@@ -5,7 +5,7 @@
 
 list="${SOX_DIRS} ${WF_DIRS}"
 
-outfile=${LIB:?}/src.zip
+outfile=${WEBFUNDS_LIB:?}/src.zip
 rm -f ${outfile}
 
 for dir in ${list}



1.26      +20 -47    java/init

Index: init
===================================================================
RCS file: /home/webfunds/cvsroot/java/init,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- init	2000/07/10 17:43:56	1.25
+++ init	2000/08/01 00:02:09	1.26
@@ -1,68 +1,41 @@
 
 
-# sets SWING, JVM, JAVA, JC
+# sets SWING, JAVA_HOME, JAVA, JAVAC
 . ./init_java
 
+: ${WEBFUNDS_DIR:=${PWD%/*}}
+export WEBFUNDS_DIR
+export WEBFUNDS_LIB=$WEBFUNDS_DIR/lib
+export WEBFUNDS_SRC=$WEBFUNDS_DIR/java			# for src archive
+export BUILD=${WEBFUNDS_DIR}/build			# where to put classes
+
 # export PATH=$PWD:$PATH:/usr/local/java/bin
 export PATH=$PWD:$PATH
 
-export LIB=$PWD/../lib
-# : ${JC:=jikes}
-# export JC
-case "${JC}" in
-	*javac) echo 'javac is set' ;;
-	*jikes) echo 'Jikes!' ;;
-	"")    echo 'No Compiler?' ;;
-	*)     echo "Unknown Compiler: ${JC}" ;;
-esac
-
 
 #
-#  Make Cryptix accessible.
+#   Initialise access to the SOX Tool Kit.
 #
-if false
-then
-	export CjC=$HOME/src/cj303/classes
-
-	# if in the java dirs
-	# export CjC=/usr/local/java/lib
-
-	export CRYPTIX=$CjC/IJCE_0-0-11.jar:$CjC/SPT_0-0-9.jar:$CjC/ALG_0-0-9.jar:$CjC/RSA_0-0-9.jar:$CjC:
-else
-	export CRYPTIX=$LIB/Cryptix.jar:$LIB:
-fi
+[ -z "${soxjar}" ] && soxjar=false    # work with the SOX jar or build dir ?
+export soxjar
 
-export SOX_JAR=$LIB/SOX.jar:
-export PGP_JAR=$LIB/openpgp.jar:
+# sets SOX_CLASSPATH SOX_DIRS SOX_JAR SOX_BUILD
+. ./init_sox
+export WF_DIRS="webfunds/client/utils webfunds/client/sun webfunds/client/contracts webfunds/client/plugins webfunds/client/sox webfunds/client"
 
 #
-#	The directories to be compiled by the
-#	difference phases - SOX & WebFunds.
-#	SOX is also a library used by other apps.
+#  Now set it up for the local application - WebFunds
 #
-#	NOTE: there is some bug in Cryptix, which is fixed by inserting
-#	the sun/security/x509/*.classes in CLASSPATH before the Cryptix
-#	archives.  E.g.,
-#		export CLASSPATH=$SRC/sun.zip:$CLASSPATH .
-#	This is currently done by compiling it into the SOX jar.
-#
-# hotlava/crypto 
-#
-export SOX_DIRS="sun/security/x509 webfunds/utils webfunds/sox"
-export WF_DIRS="webfunds/client/utils webfunds/client/sun webfunds/store webfunds/ricardian webfunds/client/contracts webfunds/client/plugins webfunds/client/sox webfunds/client"
-
-export SRC=$PWD				# for src archive
-export BUILD=${PWD%/*}/build		# where to put classes
-
-[ -z "${soxjar}" ] && soxjar=false	# work with the SOX jar or build dir ?
-export soxjar
 if ${soxjar}
 then
-	# export is useful for makefiles, etc that cannot recurse
-	export classpath=$BUILD:$SWING:$SOX_JAR:$PGP_JAR:$CRYPTIX
+    classpath=$BUILD:$SWING:${SOX_JARS}
 else
-	export classpath=$BUILD:$SWING:$PGP_JAR:$CRYPTIX
+    classpath=$BUILD:$SWING:${SOX_CLASSPATH}
 fi
+
+# export of classpath is useful for makefiles, etc that cannot recurse
+export classpath
+
 
 #
 #	Now build the classpath.  There might be stuff in there already.



1.6       +70 -67    java/init_java

Index: init_java
===================================================================
RCS file: /home/webfunds/cvsroot/java/init_java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- init_java	2000/07/07 01:54:31	1.5
+++ init_java	2000/08/01 00:02:09	1.6
@@ -1,111 +1,114 @@
 
 #
-#	This dot-script searches for Java and Swing on your machine
-#	and inserts them in the environment.
+#     This dot-script searches for Java and Swing on your machine
+#     and inserts them in the environment.
 #
-#	You can help the search two ways:
-#		create a local file
-#		set environment variables SWING and JAVA
+#     You can help the search two ways:
+#          create a local file
+#          set environment variables
+#               SWING          the Swing jar file to use
+#               JAVA_HOME      the location of the JDK directory
 #
 
 local=./init_java_local
 #
-#	*DON'T* change this file, 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 to cvs.
+#          + create a file $local and make some mods there, OR
+#          + set JAVA_HOME or SWING in the environment, OR
+#          + add to the lists, and commit to cvs.
 #
-#	This file will get overwritten by new versions.
+#     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"
+: ${JIKES_FLAGS:="-g +E"}
+: ${JAVAC_FLAGS:="-g"}
+export JIKES_FLAGS JAVAC_FLAGS
 
 #
-#	You should set the location of JAVA and SWING in this
-#	file, which will never be overwritten by the distribution.
+#     You should set the location of JAVA_HOME and SWING in this
+#     file, which will never be overwritten by the distribution.
 #
 if [ -r ${local} ]
 then
-	. ${local}
+     . ${local}
 fi
 
 #
-#	Look for the Sun installation of the JDK.
-#	(We need the JVM and the classes file.)
-#	JAVA might come from the environment
-#	$jdk might have been set in old locals.
+#     Look for the Sun installation of the JAVA_HOME.
+#     (We need the JVM ($JAVA) and the classes file.)
+#     JAVA_HOME might come from the environment
+#     $jdk might have been set in old locals.
 #
-for j in $JAVA $jdk ${jdks}
+for j in $JAVA_HOME $jdk ${jdks}
 do
         if [ -d ${j} -a -r ${j}/bin/java ]
         then
-                export JAVA=${j}
-                export JVM=${j}/bin/java		# the runner
+                export JAVA_HOME=${j}
+                export JAVA=${j}/bin/java          # the runner
                 export JAR="limits -s 32768 ${j}/bin/jar" # archiver
-                export JC=${j}/bin/javac		# the compiler
-                export JD=${j}/bin/javadoc		# make doco
-                SUNCLASSES=${j}/lib/classes.zip		# for Jikes
+                export JAVAC=${j}/bin/javac          # the compiler
+                export JD=${j}/bin/javadoc          # make doco
+                SUNCLASSES=${j}/lib/classes.zip          # for Jikes
                 break
         fi
 done
 
-if [ -x "${JVM}" ]
+if [ -x "${JAVA}" ]
 then
-	j1=$(${JVM} -version 2>&1)
-	j2=${j1#*\"}
-	j3=${j2%\"*}
-        echo "found Java in ${JAVA}, JVM version $j3"
-	export JVM_VERSION=$j3
+     j1=$(${JAVA} -version 2>&1)
+     j2=${j1#*\"}
+     j3=${j2%\"*}
+        echo "found Java in ${JAVA_HOME}, JVM version $j3"
+     export JVM_VERSION=$j3
 else
-        [ -r "${JAVA}" ] || echo "No JAVA found, nothing will work!"
-	return
+        [ -r "${JAVA_HOME}" ] || echo "No JDK found, nothing will work!"
+     return
 fi
 
 if /usr/bin/which -s jikes
 then
-	#
-	#	Great, found jikes.  Now, can use it?
-	#	It tends to be installed in the PATH, but needs
-	#	the Sun classes in the CLASSPATH.
-	#
-	if [ ! -r "${SUNCLASSES}" ]
-	then
-		#
-		#	Not in the JDK we are using, search for another.
-		#
-		for j in $jdk ${jdks}
-		do
-			if [ -d ${j} -a -r ${j}/lib/classes.zip ]
-			then
-				SUNCLASSES=${j}/lib/classes.zip
-				break
-			fi
- 		done
-	fi
-
-	if [ -r "${SUNCLASSES}" ]
-	then
-		export JC=jikes
-		export SUNCLASSES
-		echo Found jikes in path, found Sun classes ${SUNCLASSES}.
-	else
-		echo "Jikes Warning: No Sun classes found."
-	fi
+     #
+     #     Great, found jikes.  Now, can use it?
+     #     It tends to be installed in the PATH, but needs
+     #     the Sun classes in the CLASSPATH.
+     #
+     if [ ! -r "${SUNCLASSES}" ]
+     then
+          #
+          #     Not in the JDK we are using, search for another.
+          #
+          for j in $jdk ${jdks}
+          do
+               if [ -d ${j} -a -r ${j}/lib/classes.zip ]
+               then
+                    SUNCLASSES=${j}/lib/classes.zip
+                    break
+               fi
+           done
+     fi
+
+     if [ -r "${SUNCLASSES}" ]
+     then
+          export JAVAC=jikes
+          export SUNCLASSES
+          echo Found jikes in path, found Sun classes ${SUNCLASSES}.
+     else
+          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
+# # standard name for this variable seems to be JAVAC, set it if unset
+# : ${JAVAC:=${JC}}
+# export JAVAC
 
 
 #
-#	Search for a Swing library and a JVM.
-#	SWING might come from the environment.
-#	$swing might have been set in old locals.
+#     Search for a Swing library and a JVM.
+#     SWING might come from the environment.
+#     $swing might have been set in old locals.
 #
 for j in $SWING $swing ${swings}
 do



1.9       +2 -2      java/wf

Index: wf
===================================================================
RCS file: /home/webfunds/cvsroot/java/wf,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- wf	2000/06/04 23:05:22	1.8
+++ wf	2000/08/01 00:02:09	1.9
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $Id: wf,v 1.8 2000/06/04 23:05:22 gelderen Exp $
+# $Id: wf,v 1.9 2000/08/01 00:02:09 iang Exp $
 #
 # WebFunds runner script.
 #
@@ -10,4 +10,4 @@
 echo $CLASSPATH
 set -x
 # -lf motif
-${JVM:?} webfunds.client.Core
+${JAVA:?} webfunds.client.Core



1.1                  java/init_sox

Index: init_sox
===================================================================


# sets JAVA_HOME, JAVA, JAVAC
if [ "${JAVA_HOME}" = '' ]
then
    . ./init_java
fi

if [ "${WEBFUNDS_DIR}" = '' ]
then
    echo "Warning: no WEBFUNDS_DIR"
    WEBFUNDS_DIR="../lib"
fi

: ${WEBFUNDS_LIB:=${WEBFUNDS_DIR}/lib}


#
#  Make Cryptix accessible.
#
#  old methods:
#
#    export CjC=$HOME/src/cj303/classes
#
#    # if in the java dirs
#    # export CjC=/usr/local/java/lib
#
#    export CRYPTIX=$CjC/IJCE_0-0-11.jar:$CjC/SPT_0-0-9.jar: \
#                   $CjC/ALG_0-0-9.jar:$CjC/RSA_0-0-9.jar:$CjC:
#
#  local single library:
#    export CRYPTIX=$LIB/Cryptix.jar:$LIB:

lib=${WEBFUNDS_LIB}
export CRYPTIX=$lib/cryptix-jce-compat.jar:$lib/Cryptix.jar:$lib/cryptix-jce-api.jar:$lib/cryptix-jce-provider.jar:$lib/cryptix-jce-tests.jar
export PGP_JAR=$lib/openpgp.jar
export CRYPTIX_CLASSPATH=$PGP_JAR:$CRYPTIX

#
#  the SOX_JAR is really only used by the distribution stuff
#
export SOX_JAR=${WEBFUNDS_LIB}/SOX.jar
export SOX_BUILD=${BUILD:-${WEBFUNDS_DIR:-..}/build}_sox

#
#  The directories to be compiled for the SOX Tool Kit.
#  The SOX jar is also a library used by other apps.
#  SOX in this context refers to more than SOX the protocol,
#  it is really the SOX toolkit.
#
#  webfunds/x509 java/security/cert are temporaries until
#  the compat stuff goes properly into Cryptix JCE.
#
export SOX_DIRS="webfunds/x509 java/security/cert webfunds/utils webfunds/sox webfunds/store webfunds/ricardian"


#
#  Use one of these two for the CLASSPATH addition.
#
export SOX_CLASSPATH=${SOX_BUILD}:$CRYPTIX_CLASSPATH
export SOX_JARS=${SOX_JAR}:$CRYPTIX_CLASSPATH

PS1="(sox)$PS1"