cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl 7.24.0 for Windows with mingw and mingw64

From: Vincent Torri <vincent.torri_at_gmail.com>
Date: Wed, 25 Jan 2012 23:44:44 +0100

On Wed, Jan 25, 2012 at 1:31 PM, Brecht Sanders
<brechtsanders_at_users.sourceforge.net> wrote:
> Hi,
> I compiled libcurl 7.24.0 for Windows 32-bit with mingw and 64-bit with
> mingw64 with the patches below.
> The first patch was to address an issue with ftruncate/ftruncate64 on
> mingw64.

it's better to check for the function in configure.ac and garding it,
instead of that test

> The rest is all related to the configure script setting USE_THREADS_POSIX
> instead of USE_THREADS_WIN32 and the linker option -pthread which is invalid
> for mingw (and not needed when using Windows threads).

that's something to fix in configure.ac, not with some echo calls

Vincent Torri

> I hope this helps keeping libcurl crossplatform.
> Regards
>    Brecht Sanders
>
> # fix src/main.c for 64-bit
> patch -ulbf src/main.c << EOF
> --- src/main.c  2011-04-22 19:01:50 +0200
> +++ src/main.c  2011-08-13 17:04:50 +0200
> @@ -436,2 +436,3 @@
>
> +#ifndef __MINGW64__
>  static int ftruncate64(int fd, curl_off_t where)
> @@ -447,2 +448,3 @@
>  #define ftruncate(fd,where) ftruncate64(fd,where)
> +#endif
>
> EOF
>
> # after running configure the following fix is needed
> echo "#undef USE_THREADS_POSIX" >> lib/curl_config.h &&
> echo "#define USE_THREADS_WIN32 1" >> lib/curl_config.h &&
> echo "#undef USE_THREADS_POSIX" >> src/curl_config.h &&
> echo "#define USE_THREADS_WIN32 1" >> src/curl_config.h &&
> # remove -pthread from Makefiles
> for F in `find . -iname Makefile` ; do
>  sed -i.orig "s/-pthread//" $F
> done &&
> make install-strip
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-01-25