summaryrefslogtreecommitdiff
path: root/m4/dirfd.m4
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-11-02 07:36:35 +0000
committerJim Meyering <jim@meyering.net>2001-11-02 07:36:35 +0000
commit400d9b8d89a4c51465bee4f747e076dc8d72985a (patch)
treeea0f21ed1cc12ac861bb82f1e9d9bd44f560bfcb /m4/dirfd.m4
parent263dc6ae73784b09af3031369fee1457f3ad3741 (diff)
downloadgnulib-400d9b8d89a4c51465bee4f747e076dc8d72985a.tar.gz
Use the replacement only if we have neither the function
nor a declaration.
Diffstat (limited to 'm4/dirfd.m4')
-rw-r--r--m4/dirfd.m410
1 files changed, 6 insertions, 4 deletions
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index fee5fb2ec7..9b6fb457ed 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -6,7 +6,6 @@ dnl From Jim Meyering
AC_DEFUN([UTILS_FUNC_DIRFD],
[
AC_HEADER_DIRENT
- AC_REPLACE_FUNCS([dirfd])
dirfd_headers='
#if HAVE_DIRENT_H
# include <dirent.h>
@@ -23,8 +22,13 @@ AC_DEFUN([UTILS_FUNC_DIRFD],
# endif /* HAVE_NDIR_H */
#endif /* HAVE_DIRENT_H */
'
+ AC_CHECK_FUNCS(dirfd)
AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
- if test $ac_cv_func_dirfd = no; then
+
+ # Use the replacement only if we have neither the function
+ # nor a declaration.
+ if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd = no,no; then
+ AC_REPLACE_FUNCS([dirfd])
AC_CACHE_CHECK(
[how to get the file descriptor associated with an open DIR*],
ac_cv_sys_dir_to_fd,
@@ -32,10 +36,8 @@ AC_DEFUN([UTILS_FUNC_DIRFD],
dirfd_save_DEFS=$DEFS
for ac_expr in \
\
- '# Solaris' \
'dir_p->d_fd' \
\
- '# Solaris' \
'dir_p->dd_fd' \
\
'# systems for which the info is not available' \