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
14 if [ -z "$JAVACMD" ] ; then
15 if [ -n "$JAVA_HOME" ] ; then
16 if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
17 # IBM's JDK on AIX uses strange locations for the executables
18 JAVACMD=$JAVA_HOME/jre/sh/java
20 JAVACMD=$JAVA_HOME/bin/java
27 if [ ! -x "$JAVACMD" ] ; then
28 echo "Error: JAVA_HOME is not defined correctly."
29 echo " We cannot execute $JAVACMD"
33 if [ -n "$CLASSPATH" ] ; then
34 LOCALCLASSPATH=$CLASSPATH
37 # add in the dependency .jar files
38 DIRLIBS=${ANT_HOME}/lib/*.jar
41 # if the directory is empty, then it will return the input string
42 # this is stupid, so case for it
43 if [ "$i" != "${DIRLIBS}" ] ; then
44 if [ -z "$LOCALCLASSPATH" ] ; then
47 LOCALCLASSPATH="$i":$LOCALCLASSPATH
52 if [ -n "$JAVA_HOME" ] ; then
53 if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
54 LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
57 if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
58 LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
61 # OSX hack to make Ant work with jikes
63 OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
64 if [ -d ${OSXHACK} ] ; then
65 for i in ${OSXHACK}/*.jar
67 JIKESPATH=$JIKESPATH:$i
73 echo "Warning: JAVA_HOME environment variable is not set."
74 echo " If build fails because sun.* classes could not be found"
75 echo " you will need to set the JAVA_HOME environment variable"
76 echo " to the installation directory of java."
79 # supply JIKESPATH to Ant as jikes.class.path
80 if [ -n "$JIKESPATH" ] ; then
81 if [ -n "$ANT_OPTS" ] ; then
82 ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
84 ANT_OPTS=-Djikes.class.path=$JIKESPATH
88 # For Cygwin, switch paths to Windows format before running java
90 ANT_HOME=`cygpath --path --windows "$ANT_HOME"`
91 JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
92 LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
94 $JAVACMD -classpath "$LOCALCLASSPATH" -Dant.home="${ANT_HOME}" $ANT_OPTS org.apache.tools.ant.Main -e "$@"