diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-08-15 20:55:50 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-08-15 20:55:50 -0700 |
commit | 8ff67a4a297ae1f2a7cf7d108470f3e277309d9d (patch) | |
tree | b5b507e2e0f9e53bb36b895883cef38eb07a3bb2 | |
parent | 894bfc876e2326c96873de9cdcbb45801456dde0 (diff) | |
download | txr-8ff67a4a297ae1f2a7cf7d108470f3e277309d9d.tar.gz txr-8ff67a4a297ae1f2a7cf7d108470f3e277309d9d.tar.bz2 txr-8ff67a4a297ae1f2a7cf7d108470f3e277309d9d.zip |
Detect alloca.
-rwxr-xr-x | configure | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -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 <<! +#include <$try_header> + +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 # |