summaryrefslogtreecommitdiffstats
path: root/unix/configure.in
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-11-10 22:24:12 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-11-10 22:24:12 (GMT)
commit6e7b0d042d8e2395df7a6408768fde12c23abdae (patch)
tree566675aa0f9a8b20448e3bc3c1b1726ad3c82f0e /unix/configure.in
parentdb8435f4f6d903ab177a991ed393676493928b77 (diff)
downloadtcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.zip
tcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.tar.gz
tcl-6e7b0d042d8e2395df7a6408768fde12c23abdae.tar.bz2
* generic/tclBasic.c:
* unix/configure.in: * unix/tclUnixInit.c: detect stack grwoth direction at compile time, only fall to runtime detection when crosscompiling.
Diffstat (limited to 'unix/configure.in')
-rw-r--r--unix/configure.in31
1 files changed, 30 insertions, 1 deletions
diff --git a/unix/configure.in b/unix/configure.in
index 3901138..ed1cb51 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to
dnl generate the file "configure", which is run during Tcl installation
dnl to configure the system for the local environment.
#
-# RCS: @(#) $Id: configure.in,v 1.167 2007/10/30 19:03:57 dgp Exp $
+# RCS: @(#) $Id: configure.in,v 1.168 2007/11/10 22:24:14 msofer Exp $
AC_INIT([tcl],[8.5])
AC_PREREQ(2.59)
@@ -658,6 +658,35 @@ fi
AC_MSG_RESULT([$tcl_ok])
#--------------------------------------------------------------------
+# Does the C stack grow upwards or downwards? Or cross-compiling?
+#--------------------------------------------------------------------
+
+AC_CACHE_CHECK([does the C stack grow upwards in memory?], tcl_cv_stack_grows_up, [
+ AC_TRY_RUN([
+ int StackGrowsUp(int *parent)
+ {
+ int here;
+ return (&here < parent);
+ }
+
+ int main (int argc, char *argv[])
+ {
+ int foo;
+ return StackGrowsUp(&foo);
+ }
+ ],
+ tcl_cv_stack_grows_up=yes,
+ tcl_cv_stack_grows_up=no,
+ tcl_cv_stack_grows_up=unknown)])
+if test $tcl_cv_stack_grows_up = unknown; then
+ AC_DEFINE(TCL_CROSS_COMPILE, 1,
+ [Are we cross-compiling?])
+elif test $tcl_cv_stack_grows_up = yes; then
+ AC_DEFINE(TCL_STACK_GROWS_UP, 1,
+ [The C stack grows upwards in memory])
+fi
+
+#--------------------------------------------------------------------
# The statements below define a collection of symbols related to
# building libtcl as a shared library instead of a static library.
#--------------------------------------------------------------------