From 8ff67a4a297ae1f2a7cf7d108470f3e277309d9d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 15 Aug 2015 20:55:50 -0700 Subject: Detect alloca. --- configure | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/configure b/configure index 971164d4..d2c8f249 100755 --- a/configure +++ b/configure @@ -121,6 +121,7 @@ have_windres= have_posix_sigs= need_darwin_c_source= have_git= +have_alloca= conf_dir=config config_h=$conf_dir/config.h config_make=$conf_dir/config.make @@ -2048,6 +2049,32 @@ else printf "no\n" fi +printf "Checking for alloca ... " + +for try_header in alloca.h malloc.h ; do + cat > conftest.c < + +int main(int argc, char **argv) +{ + void *bytes = alloca(42); + return 0; +} +! + + if conftest ; then + printf "yes\n" + printf "#define HAVE_ALLOCA 1\n" >> $config_h + printf "#define ALLOCA_H <%s>\n" $try_header >> $config_h + have_alloca=y + break; + fi +done + +if [ -z "$have_alloca" ] ; then + printf "no\n" +fi + # # Dependent variables # -- cgit v1.2.3