3 # OS specific support. $var _must_ be set to either true or false.
7 CYGWIN*) cygwin=true ;;
8 Darwin*) darwin=true ;;
11 #Find the necessary resources
12 if [ -n "$SHIB_HOME" ] ; then
18 if [ -z "$JAVACMD" ] ; then
19 if [ -n "$JAVA_HOME" ] ; then
20 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
21 # IBM's JDK on AIX uses strange locations for the executables
22 JAVACMD=$JAVA_HOME/jre/sh/java
24 JAVACMD=$JAVA_HOME/bin/java
31 if [ ! -x "$JAVACMD" ] ; then
32 echo "Error: JAVA_HOME is not defined correctly."
33 echo " We cannot execute $JAVACMD"
37 if [ -n "$CLASSPATH" ] ; then
38 LOCALCLASSPATH=$CLASSPATH
41 # add in the dependency .jar files
42 DIRLIBS=${ANT_HOME}/lib/*.jar
45 # if the directory is empty, then it will return the input string
46 # this is stupid, so case for it
47 if [ "$i" != "${DIRLIBS}" ] ; then
48 if [ -z "$LOCALCLASSPATH" ] ; then
51 LOCALCLASSPATH="$i":$LOCALCLASSPATH
56 if [ -n "$JAVA_HOME" ] ; then
57 if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
58 LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
61 if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
62 LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
65 # OSX hack to make Ant work with jikes
67 OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
68 if [ -d ${OSXHACK} ] ; then
69 for i in ${OSXHACK}/*.jar
71 JIKESPATH=$JIKESPATH:$i
77 echo "Warning: JAVA_HOME environment variable is not set."
78 echo " If build fails because sun.* classes could not be found"
79 echo " you will need to set the JAVA_HOME environment variable"
80 echo " to the installation directory of java."
83 # supply JIKESPATH to Ant as jikes.class.path
84 if [ -n "$JIKESPATH" ] ; then
85 if [ -n "$ANT_OPTS" ] ; then
86 ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
88 ANT_OPTS=-Djikes.class.path=$JIKESPATH
92 # For Cygwin, switch paths to Windows format before running java
94 ANT_HOME=`cygpath --path --windows "$ANT_HOME"`
95 JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
96 LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
98 $JAVACMD -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main -e "$@"