delete trailing whitespace from control files
[debian/gzip] / m4 / closedir.m4
index 8a2fba4b83b3c85c57d7175349c924718823c8a1..338b5a73c5ca4dfefadf582693e91f3d8fcc5bb5 100644 (file)
@@ -1,5 +1,5 @@
-# closedir.m4 serial 2
-dnl Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# closedir.m4 serial 6
+dnl Copyright (C) 2011-2018 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.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_CLOSEDIR],
 [
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   AC_CHECK_FUNCS([closedir])
   if test $ac_cv_func_closedir = no; then
@@ -22,4 +23,9 @@ AC_DEFUN([gl_FUNC_CLOSEDIR],
       fi
     fi
   ])
+  dnl Replace closedir() for supporting the gnulib-defined dirfd() function.
+  case $host_os,$HAVE_CLOSEDIR in
+    os2*,1)
+      REPLACE_CLOSEDIR=1;;
+  esac
 ])