summaryrefslogtreecommitdiff
path: root/m4/dirfd.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/dirfd.m4')
-rw-r--r--m4/dirfd.m416
1 files changed, 9 insertions, 7 deletions
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index e9532e60a9..1d7cb080d8 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -1,4 +1,4 @@
-# serial 22 -*- Autoconf -*-
+# serial 24 -*- Autoconf -*-
dnl Find out how to get the file descriptor associated with an open DIR*.
@@ -35,13 +35,15 @@ AC_DEFUN([gl_FUNC_DIRFD],
gl_cv_func_dirfd_macro=yes,
gl_cv_func_dirfd_macro=no)])
- # Use the replacement only if we have no function or macro with that name.
- if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no; then
- if test $ac_cv_have_decl_dirfd = yes; then
- # If the system declares dirfd already, let's declare rpl_dirfd instead.
+ # Use the replacement if we have no function or macro with that name,
+ # or if OS/2 kLIBC whose dirfd() does not work.
+ # Replace only if the system declares dirfd already.
+ case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
+ no,no,*,yes | *,*,os2*,yes)
REPLACE_DIRFD=1
- fi
- fi
+ AC_DEFINE([REPLACE_DIRFD], [1],
+ [Define to 1 if gnulib's dirfd() replacement is used.]);;
+ esac
])
dnl Prerequisites of lib/dirfd.c.