diff options
author | Bruno Haible <bruno@clisp.org> | 2008-10-19 12:47:52 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2008-10-19 12:47:52 +0200 |
commit | 2cf6b078ffb5955943be20eec0a1d6742b118c5e (patch) | |
tree | c4e0c192f121d65c81c346744d361fa4421e03e1 /m4 | |
parent | cded3d983ba2d3e0c76bc1c721c78333fa31b385 (diff) | |
download | gnulib-2cf6b078ffb5955943be20eec0a1d6742b118c5e.tar.gz |
Move the dirfd() declaration to <dirent.h>.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/dirent_h.m4 | 6 | ||||
-rw-r--r-- | m4/dirfd.m4 | 14 |
2 files changed, 16 insertions, 4 deletions
diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4 index 93cfbdc1f4..a72fc36297 100644 --- a/m4/dirent_h.m4 +++ b/m4/dirent_h.m4 @@ -1,4 +1,4 @@ -# dirent_h.m4 serial 1 +# dirent_h.m4 serial 2 dnl Copyright (C) 2008 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -32,6 +32,8 @@ AC_DEFUN([gl_DIRENT_MODULE_INDICATOR], AC_DEFUN([gl_DIRENT_H_DEFAULTS], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR + GNULIB_DIRFD=0; AC_SUBST([GNULIB_DIRFD]) dnl Assume proper GNU behavior unless another module says otherwise. - DIRENT_H=''; AC_SUBST([DIRENT_H]) + HAVE_DECL_DIRFD=1; AC_SUBST([HAVE_DECL_DIRFD]) + DIRENT_H=''; AC_SUBST([DIRENT_H]) ]) diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 index 125966b1a0..baab4dddad 100644 --- a/m4/dirfd.m4 +++ b/m4/dirfd.m4 @@ -1,8 +1,8 @@ -#serial 14 -*- Autoconf -*- +#serial 15 -*- Autoconf -*- dnl Find out how to get the file descriptor associated with an open DIR*. -# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software +# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 Free Software # Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -12,13 +12,23 @@ dnl From Jim Meyering AC_DEFUN([gl_FUNC_DIRFD], [ + AC_REQUIRE([gl_DIRENT_H_DEFAULTS]) + gl_REPLACE_DIRENT_H + + dnl Persuade glibc <dirent.h> to declare dirfd(). + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) + dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57. AC_REQUIRE([AC_PROG_CPP]) AC_REQUIRE([AC_PROG_EGREP]) + AC_CHECK_FUNCS(dirfd) AC_CHECK_DECLS([dirfd], , , [#include <sys/types.h> #include <dirent.h>]) + if test $ac_cv_have_decl_dirfd = no; then + HAVE_DECL_DIRFD=0 + fi AC_CACHE_CHECK([whether dirfd is a macro], gl_cv_func_dirfd_macro, |