[4916] | 1 | #!/bin/sh
|
---|
[4935] | 2 |
|
---|
[5011] | 3 |
|
---|
| 4 | ## -------- Compile the Greenstone Librarian Interface --------
|
---|
| 5 |
|
---|
| 6 | ## ---- Check Javac exists ----
|
---|
| 7 | javacpath=
|
---|
| 8 |
|
---|
| 9 | # Some users may set the above line manually
|
---|
| 10 | if [ "$javacpath" == "" ]; then
|
---|
| 11 |
|
---|
| 12 | # If it is set, use the JAVAHOME environment variable
|
---|
| 13 | if [ "$JAVAHOME" != "" ]; then
|
---|
| 14 | javacpath="$JAVAHOME/bin/javac"
|
---|
| 15 |
|
---|
| 16 | # Check if Javac is on the search path
|
---|
| 17 | else
|
---|
| 18 | javacpath=`which javac 2> /dev/null`
|
---|
| 19 | fi
|
---|
| 20 | fi
|
---|
| 21 |
|
---|
| 22 | # Check that a Javac executable has been found
|
---|
| 23 | echo "Checking Javac: $javacpath"
|
---|
| 24 | if [ ! -x "$javacpath" ]; then
|
---|
| 25 | echo
|
---|
| 26 | echo "Failed to locate an appropriate version of Javac. You must install a"
|
---|
| 27 | echo "Java Development Kit (version 1.4 or greater) before compiling the"
|
---|
| 28 | echo "Greenstone Librarian Interface."
|
---|
[4935] | 29 | exit 1
|
---|
[4916] | 30 | fi
|
---|
| 31 |
|
---|
[4935] | 32 | # Check that the version of javac is new enough (1.4.0 or higher) to compile the GLI
|
---|
[5011] | 33 | javacOK=`$javacpath -target 1.4 2>&1`
|
---|
[4935] | 34 | if [ ! "$javacOK" = "" ]; then
|
---|
[5621] | 35 | # Special code for javac 1.4.2, since it complains about "no source files"
|
---|
| 36 | javacOK142=`$javacpath -target 1.4 2>&1 | grep "javac: no source files"`
|
---|
| 37 | if [ "$javacOK142" = "" ]; then
|
---|
| 38 | echo
|
---|
| 39 | echo "The version of the Java Development Kit you have installed is too old"
|
---|
| 40 | echo "to compile the Greenstone Librarian Interface. Please install a new"
|
---|
| 41 | echo "version of the Java SDK (version 1.4 or newer) and rerun this script."
|
---|
| 42 | exit 1
|
---|
| 43 | fi
|
---|
[4935] | 44 | fi
|
---|
| 45 |
|
---|
[5011] | 46 |
|
---|
| 47 | ## ---- Compile the GLI ----
|
---|
| 48 | echo
|
---|
| 49 |
|
---|
[4947] | 50 | # If a file has been specified at the command-line, just compile that file
|
---|
[4935] | 51 | if [ ! "x$*" = "x" ] ; then
|
---|
[5011] | 52 | echo "Compiling $* and dependant classes..."
|
---|
| 53 |
|
---|
| 54 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar $*
|
---|
| 55 |
|
---|
| 56 | echo "Done!"
|
---|
[4935] | 57 | exit 0
|
---|
| 58 | fi
|
---|
| 59 |
|
---|
| 60 | # Otherwise compile the lot...
|
---|
[4947] | 61 | echo "Compiling the Greenstone Librarian Interface..."
|
---|
[5011] | 62 |
|
---|
| 63 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/*.java
|
---|
| 64 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/cdm/*.java
|
---|
| 65 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/checklist/*.java
|
---|
| 66 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/collection/*.java
|
---|
| 67 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/file/*.java
|
---|
| 68 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/gui/*.java
|
---|
| 69 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/gui/border/*.java
|
---|
| 70 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/gui/metaaudit/*.java
|
---|
| 71 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/gui/tree/*.java
|
---|
| 72 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/help/*.java
|
---|
| 73 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/mem/*.java
|
---|
| 74 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/msm/*.java
|
---|
| 75 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/msm/parsers/*.java
|
---|
| 76 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/shell/*.java
|
---|
| 77 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/undo/*.java
|
---|
| 78 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/util/*.java
|
---|
| 79 | $javacpath -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/calpa.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/skinlf.jar:lib/nanoxml.jar src/org/greenstone/gatherer/valuetree/*.java
|
---|
| 80 |
|
---|
[4935] | 81 | echo "Done!"
|
---|