ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/script ant
Date Tue, 08 May 2001 11:21:33 GMT
bodewig     01/05/08 04:21:31

  Modified:    .        bootstrap.sh
               src/script ant
  Log:
  Made scripts a little more consistent, they should now work with IBM's
  JDK on AIX out of the box.
  
  Ant will now prepend CLASSPATH to the jars in ANT_HOME/lib like it
  always did for Windows - if this is not the correct order, change it
  here and in the batch file. We need to be consistent.
  
  Make sure :: doesn't slip into the CLASSPATH when adding the library
  jars.
  
  Revision  Changes    Path
  1.49      +31 -9     jakarta-ant/bootstrap.sh
  
  Index: bootstrap.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/bootstrap.sh,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- bootstrap.sh	2001/04/24 08:41:47	1.48
  +++ bootstrap.sh	2001/05/08 11:21:12	1.49
  @@ -2,8 +2,8 @@
   
   # You will need to specify JAVA_HOME if compiling with 1.2 or later.
   
  -if [ "$JAVA_HOME" != "" ] ; then
  -  if [ -f $JAVA_HOME/lib/tools.jar ] ; then
  +if [ -n "$JAVA_HOME" ] ; then
  +  if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
       CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
     fi
    
  @@ -17,9 +17,35 @@
     echo "  to the installation directory of java."
   fi
   
  -if [ ! -x "$JAVA_HOME/bin/java" ] ; then
  +# IBM's JDK on AIX uses strange locations for the executables:
  +# JAVA_HOME/jre/sh for java and rmid
  +# JAVA_HOME/sh for javac and rmic
  +if [ -z "$JAVAC" ] ; then
  +  if [ -n "$JAVA_HOME"  ] ; then
  +    if [ -x "$JAVA_HOME/sh/javac" ] ; then 
  +      JAVAC=${JAVA_HOME}/sh/javac;
  +    else
  +      JAVAC=${JAVA_HOME}/bin/javac;
  +    fi
  +  else
  +    JAVAC=javac
  +  fi
  +fi
  +if [ -z "$JAVACMD" ] ; then 
  +  if [ -n "$JAVA_HOME"  ] ; then
  +    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 
  +      JAVACMD=$JAVA_HOME/jre/sh/java
  +    else
  +      JAVACMD=$JAVA_HOME/bin/java
  +    fi
  +  else
  +    JAVACMD=java
  +  fi
  +fi
  + 
  +if [ ! -x "$JAVACMD" ] ; then
     echo "Error: JAVA_HOME is not defined correctly."
  -  echo "  We cannot execute JAVA_HOME/bin/java"
  +  echo "  We cannot execute $JAVACMD"
     exit
   fi
   
  @@ -31,10 +57,6 @@
   ANT_HOME=.
   export ANT_HOME
   
  -if [ -z "$JAVAC" ] ; then
  -  JAVAC=${JAVA_HOME}/bin/javac;
  -fi
  -
   echo ... Bootstrapping Ant Distribution
   
   if [ -d "bootstrap" ] ; then
  @@ -91,7 +113,7 @@
   
   cp -r ${CLASSDIR} build
   
  -${JAVA_HOME}/bin/java -classpath ${CLASSPATH} org.apache.tools.ant.Main -emacs bootstrap
  +${JAVACMD} -classpath ${CLASSPATH} org.apache.tools.ant.Main -emacs bootstrap
   
   echo ... Cleaning Up Build Directories
   
  
  
  
  1.5       +36 -23    jakarta-ant/src/script/ant
  
  Index: ant
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/script/ant,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ant	2001/05/08 01:24:49	1.4
  +++ ant	2001/05/08 11:21:27	1.5
  @@ -22,7 +22,7 @@
       CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
   fi
   
  -if [ "$ANT_HOME" = "" ] ; then
  +if [ -z "$ANT_HOME" ] ; then
     # try to find ANT
     if [ -d /opt/ant ] ; then 
       ANT_HOME=/opt/ant
  @@ -50,16 +50,29 @@
   
   fi
   
  -if [ "$JAVA_HOME" != "" ] ; then
  -  if [ "$JAVACMD" = "" ] ; then 
  -    JAVACMD=$JAVA_HOME/bin/java
  -  fi
  -else
  -  if [ "$JAVACMD" = "" ] ; then 
  +if [ -z "$JAVACMD" ] ; then 
  +  if [ -n "$JAVA_HOME"  ] ; then
  +    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 
  +      # IBM's JDK on AIX uses strange locations for the executables
  +      JAVACMD=$JAVA_HOME/jre/sh/java
  +    else
  +      JAVACMD=$JAVA_HOME/bin/java
  +    fi
  +  else
       JAVACMD=java
     fi
   fi
    
  +if [ ! -x "$JAVACMD" ] ; then
  +  echo "Error: JAVA_HOME is not defined correctly."
  +  echo "  We cannot execute $JAVACMD"
  +  exit
  +fi
  +
  +if [ -n "$CLASSPATH" ] ; then
  +  LOCALCLASSPATH=$CLASSPATH
  +fi
  +
   # add in the dependency .jar files
   DIRLIBS=${ANT_HOME}/lib/*.jar
   for i in ${DIRLIBS}
  @@ -67,32 +80,32 @@
       # if the directory is empty, then it will return the input string
       # this is stupid, so case for it
       if [ "$i" != "${DIRLIBS}" ] ; then
  +      if [ -z "$LOCALCLASSPATH" ] ; then
  +        LOCALCLASSPATH=$i
  +      else
           LOCALCLASSPATH=$LOCALCLASSPATH:"$i"
  +      fi
       fi
   done
  -
  -if [ "$CLASSPATH" != "" ] ; then
  -  LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH
  -fi
   
  -if [ "$JAVA_HOME" != "" ] ; then
  -  if test -f $JAVA_HOME/lib/tools.jar ; then
  +if [ -n "$JAVA_HOME" ] ; then
  +  if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then
       LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
     fi
   
  -  if test -f $JAVA_HOME/lib/classes.zip ; then
  +  if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then
       LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip
     fi
   
     # OSX hack to make Ant work with jikes
     if $darwin ; then
  -  OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
  -  if [ -d ${OSXHACK} ] ; then
  -    for i in ${OSXHACK}/*.jar
  -    do
  -      JIKESPATH=$JIKESPATH:$i
  -    done
  -  fi
  +    OSXHACK="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Classes"
  +    if [ -d ${OSXHACK} ] ; then
  +      for i in ${OSXHACK}/*.jar
  +      do
  +        JIKESPATH=$JIKESPATH:$i
  +      done
  +    fi
     fi
   
   else
  @@ -103,8 +116,8 @@
   fi
   
   # supply JIKESPATH to Ant as jikes.class.path
  -if [ "$JIKESPATH" != "" ] ; then
  -  if [ "$ANT_OPTS" != "" ] ; then
  +if [ -n "$JIKESPATH" ] ; then
  +  if [ -n "$ANT_OPTS" ] ; then
       ANT_OPTS="$ANT_OPTS -Djikes.class.path=$JIKESPATH"
     else
       ANT_OPTS=-Djikes.class.path=$JIKESPATH
  
  
  

Mime
View raw message