Tcl Source Code

Artifact [3e03e38b2c]
Login

Artifact 3e03e38b2c0898d317a785e13613b9d9feea6431:

Attachment "configure.patch" to ticket [450795ffff] added by dkf 2002-02-26 20:57:34.
--- configure.in.old	Tue Feb 26 13:36:26 2002
+++ configure.in	Tue Feb 26 13:44:19 2002
@@ -384,20 +384,26 @@
 
 # getrlimit is needed for TclpCheckStackSpace
 AC_CHECK_FUNCS(getrlimit)
-
-AC_TRY_RUN([
-foo(p) 
-    char *p;
-{
-    char there;
-    return (&there > p);
-}
-int main()
-{
-    char here;
-    exit(foo(&here));
-}
-], AC_DEFINE(CSTACK_DOWN), AC_DEFINE(CSTACK_UP))
+AC_MSG_CHECKING([which way C stack grows])
+AC_CACHE_VAL(tcl_cv_stack_direction,
+    AC_TRY_RUN([
+	#include <stdlib.h>
+	foo(p) char *p; {
+	    char there;
+	    return (&there > p);
+	}
+	int main() {
+	    char here;
+	    exit(foo(&here));
+	}
+    ], tcl_cv_stack_direction=down,
+    tcl_cv_stack_direction=up,
+    tcl_cv_stack_direction="cross-compiling"))
+AC_MSG_RESULT($tcl_cv_stack_direction)
+case "$tcl_cv_stack_direction" in
+    down) AC_DEFINE(CSTACK_DOWN);;
+    up)   AC_DEFINE(CSTACK_UP);;
+esac
 
 #--------------------------------------------------------------------
 # The statements below define a collection of compile flags.  This