diff configure.in @ 8792:bbb3fa6778f3

use mkstemps as replacement for mkstemp on mingw32
author Benjamin Lindner <lindnerb@users.sourceforge.net>
date Wed, 18 Feb 2009 00:55:32 -0500
parents d3382daaf4d2
children 8b7e448d989c
line wrap: on
line diff
--- a/configure.in	Wed Feb 18 00:47:48 2009 -0500
+++ b/configure.in	Wed Feb 18 00:55:32 2009 -0500
@@ -1580,6 +1580,28 @@
   _chmod _snprintf x_utime _utime32)
 
 case "$canonical_host_type" in
+  *-*-mingw*)
+    ## MinGW does not provide a mkstemp function.  However, it provides
+    ## the mkstemps function in libiberty.
+    AC_MSG_CHECKING(for mkstemps in libiberty)
+    save_LIBS="$LIBS"
+    LIBS="-liberty $LIBS"
+    AC_LINK_IFELSE([
+      AC_LANG_PROGRAM([[int mkstemps (char *pattern, int suffix_len);]], 
+       [[mkstemps ("XXXXXX", 0);]]
+    )],
+    [AC_MSG_RESULT(yes)
+     HAVE_MKSTEMPS=yes
+     AC_DEFINE(HAVE_MKSTEMPS, 1, [Define if mkstemps is available in libiberty.])
+    ],
+    [AC_MSG_RESULT(no)
+     HAVE_MKSTEMPS=no
+     LIBS="$save_LIBS"
+    ])
+   ;;
+esac
+
+case "$canonical_host_type" in
   *-*-msdosmsvc)
     ## The %T format specifier for strftime is reportedly broken,
     ## so use our version.  We could use an actual configure test