码迷,mamicode.com
首页 > Web开发 > 详细

libcurl编译

时间:2015-12-29 22:44:18      阅读:328      评论:0      收藏:0      [点我收藏+]

标签:

下载:

git://github.com/bagder/curl.git

 

openssl:

openssl编译 

 
for linux or mingw:
./buildconf
./configure --with-ssl="$PREFIX"
make


for android:
./buildconf
../configure  --prefix=$PREFIX \
    CC=${CROSS_PREFIX}gcc \
    --disable-shared \
    --enable-static \
    --with-ssl="$PREFIX"\
    CFLAGS="-march=armv7-a -mfpu=neon --sysroot=${PLATFORM}" \
    CPPFLAGS="-march=armv7-a -mfpu=neon --sysroot=${PLATFORM}" \
    --host=arm-linux-androideabi \

make install
 
for msvc:
从开始菜单 -> visual studio 2013-> visual studio tools -> VS2013 x86 本机工具命令提示。进入vs编译环境。
再进入curl源码根目录,执行下面命令:

buildconf.bat
cd winbuild
nmake /f Makefile.vc mode=static VC=12

生成的库位于源码根目录的 builds 下


 

Usage: nmake /f Makefile.vc mode=<static or dll> <options>
where <options> is one or many of:
VC=<6,7,8,9,10,11,12>        - VC versions
WITH_DEVEL=<path>            - Paths for the development files (SSL, zlib, etc.)
Defaults to sibbling directory deps: ../deps
Libraries can be fetched at http://pecl2.php.net/downloads/php-windows-builds/
Uncompress them into the deps folder.
WITH_SSL=<dll or static>     - Enable OpenSSL support, DLL or static
WITH_ZLIB=<dll or static>    - Enable zlib support, DLL or static
WITH_SSH2=<dll or static>    - Enable libSSH2 support, DLL or static
ENABLE_IDN=<yes or no>       - Enable use of Windows IDN APIs, defaults to yes
Requires Windows Vista or later, or installation from:
http://www.microsoft.com/downloads/details.aspx?FamilyID=AD6158D7-DDBA-416A-9109
-07607425A815
ENABLE_IPV6=<yes or no>      - Enable IPv6, defaults to yes
ENABLE_SSPI=<yes or no>      - Enable SSPI support, defaults to yes
ENABLE_WINSSL=<yes or no>    - Enable native Windows SSL support, defaults to ye
s
GEN_PDB=<yes or no>          - Generate Program Database (debug symbols for rele
ase build)
DEBUG=<yes or no>            - Debug builds
MACHINE=<x86 or x64>         - Target architecture (default x64 on AMD64, x86 on
 others)
Makefile.vc(35) : fatal error U1050: please choose a valid mode
Stop.
 
 
 
使用 libcurl 库:
编译时会生成一个工具 curl-config,用它可以得到编译需要的信息:
$ ./curl-config --cflags
-DCURL_STATICLIB -I/d/source/rabbitim/ThirdLibary/build_script/../windows_mingw/include
 
$ ./curl-config --libs
-L/d/source/rabbitim/ThirdLibary/build_script/../windows_mingw/lib -lcurl -lssl -lcrypto -lgdi32 -lwldap32 -lz -lws2_32
 
http://blog.csdn.net/kl222/article/details/41898025

libcurl编译

标签:

原文地址:http://www.cnblogs.com/findumars/p/5087218.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!