From d165a20ae4804992a104ffc8fa8e897e8964fbe8 Mon Sep 17 00:00:00 2001 From: Cosmin Truta Date: Mon, 19 Feb 2024 20:51:26 +0200 Subject: [PATCH] build: Improve the search for an AWK processor in the CMake build Add nawk to the list of AWK-processing programs that are known to work, and show the search result in the CMake log. --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 45bd2d542..8ab735d83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -353,7 +353,15 @@ int main(void) { return 0; } file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/conftest.map") endif() -find_program(AWK NAMES gawk awk) +# Find an AWK language processor. +# Start with specific AWK implementations like gawk and nawk, which are +# known to work with our scripts, then fall back to the system awk. +find_program(AWK NAMES gawk nawk awk) +if(AWK) + message(STATUS "Found AWK program: ${AWK}") +else() + message(STATUS "Could not find an AWK-compatible program") +endif() include_directories(${CMAKE_CURRENT_BINARY_DIR})