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

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