From d614713a565235b36338496fe3b67a7932a8c78a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 30 Jul 2010 23:54:44 +0200 Subject: dirfd: Avoid link error on AIX 7.1. --- m4/dirent_h.m4 | 3 ++- m4/dirfd.m4 | 14 ++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'm4') diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4 index 361296a6c2..8d9d565479 100644 --- a/m4/dirent_h.m4 +++ b/m4/dirent_h.m4 @@ -1,4 +1,4 @@ -# dirent_h.m4 serial 12 +# dirent_h.m4 serial 13 dnl Copyright (C) 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -51,6 +51,7 @@ AC_DEFUN([gl_DIRENT_H_DEFAULTS], HAVE_SCANDIR=1; AC_SUBST([HAVE_SCANDIR]) HAVE_ALPHASORT=1; AC_SUBST([HAVE_ALPHASORT]) REPLACE_CLOSEDIR=0; AC_SUBST([REPLACE_CLOSEDIR]) + REPLACE_DIRFD=0; AC_SUBST([REPLACE_DIRFD]) REPLACE_FDOPENDIR=0; AC_SUBST([REPLACE_FDOPENDIR]) REPLACE_OPENDIR=0; AC_SUBST([REPLACE_OPENDIR]) ]) diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 index 7fefa2e483..48b7bae1a8 100644 --- a/m4/dirfd.m4 +++ b/m4/dirfd.m4 @@ -1,4 +1,4 @@ -# serial 17 -*- Autoconf -*- +# serial 18 -*- Autoconf -*- dnl Find out how to get the file descriptor associated with an open DIR*. @@ -40,11 +40,13 @@ 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, macro, - # or declaration with that name. - if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$gl_cv_func_dirfd_macro \ - = no,no,no; then - AC_REPLACE_FUNCS([dirfd]) + # Use the replacement only if we have no function or macro with that name. + if test $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro = no,no; then + if test $ac_cv_have_decl_dirfd = yes; then + # If the system declares dirfd already, let's declare rpl_dirfd instead. + REPLACE_DIRFD=1 + fi + AC_LIBOBJ([dirfd]) AC_CACHE_CHECK( [how to get the file descriptor associated with an open DIR*], gl_cv_sys_dir_fd_member_name, -- cgit v1.2.1