Sorry, I didn't notice there was a preexisting way of appending to OBJ
variable.

New patch attached.

-- 
Robert Millan

My spam trap is [EMAIL PROTECTED]  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
2007-04-01  Robert Millan  <[EMAIL PROTECTED]>

	* Makefile.in: Add @MINGW32_WS2@ to LIBS.
	* configure.in:
	- Detect mingw32 and set appropiate variables.
	- Use AC_CHECK_FUNCS for all functions, including ones that can be
	assumed on Unix-like systems.
	* src/Makefile.in: Adjust OBJ and LIBS for mingw32.

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 2207)
+++ Makefile.in	(working copy)
@@ -57,7 +57,7 @@
 CFLAGS = @CFLAGS@
 CPPFLAGS = @CPPFLAGS@
 DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
-LIBS = @LIBS@ @LIBSSL@ @LIBGNUTLS@
+LIBS = @LIBS@ @LIBSSL@ @LIBGNUTLS@ @MINGW32_WS2@
 LDFLAGS = @LDFLAGS@
 
 #
Index: configure.in
===================================================================
--- configure.in	(revision 2207)
+++ configure.in	(working copy)
@@ -140,9 +140,17 @@
 dnl
 case "$host_os" in
   *win32) exeext='.exe';;
+  mingw32*)
+    exeext='.exe'
+    CFLAGS="$CFLAGS -DWINDOWS"
+    WIN32_OBJ="mswindows.o"
+    MINGW32_WS2="-lws2_32"
+  ;;
   *) exeext='';;
 esac
 AC_SUBST(exeext)
+AC_SUBST(WIN32_OBJ)
+AC_SUBST(MINGW32_WS2)
 
 dnl
 dnl Checks for basic compiler characteristics.
@@ -206,18 +214,8 @@
 AC_FUNC_MMAP
 AC_FUNC_FSEEKO
 AC_CHECK_FUNCS(strptime timegm snprintf vsnprintf vasprintf drand48)
-AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr)
+AC_CHECK_FUNCS(strtoll usleep ftello sigblock sigsetjmp memrchr strcasecmp strncasecmp strdup isatty symlink)
 
-dnl We expect to have these functions on Unix-like systems configure
-dnl runs on.  The defines are provided to get them in config.h.in so
-dnl Wget can still be ported to non-Unix systems (such as Windows)
-dnl that lack some of these functions.
-AC_DEFINE([HAVE_STRCASECMP], 1, [Define to 1 if you have the `strcasecmp' function.])
-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.
 dnl
Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision 2207)
+++ src/Makefile.in	(working copy)
@@ -51,8 +51,8 @@
 # The following line is losing on some versions of make!
 DEFS     = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
 CFLAGS   = @CFLAGS@
-LDFLAGS  = @LDFLAGS@ 
-LIBS     = @LIBS@ @LIBSSL@ @LIBGNUTLS@
+LDFLAGS  = @LDFLAGS@
+LIBS     = @LIBS@ @LIBSSL@ @LIBGNUTLS@ @MINGW32_WS2@
 exeext   = @exeext@
 
 INCLUDES = -I. -I$(srcdir)
@@ -71,13 +71,14 @@
 NTLM_OBJ   = @NTLM_OBJ@
 SSL_OBJ    = @SSL_OBJ@
 GETOPT_OBJ = @GETOPT_OBJ@
+WIN32_OBJ  = @WIN32_OBJ@
 
-OBJ = $(ALLOCA) cmpt.o connect.o convert.o cookies.o              \
+OBJ += $(ALLOCA) cmpt.o connect.o convert.o cookies.o              \
       ftp.o ftp-basic.o ftp-ls.o $(OPIE_OBJ) $(GETOPT_OBJ) hash.o \
       host.o html-parse.o html-url.o http.o $(NTLM_OBJ) init.o    \
       log.o main.o $(MD5_OBJ) netrc.o progress.o ptimer.o recur.o \
       res.o retr.o safe-ctype.o snprintf.o spider.o $(SSL_OBJ)    \
-      url.o utils.o version.o xmalloc.o
+      url.o utils.o version.o xmalloc.o $(WIN32_OBJ)
 
 .SUFFIXES:
 .SUFFIXES: .c .o

Reply via email to