1 dnl Copyright (C) 2009 Sun Microsystems
2 dnl This file is free software; Sun Microsystems
3 dnl gives unlimited permission to copy and/or distribute it,
4 dnl with or without modifications, as long as this notice is preserved.
6 #--------------------------------------------------------------------
7 # Check what direction the stack runs in
8 #--------------------------------------------------------------------
10 AC_DEFUN([PANDORA_STACK_DIRECTION],[
11 AC_REQUIRE([AC_FUNC_ALLOCA])
12 AC_CACHE_CHECK([stack direction], [ac_cv_c_stack_direction],[
13 AC_RUN_IFELSE([AC_LANG_PROGRAM([[
15 int find_stack_direction ()
17 static char *addr = 0;
22 return find_stack_direction ();
25 return (&dummy > addr) ? 1 : -1;
28 exit (find_stack_direction() < 0);
30 ac_cv_c_stack_direction=1
32 ac_cv_c_stack_direction=-1
35 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)