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_CACHE_CHECK([stack direction], [ac_cv_c_stack_direction],[
12
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
14
int find_stack_direction ()
16
static char *addr = 0;
21
return find_stack_direction ();
24
return (&dummy > addr) ? 1 : -1;
27
exit (find_stack_direction() < 0);
29
ac_cv_c_stack_direction=1
31
ac_cv_c_stack_direction=-1
34
AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)