Thursday, July 30, 2009

To Build Curl for Windows

I've been pretty content with wget. Then came curl. Like wget, curl is also a tool that helps you retrieve files on the Internet. I've yet to learn more about this utility, but curl seems to be quite powerful and popular. So I decided to compile curl on my own.



First, compile zlib.


make -f win32/Makefile.gcc
cp -iv zconf.h zlib.h /mingw/include
cp -iv libz.a /mingw/lib


Next, compile OpenSSL.


./Configure -DHAVE_STRUCT_TIMESPEC -DPTW32_STATIC_LIB -L/mingw/lib -lz -lpthreadGC2 -lws2_32 --prefix=/mingw threads zlib mingw
make
make install


I downloaded the Curl source from curl.haxx.se, launched MSYS and compiled Curl with the following commands:


./configure --build=i686-pc-mingw32 --prefix=/mingw --disable-shared
make
make install


This produces a static executable curl.exe. Copy it to a folder in your PATH.


cp -iv src/curl.exe /C/Windows

The command “make install” will copy the following files into /mingw.


bin/curl-config
bin/curl.exe
include/curl/curl.h
include/curl/curlbuild.h
include/curl/curlrules.h
include/curl/curlver.h
include/curl/easy.h
include/curl/mprintf.h
include/curl/multi.h
include/curl/stdcheaders.h
include/curl/typecheck-gcc.h
include/curl/types.h
lib/libcurl.a
lib/libcurl.la
lib/pkgconfig/libcurl.pc
share/man/man1/curl-config.1
share/man/man1/curl.1
share/man/man3/curl_easy_cleanup.3
share/man/man3/curl_easy_duphandle.3
share/man/man3/curl_easy_escape.3
share/man/man3/curl_easy_getinfo.3
share/man/man3/curl_easy_init.3
share/man/man3/curl_easy_pause.3
share/man/man3/curl_easy_perform.3
share/man/man3/curl_easy_recv.3
share/man/man3/curl_easy_reset.3
share/man/man3/curl_easy_send.3
share/man/man3/curl_easy_setopt.3
share/man/man3/curl_easy_strerror.3
share/man/man3/curl_easy_unescape.3
share/man/man3/curl_escape.3
share/man/man3/curl_formadd.3
share/man/man3/curl_formfree.3
share/man/man3/curl_formget.3
share/man/man3/curl_free.3
share/man/man3/curl_getdate.3
share/man/man3/curl_getenv.3
share/man/man3/curl_global_cleanup.3
share/man/man3/curl_global_init.3
share/man/man3/curl_global_init_mem.3
share/man/man3/curl_mprintf.3
share/man/man3/curl_multi_add_handle.3
share/man/man3/curl_multi_assign.3
share/man/man3/curl_multi_cleanup.3
share/man/man3/curl_multi_fdset.3
share/man/man3/curl_multi_info_read.3
share/man/man3/curl_multi_init.3
share/man/man3/curl_multi_perform.3
share/man/man3/curl_multi_remove_handle.3
share/man/man3/curl_multi_setopt.3
share/man/man3/curl_multi_socket.3
share/man/man3/curl_multi_socket_action.3
share/man/man3/curl_multi_strerror.3
share/man/man3/curl_multi_timeout.3
share/man/man3/curl_share_cleanup.3
share/man/man3/curl_share_init.3
share/man/man3/curl_share_setopt.3
share/man/man3/curl_share_strerror.3
share/man/man3/curl_slist_append.3
share/man/man3/curl_slist_free_all.3
share/man/man3/curl_strequal.3
share/man/man3/curl_unescape.3
share/man/man3/curl_version.3
share/man/man3/curl_version_info.3
share/man/man3/libcurl-easy.3
share/man/man3/libcurl-errors.3
share/man/man3/libcurl-multi.3
share/man/man3/libcurl-share.3
share/man/man3/libcurl-tutorial.3
share/man/man3/libcurl.3


Integrating Curl into Git


Git didn't pick up the curl library so I had to manually specify curl dependencies with LIBS:


./configure --prefix=/mingw --without-tcltk LIBS='-lssl -lcrypto -lgdi32 -lws2_32 -lwldap32 -lz'


Related Posts


1 comment:

About This Blog

KBlog logo This blog is about current events and issues concerning general population. Thanks for visiting the blog and posting your comments.

© Contents by KBlog

© Blogger template by Emporium Digital 2008

Followers

Total Pageviews

icon
Powered By Blogger