summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-08-15 20:55:50 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-08-15 20:55:50 -0700
commit8ff67a4a297ae1f2a7cf7d108470f3e277309d9d (patch)
treeb5b507e2e0f9e53bb36b895883cef38eb07a3bb2
parent894bfc876e2326c96873de9cdcbb45801456dde0 (diff)
downloadtxr-8ff67a4a297ae1f2a7cf7d108470f3e277309d9d.tar.gz
txr-8ff67a4a297ae1f2a7cf7d108470f3e277309d9d.tar.bz2
txr-8ff67a4a297ae1f2a7cf7d108470f3e277309d9d.zip
Detect alloca.
-rwxr-xr-xconfigure27
1 files changed, 27 insertions, 0 deletions
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 <<!
+#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
#