[35634] | 1 |
|
---|
| 2 | # Script assumes you are in the same directory as rk-setup.bash when it is sourced
|
---|
| 3 |
|
---|
| 4 | if [ "x$RK_HOME" != "x" ] ; then
|
---|
| 5 | echo "Your Environment has already been set up for the Greenstone Release Kit!!"
|
---|
| 6 | return 0
|
---|
| 7 | fi
|
---|
| 8 |
|
---|
[35673] | 9 | # https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel
|
---|
| 10 | # SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
|
---|
| 11 |
|
---|
[35634] | 12 | export RK_HOME="`pwd`"
|
---|
| 13 | export PATH="$RK_HOME/bin":$PATH
|
---|
| 14 |
|
---|
| 15 | echo "Set RK_HOME and added RK_HOME/bin into PATH"
|
---|
| 16 |
|
---|
| 17 |
|
---|
[35673] | 18 | # Set JAVACFLAGS (used in the relevant javac lines in our Makefiles)
|
---|
| 19 | # so that any compiled Java code is backwards compatible with Java v1.8
|
---|
[35634] | 20 |
|
---|
[35682] | 21 | # To fully support backward compatible compilation need to specfiy
|
---|
| 22 | # -bootclasspath in addition to -source and -target
|
---|
| 23 |
|
---|
[35673] | 24 | # Note: Given the way autoconf/configure uses 'eval' to test for
|
---|
| 25 | # javac, then the usual technique of double-quoting (e.g.) the
|
---|
| 26 | # bootclasspath directory to project against spaces *doesn't*
|
---|
| 27 | # *work* as in an eval it is not passed to a shell environment
|
---|
| 28 | # to be interpretted first. The main outcome of all of this
|
---|
| 29 | # is that we need to resort to backlash escaping any spaces
|
---|
| 30 | # to keep things on track
|
---|
| 31 |
|
---|
| 32 | jrt_home_dir="$RK_HOME/shared/core/java-rt"
|
---|
| 33 |
|
---|
| 34 | rt_jar="$jrt_home_dir/rt-openjdk8.jar"
|
---|
| 35 | jce_jars="$jrt_home_dir/jce1_2_2.jar:$jrt_home_dir/local_policy.jar:$jrt_home_dir/US_export_policy.jar:$jrt_home_dir/sunjce_provider.jar"
|
---|
| 36 |
|
---|
| 37 | bootclasspath="$rt_jar:$jce_jars"
|
---|
| 38 | bootclasspath_backslash_escaped=`echo $bootclasspath | sed 's/ /\\\\ /g'`
|
---|
| 39 |
|
---|
| 40 | export JAVACFLAGS="-source 1.8 -target 1.8 -bootclasspath $bootclasspath_backslash_escaped -extdirs ''"
|
---|
| 41 |
|
---|
[35634] | 42 | echo "Set JAVACFLAGS to compile for source, and to target, 1.8"
|
---|