2010-02-15 03:40:18 +08:00
|
|
|
_ _ ____ _
|
|
|
|
___| | | | _ \| |
|
|
|
|
/ __| | | | |_) | |
|
|
|
|
| (__| |_| | _ <| |___
|
2003-08-05 22:52:31 +08:00
|
|
|
\___|\___/|_| \_\_____|
|
|
|
|
|
2004-04-06 15:59:11 +08:00
|
|
|
How To Build libcurl to Use c-ares For Asynch Name Resolves
|
|
|
|
===========================================================
|
|
|
|
|
2010-02-15 03:40:18 +08:00
|
|
|
c-ares:
|
2010-04-12 17:09:08 +08:00
|
|
|
http://c-ares.haxx.se/
|
2003-08-05 22:52:31 +08:00
|
|
|
|
2003-10-13 21:07:50 +08:00
|
|
|
NOTE
|
2010-10-01 05:14:58 +08:00
|
|
|
The latest libcurl version requires c-ares 1.6.0 or later.
|
2004-04-06 15:59:11 +08:00
|
|
|
|
|
|
|
Once upon the time libcurl built fine with the "original" ares. That is no
|
2006-11-03 18:56:37 +08:00
|
|
|
longer true. You need to use c-ares.
|
2003-08-05 22:52:31 +08:00
|
|
|
|
2004-04-06 15:59:11 +08:00
|
|
|
Build c-ares
|
|
|
|
============
|
2003-08-06 21:21:19 +08:00
|
|
|
|
2004-04-06 15:59:11 +08:00
|
|
|
1. unpack the c-ares archive
|
|
|
|
2. cd c-ares-dir
|
2003-10-13 21:07:50 +08:00
|
|
|
3. ./configure
|
|
|
|
4. make
|
2010-04-12 17:09:08 +08:00
|
|
|
5. make install
|
2003-08-05 22:52:31 +08:00
|
|
|
|
2004-04-06 15:59:11 +08:00
|
|
|
Build libcurl to use c-ares in the curl source tree
|
|
|
|
===================================================
|
2003-08-05 22:52:31 +08:00
|
|
|
|
2010-03-24 17:44:25 +08:00
|
|
|
1. name or symlink the c-ares source directory 'ares' in the curl source
|
|
|
|
directory
|
2003-10-13 21:07:50 +08:00
|
|
|
2. ./configure --enable-ares
|
2010-03-24 17:44:25 +08:00
|
|
|
|
|
|
|
Optionally, you can point out the c-ares install tree root with the the
|
|
|
|
--enable-ares option.
|
|
|
|
|
2003-10-13 21:07:50 +08:00
|
|
|
3. make
|
2003-08-05 22:52:31 +08:00
|
|
|
|
2004-04-06 15:59:11 +08:00
|
|
|
Build libcurl to use an installed c-ares
|
|
|
|
========================================
|
2003-12-10 22:16:56 +08:00
|
|
|
|
|
|
|
1. ./configure --enable-ares=/path/to/ares/install
|
|
|
|
2. make
|
|
|
|
|
2004-04-06 15:59:11 +08:00
|
|
|
c-ares on win32
|
|
|
|
===============
|
2004-01-04 20:00:11 +08:00
|
|
|
(description brought by Dominick Meglio)
|
|
|
|
|
2004-04-06 15:59:11 +08:00
|
|
|
First I compiled c-ares. I changed the default C runtime library to be the
|
2004-01-04 20:00:11 +08:00
|
|
|
single-threaded rather than the multi-threaded (this seems to be required to
|
|
|
|
prevent linking errors later on). Then I simply build the areslib project (the
|
|
|
|
other projects adig/ahost seem to fail under MSVC).
|
|
|
|
|
|
|
|
Next was libcurl. I opened lib/config-win32.h and I added a:
|
|
|
|
#define USE_ARES 1
|
|
|
|
|
|
|
|
Next thing I did was I added the path for the ares includes to the include
|
|
|
|
path, and the libares.lib to the libraries.
|
|
|
|
|
|
|
|
Lastly, I also changed libcurl to be single-threaded rather than
|
|
|
|
multi-threaded, again this was to prevent some duplicate symbol errors. I'm
|
|
|
|
not sure why I needed to change everything to single-threaded, but when I
|
|
|
|
didn't I got redefinition errors for several CRT functions (malloc, stricmp,
|
|
|
|
etc.)
|
|
|
|
|
|
|
|
I would have modified the MSVC++ project files, but I only have VC.NET and it
|
|
|
|
uses a different format than VC6.0 so I didn't want to go and change
|
|
|
|
everything and remove VC6.0 support from libcurl.
|