Blob Blame History Raw
--- ./configure.in.orig	2012-07-26 09:38:23.701365523 -0600
+++ ./configure.in	2012-07-26 09:46:52.534571240 -0600
@@ -1926,33 +1926,7 @@ AC_SUBST(NOTIFY)
 
 # 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)
--- ./configure.orig	2013-05-10 09:55:18.206122299 -0600
+++ ./configure	2013-05-10 10:01:04.970561031 -0600
@@ -629,6 +629,7 @@ O3FLAGS
 NIFLAGS
 FINAL_CFLAGS
 BROKEN_O4_OPT
+ALLOCA
 NOTIFY
 TCL_LIBS
 TCL_DL_LIBS
@@ -2068,6 +2069,60 @@ rm -f conftest.val
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_compute_int
+
+# 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.
@@ -7988,81 +8043,202 @@ NOTIFY=$enable_notify
 
 # 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 (int *addr, int depth)
+{
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
+}
+
+int
+main (int argc, char **argv)
+{
+  return find_stack_direction (0, argc + !argv + 20) < 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
--- ./h/gclincl.h.in.orig	2012-01-16 13:08:04.000000000 -0700
+++ ./h/gclincl.h.in	2013-05-10 10:06:39.000000000 -0600
@@ -56,9 +56,9 @@ SGC is enabled.  */
 
 
 /* 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
 
@@ -261,6 +261,21 @@ SGC is enabled.  */
 #undef HAVE_OUTPUT_BFD
 #undef HAVE_BUILTIN_CLEAR_CACHE
 
+/* 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
 
@@ -312,9 +327,6 @@ SGC is enabled.  */
 /* Define to 1 if you have the <readline/readline.h> header file. */
 #undef HAVE_READLINE_READLINE_H
 
-/* Define to 1 if you have the <rpc/rpc.h> header file. */
-#undef HAVE_RPC_RPC_H
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -366,8 +378,19 @@ SGC is enabled.  */
 /* 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
--- ./acconfig.h.orig	2012-01-16 13:07:59.000000000 -0700
+++ ./acconfig.h	2012-07-26 09:46:52.541571229 -0600
@@ -55,9 +55,9 @@ SGC is enabled.  */
 
 
 /* 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