summaryrefslogtreecommitdiff
path: root/m4/dirfd.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/dirfd.m4')
-rw-r--r--m4/dirfd.m418
1 files changed, 10 insertions, 8 deletions
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index b42276948..1d7cb080d 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -1,8 +1,8 @@
-# serial 22 -*- Autoconf -*-
+# serial 24 -*- Autoconf -*-
dnl Find out how to get the file descriptor associated with an open DIR*.
-# Copyright (C) 2001-2006, 2008-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2016 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -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.