source: main/trunk/release-kits/rk-setup.bash@ 35682

Last change on this file since 35682 was 35682, checked in by davidb, 3 years ago

Text/commment/echo/README tidy up

File size: 1.7 KB
Line 
1
2# Script assumes you are in the same directory as rk-setup.bash when it is sourced
3
4if [ "x$RK_HOME" != "x" ] ; then
5 echo "Your Environment has already been set up for the Greenstone Release Kit!!"
6 return 0
7fi
8
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
12export RK_HOME="`pwd`"
13export PATH="$RK_HOME/bin":$PATH
14
15echo "Set RK_HOME and added RK_HOME/bin into PATH"
16
17
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
20
21# To fully support backward compatible compilation need to specfiy
22# -bootclasspath in addition to -source and -target
23
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
32jrt_home_dir="$RK_HOME/shared/core/java-rt"
33
34rt_jar="$jrt_home_dir/rt-openjdk8.jar"
35jce_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
37bootclasspath="$rt_jar:$jce_jars"
38bootclasspath_backslash_escaped=`echo $bootclasspath | sed 's/ /\\\\ /g'`
39
40export JAVACFLAGS="-source 1.8 -target 1.8 -bootclasspath $bootclasspath_backslash_escaped -extdirs ''"
41
42echo "Set JAVACFLAGS to compile for source, and to target, 1.8"
Note: See TracBrowser for help on using the repository browser.