Blame SOURCES/nvptx-tools-no-ptxas.patch

02b0fd
--- nvptx-tools/configure.ac
02b0fd
+++ nvptx-tools/configure.ac
02b0fd
@@ -51,6 +51,7 @@ LIBS="$LIBS -lcuda"
02b0fd
 AC_CHECK_FUNCS([[cuGetErrorName] [cuGetErrorString]])
02b0fd
 AC_CHECK_DECLS([[cuGetErrorName], [cuGetErrorString]],
02b0fd
   [], [], [[#include <cuda.h>]])
02b0fd
+AC_CHECK_HEADERS(unistd.h sys/stat.h)
02b0fd
 
02b0fd
 AC_MSG_CHECKING([for extra programs to build requiring -lcuda])
02b0fd
 NVPTX_RUN=
02b0fd
--- nvptx-tools/include/libiberty.h
02b0fd
+++ nvptx-tools/include/libiberty.h
02b0fd
@@ -390,6 +390,17 @@ extern void hex_init (void);
02b0fd
 /* Save files used for communication between processes.  */
02b0fd
 #define PEX_SAVE_TEMPS		0x4
02b0fd
 
02b0fd
+/* Max number of alloca bytes per call before we must switch to malloc.
02b0fd
+
02b0fd
+   ?? Swiped from gnulib's regex_internal.h header.  Is this actually
02b0fd
+   the case?  This number seems arbitrary, though sane.
02b0fd
+
02b0fd
+   The OS usually guarantees only one guard page at the bottom of the stack,
02b0fd
+   and a page size can be as small as 4096 bytes.  So we cannot safely
02b0fd
+   allocate anything larger than 4096 bytes.  Also care for the possibility
02b0fd
+   of a few compiler-allocated temporary stack slots.  */
02b0fd
+#define MAX_ALLOCA_SIZE	4032
02b0fd
+
02b0fd
 /* Prepare to execute one or more programs, with standard output of
02b0fd
    each program fed to standard input of the next.
02b0fd
    FLAGS	As above.
02b0fd
--- nvptx-tools/nvptx-as.c
02b0fd
+++ nvptx-tools/nvptx-as.c
02b0fd
@@ -30,6 +30,9 @@
02b0fd
 #include <string.h>
02b0fd
 #include <wait.h>
02b0fd
 #include <unistd.h>
02b0fd
+#ifdef HAVE_SYS_STAT_H
02b0fd
+#include <sys/stat.h>
02b0fd
+#endif
02b0fd
 #include <errno.h>
02b0fd
 #define obstack_chunk_alloc malloc
02b0fd
 #define obstack_chunk_free free
02b0fd
@@ -42,6 +45,38 @@
02b0fd
 
02b0fd
 #include "version.h"
02b0fd
 
02b0fd
+#ifndef R_OK
02b0fd
+#define R_OK 4
02b0fd
+#define W_OK 2
02b0fd
+#define X_OK 1
02b0fd
+#endif
02b0fd
+
02b0fd
+#ifndef DIR_SEPARATOR
02b0fd
+#  define DIR_SEPARATOR '/'
02b0fd
+#endif
02b0fd
+
02b0fd
+#if defined (_WIN32) || defined (__MSDOS__) \
02b0fd
+    || defined (__DJGPP__) || defined (__OS2__)
02b0fd
+#  define HAVE_DOS_BASED_FILE_SYSTEM
02b0fd
+#  define HAVE_HOST_EXECUTABLE_SUFFIX
02b0fd
+#  define HOST_EXECUTABLE_SUFFIX ".exe"
02b0fd
+#  ifndef DIR_SEPARATOR_2 
02b0fd
+#    define DIR_SEPARATOR_2 '\\'
02b0fd
+#  endif
02b0fd
+#  define PATH_SEPARATOR ';'
02b0fd
+#else
02b0fd
+#  define PATH_SEPARATOR ':'
02b0fd
+#endif
02b0fd
+
02b0fd
+#ifndef DIR_SEPARATOR_2
02b0fd
+#  define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
02b0fd
+#else
02b0fd
+#  define IS_DIR_SEPARATOR(ch) \
02b0fd
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
02b0fd
+#endif
02b0fd
+
02b0fd
+#define DIR_UP ".."
02b0fd
+
02b0fd
 static const char *outname = NULL;
02b0fd
 
02b0fd
 static void __attribute__ ((format (printf, 1, 2)))
02b0fd
@@ -816,7 +851,7 @@ traverse (void **slot, void *data)
02b0fd
 }
02b0fd
 
02b0fd
 static void
02b0fd
-process (FILE *in, FILE *out)
02b0fd
+process (FILE *in, FILE *out, int verify, const char *outname)
02b0fd
 {
02b0fd
   symbol_table = htab_create (500, hash_string_hash, hash_string_eq,
02b0fd
                               NULL);
02b0fd
@@ -824,6 +859,18 @@ process (FILE *in, FILE *out)
02b0fd
   const char *input = read_file (in);
02b0fd
   Token *tok = tokenize (input);
02b0fd
 
02b0fd
+  /* By default, when ptxas is not in PATH, do minimalistic verification,
02b0fd
+     just require that the first non-comment directive is .version.  */
02b0fd
+  if (verify < 0)
02b0fd
+    {
02b0fd
+      size_t i;
02b0fd
+      for (i = 0; tok[i].kind == K_comment; i++)
02b0fd
+	;
02b0fd
+      if (tok[i].kind != K_dotted || !is_keyword (&tok[i], "version"))
02b0fd
+	fatal_error ("missing .version directive at start of file '%s'",
02b0fd
+		     outname);
02b0fd
+    }
02b0fd
+
02b0fd
   do
02b0fd
     tok = parse_file (tok);
02b0fd
   while (tok->kind);
02b0fd
@@ -897,9 +944,83 @@ fork_execute (const char *prog, char *const *argv)
02b0fd
   do_wait (prog, pex);
02b0fd
 }
02b0fd
 
02b0fd
+/* Determine if progname is available in PATH.  */
02b0fd
+static bool
02b0fd
+program_available (const char *progname)
02b0fd
+{
02b0fd
+  char *temp = getenv ("PATH");
02b0fd
+  if (temp)
02b0fd
+    {
02b0fd
+      char *startp, *endp, *nstore, *alloc_ptr = NULL;
02b0fd
+      size_t prefixlen = strlen (temp) + 1;
02b0fd
+      size_t len;
02b0fd
+      if (prefixlen < 2)
02b0fd
+	prefixlen = 2;
02b0fd
+
02b0fd
+      len = prefixlen + strlen (progname) + 1;
02b0fd
+#ifdef HAVE_HOST_EXECUTABLE_SUFFIX
02b0fd
+      len += strlen (HOST_EXECUTABLE_SUFFIX);
02b0fd
+#endif
02b0fd
+      if (len < MAX_ALLOCA_SIZE)
02b0fd
+	nstore = (char *) alloca (len);
02b0fd
+      else
02b0fd
+	alloc_ptr = nstore = (char *) malloc (len);
02b0fd
+
02b0fd
+      startp = endp = temp;
02b0fd
+      while (1)
02b0fd
+	{
02b0fd
+	  if (*endp == PATH_SEPARATOR || *endp == 0)
02b0fd
+	    {
02b0fd
+	      if (endp == startp)
02b0fd
+		{
02b0fd
+		  nstore[0] = '.';
02b0fd
+		  nstore[1] = DIR_SEPARATOR;
02b0fd
+		  nstore[2] = '\0';
02b0fd
+		}
02b0fd
+	      else
02b0fd
+		{
02b0fd
+		  memcpy (nstore, startp, endp - startp);
02b0fd
+		  if (! IS_DIR_SEPARATOR (endp[-1]))
02b0fd
+		    {
02b0fd
+		      nstore[endp - startp] = DIR_SEPARATOR;
02b0fd
+		      nstore[endp - startp + 1] = 0;
02b0fd
+		    }
02b0fd
+		  else
02b0fd
+		    nstore[endp - startp] = 0;
02b0fd
+		}
02b0fd
+	      strcat (nstore, progname);
02b0fd
+	      if (! access (nstore, X_OK)
02b0fd
+#ifdef HAVE_HOST_EXECUTABLE_SUFFIX
02b0fd
+		  || ! access (strcat (nstore, HOST_EXECUTABLE_SUFFIX), X_OK)
02b0fd
+#endif
02b0fd
+		 )
02b0fd
+		{
02b0fd
+#if defined (HAVE_SYS_STAT_H) && defined (S_ISREG)
02b0fd
+		  struct stat st;
02b0fd
+		  if (stat (nstore, &st) >= 0 && S_ISREG (st.st_mode))
02b0fd
+#endif
02b0fd
+		    {
02b0fd
+		      free (alloc_ptr);
02b0fd
+		      return true;
02b0fd
+		    }
02b0fd
+		}
02b0fd
+
02b0fd
+	      if (*endp == 0)
02b0fd
+		break;
02b0fd
+	      endp = startp = endp + 1;
02b0fd
+	    }
02b0fd
+	  else
02b0fd
+	    endp++;
02b0fd
+	}
02b0fd
+      free (alloc_ptr);
02b0fd
+    }
02b0fd
+  return false;
02b0fd
+}
02b0fd
+
02b0fd
 static struct option long_options[] = {
02b0fd
   {"traditional-format",     no_argument, 0,  0 },
02b0fd
   {"save-temps",  no_argument,       0,  0 },
02b0fd
+  {"verify",  no_argument,       0,  0 },
02b0fd
   {"no-verify",  no_argument,       0,  0 },
02b0fd
   {"help", no_argument, 0, 'h' },
02b0fd
   {"version", no_argument, 0, 'V' },
02b0fd
@@ -912,7 +1033,7 @@ main (int argc, char **argv)
02b0fd
   FILE *in = stdin;
02b0fd
   FILE *out = stdout;
02b0fd
   bool verbose __attribute__((unused)) = false;
02b0fd
-  bool verify = true;
02b0fd
+  int verify = -1;
02b0fd
   const char *smver = "sm_30";
02b0fd
 
02b0fd
   int o;
02b0fd
@@ -923,7 +1044,9 @@ main (int argc, char **argv)
02b0fd
 	{
02b0fd
 	case 0:
02b0fd
 	  if (option_index == 2)
02b0fd
-	    verify = false;
02b0fd
+	    verify = 1;
02b0fd
+	  else if (option_index == 3)
02b0fd
+	    verify = 0;
02b0fd
 	  break;
02b0fd
 	case 'v':
02b0fd
 	  verbose = true;
02b0fd
@@ -948,7 +1071,8 @@ Usage: nvptx-none-as [option...] [asmfile]\n\
02b0fd
 Options:\n\
02b0fd
   -o FILE               Write output to FILE\n\
02b0fd
   -v                    Be verbose\n\
02b0fd
+  --verify              Do verify output is acceptable to ptxas\n\
02b0fd
   --no-verify           Do not verify output is acceptable to ptxas\n\
02b0fd
   --help                Print this help and exit\n\
02b0fd
   --version             Print version number and exit\n\
02b0fd
 \n\
02b0fd
@@ -983,11 +1108,17 @@ This program has absolutely no warranty.\n",
02b0fd
   if (!in)
02b0fd
     fatal_error ("cannot open input ptx file");
02b0fd
 
02b0fd
-  process (in, out);
02b0fd
-  if  (outname)
02b0fd
+  if (outname == NULL)
02b0fd
+    verify = 0;
02b0fd
+  else if (verify == -1)
02b0fd
+    if (program_available ("ptxas"))
02b0fd
+      verify = 1;
02b0fd
+
02b0fd
+  process (in, out, verify, outname);
02b0fd
+  if (outname)
02b0fd
     fclose (out);
02b0fd
 
02b0fd
-  if (verify && outname)
02b0fd
+  if (verify > 0)
02b0fd
     {
02b0fd
       struct obstack argv_obstack;
02b0fd
       obstack_init (&argv_obstack);
02b0fd
--- nvptx-tools/configure
02b0fd
+++ nvptx-tools/configure
02b0fd
@@ -168,7 +168,8 @@ test x\$exitcode = x0 || exit 1"
02b0fd
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
02b0fd
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
02b0fd
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
02b0fd
-  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
02b0fd
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
02b0fd
+test \$(( 1 + 1 )) = 2 || exit 1"
02b0fd
   if (eval "$as_required") 2>/dev/null; then :
02b0fd
   as_have_required=yes
02b0fd
 else
02b0fd
@@ -552,11 +553,50 @@ PACKAGE_URL=
02b0fd
 
02b0fd
 ac_unique_file="nvptx-tools"
02b0fd
 ac_unique_file="nvptx-as.c"
02b0fd
+# Factoring default headers for most tests.
02b0fd
+ac_includes_default="\
02b0fd
+#include <stdio.h>
02b0fd
+#ifdef HAVE_SYS_TYPES_H
02b0fd
+# include <sys/types.h>
02b0fd
+#endif
02b0fd
+#ifdef HAVE_SYS_STAT_H
02b0fd
+# include <sys/stat.h>
02b0fd
+#endif
02b0fd
+#ifdef STDC_HEADERS
02b0fd
+# include <stdlib.h>
02b0fd
+# include <stddef.h>
02b0fd
+#else
02b0fd
+# ifdef HAVE_STDLIB_H
02b0fd
+#  include <stdlib.h>
02b0fd
+# endif
02b0fd
+#endif
02b0fd
+#ifdef HAVE_STRING_H
02b0fd
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
02b0fd
+#  include <memory.h>
02b0fd
+# endif
02b0fd
+# include <string.h>
02b0fd
+#endif
02b0fd
+#ifdef HAVE_STRINGS_H
02b0fd
+# include <strings.h>
02b0fd
+#endif
02b0fd
+#ifdef HAVE_INTTYPES_H
02b0fd
+# include <inttypes.h>
02b0fd
+#endif
02b0fd
+#ifdef HAVE_STDINT_H
02b0fd
+# include <stdint.h>
02b0fd
+#endif
02b0fd
+#ifdef HAVE_UNISTD_H
02b0fd
+# include <unistd.h>
02b0fd
+#endif"
02b0fd
+
02b0fd
 enable_option_checking=no
02b0fd
 ac_subst_vars='LTLIBOBJS
02b0fd
 LIBOBJS
02b0fd
 subdirs
02b0fd
 NVPTX_RUN
02b0fd
+EGREP
02b0fd
+GREP
02b0fd
+CPP
02b0fd
 CUDA_DRIVER_LDFLAGS
02b0fd
 CUDA_DRIVER_CPPFLAGS
02b0fd
 AR
02b0fd
@@ -635,7 +675,8 @@ LIBS
02b0fd
 CPPFLAGS
02b0fd
 CXX
02b0fd
 CXXFLAGS
02b0fd
-CCC'
02b0fd
+CCC
02b0fd
+CPP'
02b0fd
 ac_subdirs_all='libiberty'
02b0fd
 
02b0fd
 # Initialize some variables set by options.
02b0fd
@@ -1267,6 +1308,7 @@ Some influential environment variables:
02b0fd
               you have headers in a nonstandard directory <include dir>
02b0fd
   CXX         C++ compiler command
02b0fd
   CXXFLAGS    C++ compiler flags
02b0fd
+  CPP         C preprocessor
02b0fd
 
02b0fd
 Use these variables to override the choices made by `configure' or to help
02b0fd
 it to find libraries and programs with nonstandard names/locations.
02b0fd
@@ -1575,6 +1617,203 @@ $as_echo "$ac_res" >&6; }
02b0fd
   eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
02b0fd
 
02b0fd
 } # ac_fn_c_check_decl
02b0fd
+
02b0fd
+# ac_fn_c_try_cpp LINENO
02b0fd
+# ----------------------
02b0fd
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
02b0fd
+ac_fn_c_try_cpp ()
02b0fd
+{
02b0fd
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
02b0fd
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
02b0fd
+case "(($ac_try" in
02b0fd
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
02b0fd
+  *) ac_try_echo=$ac_try;;
02b0fd
+esac
02b0fd
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
02b0fd
+$as_echo "$ac_try_echo"; } >&5
02b0fd
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
02b0fd
+  ac_status=$?
02b0fd
+  if test -s conftest.err; then
02b0fd
+    grep -v '^ *+' conftest.err >conftest.er1
02b0fd
+    cat conftest.er1 >&5
02b0fd
+    mv -f conftest.er1 conftest.err
02b0fd
+  fi
02b0fd
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
02b0fd
+  test $ac_status = 0; } >/dev/null && {
02b0fd
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
02b0fd
+	 test ! -s conftest.err
02b0fd
+       }; then :
02b0fd
+  ac_retval=0
02b0fd
+else
02b0fd
+  $as_echo "$as_me: failed program was:" >&5
02b0fd
+sed 's/^/| /' conftest.$ac_ext >&5
02b0fd
+
02b0fd
+    ac_retval=1
02b0fd
+fi
02b0fd
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
02b0fd
+  return $ac_retval
02b0fd
+
02b0fd
+} # ac_fn_c_try_cpp
02b0fd
+
02b0fd
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
02b0fd
+# -------------------------------------------------------
02b0fd
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
02b0fd
+# the include files in INCLUDES and setting the cache variable VAR
02b0fd
+# accordingly.
02b0fd
+ac_fn_c_check_header_mongrel ()
02b0fd
+{
02b0fd
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
02b0fd
+  if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
02b0fd
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
02b0fd
+$as_echo_n "checking for $2... " >&6; }
02b0fd
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
02b0fd
+  $as_echo_n "(cached) " >&6
02b0fd
+fi
02b0fd
+eval ac_res=\$$3
02b0fd
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
02b0fd
+$as_echo "$ac_res" >&6; }
02b0fd
+else
02b0fd
+  # Is the header compilable?
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
02b0fd
+$as_echo_n "checking $2 usability... " >&6; }
02b0fd
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+$4
02b0fd
+#include <$2>
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_compile "$LINENO"; then :
02b0fd
+  ac_header_compiler=yes
02b0fd
+else
02b0fd
+  ac_header_compiler=no
02b0fd
+fi
02b0fd
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
02b0fd
+$as_echo "$ac_header_compiler" >&6; }
02b0fd
+
02b0fd
+# Is the header present?
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
02b0fd
+$as_echo_n "checking $2 presence... " >&6; }
02b0fd
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#include <$2>
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_cpp "$LINENO"; then :
02b0fd
+  ac_header_preproc=yes
02b0fd
+else
02b0fd
+  ac_header_preproc=no
02b0fd
+fi
02b0fd
+rm -f conftest.err conftest.$ac_ext
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
02b0fd
+$as_echo "$ac_header_preproc" >&6; }
02b0fd
+
02b0fd
+# So?  What about this header?
02b0fd
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
02b0fd
+  yes:no: )
02b0fd
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
02b0fd
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
02b0fd
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
02b0fd
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
02b0fd
+    ;;
02b0fd
+  no:yes:* )
02b0fd
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
02b0fd
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
02b0fd
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
02b0fd
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
02b0fd
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
02b0fd
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
02b0fd
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
02b0fd
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
02b0fd
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
02b0fd
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
02b0fd
+    ;;
02b0fd
+esac
02b0fd
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
02b0fd
+$as_echo_n "checking for $2... " >&6; }
02b0fd
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
02b0fd
+  $as_echo_n "(cached) " >&6
02b0fd
+else
02b0fd
+  eval "$3=\$ac_header_compiler"
02b0fd
+fi
02b0fd
+eval ac_res=\$$3
02b0fd
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
02b0fd
+$as_echo "$ac_res" >&6; }
02b0fd
+fi
02b0fd
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
02b0fd
+
02b0fd
+} # ac_fn_c_check_header_mongrel
02b0fd
+
02b0fd
+# ac_fn_c_try_run LINENO
02b0fd
+# ----------------------
02b0fd
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
02b0fd
+# that executables *can* be run.
02b0fd
+ac_fn_c_try_run ()
02b0fd
+{
02b0fd
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
02b0fd
+  if { { ac_try="$ac_link"
02b0fd
+case "(($ac_try" in
02b0fd
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
02b0fd
+  *) ac_try_echo=$ac_try;;
02b0fd
+esac
02b0fd
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
02b0fd
+$as_echo "$ac_try_echo"; } >&5
02b0fd
+  (eval "$ac_link") 2>&5
02b0fd
+  ac_status=$?
02b0fd
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
02b0fd
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
02b0fd
+  { { case "(($ac_try" in
02b0fd
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
02b0fd
+  *) ac_try_echo=$ac_try;;
02b0fd
+esac
02b0fd
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
02b0fd
+$as_echo "$ac_try_echo"; } >&5
02b0fd
+  (eval "$ac_try") 2>&5
02b0fd
+  ac_status=$?
02b0fd
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
02b0fd
+  test $ac_status = 0; }; }; then :
02b0fd
+  ac_retval=0
02b0fd
+else
02b0fd
+  $as_echo "$as_me: program exited with status $ac_status" >&5
02b0fd
+       $as_echo "$as_me: failed program was:" >&5
02b0fd
+sed 's/^/| /' conftest.$ac_ext >&5
02b0fd
+
02b0fd
+       ac_retval=$ac_status
02b0fd
+fi
02b0fd
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
02b0fd
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
02b0fd
+  return $ac_retval
02b0fd
+
02b0fd
+} # ac_fn_c_try_run
02b0fd
+
02b0fd
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
02b0fd
+# -------------------------------------------------------
02b0fd
+# Tests whether HEADER exists and can be compiled using the include files in
02b0fd
+# INCLUDES, setting the cache variable VAR accordingly.
02b0fd
+ac_fn_c_check_header_compile ()
02b0fd
+{
02b0fd
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
02b0fd
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
02b0fd
+$as_echo_n "checking for $2... " >&6; }
02b0fd
+if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then :
02b0fd
+  $as_echo_n "(cached) " >&6
02b0fd
+else
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+$4
02b0fd
+#include <$2>
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_compile "$LINENO"; then :
02b0fd
+  eval "$3=yes"
02b0fd
+else
02b0fd
+  eval "$3=no"
02b0fd
+fi
02b0fd
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
02b0fd
+fi
02b0fd
+eval ac_res=\$$3
02b0fd
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
02b0fd
+$as_echo "$ac_res" >&6; }
02b0fd
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
02b0fd
+
02b0fd
+} # ac_fn_c_check_header_compile
02b0fd
 cat >config.log <<_ACEOF
02b0fd
 This file contains any messages produced by compilers while
02b0fd
 running configure, to aid debugging if configure makes a mistake.
02b0fd
@@ -3284,6 +3523,418 @@ cat >>confdefs.h <<_ACEOF
02b0fd
 #define HAVE_DECL_CUGETERRORSTRING $ac_have_decl
02b0fd
 _ACEOF
02b0fd
 
02b0fd
+ac_ext=c
02b0fd
+ac_cpp='$CPP $CPPFLAGS'
02b0fd
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
02b0fd
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
02b0fd
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
02b0fd
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
02b0fd
+# On Suns, sometimes $CPP names a directory.
02b0fd
+if test -n "$CPP" && test -d "$CPP"; then
02b0fd
+  CPP=
02b0fd
+fi
02b0fd
+if test -z "$CPP"; then
02b0fd
+  if test "${ac_cv_prog_CPP+set}" = set; then :
02b0fd
+  $as_echo_n "(cached) " >&6
02b0fd
+else
02b0fd
+      # Double quotes because CPP needs to be expanded
02b0fd
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
02b0fd
+    do
02b0fd
+      ac_preproc_ok=false
02b0fd
+for ac_c_preproc_warn_flag in '' yes
02b0fd
+do
02b0fd
+  # Use a header file that comes with gcc, so configuring glibc
02b0fd
+  # with a fresh cross-compiler works.
02b0fd
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
02b0fd
+  # <limits.h> exists even on freestanding compilers.
02b0fd
+  # On the NeXT, cc -E runs the code through the compiler's parser,
02b0fd
+  # not just through cpp. "Syntax error" is here to catch this case.
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#ifdef __STDC__
02b0fd
+# include <limits.h>
02b0fd
+#else
02b0fd
+# include <assert.h>
02b0fd
+#endif
02b0fd
+		     Syntax error
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_cpp "$LINENO"; then :
02b0fd
+
02b0fd
+else
02b0fd
+  # Broken: fails on valid input.
02b0fd
+continue
02b0fd
+fi
02b0fd
+rm -f conftest.err conftest.$ac_ext
02b0fd
+
02b0fd
+  # OK, works on sane cases.  Now check whether nonexistent headers
02b0fd
+  # can be detected and how.
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#include <ac_nonexistent.h>
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_cpp "$LINENO"; then :
02b0fd
+  # Broken: success on invalid input.
02b0fd
+continue
02b0fd
+else
02b0fd
+  # Passes both tests.
02b0fd
+ac_preproc_ok=:
02b0fd
+break
02b0fd
+fi
02b0fd
+rm -f conftest.err conftest.$ac_ext
02b0fd
+
02b0fd
+done
02b0fd
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
02b0fd
+rm -f conftest.err conftest.$ac_ext
02b0fd
+if $ac_preproc_ok; then :
02b0fd
+  break
02b0fd
+fi
02b0fd
+
02b0fd
+    done
02b0fd
+    ac_cv_prog_CPP=$CPP
02b0fd
+
02b0fd
+fi
02b0fd
+  CPP=$ac_cv_prog_CPP
02b0fd
+else
02b0fd
+  ac_cv_prog_CPP=$CPP
02b0fd
+fi
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
02b0fd
+$as_echo "$CPP" >&6; }
02b0fd
+ac_preproc_ok=false
02b0fd
+for ac_c_preproc_warn_flag in '' yes
02b0fd
+do
02b0fd
+  # Use a header file that comes with gcc, so configuring glibc
02b0fd
+  # with a fresh cross-compiler works.
02b0fd
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
02b0fd
+  # <limits.h> exists even on freestanding compilers.
02b0fd
+  # On the NeXT, cc -E runs the code through the compiler's parser,
02b0fd
+  # not just through cpp. "Syntax error" is here to catch this case.
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#ifdef __STDC__
02b0fd
+# include <limits.h>
02b0fd
+#else
02b0fd
+# include <assert.h>
02b0fd
+#endif
02b0fd
+		     Syntax error
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_cpp "$LINENO"; then :
02b0fd
+
02b0fd
+else
02b0fd
+  # Broken: fails on valid input.
02b0fd
+continue
02b0fd
+fi
02b0fd
+rm -f conftest.err conftest.$ac_ext
02b0fd
+
02b0fd
+  # OK, works on sane cases.  Now check whether nonexistent headers
02b0fd
+  # can be detected and how.
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#include <ac_nonexistent.h>
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_cpp "$LINENO"; then :
02b0fd
+  # Broken: success on invalid input.
02b0fd
+continue
02b0fd
+else
02b0fd
+  # Passes both tests.
02b0fd
+ac_preproc_ok=:
02b0fd
+break
02b0fd
+fi
02b0fd
+rm -f conftest.err conftest.$ac_ext
02b0fd
+
02b0fd
+done
02b0fd
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
02b0fd
+rm -f conftest.err conftest.$ac_ext
02b0fd
+if $ac_preproc_ok; then :
02b0fd
+
02b0fd
+else
02b0fd
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
02b0fd
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
02b0fd
+as_fn_error "C preprocessor \"$CPP\" fails sanity check
02b0fd
+See \`config.log' for more details." "$LINENO" 5; }
02b0fd
+fi
02b0fd
+
02b0fd
+ac_ext=c
02b0fd
+ac_cpp='$CPP $CPPFLAGS'
02b0fd
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
02b0fd
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
02b0fd
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
02b0fd
+
02b0fd
+
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
02b0fd
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
02b0fd
+if test "${ac_cv_path_GREP+set}" = set; then :
02b0fd
+  $as_echo_n "(cached) " >&6
02b0fd
+else
02b0fd
+  if test -z "$GREP"; then
02b0fd
+  ac_path_GREP_found=false
02b0fd
+  # Loop through the user's path and test for each of PROGNAME-LIST
02b0fd
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
02b0fd
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
02b0fd
+do
02b0fd
+  IFS=$as_save_IFS
02b0fd
+  test -z "$as_dir" && as_dir=.
02b0fd
+    for ac_prog in grep ggrep; do
02b0fd
+    for ac_exec_ext in '' $ac_executable_extensions; do
02b0fd
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
02b0fd
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
02b0fd
+# Check for GNU ac_path_GREP and select it if it is found.
02b0fd
+  # Check for GNU $ac_path_GREP
02b0fd
+case `"$ac_path_GREP" --version 2>&1` in
02b0fd
+*GNU*)
02b0fd
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
02b0fd
+*)
02b0fd
+  ac_count=0
02b0fd
+  $as_echo_n 0123456789 >"conftest.in"
02b0fd
+  while :
02b0fd
+  do
02b0fd
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
02b0fd
+    mv "conftest.tmp" "conftest.in"
02b0fd
+    cp "conftest.in" "conftest.nl"
02b0fd
+    $as_echo 'GREP' >> "conftest.nl"
02b0fd
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
02b0fd
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
02b0fd
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
02b0fd
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
02b0fd
+      # Best one so far, save it but keep looking for a better one
02b0fd
+      ac_cv_path_GREP="$ac_path_GREP"
02b0fd
+      ac_path_GREP_max=$ac_count
02b0fd
+    fi
02b0fd
+    # 10*(2^10) chars as input seems more than enough
02b0fd
+    test $ac_count -gt 10 && break
02b0fd
+  done
02b0fd
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
02b0fd
+esac
02b0fd
+
02b0fd
+      $ac_path_GREP_found && break 3
02b0fd
+    done
02b0fd
+  done
02b0fd
+  done
02b0fd
+IFS=$as_save_IFS
02b0fd
+  if test -z "$ac_cv_path_GREP"; then
02b0fd
+    as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
02b0fd
+  fi
02b0fd
+else
02b0fd
+  ac_cv_path_GREP=$GREP
02b0fd
+fi
02b0fd
+
02b0fd
+fi
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
02b0fd
+$as_echo "$ac_cv_path_GREP" >&6; }
02b0fd
+ GREP="$ac_cv_path_GREP"
02b0fd
+
02b0fd
+
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
02b0fd
+$as_echo_n "checking for egrep... " >&6; }
02b0fd
+if test "${ac_cv_path_EGREP+set}" = set; then :
02b0fd
+  $as_echo_n "(cached) " >&6
02b0fd
+else
02b0fd
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
02b0fd
+   then ac_cv_path_EGREP="$GREP -E"
02b0fd
+   else
02b0fd
+     if test -z "$EGREP"; then
02b0fd
+  ac_path_EGREP_found=false
02b0fd
+  # Loop through the user's path and test for each of PROGNAME-LIST
02b0fd
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
02b0fd
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
02b0fd
+do
02b0fd
+  IFS=$as_save_IFS
02b0fd
+  test -z "$as_dir" && as_dir=.
02b0fd
+    for ac_prog in egrep; do
02b0fd
+    for ac_exec_ext in '' $ac_executable_extensions; do
02b0fd
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
02b0fd
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
02b0fd
+# Check for GNU ac_path_EGREP and select it if it is found.
02b0fd
+  # Check for GNU $ac_path_EGREP
02b0fd
+case `"$ac_path_EGREP" --version 2>&1` in
02b0fd
+*GNU*)
02b0fd
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
02b0fd
+*)
02b0fd
+  ac_count=0
02b0fd
+  $as_echo_n 0123456789 >"conftest.in"
02b0fd
+  while :
02b0fd
+  do
02b0fd
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
02b0fd
+    mv "conftest.tmp" "conftest.in"
02b0fd
+    cp "conftest.in" "conftest.nl"
02b0fd
+    $as_echo 'EGREP' >> "conftest.nl"
02b0fd
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
02b0fd
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
02b0fd
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
02b0fd
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
02b0fd
+      # Best one so far, save it but keep looking for a better one
02b0fd
+      ac_cv_path_EGREP="$ac_path_EGREP"
02b0fd
+      ac_path_EGREP_max=$ac_count
02b0fd
+    fi
02b0fd
+    # 10*(2^10) chars as input seems more than enough
02b0fd
+    test $ac_count -gt 10 && break
02b0fd
+  done
02b0fd
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
02b0fd
+esac
02b0fd
+
02b0fd
+      $ac_path_EGREP_found && break 3
02b0fd
+    done
02b0fd
+  done
02b0fd
+  done
02b0fd
+IFS=$as_save_IFS
02b0fd
+  if test -z "$ac_cv_path_EGREP"; then
02b0fd
+    as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
02b0fd
+  fi
02b0fd
+else
02b0fd
+  ac_cv_path_EGREP=$EGREP
02b0fd
+fi
02b0fd
+
02b0fd
+   fi
02b0fd
+fi
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
02b0fd
+$as_echo "$ac_cv_path_EGREP" >&6; }
02b0fd
+ EGREP="$ac_cv_path_EGREP"
02b0fd
+
02b0fd
+
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
02b0fd
+$as_echo_n "checking for ANSI C header files... " >&6; }
02b0fd
+if test "${ac_cv_header_stdc+set}" = set; then :
02b0fd
+  $as_echo_n "(cached) " >&6
02b0fd
+else
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#include <stdlib.h>
02b0fd
+#include <stdarg.h>
02b0fd
+#include <string.h>
02b0fd
+#include <float.h>
02b0fd
+
02b0fd
+int
02b0fd
+main ()
02b0fd
+{
02b0fd
+
02b0fd
+  ;
02b0fd
+  return 0;
02b0fd
+}
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_compile "$LINENO"; then :
02b0fd
+  ac_cv_header_stdc=yes
02b0fd
+else
02b0fd
+  ac_cv_header_stdc=no
02b0fd
+fi
02b0fd
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
02b0fd
+
02b0fd
+if test $ac_cv_header_stdc = yes; then
02b0fd
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#include <string.h>
02b0fd
+
02b0fd
+_ACEOF
02b0fd
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
02b0fd
+  $EGREP "memchr" >/dev/null 2>&1; then :
02b0fd
+
02b0fd
+else
02b0fd
+  ac_cv_header_stdc=no
02b0fd
+fi
02b0fd
+rm -f conftest*
02b0fd
+
02b0fd
+fi
02b0fd
+
02b0fd
+if test $ac_cv_header_stdc = yes; then
02b0fd
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#include <stdlib.h>
02b0fd
+
02b0fd
+_ACEOF
02b0fd
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
02b0fd
+  $EGREP "free" >/dev/null 2>&1; then :
02b0fd
+
02b0fd
+else
02b0fd
+  ac_cv_header_stdc=no
02b0fd
+fi
02b0fd
+rm -f conftest*
02b0fd
+
02b0fd
+fi
02b0fd
+
02b0fd
+if test $ac_cv_header_stdc = yes; then
02b0fd
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
02b0fd
+  if test "$cross_compiling" = yes; then :
02b0fd
+  :
02b0fd
+else
02b0fd
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
02b0fd
+/* end confdefs.h.  */
02b0fd
+#include <ctype.h>
02b0fd
+#include <stdlib.h>
02b0fd
+#if ((' ' & 0x0FF) == 0x020)
02b0fd
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
02b0fd
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
02b0fd
+#else
02b0fd
+# define ISLOWER(c) \
02b0fd
+		   (('a' <= (c) && (c) <= 'i') \
02b0fd
+		     || ('j' <= (c) && (c) <= 'r') \
02b0fd
+		     || ('s' <= (c) && (c) <= 'z'))
02b0fd
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
02b0fd
+#endif
02b0fd
+
02b0fd
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
02b0fd
+int
02b0fd
+main ()
02b0fd
+{
02b0fd
+  int i;
02b0fd
+  for (i = 0; i < 256; i++)
02b0fd
+    if (XOR (islower (i), ISLOWER (i))
02b0fd
+	|| toupper (i) != TOUPPER (i))
02b0fd
+      return 2;
02b0fd
+  return 0;
02b0fd
+}
02b0fd
+_ACEOF
02b0fd
+if ac_fn_c_try_run "$LINENO"; then :
02b0fd
+
02b0fd
+else
02b0fd
+  ac_cv_header_stdc=no
02b0fd
+fi
02b0fd
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
02b0fd
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
02b0fd
+fi
02b0fd
+
02b0fd
+fi
02b0fd
+fi
02b0fd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
02b0fd
+$as_echo "$ac_cv_header_stdc" >&6; }
02b0fd
+if test $ac_cv_header_stdc = yes; then
02b0fd
+
02b0fd
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
02b0fd
+
02b0fd
+fi
02b0fd
+
02b0fd
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
02b0fd
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
02b0fd
+		  inttypes.h stdint.h unistd.h
02b0fd
+do :
02b0fd
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
02b0fd
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
02b0fd
+"
02b0fd
+eval as_val=\$$as_ac_Header
02b0fd
+   if test "x$as_val" = x""yes; then :
02b0fd
+  cat >>confdefs.h <<_ACEOF
02b0fd
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
02b0fd
+_ACEOF
02b0fd
+
02b0fd
+fi
02b0fd
+
02b0fd
+done
02b0fd
+
02b0fd
+
02b0fd
+for ac_header in unistd.h sys/stat.h
02b0fd
+do :
02b0fd
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
02b0fd
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
02b0fd
+eval as_val=\$$as_ac_Header
02b0fd
+   if test "x$as_val" = x""yes; then :
02b0fd
+  cat >>confdefs.h <<_ACEOF
02b0fd
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
02b0fd
+_ACEOF
02b0fd
+
02b0fd
+fi
02b0fd
+
02b0fd
+done
02b0fd
+
02b0fd
 
02b0fd
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra programs to build requiring -lcuda" >&5
02b0fd
 $as_echo_n "checking for extra programs to build requiring -lcuda... " >&6; }