# getcwd.m4 - check for working getcwd that is compatible with glibc
-# Copyright (C) 2001, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007 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.
AC_DEFUN([gl_FUNC_GETCWD_NULL],
[
- AC_LIBSOURCES([getcwd.c, getcwd.h])
-
AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
[gl_cv_func_getcwd_null],
[AC_TRY_RUN(
AC_DEFUN([gl_FUNC_GETCWD],
[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
AC_REQUIRE([gl_FUNC_GETCWD_NULL])
gl_abort_bug=no
case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_path_max,$gl_abort_bug in
yes,yes,no) ;;
*)
+ REPLACE_GETCWD=1
AC_LIBOBJ([getcwd])
- AC_DEFINE([__GETCWD_PREFIX], [[rpl_]],
- [Define to rpl_ if the getcwd replacement function should be used.])
gl_PREREQ_GETCWD;;
esac
])