aboutsummaryrefslogtreecommitdiff
path: root/ndk-build
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2010-06-08 16:58:08 -0700
committerDavid 'Digit' Turner <digit@google.com>2010-06-08 17:35:04 -0700
commitdfc478bcac20693422ee56a423377403bba46932 (patch)
tree10d704af674156afc62c373859101534914521b5 /ndk-build
parent219eddd0f8d4ee578d5afb895decc60a364a7191 (diff)
downloadndk-dfc478bcac20693422ee56a423377403bba46932.tar.gz
ndk-build: On Windows, check that a Cygwin-compatible GNU Make is being used.
It looks like that many NDK developers on Windows have some sort of other GNU Make program installed in their path (e.g. because they installed another IDE or Developer Environment), and that conflicts badly with our build scripts. Also fix a tiny bug where the debuggable flag was lost when building the modules. Change-Id: I2d26131b08cf19959122abdefec9a22955d2a89c
Diffstat (limited to 'ndk-build')
-rwxr-xr-xndk-build27
1 files changed, 27 insertions, 0 deletions
diff --git a/ndk-build b/ndk-build
index 05bc8f8a4..c1700462b 100755
--- a/ndk-build
+++ b/ndk-build
@@ -45,4 +45,31 @@ if [ -z "$GNUMAKE" ] ; then
GNUMAKE=make
fi
+# On Windows, when running under cygwin, check that we are
+# invoking a cygwin-compatible GNU Make binary. It is unfortunately
+# common for app developers to have another non-cygwin compatible
+#
+if [ "$OSTYPE" = "cygwin" ] ; then
+ PROGDIR_MIXED=`cygpath -m $PROGDIR`
+ GNUMAKE=`cygpath -u $GNUMAKE`
+ 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."
+ echo "Currently using: `cygpath -m $GNUMAKE`"
+ echo ""
+ echo "To solve the issue, follow these steps:"
+ echo ""
+ echo "1. Ensure that the Cygwin 'make' package is installed."
+ echo " NOTE: You will need GNU Make 3.81 or later!"
+ echo ""
+ echo "2. Define the GNUMAKE environment variable to point to it, as in:"
+ echo ""
+ echo " export GNUMAKE=/usr/bin/make"
+ echo ""
+ echo "3. Call 'ndk-build' again."
+ echo ""
+ exit 1
+ fi
+fi
+
$GNUMAKE -f $PROGDIR/build/core/build-local.mk $@