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

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