cmake: check for alloca() in stdlib.h and malloc.h, too (bug #5316)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e622189..9400258 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -848,7 +848,12 @@ if(LIBC)
if(NOT APPLE)
check_include_file(alloca.h HAVE_ALLOCA_H)
- check_symbol_exists(alloca "alloca.h" HAVE_ALLOCA)
+ check_symbol_exists(alloca "alloca.h" HAVE_ALLOCA1)
+ check_symbol_exists(alloca "stdlib.h" HAVE_ALLOCA2)
+ check_symbol_exists(alloca "malloc.h" HAVE_ALLOCA3)
+ if(HAVE_ALLOCA1 OR HAVE_ALLOCA2 OR HAVE_ALLOCA3)
+ set(HAVE_ALLOCA 1)
+ endif()
else()
set(HAVE_ALLOCA_H 1)
set(HAVE_ALLOCA 1)