This starts off as an Android question but I think becomes a linux/cygwin question.
The Android ndk is shipped with an unsuitable version of awk – definitive report here – so I’m trying to get cygwin to accept that I don’t want to use the ndk awk, but to use nawk or gawk instead.
Bearing in mind I know nothing about linux/cygwin, these are my discoveries:
The first part of the question has already been answered here so I know I need to rename the existing awk as awk_ so it isn’t picked up (done). And I need to set the cygwin environment variable HOST_AWk to gawk (or nawk – both of which are supplied with cygwin). The easy way to do this (for me) is to set that environment variable in Windows – then when cygwin runs it imports all the environment stuff from Windows.
So I think I know what to do, but the value of HOST_AWK doesn’t seem to be picked up when I try to do a build either directly in eclipse (build all) or in cygwin from bash:
Barry@BARRY /cygdrive/c/data/eclipse/camfeeda/jni
$ ndk-build
make: awk: Command not found
Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !
/cygdrive/c/DATA/eclipse/android/android-ndk-r7/build/core/init.mk:258: *** Android NDK: Aborting. . Stop.
Barry@BARRY /cygdrive/c/data/eclipse/camfeeda/jni
$ printenv HOST_AWK
c:\cygwin\bin\gawk.exe
As you see I have set HOST_AWK to gawk.exe in the correct location, but I’ve tried:
HOST_AWK=c:\cygwin\bin\gawk.exe
HOST_AWK=c:\cygwin\bin\gawk
HOST_AWK=c:\cygwin\bin\nawk.exe
HOST_AWK=c:\cygwin\bin\nawk
And I’ve tried using forward slashes in case that was the problem, but I still get the same error 🙁
I feel as if I am so close, but I can’t make the last step. Why won’t ndk-build read the environment variable HOST_AWK and do the dratted job?! Can anyone put me out of my misery?
Many thanks
Barry
Edit: I also tried:
HOST_AWK=/cygdrive/c/cygwin/bin/gawk.exe
etc, but no joy.
B.
For me it’s just deleting/renaming awk.exe that is shipped with ndk-r7. And they everything works. No need for setting HOST_AWK env variable.