[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] Re: wget 1.9.1 doesn't compile with gcc 4.4.0 on Windows (Min
From: |
Andy Rushton |
Subject: |
[Bug-wget] Re: wget 1.9.1 doesn't compile with gcc 4.4.0 on Windows (MinGW) |
Date: |
Tue, 13 Oct 2009 19:14:02 +0100 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
Some patches - I'm not sure what convention you use for patches, I have
expressed them as the difference between the file that works and the
backup (~) file which is the original.
./configure.ac patch:
-------------------------------------------------------------
diff -u3pr configure.ac~ configure.ac
--- configure.ac~ 2009-09-22 17:39:49 +0100
+++ configure.ac 2009-10-13 16:11:23 +0100
@@ -201,7 +201,7 @@ dnl
AC_FUNC_MMAP
AC_FUNC_FSEEKO
AC_CHECK_FUNCS(strptime timegm snprintf vsnprintf vasprintf drand48)
-AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr wcwidth
mbtowc)
+AC_CHECK_FUNCS(strtoll ftello sigblock sigsetjmp memrchr wcwidth mbtowc)
if test x"$ENABLE_OPIE" = xyes; then
AC_LIBOBJ([ftp-opie])
@@ -215,7 +215,6 @@ AC_DEFINE([HAVE_STRCASECMP], 1, [Define
AC_DEFINE([HAVE_STRNCASECMP], 1, [Define to 1 if you have the
`strncasecmp' function.])
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.])
-AC_DEFINE([HAVE_SYMLINK], 1, [Define to 1 if you have the `symlink'
function.])
dnl
dnl Call Wget-specific macros defined in aclocal.
-------------------------------------------------------------
Actually, the logic is wrong. The configure script checks for usleep,
which Windoze has, but then uses sleep as well, unchecked, which Windoze
doesn't have. A better check would be to check for both usleep and sleep
and then change the source wherever #ifdef HAVE_USLEEP is to #if
defined(HAVE_USLEEP) && defined(HAVE_SLEEP).
src/Makefile.in patch
-------------------------------------------------------------
--- Makefile.in~ 2009-09-22 17:40:11 +0100
+++ Makefile.in 2009-10-13 16:16:00 +0100
@@ -166,7 +166,7 @@ am_wget_OBJECTS = cmpt.$(OBJEXT) connect
css-url.$(OBJEXT) ftp-basic.$(OBJEXT) ftp-ls.$(OBJEXT) \
hash.$(OBJEXT) host.$(OBJEXT) html-parse.$(OBJEXT) \
html-url.$(OBJEXT) http.$(OBJEXT) init.$(OBJEXT) log.$(OBJEXT) \
- main.$(OBJEXT) netrc.$(OBJEXT) progress.$(OBJEXT) \
+ main.$(OBJEXT) mswindows.$(OBJEXT) netrc.$(OBJEXT) progress.$(OBJEXT) \
ptimer.$(OBJEXT) recur.$(OBJEXT) res.$(OBJEXT) retr.$(OBJEXT) \
snprintf.$(OBJEXT) spider.$(OBJEXT) url.$(OBJEXT) \
utils.$(OBJEXT) exits.$(OBJEXT) build_info.$(OBJEXT) \
-------------------------------------------------------------
Not sure how to make this Windows-specific though...
src/host.c patch:
-------------------------------------------------------------
--- host.c~ 2009-09-22 04:00:05 +0100
+++ host.c 2009-10-13 16:00:51 +0100
@@ -47,6 +47,9 @@ as that of the covered work. */
# else /* def __VMS */
# include <netdb.h>
# endif /* def __VMS [else] */
+#if !HAVE_DECL_H_ERRNO
+extern int h_errno;
+#endif
# define SET_H_ERRNO(err) ((void)(h_errno = (err)))
#else /* WINDOWS */
# define SET_H_ERRNO(err) WSASetLastError (err)
@@ -63,11 +66,6 @@ as that of the covered work. */
# define NO_ADDRESS NO_DATA
#endif
-#if !HAVE_DECL_H_ERRNO
-extern int h_errno;
-#endif
-
-
/* Lists of IP addresses that result from running DNS queries. See
lookup_host for details. */
-------------------------------------------------------------
I can use configure with no parameters:
./configure
but still have to run make with the following:
make CPPFLAGS=-DWINDOWS LIBS=-lws2_32 exeext=.exe
So, really these options need to be part of configure too, I just didn't
know how to patch configure.ac to do that.
This gives a wget with the following options enabled:
-------------------------------------------------------------
GNU Wget 1.12 built on mingw32.
+digest -ipv6 -nls -ntlm +opie +md5/builtin -https -gnutls -openssl
-iri
Wgetrc:
c:/Andy/.wgetrc (user)
c:/msys/1.0/local/etc/wgetrc (system)
Compile: gcc -DHAVE_CONFIG_H -DSYSTEM_WGETRC="/usr/local/etc/wgetrc"
-DLOCALEDIR="/usr/local/share/locale" -I. -I../lib -I ../md5
-DWINDOWS -O2 -Wall
Link: gcc -O2 -Wall -lws2_32 ftp-opie.o gen-md5.o ../lib/libgnu.a
../md5/libmd5.a
-------------------------------------------------------------