diff options
author | twogee <g.grigelionis@gmail.com> | 2017-12-19 16:24:39 +0100 |
---|---|---|
committer | twogee <g.grigelionis@gmail.com> | 2017-12-19 16:53:48 +0100 |
commit | a79d27597a0f1fa949048ed3ce3372bb9a328412 (patch) | |
tree | 35e8e9e692857ef442f038f9c7659cbb005273c7 /build.sh | |
parent | eec1ab7606ec0399d6db159a09316507af0959c0 (diff) | |
download | ant-a79d27597a0f1fa949048ed3ce3372bb9a328412.tar.gz |
Make build & bootstrap work on macOS (cf ant);
normalise whitespace in scripts and use Perl idioms properly
Diffstat (limited to 'build.sh')
-rwxr-xr-x | build.sh | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -19,34 +19,41 @@ cygwin=false; darwin=false; case "`uname`" in - CYGWIN*) cygwin=true ;; - Darwin*) darwin=true - if [ -z "$JAVA_HOME" ] ; then - JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home - fi - ;; + CYGWIN*) + cygwin=true + ;; + Darwin*) + darwin=true + if [ -z "$JAVA_HOME" ]; then + if [ -x '/usr/libexec/java_home' ]; then + JAVA_HOME=`/usr/libexec/java_home` + elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home + fi + fi + ;; esac REALANTHOME=$ANT_HOME if [ -z "$PWD" ]; then - ANT_HOME=./bootstrap + ANT_HOME=./bootstrap else - ANT_HOME="$PWD"/bootstrap + ANT_HOME="$PWD"/bootstrap fi export ANT_HOME -if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun ; then +if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun; then /bin/sh ./bootstrap.sh fi -if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun ; then +if test ! -f bootstrap/lib/ant.jar -o ! -x bootstrap/bin/ant -o ! -x bootstrap/bin/antRun; then echo Bootstrap FAILED exit 1 fi -if [ "$REALANTHOME" != "" ] ; then +if [ "$REALANTHOME" != "" ]; then if $cygwin; then - REALANTHOME=`cygpath --windows "$REALANTHOME"` + REALANTHOME=`cygpath --windows "$REALANTHOME"` fi ANT_INSTALL="-Dant.install=$REALANTHOME" else @@ -54,4 +61,3 @@ else fi bootstrap/bin/ant -nouserlib -lib lib/optional "$ANT_INSTALL" $* - |