diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-11-15 20:16:40 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-11-16 09:23:46 +0100 |
commit | 8912421cf3829a4fd65877fd1255125c191f6f89 (patch) | |
tree | 6b89fecf0738a1f80792bbe7453730f7882f1d54 /m4/readlink.m4 | |
parent | 3fe87cf7aff396d7bd993aa009f48eb8afd6c1cd (diff) | |
download | guile-8912421cf3829a4fd65877fd1255125c191f6f89.tar.gz |
Use Gnulib's `inet_ntop' and `inet_pton' modules.
* m4/gnulib-cache.m4: Add `inet_ntop' and `inet_pton'.
* configure.ac: Don't check for `inet_ntop' and `inet_pton'.
* libguile/socket.c (scm_inet_pton, scm_inet_ntop): Compile regardless
of `HAVE_INET_PTON' and `HAVE_INET_NTOP' respectively.
* libguile/filesys.c: Use <stdlib.h> instead of <canonicalize.h>.
Diffstat (limited to 'm4/readlink.m4')
-rw-r--r-- | m4/readlink.m4 | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/m4/readlink.m4 b/m4/readlink.m4 index ff3f1f587..fa7c2ddcb 100644 --- a/m4/readlink.m4 +++ b/m4/readlink.m4 @@ -1,4 +1,4 @@ -# readlink.m4 serial 5 +# readlink.m4 serial 7 dnl Copyright (C) 2003, 2007, 2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -12,6 +12,36 @@ AC_DEFUN([gl_FUNC_READLINK], HAVE_READLINK=0 AC_LIBOBJ([readlink]) gl_PREREQ_READLINK + else + AC_CACHE_CHECK([whether readlink signature is correct], + [gl_cv_decl_readlink_works], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h> + /* Cause compilation failure if original declaration has wrong type. */ + ssize_t readlink (const char *, char *, size_t);]])], + [gl_cv_decl_readlink_works=yes], [gl_cv_decl_readlink_works=no])]) + AC_CACHE_CHECK([whether readlink handles trailing slash correctly], + [gl_cv_func_readlink_works], + [# We have readlink, so assume ln -s works. + ln -s conftest.no-such conftest.link + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[#include <unistd.h> +]], [[char buf[20]; + return readlink ("conftest.link/", buf, sizeof buf) != -1;]])], + [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no], + [gl_cv_func_readlink_works="guessing no"]) + rm -f conftest.link]) + if test "$gl_cv_func_readlink_works" != yes; then + AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink + fails to recognize a trailing slash.]) + REPLACE_READLINK=1 + AC_LIBOBJ([readlink]) + elif test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINK=1 + AC_LIBOBJ([readlink]) + fi fi ]) |