- # Use the replacement only if we have no function, macro,
- # or declaration with that name.
- if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
- = no,no,no; then
- AC_REPLACE_FUNCS([dirfd])
- AC_CACHE_CHECK(
- [how to get the file descriptor associated with an open DIR*],
- gl_cv_sys_dir_fd_member_name,
- [
- dirfd_save_CFLAGS=$CFLAGS
- for ac_expr in d_fd dd_fd; do
+dnl Prerequisites of lib/dirfd.c.
+AC_DEFUN([gl_PREREQ_DIRFD],
+[
+ AC_CACHE_CHECK([how to get the file descriptor associated with an open DIR*],
+ [gl_cv_sys_dir_fd_member_name],
+ [
+ dirfd_save_CFLAGS=$CFLAGS
+ for ac_expr in d_fd dd_fd; do