This is an old revision of the document!
libcURL - the multiprotocol file transfer library
Project URL: http://curl.haxx.se/libcurl/
Available prebuilt libraries
All prebuilt libraries are available as part of the PHP SDK
Requirements
- CURL sources, patched, available in here
- OpenSSL binaries and development files
- Libssh2 binaries and development files
- Zlib binaries and development files
- Create a clean build tree without the classic php dependencies in ..\..\deps but only the required deps (ssl and zlib). Having curl headers in your include path is likely to break the build
Configuration
If you did not use the patched sources, you will need to manually add SSH2 support in the Makefile(s) (vc6 and vc9) as well as than enabling SSPI and IPV6.
To enable IPV6 add the following line to lib/config-win32.h (on line 179, before HAVE_SELECT):
/* Define if you want to enable IPv6 support */ #define ENABLE_IPV6
Uncomment the WINDOWS_SSPI line in the Makefile:
WINDOWS_SSPI = 1
Add a new configuration to compile curl with SSH2 support (I only define what we need for php, ssl as dll, zip static).
Add the SSH cflag after the CFLAGSSSL definition (line 99):
CFLAGSSSH = /DHAVE_LIBSSH2 /DHAVE_LIBSSH2_H /DLIBSSH2_WIN32 /DLIBSSH2_LIBRARY /DUSE_LIBSSH2 ... SSH2LIBSDLL = libssh2.lib SSH2LIBS = libssh2_a.lib
Add the new configuration:
###################### # release-ssh2-ssl-dll-zlib !IF "$(CFG)" == "release-ssh2-ssl-dll-zlib" TARGET = $(LIB_NAME).lib DIROBJ = $(CFG) LFLAGSSSH = "/LIBPATH:$(DEPS_PATH)\lib" LFLAGSZLIB = "/LIBPATH:$(ZLIB_PATH)" LFLAGSSSL = "/LIBPATH:$(OPENSSL_PATH)\out32dll" LNK = $(LNKLIB) $(WINLIBS) $(SSLLIBS) $(ZLIBLIBS) $(SSH2LIBS) $(LFLAGSSSL) $(LFLAGSZLIB) $(LFLAGSSSH) /out:$(DIROBJ)\$(TARGET) CC = $(CCNODBG) $(RTLIB) $(CFLAGSSSL) $(CFLAGSZLIB) $(CFLAGSLIB) $(CFLAGSSSH) /I$(DEPS_PATH)/include/libssh2 CFGSET = TRUE !ENDIF
Compilation
To build the library, go to the lib directory and call the makefile with the desired options:
cd C:\php-sdk\libs_build\vc9\x86\curl-7.19.4\lib
Example for a Visual C++ 2008 (VC9):
Compilation x64, release
nmake /f Makefile.vc9 cfg=release-ssl-zlib ZLIB_PATH=c:\phpbuilds\2k5\x64\deps OPENSSL_PATH=c:\phpbuilds\2k5\x64\deps MACHINE=x64
Compilation x86, release
nmake /f Makefile.vc9 cfg=release-ssl-zlib ZLIB_PATH=c:\phpbuilds\2k5\x86\deps OPENSSL_PATH=c:\phpbuilds\2k5\x86\deps
Compilation x86, Debug
nmake /f Makefile.vc9 cfg=debug-ssl-zlib ZLIB_PATH=c:\phpbuilds\2k5\x86\deps OPENSSL_PATH=c:\phpbuilds\2k5\x86\deps
Compilation x64, Debug
nmake /f Makefile.vc9 cfg=debug-ssl-zlib ZLIB_PATH=c:\phpbuilds\2k5\x64\deps OPENSSL_PATH=c:\phpbuilds\2k5\x64\deps MACHINE=x64