diff --git a/bootstrap.conf b/bootstrap.conf index fbdbe6b9..3a0f4857 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -53,9 +53,11 @@ gettext gitlog-to-changelog git-version-gen gnupload +hostent ioctl iconv iconv-h +inet_ntop langinfo link listen @@ -66,6 +68,7 @@ memrchr mkdir mkstemp mkostemp +nanosleep crypto/md2 crypto/md4 crypto/md5 @@ -104,6 +107,7 @@ update-copyright libunistring-optional unistr/base unicase/tolower +utimens vasprintf vsnprintf write diff --git a/configure.ac b/configure.ac index 5b5b6f1a..8786e00e 100644 --- a/configure.ac +++ b/configure.ac @@ -290,15 +290,6 @@ AC_DEFINE([HAVE_STRNCASECMP], 1, [Define to 1 if you have the `strncasecmp' func AC_DEFINE([HAVE_STRDUP], 1, [Define to 1 if you have the `strdup' function.]) AC_DEFINE([HAVE_ISATTY], 1, [Define to 1 if you have the `isatty' function.]) -dnl -dnl Call Wget-specific macros defined in aclocal. -dnl -WGET_STRUCT_UTIMBUF -WGET_FNMATCH -WGET_NANOSLEEP -WGET_POSIX_CLOCK -WGET_NSL_SOCKET - dnl Deal with specific hosts case $host_os in *mingw32* ) diff --git a/m4/wget.m4 b/m4/wget.m4 index 777e9734..d04f55a4 100644 --- a/m4/wget.m4 +++ b/m4/wget.m4 @@ -27,89 +27,6 @@ dnl Corresponding Source for a non-source form of such a combination dnl shall include the source code for the parts of OpenSSL used as well dnl as that of the covered work. -dnl -dnl Check for `struct utimbuf'. -dnl - -AC_DEFUN([WGET_STRUCT_UTIMBUF], [ - AC_CHECK_TYPES([struct utimbuf], [], [], [ -#include -#if HAVE_SYS_TYPES_H -# include -#endif -#if HAVE_UTIME_H -# include -#endif - ]) -]) - -dnl Check whether fnmatch.h can be included. This doesn't use -dnl AC_FUNC_FNMATCH because Wget is already careful to only use -dnl fnmatch on certain OS'es. However, fnmatch.h is sometimes broken -dnl even on those because Apache installs its own fnmatch.h to -dnl /usr/local/include (!), which GCC uses before /usr/include. - -AC_DEFUN([WGET_FNMATCH], [ - AC_MSG_CHECKING([for working fnmatch.h]) - AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include - ])], [ - AC_MSG_RESULT(yes) - AC_DEFINE([HAVE_WORKING_FNMATCH_H], 1, - [Define if fnmatch.h can be included.]) - ], [ - AC_MSG_RESULT(no) - ]) -]) - -dnl Check for nanosleep. For nanosleep to work on Solaris, we must -dnl link with -lrt (recently) or with -lposix4 (older releases). - -AC_DEFUN([WGET_NANOSLEEP], [ - AC_CHECK_FUNCS(nanosleep, [], [ - AC_CHECK_LIB(rt, nanosleep, [ - AC_DEFINE([HAVE_NANOSLEEP], 1, - [Define if you have the nanosleep function.]) - LIBS="-lrt $LIBS" - ], [ - AC_CHECK_LIB(posix4, nanosleep, [ - AC_DEFINE([HAVE_NANOSLEEP], 1, - [Define if you have the nanosleep function.]) - LIBS="-lposix4 $LIBS" - ]) - ]) - ]) -]) - -AC_DEFUN([WGET_POSIX_CLOCK], [ - AC_CHECK_FUNCS(clock_gettime, [], [ - AC_CHECK_LIB(rt, clock_gettime) - ]) -]) - -dnl Check whether we need to link with -lnsl and -lsocket, as is the -dnl case on e.g. Solaris. - -AC_DEFUN([WGET_NSL_SOCKET], [ - dnl On Solaris, -lnsl is needed to use gethostbyname. But checking - dnl for gethostbyname is not enough because on "NCR MP-RAS 3.0" - dnl gethostbyname is in libc, but -lnsl is still needed to use - dnl -lsocket, as well as for functions such as inet_ntoa. We look - dnl for such known offenders and if one of them is not found, we - dnl check if -lnsl is needed. - wget_check_in_nsl=NONE - AC_CHECK_FUNCS(gethostbyname, [], [ - wget_check_in_nsl=gethostbyname - ]) - AC_CHECK_FUNCS(inet_ntoa, [], [ - wget_check_in_nsl=inet_ntoa - ]) - if test $wget_check_in_nsl != NONE; then - AC_CHECK_LIB(nsl, $wget_check_in_nsl) - fi - AC_CHECK_LIB(socket, socket) -]) - - dnl ************************************************************ dnl START OF IPv6 AUTOCONFIGURATION SUPPORT MACROS dnl ************************************************************ diff --git a/src/Makefile.am b/src/Makefile.am index 526d458a..8a134ff3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -63,9 +63,10 @@ wget_SOURCES = connect.c convert.c cookies.c ftp.c \ exits.h version.h metalink.h xattr.h nodist_wget_SOURCES = version.c EXTRA_wget_SOURCES = iri.c -LDADD = $(LIBOBJS) ../lib/libgnu.a $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(LIBSOCKET)\ - $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO) $(LIB_SELECT) $(LTLIBICONV) $(LTLIBINTL) $(LTLIBTHREAD)\ - $(LTLIBUNISTRING) $(SERVENT_LIB) +LDADD = $(LIBOBJS) ../lib/libgnu.a $(GETADDRINFO_LIB) $(HOSTENT_LIB)\ + $(INET_NTOP_LIB) $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO)\ + $(LIB_NANOSLEEP) $(LIB_POSIX_SPAWN) $(LIB_SELECT) $(LTLIBICONV) $(LTLIBINTL)\ + $(LTLIBTHREAD) $(LTLIBUNISTRING) $(SERVENT_LIB) AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib diff --git a/src/host.c b/src/host.c index 8d58271b..9f551c72 100644 --- a/src/host.c +++ b/src/host.c @@ -428,14 +428,12 @@ getaddrinfo_with_timeout (const char *node, const char *service, const char * print_address (const ip_address *addr) { -#ifdef ENABLE_IPV6 static char buf[64]; + if (!inet_ntop (addr->family, IP_INADDR_DATA (addr), buf, sizeof buf)) snprintf (buf, sizeof buf, "", strerror (errno)); + return buf; -#else - return inet_ntoa (addr->data.d4); -#endif } /* The following two functions were adapted from glibc's diff --git a/tests/Makefile.am b/tests/Makefile.am index 3af00692..2c868296 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -136,9 +136,10 @@ EXTRA_DIST = FTPServer.pm FTPTest.pm HTTPServer.pm HTTPTest.pm \ check_PROGRAMS = unit-tests unit_tests_SOURCES = -LDADD = ../src/libunittest.a ../lib/libgnu.a $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(INET_NTOP_LIB) $(LIBSOCKET)\ - $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO) $(LIB_SELECT) $(LTLIBICONV) $(LTLIBINTL) $(LTLIBTHREAD)\ - $(LTLIBUNISTRING) $(SERVENT_LIB) +LDADD = ../src/libunittest.a ../lib/libgnu.a $(GETADDRINFO_LIB) $(HOSTENT_LIB)\ + $(INET_NTOP_LIB) $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_CRYPTO)\ + $(LIB_NANOSLEEP) $(LIB_POSIX_SPAWN) $(LIB_SELECT) $(LTLIBICONV) $(LTLIBINTL)\ + $(LTLIBTHREAD) $(LTLIBUNISTRING) $(SERVENT_LIB) CLEANFILES = *~ *.bak core core.[0-9]*