aboutsummaryrefslogtreecommitdiff
path: root/ndk-build
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-06-17 15:53:10 -0700
committerDavid 'Digit' Turner <digit@google.com>2010-06-17 16:48:31 -0700
commit33202f3b3008ce413717c04b7eefd8722eaa214c (patch)
tree76e06e0948f1fd2293ba9e48c65e1d4a033ff7ce /ndk-build
parenta4bb90c0f16a53fd6d7e55a0e53a4487bc0c058f (diff)
downloadndk-33202f3b3008ce413717c04b7eefd8722eaa214c.tar.gz
Change-Id: I695ea8e09e55a48ddb23f35cd26c91e96966cb6a
Diffstat (limited to 'ndk-build')
-rwxr-xr-xndk-build22
1 files changed, 18 insertions, 4 deletions
diff --git a/ndk-build b/ndk-build
index c1700462b..625368e32 100755
--- a/ndk-build
+++ b/ndk-build
@@ -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."