diff options
author | David 'Digit' Turner <digit@google.com> | 2010-06-17 15:53:10 -0700 |
---|---|---|
committer | David 'Digit' Turner <digit@google.com> | 2010-06-17 16:48:31 -0700 |
commit | 33202f3b3008ce413717c04b7eefd8722eaa214c (patch) | |
tree | 76e06e0948f1fd2293ba9e48c65e1d4a033ff7ce /ndk-build | |
parent | a4bb90c0f16a53fd6d7e55a0e53a4487bc0c058f (diff) | |
download | ndk-33202f3b3008ce413717c04b7eefd8722eaa214c.tar.gz |
ndk-build: fix Cygwin make auto-detection.android-cts-2.2_r8android-cts-2.2_r7android-cts-2.2_r6android-cts-2.2_r5android-cts-2.2_r4android-cts-2.2_r3android-cts-2.2_r2android-cts-2.2_r1froyo
Change-Id: I695ea8e09e55a48ddb23f35cd26c91e96966cb6a
Diffstat (limited to 'ndk-build')
-rwxr-xr-x | ndk-build | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -40,9 +40,23 @@ PROGDIR=`dirname $0` PROGDIR=`cd $PROGDIR && pwd` -# if GNUMAKE is not defined in the environment, use 'make' -if [ -z "$GNUMAKE" ] ; then - GNUMAKE=make +# If GNUMAKE is defined, check that it points to a valid file +if [ -n "$GNUMAKE" ] ; then + ABS_GNUMAKE=`which $GNUMAKE 2> /dev/null` + if [ $? != 0 ] ; then + echo "ERROR: Your GNUMAKE variable is defined to an invalid name: $GNUMAKE" + echo "Please fix it to point to a valid make executable (e.g. /usr/bin/make)" + exit 1 + fi + GNUMAKE="$ABS_GNUMAKE" +else + # Otherwise, use 'make' and check that it is available + GNUMAKE=`which make 2> /dev/null` + if [ $? != 0 ] ; then + echo "ERROR: Cannot find 'make' program. Please install Cygwin make package" + echo "or define the GNUMAKE variable to point to it." + exit 1 + fi fi # On Windows, when running under cygwin, check that we are @@ -50,8 +64,8 @@ fi # common for app developers to have another non-cygwin compatible # if [ "$OSTYPE" = "cygwin" ] ; then - PROGDIR_MIXED=`cygpath -m $PROGDIR` GNUMAKE=`cygpath -u $GNUMAKE` + PROGDIR_MIXED=`cygpath -m $PROGDIR` CYGWIN_GNUMAKE=`$GNUMAKE -f $PROGDIR_MIXED/build/core/check-cygwin-make.mk 2>&1` if [ $? != 0 ] ; then echo "ERROR: You are using a non-Cygwin compatible Make program." |