diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-01 14:53:19 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-02-01 15:16:24 +0100 |
commit | c306c444bfd3d0984741fd99ed4f29016ef14ee2 (patch) | |
tree | 0486343a3c7533a81655b56838a5a64b515ab7da /odk/config | |
parent | c34fc4520dfee4ca068f249ee0756dacaa7a60cf (diff) |
Also on macOS use JDK's .../Home/bin/javac etc.
Only on macOS, the SDK used to expect javac etc. in a Commands sub-dir (which
Apple's JDK 1.6.0 has but Oracle's JDK 1.8.x don't). However, at least both
Apple's latest JDK 1.6.0 (as available via <https://support.apple.com/kb/DL1572>
"Download Java for OS X 2015-001") and any recent Oracle JDK 1.8.x (like
jdk1.8.0_121.jdk) have a Home sub-dir that contains a "standard" sub-tree with
bin sub-dir etc., like on other platforms. So consistently make the SDK use
that instead.
This removes the JAVABIN Make variable from settings.mk. It is assumed to not
be used by client code.
Change-Id: Ie0ad647f489528444dfd399c2f00500b772d3288
Diffstat (limited to 'odk/config')
-rwxr-xr-x | odk/config/configure.pl | 27 | ||||
-rw-r--r-- | odk/config/setsdkenv_unix.sh.in | 4 |
2 files changed, 12 insertions, 19 deletions
diff --git a/odk/config/configure.pl b/odk/config/configure.pl index c9505dc79084..bc56d8782944 100755 --- a/odk/config/configure.pl +++ b/odk/config/configure.pl @@ -74,11 +74,6 @@ $main::cppVersion = "4.0.1"; $main::OO_SDK_CPP_HOME_SUGGESTION = searchprog($main::cppName); $main::OO_SDK_JAVA_HOME = ""; -$main::OO_SDK_JAVA_BIN_DIR = "bin"; -if ( $main::operatingSystem =~ m/darwin/ ) -{ - $main::OO_SDK_JAVA_BIN_DIR="Commands"; -} $main::OO_SDK_JAVA_HOME_SUGGESTION = searchprog("javac"); $main::javaVersion = "1.5.0_01"; @@ -387,8 +382,8 @@ while ( (!$main::correctVersion) && # prepare Java path $main::correctVersion = 0; -# prepare Java suggestion (cut bin or Commands directory to be in the root of the Java SDK) -$main::offset = rindex($main::OO_SDK_JAVA_HOME_SUGGESTION, "/$main::OO_SDK_JAVA_BIN_DIR"); +# prepare Java suggestion (cut bin directory to be in the root of the Java SDK) +$main::offset = rindex($main::OO_SDK_JAVA_HOME_SUGGESTION, "/bin"); if ( $main::offset != -1 ) { $main::OO_SDK_JAVA_HOME_SUGGESTION = substr($main::OO_SDK_JAVA_HOME_SUGGESTION, 0, $main::offset); @@ -396,7 +391,7 @@ if ( $main::offset != -1 ) while ( (!$main::correctVersion) && ((! -d "$main::OO_SDK_JAVA_HOME" ) || - ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac"))) ) + ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/bin/javac"))) ) { print " Enter Java SDK (1.5, recommendation is 1.6 or higher) installation directory (optional) [$main::OO_SDK_JAVA_HOME_SUGGESTION]: "; $main::OO_SDK_JAVA_HOME = readStdIn(); @@ -408,9 +403,9 @@ while ( (!$main::correctVersion) && if ( ! $main::OO_SDK_JAVA_HOME eq "" ) { if ( (! -d "$main::OO_SDK_JAVA_HOME") || - ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac")) ) + ((-d "$main::OO_SDK_JAVA_HOME") && (! -e "$main::OO_SDK_JAVA_HOME/bin/javac")) ) { - print " Error: Could not find directory '$main::OO_SDK_JAVA_HOME' or '$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/javac'.\n"; + print " Error: Could not find directory '$main::OO_SDK_JAVA_HOME' or '$main::OO_SDK_JAVA_HOME/bin/javac'.\n"; if ( skipChoice("JAVA SDK") == 1 ) { $main::correctVersion = 1; @@ -419,10 +414,10 @@ while ( (!$main::correctVersion) && } else { #check version - my $testVersion = `$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java -version 2>&1 | egrep "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`; + my $testVersion = `$main::OO_SDK_JAVA_HOME/bin/java -version 2>&1 | egrep "java version" | head -n 1 | sed -e 's#.*version "##' | sed -e 's#".*##'`; $testVersion =~ s#([^\n]+)\n#$1#go; - $main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/$main::OO_SDK_JAVA_BIN_DIR/java", 1); + $main::correctVersion = testVersion($main::javaVersion, $testVersion, "$main::OO_SDK_JAVA_HOME/bin/java", 1); if ( !$main::correctVersion ) { if ( skipChoice("JAVA SDK") == 1 ) @@ -559,17 +554,17 @@ sub searchprog if ( $main::operatingSystem =~ m/darwin/ ) { $progDir = resolveLink("/System/Library/Frameworks/JavaVM.Framework/Versions", "CurrentJDK"); - if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" ) + if ( -e "$progDir/Home/bin/javac" ) { - return "$progDir/$main::OO_SDK_JAVA_BIN_DIR"; + return "$progDir/Home/bin"; } } if ( $main::operatingSystem =~ m/solaris/ ) { $progDir = resolveLink("/usr/jdk", "latest"); - if ( -e "$progDir/$main::OO_SDK_JAVA_BIN_DIR/javac" ) + if ( -e "$progDir/bin/javac" ) { - return "$progDir/$main::OO_SDK_JAVA_BIN_DIR"; + return "$progDir/bin"; } } } diff --git a/odk/config/setsdkenv_unix.sh.in b/odk/config/setsdkenv_unix.sh.in index 1ca7249cbea4..03644b58809a 100644 --- a/odk/config/setsdkenv_unix.sh.in +++ b/odk/config/setsdkenv_unix.sh.in @@ -81,12 +81,10 @@ sdk_platform=`/bin/sh ${OO_SDK_HOME}/config.guess | cut -d"-" -f3,4` # Set the directory name. programdir=program -javadir=bin sdk_lo_java_dir=program/classes case ${sdk_platform} in darwin*) programdir="Contents/MacOS" - javadir=Commands sdk_lo_java_dir=Contents/Resources/java ;; esac @@ -244,7 +242,7 @@ fi # Add directory of the Java tools to the path, if necessary. if [ -n "${OO_SDK_JAVA_HOME}" ] then - PATH=${OO_SDK_JAVA_HOME}/${javadir}:${PATH} + PATH=${OO_SDK_JAVA_HOME}/bin:${PATH} # JAVA_HOME=${OO_SDK_JAVA_HOME} # export JAVA_HOME export OO_SDK_JAVA_HOME |