1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

Brian Dessent's fixes for cygwin builds

This commit is contained in:
Daniel Stenberg 2006-06-08 06:12:30 +00:00
parent 2bd3033f68
commit 990e56fb13
8 changed files with 83 additions and 36 deletions

23
CHANGES
View File

@ -6,6 +6,29 @@
Changelog
Daniel (8 June 2006)
- Brian Dessent fixed the code for cygwin in three distinct ways:
The first modifies {lib,src}/setup.h to not include the winsock headers
under Cygwin. This fixes the reported build problem. Cygwin attempts as
much as possible to emulate a posix environment under Windows. This means
that WIN32 is *not* #defined and (to the extent possible) everything is done
as it would be on a *ix type system. Thus <sys/socket.h> is the proper
include, and even though winsock2.h is present, including it just introduces
a whole bunch of incompatible socket API stuff.
The second is a patch I've included in the Cygwin binary packages for a
while. It skips two unnecessary library checks (-lwinmm and -lgdi32). The
checks are innocuous and they do succeed, but they pollute LIBS with
unnecessary stuff which gets recorded as such in the libcurl.la file, which
brings them into the build of any libcurl-downstream. As far as I know
these libs are really only necessary for mingw, so alternatively they could
be designed to only run if $host matches *-*-mingw* but I took the safer
route of skipping them for *-*-cygwin*.
The third patch replaces all uses of the ancient and obsolete __CYGWIN32__
with __CYGWIN__. Ref: <http://cygwin.com/ml/cygwin/2003-09/msg01520.html>.
Daniel (7 June 2006)
- Mikael Sennerholm provided a patch that added NTLM2 session response support
to libcurl. The 21 NTLM test cases were again modified to comply...

View File

@ -23,6 +23,7 @@ This release includes the following changes:
This release includes the following bugfixes:
o builds fine on cygwin
o md5-sess with Digest authentication
o dict with letters such as space in a word
o dict with url-encoded words in the URL
@ -41,7 +42,6 @@ This release includes the following bugfixes:
o improved NTLM functionality
o following redirects with more than one question mark in source URL
o fixed debug build crash with -d
o TFTP works on more systems
o generates a fine AIX Toolbox RPM spec
o treat FTP AUTH failures properly
o TFTP transfers could trash data
@ -65,6 +65,7 @@ advice from friends like these:
Dan Fandrich, Ilja van Sprundel, David McCreedy, Tor Arntsen, Xavier Bouchoux,
David Byron, Michele Bini, Ates Goral, Katie Wang, Robson Braga Araujo,
Ale Vesely, Paul Querna, Gisle Vanem, Mark Eichin, Roland Blom, Andreas
Ntaflos, David Shaw, Michael Wallner, Olaf Stüben, Mikael Sennerholm
Ntaflos, David Shaw, Michael Wallner, Olaf Stüben, Mikael Sennerholm,
Brian Dessent
Thanks! (and sorry if I forgot to mention someone)

View File

@ -472,20 +472,31 @@ dnl **********************************************************************
dnl Check for the presence of the winmm library.
dnl **********************************************************************
AC_MSG_CHECKING([for timeGetTime in winmm])
my_ac_save_LIBS=$LIBS
LIBS="-lwinmm $LIBS"
AC_TRY_LINK([#include <windef.h>
#include <mmsystem.h>
],
[timeGetTime();],
[ dnl worked!
AC_MSG_RESULT([yes])
],
[ dnl failed, restore LIBS
LIBS=$my_ac_save_LIBS
AC_MSG_RESULT(no)]
)
case $host in
*-*-cygwin*)
dnl Under Cygwin, winmm exists but is not needed as WIN32 is not #defined
dnl and gettimeofday() will be used regardless of the outcome of this test.
dnl Skip this test, otherwise -lwinmm will be needlessly added to LIBS
dnl (and recorded as such in the .la file, potentially affecting downstream
dnl clients of the library.)
;;
*)
AC_MSG_CHECKING([for timeGetTime in winmm])
my_ac_save_LIBS=$LIBS
LIBS="-lwinmm $LIBS"
AC_TRY_LINK([#include <windef.h>
#include <mmsystem.h>
],
[timeGetTime();],
[ dnl worked!
AC_MSG_RESULT([yes])
],
[ dnl failed, restore LIBS
LIBS=$my_ac_save_LIBS
AC_MSG_RESULT(no)]
)
;;
esac
dnl **********************************************************************
dnl Checks for IPv6
@ -888,18 +899,26 @@ if test X"$OPT_SSL" != Xno; then
fi
dnl This is for Msys/Mingw
AC_MSG_CHECKING([for gdi32])
my_ac_save_LIBS=$LIBS
LIBS="-lgdi32 $LIBS"
AC_TRY_LINK([#include <windef.h>
#include <wingdi.h>],
[GdiFlush();],
[ dnl worked!
AC_MSG_RESULT([yes])],
[ dnl failed, restore LIBS
LIBS=$my_ac_save_LIBS
AC_MSG_RESULT(no)]
)
case $host in
*-*-cygwin*)
dnl Under Cygwin this is extraneous and causes an unnecessary -lgdi32
dnl to be added to LIBS and recorded in the .la file.
;;
*)
AC_MSG_CHECKING([for gdi32])
my_ac_save_LIBS=$LIBS
LIBS="-lgdi32 $LIBS"
AC_TRY_LINK([#include <windef.h>
#include <wingdi.h>],
[GdiFlush();],
[ dnl worked!
AC_MSG_RESULT([yes])],
[ dnl failed, restore LIBS
LIBS=$my_ac_save_LIBS
AC_MSG_RESULT(no)]
)
;;
esac
AC_CHECK_LIB(crypto, CRYPTO_lock,[
HAVECRYPTO="yes"

View File

@ -33,7 +33,7 @@
#include "if2ip.h"
#if !defined(WIN32) && !defined(__BEOS__) && !defined(__CYGWIN32__) && \
#if !defined(WIN32) && !defined(__BEOS__) && !defined(__CYGWIN__) && \
!defined(__riscos__) && !defined(__INTERIX) && !defined(NETWARE) && \
!defined(_AMIGASF)

View File

@ -79,10 +79,12 @@
* Include header files for windows builds before redefining anything.
* Use this preproessor block only to include or exclude windows.h,
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
* to any other further and independant block.
* to any other further and independant block. Under Cygwin things work
* just as under linux (e.g. <sys/socket.h>) and the winsock headers should
* never be included.
*/
#ifdef HAVE_WINDOWS_H
#if defined(HAVE_WINDOWS_H) && !defined(__CYGWIN__)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif

View File

@ -157,7 +157,7 @@ static long ConnectionStore(struct SessionHandle *data,
#ifndef USE_ARES
/* not for Win32, unless it is cygwin
not for ares builds */
#if !defined(WIN32) || defined(__CYGWIN32__)
#if !defined(WIN32) || defined(__CYGWIN__)
#ifndef RETSIGTYPE
#define RETSIGTYPE void

View File

@ -3242,7 +3242,7 @@ static void free_config_fields(struct Configurable *config)
curl_slist_free_all(config->headers);
}
#if defined(WIN32) && !defined(__CYGWIN32__)
#if defined(WIN32) && !defined(__CYGWIN__)
/* Function to find CACert bundle on a Win32 platform using SearchPath.
* (SearchPath is already declared via inclusions done in setup header file)
@ -3485,7 +3485,7 @@ operate(struct Configurable *config, int argc, char *argv[])
if(env)
curl_free(env);
#if defined(WIN32) && !defined(__CYGWIN32__)
#if defined(WIN32) && !defined(__CYGWIN__)
else
FindWin32CACert(config, "curl-ca-bundle.crt");
#endif

View File

@ -81,10 +81,12 @@
* Include header files for windows builds before redefining anything.
* Use this preproessor block only to include or exclude windows.h,
* winsock2.h, ws2tcpip.h or winsock.h. Any other windows thing belongs
* to any other further and independant block.
* to any other further and independant block. Under Cygwin things work
* just as under linux (e.g. <sys/socket.h>) and the winsock headers should
* never be included.
*/
#ifdef HAVE_WINDOWS_H
#if defined(HAVE_WINDOWS_H) && !defined(__CYGWIN__)
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif