--- ./configure.orig 2011-06-01 15:29:46.654433763 -0600
+++ ./configure 2011-06-01 15:36:13.191433769 -0600
@@ -609,6 +609,7 @@
NIFLAGS
FINAL_CFLAGS
BROKEN_O4_OPT
+ALLOCA
NOTIFY
TCL_LIBS
TCL_DL_LIBS
@@ -2045,6 +2046,60 @@
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
+
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ eval "$3=no"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
@@ -7787,81 +7842,205 @@
# alloca
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if test "$cross_compiling" = yes; then :
- gcl_ok=no
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if ${ac_cv_working_alloca_h+:} false; then :
+ $as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
+#include <alloca.h>
int
main ()
{
-exit(alloca(500) != NULL ? 0 : 1);
+char *p = (char *) alloca (2 * sizeof (int));
+ if (p) return 0;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_working_alloca_h=yes
else
- gcl_ok=yes
+ ac_cv_working_alloca_h=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
-if test $gcl_ok = yes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
-else
- if test "$cross_compiling" = yes; then :
- gcl_ok=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if ${ac_cv_func_alloca_works+:} false; then :
+ $as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-
- #include <alloca.h>
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+void *alloca (size_t);
+# endif
+# endif
+# endif
+# endif
+#endif
int
main ()
{
-exit(alloca(500) != NULL ? 0 : 1);
+char *p = (char *) alloca (1);
+ if (p) return 0;
;
return 0;
}
_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_func_alloca_works=yes
else
- gcl_ok=yes
+ ac_cv_func_alloca_works=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
- if test $gcl_ok = yes ; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- $as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+if test $ac_cv_func_alloca_works = yes; then
- $as_echo "#define NEED_ALLOCA_H 1" >>confdefs.h
+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
- fi
+else
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
+
+$as_echo "#define C_ALLOCA 1" >>confdefs.h
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if ${ac_cv_os_cray+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "webecray" >/dev/null 2>&1; then :
+ ac_cv_os_cray=yes
+else
+ ac_cv_os_cray=no
fi
-if test $gcl_ok = no ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; } ; fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+ for ac_func in _getb67 GETB67 getb67; do
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+ break
+fi
+ done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if ${ac_cv_c_stack_direction+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test "$cross_compiling" = yes; then :
+ ac_cv_c_stack_direction=0
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$ac_includes_default
+int
+find_stack_direction ()
+{
+ static char *addr = 0;
+ auto char dummy;
+ if (addr == 0)
+ {
+ addr = &dummy;
+ return find_stack_direction ();
+ }
+ else
+ return (&dummy > addr) ? 1 : -1;
+}
+
+int
+main ()
+{
+ return find_stack_direction () < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+ ac_cv_c_stack_direction=1
+else
+ ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+ conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
+_ACEOF
+fi
# dlopen etc
--- ./acconfig.h.orig 2009-02-23 12:39:42.000000000 -0700
+++ ./acconfig.h 2011-06-01 15:34:15.452433766 -0600
@@ -53,11 +53,10 @@
#undef HAVE_ALLOCA
#endif
-
/* define if need alloca.h */
-#undef NEED_ALLOCA_H
+#undef HAVE_ALLOCA_H
-#ifdef NEED_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
--- ./h/gclincl.h.in.orig 2010-08-04 15:44:24.000000000 -0600
+++ ./h/gclincl.h.in 2011-06-01 15:36:13.000000000 -0600
@@ -54,11 +54,10 @@
#undef HAVE_ALLOCA
#endif
-
/* define if need alloca.h */
-#undef NEED_ALLOCA_H
+#undef HAVE_ALLOCA_H
-#ifdef NEED_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
@@ -260,6 +259,21 @@
#undef HAVE_OBJC_MALLOC_H
#undef HAVE_OUTPUT_BFD
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
/* Define to 1 if you have the <asm/sigcontext.h> header file. */
#undef HAVE_ASM_SIGCONTEXT_H
@@ -365,8 +379,19 @@
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at runtime.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
/* staticly linked images */
#undef STATIC_LINKING
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
--- ./configure.in.orig 2011-06-01 15:26:13.260433763 -0600
+++ ./configure.in 2011-06-01 15:34:57.261433766 -0600
@@ -1885,33 +1885,7 @@
# alloca
-AC_MSG_CHECKING([for alloca])
-AC_RUN_IFELSE([AC_LANG_PROGRAM([],[[exit(alloca(500) != NULL ? 0 : 1);]])],
- ,gcl_ok=yes, gcl_ok=no,gcl_ok=no)
-if test $gcl_ok = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ALLOCA)
-else
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
- #include <alloca.h>
- ]],[[exit(alloca(500) != NULL ? 0 : 1);]])],
- ,gcl_ok=yes, gcl_ok=no,gcl_ok=no)
- if test $gcl_ok = yes ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_ALLOCA)
- AC_DEFINE(NEED_ALLOCA_H)
- fi
-fi
-if test $gcl_ok = no ; then AC_MSG_RESULT(no) ; fi
-
-
-
-
-
-
-
-
-
+AC_FUNC_ALLOCA
# dlopen etc
# idea make it so you do something dlopen(libX.so,RTLD_GLOBAL)