problems with Android NDK-7 and AWK
I am having problems with the latest Android NDK:
ligi@ligid:~$ ndk-build /home/ligi/bin/android-ndk/prebuilt/linux-x86/bin/awk: 1: ELF: not found /home/ligi/bin/android-ndk/prebuilt/linux-x86/bin/awk: 4: Syntax error: word unexpected (expecting ")") Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk ! /home/ligi/bin/android-ndk/build/core/init.mk:258: *** Android NDK: Aborting. . Stop. ligi@ligid:~$ `echo $HOST_AWK --v` GNU Awk 3.1.7
I am on stock ubuntu ant totally out of ideas and good keywords for searches
I also had this issue and found this Japanese site with similar problems:
I hope I puzzled out the Google Translated stuff correctly - in any case, basically in the new NDK install, find this directory:
and rename the file "awk" there to something else like "awk_"
I did this and ndk_build now works for me. If I am reading the make files right there is a file called init.mk which replaces your HOST_AWK with the prebuilt value if it finds it...so renaming the awk file there defaults back to your gawk.
Hope that helps
The problem is the executable ndk/prebuild/linux-x86/awk is compiled for x86_64, it's not run in a 32 bit kernel
- Update your local awk.
- Remove the awk in android-ndk itself.
This should resolve the problem.
Go to your <ndk_dir>\build\core\ and open init.mk in a text editor, e.g. notepad
Replace the following line
HOST_AWK := $(wildcard $(HOST_PREBUILT)/awk$(HOST_EXEEXT))
ifeq ($(HOST_OS),cygwin) HOST_AWK := $(wildcard $(HOST_PREBUILT)/gawk$(HOST_EXEEXT)) else HOST_AWK := $(wildcard $(HOST_PREBUILT)/awk$(HOST_EXEEXT)) endif
@Tod : Thanks, I used your hint here
I had the same problem running from eclipse on windows with cygwin and NDK8.
I had to add HOST_AWK as an environment variable under project properties -> c/c++ Build -> Environment with the value /cygdrive/[cygwin installdir]/bin/gawk
(As well as having to set the c/c++ build command to bash -c ndk-build)
I was having a problem with different versions of awk on windows. This change uses the cygwin version of awk from a cygwin console and the prebuilt version from a dos console.
Add to init.mk:
ifeq ($(HOST_OS),cygwin) HOST_AWK := /bin/awk endif