]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update from gnulib.
authorBruno Haible <bruno@clisp.org>
Sat, 18 Feb 2012 12:58:15 +0000 (13:58 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 18 Feb 2012 21:28:03 +0000 (22:28 +0100)
gettext-runtime/m4/ChangeLog
gettext-runtime/m4/fcntl-o.m4

index e5b9aee9d576f7ca4eac7ce5b7806324a895aead..6712b26410691fbebf6d5adb1eba60bbc4194475 100644 (file)
@@ -1,3 +1,10 @@
+2011-09-11  Bruno Haible  <bruno@clisp.org>
+
+       Don't assume <unistd.h> exists.
+       * fcntl-o.m4 (gl_FCNTL_O_FLAGS): If <unistd.h> does not exist,
+       include <io.h> and <stdlib.h> instead. Don't test symbolink links if
+       symlink() does not exist.
+
 2012-01-04  Bruno Haible  <bruno@clisp.org>
 
        Talk about "native Windows API", not "Win32".
index 88db07ec73e1b2f702e292b003fbdc9b618a65ae..9862741f3943c38cc2269b8a582c5c4294ddf942 100644 (file)
@@ -1,5 +1,5 @@
-# fcntl-o.m4 serial 3
-dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc.
+# fcntl-o.m4 serial 4
+dnl Copyright (C) 2006, 2009-2012 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -17,12 +17,21 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
   m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
     [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
     [AC_REQUIRE([AC_GNU_SOURCE])])
+
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_CHECK_FUNCS_ONCE([symlink])
   AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
     [AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <sys/types.h>
            #include <sys/stat.h>
-           #include <unistd.h>
+           #if HAVE_UNISTD_H
+           # include <unistd.h>
+           #else /* on Windows with MSVC */
+           # include <io.h>
+           # include <stdlib.h>
+           # defined sleep(n) _sleep ((n) * 1000)
+           #endif
            #include <fcntl.h>
            #ifndef O_NOATIME
             #define O_NOATIME 0
@@ -38,6 +47,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
           ]],
           [[
             int result = !constants;
+            #if HAVE_SYMLINK
             {
               static char const sym[] = "conftest.sym";
               if (symlink (".", sym) != 0)
@@ -53,6 +63,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
                 }
               unlink (sym);
             }
+            #endif
             {
               static char const file[] = "confdefs.h";
               int fd = open (file, O_RDONLY | O_NOATIME);