test/java/lang/instrument/MakeJAR2.sh

Print this page




  24 #
  25 
  26 
  27 AGENT="$1"
  28 APP="$2"
  29 
  30 if [ "${TESTSRC}" = "" ]
  31 then
  32   echo "TESTSRC not set.  Test cannot execute.  Failed."
  33   exit 1
  34 fi
  35 echo "TESTSRC=${TESTSRC}"
  36 
  37 if [ "${TESTJAVA}" = "" ]
  38 then
  39   echo "TESTJAVA not set.  Test cannot execute.  Failed."
  40   exit 1
  41 fi
  42 echo "TESTJAVA=${TESTJAVA}"
  43 






  44 if [ "${TESTCLASSES}" = "" ]
  45 then
  46   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  47   exit 1
  48 fi
  49 
  50 OS=`uname -s`
  51 case "$OS" in
  52    SunOS | Linux )
  53       PATHSEP=":"
  54       ;;
  55 
  56    Windows* | CYGWIN*)
  57       PATHSEP=";"
  58       ;;
  59 
  60    # catch all other OSs
  61    * )
  62       echo "Unrecognized system!  $OS"
  63       fail "Unrecognized system!  $OS"
  64       ;;
  65 esac
  66 
  67 JAVAC="${TESTJAVA}/bin/javac -g"
  68 JAR="${TESTJAVA}/bin/jar"
  69 
  70 cp ${TESTSRC}/${AGENT}.java .
  71 cp ${TESTSRC}/${APP}.java .
  72 rm -rf ilib
  73 mkdir ilib
  74 cp ${TESTSRC}/ilib/*.java ilib
  75 rm -rf bootpath
  76 mkdir -p bootpath/bootreporter
  77 cp ${TESTSRC}/bootreporter/*.java bootpath/bootreporter
  78 
  79 cd bootpath
  80 ${JAVAC} bootreporter/*.java
  81 cd ..
  82 
  83 ${JAVAC} ${AGENT}.java ilib/*.java
  84 ${JAVAC} -classpath .${PATHSEP}bootpath ${APP}.java
  85 
  86 echo "Manifest-Version: 1.0"    >  ${AGENT}.mf
  87 echo Premain-Class: ${AGENT} >> ${AGENT}.mf
  88 echo Boot-Class-Path: bootpath >> ${AGENT}.mf
  89 shift 2
  90 while [ $# != 0 ] ; do
  91   echo $1 >> ${AGENT}.mf
  92   shift
  93 done
  94 
  95 ${JAR} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ilib/*.class
  96 
  97 # rm -rf  ${AGENT}.java ilib ${AGENT}.mf ${AGENT}*.class


  24 #
  25 
  26 
  27 AGENT="$1"
  28 APP="$2"
  29 
  30 if [ "${TESTSRC}" = "" ]
  31 then
  32   echo "TESTSRC not set.  Test cannot execute.  Failed."
  33   exit 1
  34 fi
  35 echo "TESTSRC=${TESTSRC}"
  36 
  37 if [ "${TESTJAVA}" = "" ]
  38 then
  39   echo "TESTJAVA not set.  Test cannot execute.  Failed."
  40   exit 1
  41 fi
  42 echo "TESTJAVA=${TESTJAVA}"
  43 
  44 if [ "${COMPILEJAVA}" = "" ]
  45 then
  46   COMPILEJAVA="${TESTJAVA}"
  47 fi
  48 echo "COMPILEJAVA=${COMPILEJAVA}"
  49 
  50 if [ "${TESTCLASSES}" = "" ]
  51 then
  52   echo "TESTCLASSES not set.  Test cannot execute.  Failed."
  53   exit 1
  54 fi
  55 
  56 OS=`uname -s`
  57 case "$OS" in
  58    SunOS | Linux )
  59       PATHSEP=":"
  60       ;;
  61 
  62    Windows* | CYGWIN*)
  63       PATHSEP=";"
  64       ;;
  65 
  66    # catch all other OSs
  67    * )
  68       echo "Unrecognized system!  $OS"
  69       fail "Unrecognized system!  $OS"
  70       ;;
  71 esac
  72 
  73 JAVAC="${COMPILEJAVA}/bin/javac -g"
  74 JAR="${COMPILEJAVA}/bin/jar"
  75 
  76 cp ${TESTSRC}/${AGENT}.java .
  77 cp ${TESTSRC}/${APP}.java .
  78 rm -rf ilib
  79 mkdir ilib
  80 cp ${TESTSRC}/ilib/*.java ilib
  81 rm -rf bootpath
  82 mkdir -p bootpath/bootreporter
  83 cp ${TESTSRC}/bootreporter/*.java bootpath/bootreporter
  84 
  85 cd bootpath
  86 ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} bootreporter/*.java
  87 cd ..
  88 
  89 ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} ${AGENT}.java ilib/*.java
  90 ${JAVAC} ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -classpath .${PATHSEP}bootpath ${APP}.java
  91 
  92 echo "Manifest-Version: 1.0"    >  ${AGENT}.mf
  93 echo Premain-Class: ${AGENT} >> ${AGENT}.mf
  94 echo Boot-Class-Path: bootpath >> ${AGENT}.mf
  95 shift 2
  96 while [ $# != 0 ] ; do
  97   echo $1 >> ${AGENT}.mf
  98   shift
  99 done
 100 
 101 ${JAR} ${TESTTOOLVMOPTS} cvfm ${AGENT}.jar ${AGENT}.mf ${AGENT}*.class ilib/*.class
 102 
 103 # rm -rf  ${AGENT}.java ilib ${AGENT}.mf ${AGENT}*.class