[svn] Support for MINGW compilation.

By Chin-yuan Kuo.
This commit is contained in:
hniksic 2003-10-25 17:19:07 -07:00
parent dd356aff3d
commit 524cc47d84
6 changed files with 393 additions and 1 deletions

View File

@ -1,3 +1,16 @@
2003-10-26 Hrvoje Niksic <hniksic@xemacs.org>
* windows/config.h.mingw: Ditto.
* windows/Makefile.top.mingw: Ditto.
* windows/Makefile.src.mingw: New file.
* windows/wget.dep: Support convert.o.
* configure.bat.in: New option `--mingw'.
From Chin-yuan Kuo.
2003-10-23 Hrvoje Niksic <hniksic@xemacs.org>
* Makefile.in (dist): Depend on configure.bat.

View File

@ -28,6 +28,7 @@ rem so, delete this exception statement from your version.
cls
if .%1 == .--borland goto :borland
if .%1 == .--mingw goto :mingw
if .%1 == .--msvc goto :msvc
if .%1 == .--watcom goto :watcom
goto :usage
@ -52,6 +53,15 @@ copy windows\Makefile.doc doc\Makefile > nul
echo Type MAKE to start compiling.
goto :end
:mingw
copy windows\config.h.mingw src\config.h > nul
copy windows\Makefile.top.mingw Makefile > nul
copy windows\Makefile.src.mingw src\Makefile > nul
copy windows\Makefile.doc doc\Makefile > nul
echo Type mingw32-make to start compiling.
goto :end
:watcom
copy windows\config.h.ms src\config.h > nul
copy windows\Makefile.watcom src\Makefile > nul
@ -67,5 +77,5 @@ cd src
goto :end
:usage
echo "Usage: configure [--borland | --msvc | --watcom]"
echo "Usage: configure [--borland | --mingw | --msvc | --watcom]"
:end

View File

@ -0,0 +1,45 @@
## Compiler, linker, and lib stuff
## Makefile for use with MinGW GCC/Win32 executable.
##
## ----------------------------------------------------
## USAGE:
## You can type either
## mingw32-make
## to build wget.exe without SSL support or
## mingw32-make SSL=1
## to build wget.exe with SSL support.
##
## ----------------------------------------------------
## NOTE: If you plan to build WGET.EXE with SSL support,
## please check the value of OPENSSL_PATH in this file
## and correct it if it is not the OpenSSL installed directory.
CC=gcc
LDFLAGS= -s
CFLAGS= -DWINDOWS -DHAVE_CONFIG_H -O3 -Wall -I.
## variables
LIBS= -lwsock32
OBJ_EXT=.o
OBJS=cmpt${OBJ_EXT} convert${OBJ_EXT} connect${OBJ_EXT} ftp${OBJ_EXT} ftp-basic${OBJ_EXT} \
ftp-ls${OBJ_EXT} ftp-opie${OBJ_EXT} getopt${OBJ_EXT} headers${OBJ_EXT} host${OBJ_EXT} html-parse${OBJ_EXT} html-url${OBJ_EXT} \
http${OBJ_EXT} init${OBJ_EXT} log${OBJ_EXT} main${OBJ_EXT} gnu-md5${OBJ_EXT} netrc${OBJ_EXT} rbuf${OBJ_EXT} \
safe-ctype${OBJ_EXT} hash${OBJ_EXT} progress${OBJ_EXT} gen-md5${OBJ_EXT} cookies${OBJ_EXT} \
recur${OBJ_EXT} res${OBJ_EXT} retr${OBJ_EXT} url${OBJ_EXT} utils${OBJ_EXT} version${OBJ_EXT} mswindows${OBJ_EXT}
ifdef SSL
## OPENSSL_PATH is the OpenSSL installed directory
OPENSSL_PATH = ../../openssl-0.9.7c
CFLAGS += -I${OPENSSL_PATH}/outinc -DHAVE_SSL
LIBS += -L${OPENSSL_PATH}/out -leay32 -lssl32
OBJS += gen_sslfunc${OBJ_EXT}
endif
all: wget.exe
wget.exe: $(OBJS)
${CC} ${LDFLAGS} -o $@ ${OBJS} ${LIBS}
o = ${OBJ_EXT}
include ../windows/wget.dep

View File

@ -0,0 +1,60 @@
# Makefile for `Wget' utility
# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# In addition, as a special exception, the Free Software Foundation
# gives permission to link the code of its release of Wget with the
# OpenSSL project's "OpenSSL" library (or with modified versions of it
# that use the same license as the "OpenSSL" library), and distribute
# the linked executables. You must obey the GNU General Public License
# in all respects for all of the code used other than "OpenSSL". If you
# modify this file, you may extend this exception to your version of the
# file, but you are not obligated to do so. If you do not wish to do
# so, delete this exception statement from your version.
# Makefile for building WGET.EXE and WGET.HLP using MinGW GCC/Win32 compiler.
SRC_DIR = src
DOC_DIR = doc
all: ${SRC_DIR} ${DOC_DIR}
${SRC_DIR}: FORCE
@echo -----------------------------------------------------------
@echo = If you would like to build WGET.EXE without SSL support,
@echo = please issue the following commands.
@echo = [1] cd $@
@echo = [2] ${MAKE}
@echo = [3] cd ..
@echo = --------------------
@echo = If you would like to build WGET.EXE with SSL support,
@echo = please follow the instructions below.
@echo = [1] cd $@
@echo = [2] Check the value of OPENSSL_PATH in Makefile and
@echo = correct it if it is not the OpenSSL installed directory.
@echo = [3] ${MAKE} SSL=1
@echo = [4] cd ..
@echo -----------------------------------------------------------
${DOC_DIR}: FORCE
@echo -----------------------------------------------------------
@echo = Please issue the following commands to obtain WGET.HLP.
@echo = [1] cd $@
@echo = [2] ${MAKE}
@echo = [3] cd ..
@echo -----------------------------------------------------------
FORCE:

263
windows/config.h.mingw Normal file
View File

@ -0,0 +1,263 @@
/* src/config.h. Generated by configure. */
/* Configuration header file.
Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU Wget.
GNU Wget is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GNU Wget is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Wget; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
In addition, as a special exception, the Free Software Foundation
gives permission to link the code of its release of Wget with the
OpenSSL project's "OpenSSL" library (or with modified versions of it
that use the same license as the "OpenSSL" library), and distribute
the linked executables. You must obey the GNU General Public License
in all respects for all of the code used other than "OpenSSL". If you
modify this file, you may extend this exception to your version of the
file, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version. */
#ifndef CONFIG_H
#define CONFIG_H
/* Define if you have the <alloca.h> header file. */
/* #undef HAVE_ALLOCA_H */
/* For MinGW GCC/Win32, alloca is defined in the <malloc.h> header file. */
#include <malloc.h>
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to empty or __inline__ or __inline. */
/* #undef inline */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define as the return type of signal handlers (int or void). */
#define RETSIGTYPE void
/* Define if your architecture is big endian (with the most
significant byte first). */
/* #undef WORDS_BIGENDIAN */
#define ftruncate chsize
/* Define to the length of short. */
#define SIZEOF_SHORT 2
/* Define to the length of int. */
#define SIZEOF_INT 4
/* Define to the length of long. */
#define SIZEOF_LONG 4
/* Define to the length of long long. */
#define SIZEOF_LONG_LONG 8
/* Define this if you want the NLS support. */
/* #undef HAVE_NLS */
/* Define if you want the FTP support for Opie compiled in. */
#define USE_OPIE 1
/* Define if you want the HTTP Digest Authorization compiled in. */
#define USE_DIGEST 1
/* Define if you want the debug output support compiled in. */
#define ENABLE_DEBUG 1
/* Define if you have sys/time.h header. */
#define HAVE_SYS_TIME_H 1
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define if you have struct utimbuf. */
#define HAVE_STRUCT_UTIMBUF 1
/* Define if you have the uname function. */
/* #undef HAVE_UNAME */
/* Define if you have a working version of mmap. */
/* #undef HAVE_MMAP */
/* Define if you have the gethostname function. */
/* #undef HAVE_GETHOSTNAME */
/* Define if you have the select function. */
/* #undef HAVE_SELECT */
/* Define if you have the gettimeofday function. */
/* #undef HAVE_GETTIMEOFDAY */
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the sys/utsname.h header. */
/* #undef HAVE_SYS_UTSNAME_H */
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the snprintf function. */
#define HAVE_SNPRINTF 1
/* Define if you have the vsnprintf function. */
#define HAVE_VSNPRINTF 1
/* Define if you have the strstr function. */
#define HAVE_STRSTR 1
/* Define if you have the strcasecmp function. */
#define HAVE_STRCASECMP 1
/* Define if you have the strncasecmp function. */
#define HAVE_STRNCASECMP 1
/* Define if you have the strpbrk function. */
#define HAVE_STRPBRK 1
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the strptime function. */
/* #undef HAVE_STRPTIME */
/* Define if you have the mktime function. */
#define HAVE_MKTIME 1
/* Define if you have the symlink function. */
/* #undef HAVE_SYMLINK */
/* Define if you have the access function. */
#define HAVE_ACCESS 1
/* Define if you have the isatty function. */
#define HAVE_ISATTY 1
/* Define if you have the signal function. */
/* #undef HAVE_SIGNAL */
/* Define if you have the sigsetjmp function. */
/* #undef HAVE_SIGSETJMP */
/* Define if you have the sigblock function. */
/* #undef HAVE_SIGBLOCK */
/* Define if you have the gettext function. */
/* #undef HAVE_GETTEXT */
/* Define if you have the usleep function. */
/* #undef HAVE_USLEEP */
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <stdarg.h> header file. */
#define HAVE_STDARG_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1
/* Define if you have the <sys/utime.h> header file. */
#define HAVE_SYS_UTIME_H 1
/* Define if you have the <termios.h> header file. */
/* #undef HAVE_TERMIOS_H */
/* Define if you have the <sys/ioctl.h> header file. */
/* #undef HAVE_SYS_IOCTL_H */
/* Define if you have the <sys/select.h> header file. */
/* #undef HAVE_SYS_SELECT_H */
/* Define if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */
/* Define if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define if you have the <setjmp.h> header file. */
#define HAVE_SETJMP_H 1
/* Define if you have the <libintl.h> header file. */
/* #undef HAVE_LIBINTL_H */
/* Define if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
/* Define to be the name of the operating system. */
#define OS_TYPE "mingw32"
/* Define if you wish to compile with socks support. */
/* #undef HAVE_SOCKS */
/* Define to 1 if ANSI function prototypes are usable. */
#define PROTOTYPES 1
/* Define if all libs needed for ssl support are existing */
/* #undef HAVE_SSL */
/* Define if we're compiling in support for MD5. */
#define HAVE_MD5 1
/* Define if we're using Solaris libmd5. */
/* #undef HAVE_SOLARIS_MD5 */
/* Define if we're using OpenSSL md5. */
/* #undef HAVE_OPENSSL_MD5 */
/* Define if we're using builtin (GNU) md5.c. */
#define HAVE_BUILTIN_MD5 1
/* Define if you have the getaddrinfo function. */
/* #undef HAVE_GETADDRINFO */
/* Define if the system headers support the AI_ADDRCONFIG flag. */
/* #undef HAVE_GETADDRINFO_AI_ADDRCONFIG */
/* Define if the system headers support the AI_V4MAPPED flag. */
/* #undef HAVE_GETADDRINFO_AI_V4MAPPED */
/* Define if the system headers support the AI_ALL flag. */
/* #undef HAVE_GETADDRINFO_AI_ALL */
/* Define if the system supports struct sockaddr_in6 */
/* #undef HAVE_HAVE_STRUCT_SOCKADDR_IN6 */
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
/* #undef HAVE_SOCKADDR_IN6_SCOPE_ID */
/* Define if you want to enable the IPv6 support. */
/* #undef ENABLE_IPV6 */
/* Defined to int or size_t on systems without socklen_t. */
#define socklen_t int
/* Define if you have u_int32_t. */
/* #undef HAVE_U_INT32_T */
#endif /* CONFIG_H */

View File

@ -2,6 +2,7 @@ alloca$o: alloca.c config.h
ansi2knr$o: ansi2knr.c config.h
cmpt$o: cmpt.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h
connect$o: connect.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h connect.h host.h
convert$o: convert.c config.h wget.h convert.h url.h recur.h utils.h hash.h
cookies$o: cookies.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h cookies.h hash.h url.h utils.h
ftp-basic$o: ftp-basic.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h rbuf.h connect.h host.h ftp.h
ftp-ls$o: ftp-ls.c config.h wget.h sysdep.h mswindows.h options.h safe-ctype.h utils.h ftp.h url.h