のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

ndk-buildでエラー Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !

$ ndk-build
D:\cygwin\home\m_fujii\android-ndk-r7\prebuilt\windows\bin\awk.exe:
can't open file /home/m_fujii/android-ndk-r7/build/awk/check-awk.awk
source line number 1 source file /home/m_fujii/android-ndk-r7/build/awk/check-awk.awk
context is
>>> <<<
Android NDK: Host 'awk' tool is outdated.
Please define HOST_AWK to point to Gawk or Nawk !
/home/m_fujii/android-ndk-r7/build/core/init.mk:258:
*** Android NDK: Aborting. . Stop.

gawkがあることを確認する。

$which awk
/usr/bin/awk
$which gawk
/usr/bin/gawk

★対策
①D:\cygwin\home\m_fujii\android-ndk-r7\prebuilt\windows\binへ移動する。
awk.exeをawk_exeに名前を変更する。

★参考にしたページ
problems with Android NDK-7 and AWK
Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk

以上。

=========================

android-ndk-r7\build\core\init.mkの258行目付近

#
# Verify that the 'awk' tool has the features we need.
# Both Nawk and Gawk do.
#
HOST_AWK := $(strip $(HOST_AWK))
ifndef HOST_AWK
    HOST_AWK := awk
endif
$(call ndk_log,Host 'awk' tool: $(HOST_AWK))

# Location of all awk scripts we use
BUILD_AWK := $(NDK_ROOT)/build/awk

AWK_TEST := $(shell $(HOST_AWK) -f $(BUILD_AWK)/check-awk.awk)
$(call ndk_log,Host 'awk' test returned: $(AWK_TEST))
ifneq ($(AWK_TEST),Pass)
    $(call __ndk_info,Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !)
    $(call __ndk_error,Aborting.)
endif