From 78a1186f2d01bfa2746c5bf5f8a00451401f6e6c Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 7 May 2010 12:28:26 +0200 Subject: [PATCH] Fix build under mingw. --- ChangeLog | 9 ++++++--- Makefile.am | 2 +- bootstrap.conf | 9 ++++++++- src/ChangeLog | 8 ++++++++ src/connect.c | 20 ++++---------------- src/host.h | 2 +- src/mswindows.h | 11 ++--------- 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index ffb44147..6a13c87b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,13 +1,16 @@ 2010-05-07 Giuseppe Scrivano - * po/wget.pot: Remove. + * configure.ac: Don't call macro WGET_SOCKLEN_T. -2010-05-07 Giuseppe Scrivano + * Makefile.am (EXTRA_DIST): Remove autogen.sh. - * configure.ac: Don't call macro WGET_SOCKLEN_T. + * bootstrap.conf (gnulib_modules): Use new modules from gnulib: accept, + bind, close, connect, getpeername, getsockname, listen, setsockopt. * m4/wget.m4 (WGET_SOCKLEN_T): Remove macro. + * po/wget.pot: Remove. + 2010-05-07 Giuseppe Scrivano * configure.ac (ALL_LINGUAS): Remove. diff --git a/Makefile.am b/Makefile.am index 27b43549..7324ade7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -45,7 +45,7 @@ SUBDIRS = lib md5 src doc po tests util windows EXTRA_DIST = ChangeLog.README configure.bat MAILING-LIST \ msdos/ChangeLog msdos/config.h msdos/Makefile.DJ \ - msdos/Makefile.WC ABOUT-NLS autogen.sh \ + msdos/Makefile.WC ABOUT-NLS \ build-aux/build_info.pl CLEANFILES = *~ *.bak $(DISTNAME).tar.gz diff --git a/bootstrap.conf b/bootstrap.conf index 32495d2e..484b2262 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -24,19 +24,26 @@ checkout_only_file= # gnulib modules used by this package. gnulib_modules=" +accept alloca announce-gen +bind c-ctype +close +connect getopt getpass-gnu +getpeername +getsockname gnupload +listen maintainer-makefile quote quotearg -read recv select send +setsockopt socket stdbool strcasestr diff --git a/src/ChangeLog b/src/ChangeLog index 9265d5f4..83baa58f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2010-05-07 Giuseppe Scrivano + * mswindows.h: Always include and . Do not + include . + + * host.h [WINDOWS]: Include not . + + * connect.c: Include and on any platform, + gnulib ensures they exist. Remove `read', `write', `close' macros. + * Makefile.am: Copy build_info.c.in only if we are working in a VPATH. (AM_CPPFLAGS): Add directory with generated gnulib files. diff --git a/src/connect.c b/src/connect.c index 604e7a11..22fccb59 100644 --- a/src/connect.c +++ b/src/connect.c @@ -1,6 +1,6 @@ /* Establishing and handling network connections. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, - 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. + 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GNU Wget. @@ -37,8 +37,10 @@ as that of the covered work. */ #endif #include +#include +#include + #ifndef WINDOWS -# include # ifdef __VMS # include "vms_ip.h" # else /* def __VMS */ @@ -52,9 +54,6 @@ as that of the covered work. */ #include #include -#ifdef HAVE_SYS_SELECT_H -# include -#endif /* HAVE_SYS_SELECT_H */ #ifdef HAVE_SYS_TIME_H # include #endif @@ -701,17 +700,6 @@ test_socket_open (int sock) /* Basic socket operations, mostly EINTR wrappers. */ -#if defined(WINDOWS) || defined(USE_WATT32) -# define read(fd, buf, cnt) recv (fd, buf, cnt, 0) -# define write(fd, buf, cnt) send (fd, buf, cnt, 0) -# define close(fd) closesocket (fd) -#endif - -#ifdef __BEOS__ -# define read(fd, buf, cnt) recv (fd, buf, cnt, 0) -# define write(fd, buf, cnt) send (fd, buf, cnt, 0) -#endif - static int sock_read (int fd, char *buf, int bufsize) { diff --git a/src/host.h b/src/host.h index ae997177..cefbb4f4 100644 --- a/src/host.h +++ b/src/host.h @@ -32,7 +32,7 @@ as that of the covered work. */ #define HOST_H #ifdef WINDOWS -# include +# include #else # ifdef __VMS # include "vms_ip.h" diff --git a/src/mswindows.h b/src/mswindows.h index 241c0016..bb72a282 100644 --- a/src/mswindows.h +++ b/src/mswindows.h @@ -42,15 +42,8 @@ as that of the covered work. */ #include -/* We need winsock2.h for IPv6 and ws2tcpip.h for getaddrinfo, so - include both in ENABLE_IPV6 case. (ws2tcpip.h includes winsock2.h - only on MinGW.) */ -#ifdef ENABLE_IPV6 -# include -# include -#else -# include -#endif +#include +#include #ifndef EAI_SYSTEM # define EAI_SYSTEM -1 /* value doesn't matter */ -- 2.39.2