From 912da04e8be8f7b78ea66c0fba08b2ceb292b8b0 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 11 Sep 2011 21:44:32 +0200 Subject: unistd et al.: Don't assume exists. * m4/chdir-long.m4 (gl_FUNC_CHDIR_LONG): Don't include if it does not exist. * m4/environ.m4 (gl_ENVIRON): Don't include if it does not exist. But include . * m4/fcntl-o.m4 (gl_FCNTL_O_FLAGS): If does not exist, include and instead. Don't test symbolink links if symlink() does not exist. * m4/fflush.m4 (gl_FUNC_FFLUSH_STDIN): If does not exist, include instead. * m4/free.m4 (gl_FUNC_FREE): Assume free(NULL) works on native Windows. * m4/getcwd.m4 (gl_FUNC_GETCWD_NULL): If does not exist, include instead. * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Likewise. * m4/getcwd-path-max.m4 (gl_FUNC_GETCWD_PATH_MAX): Likewise. * m4/lseek.m4 (gl_FUNC_LSEEK): If does not exist, include instead. * m4/rename.m4 (gl_FUNC_RENAME): Assume rename() manages hard links correctly if the system does not have hard links. * m4/rmdir.m4 (gl_FUNC_RMDIR): If does not exist, include instead. * m4/unistd_h.m4 (gl_UNISTD_H): If does not exist, bypass it when looking for function declarations. * m4/unlink.m4 (gl_FUNC_UNLINK): If does not exist, include and instead. * doc/posix-headers/unistd.texi: More details about MSVC problem. --- m4/getcwd-path-max.m4 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'm4/getcwd-path-max.m4') diff --git a/m4/getcwd-path-max.m4 b/m4/getcwd-path-max.m4 index 475ae96d16..65ee491037 100644 --- a/m4/getcwd-path-max.m4 +++ b/m4/getcwd-path-max.m4 @@ -1,4 +1,4 @@ -# serial 16 +# serial 17 # Check for several getcwd bugs with long file names. # If so, arrange to compile the wrapper function. @@ -17,6 +17,7 @@ AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX], [ AC_CHECK_DECLS_ONCE([getcwd]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + AC_CHECK_HEADERS_ONCE([unistd.h]) AC_CACHE_CHECK([whether getcwd handles long file names properly], gl_cv_func_getcwd_path_max, [# Arrange for deletion of the temporary directory this test creates. @@ -27,7 +28,11 @@ AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX], [[ #include #include -#include +#if HAVE_UNISTD_H +# include +#else +# include +#endif #include #include #include -- cgit v1.2.1