http://blog.csdn.net/ubuntu64fan/article/details/8918808
http://blog.csdn.net/ubuntu64fan/article/details/49865237
编译准备工作:使用MingW编译32位的下列动态库和静态库。
进入MSYS-x64-Shell, 运行:
$ source /local32/etc/profile.local
# Configure PATH and FLAGS. ... APPLICATION_ARRAY=( ... "ZLIB_PREFIX:$DST_DIR/zlib" "OPENSSL_PREFIX:$DST_DIR/openssl" "LIBSSH2_PREFIX:$DST_DIR/libssh2" "LIBCURL_PREFIX:$DST_DIR/libcurl" )
$ cd $SRC_DIR
/local32/src/zlib-1.2.8 $ 1 make -f win32/Makefile.gcc clean /local32/src/zlib-1.2.8 $ 1 export "INCLUDE_PATH=$ZLIB_PREFIX/include" /local32/src/zlib-1.2.8 $ 1 export "LIBRARY_PATH=$ZLIB_PREFIX/lib" /local32/src/zlib-1.2.8 $ 1 export "BINARY_PATH=$ZLIB_PREFIX/bin" /local32/src/zlib-1.2.8 $ make -f win32/Makefile.gcc SHARED_MODE=1 install
/local32/src/openssl-1.0.2e $ ./config shared --prefix=$OPENSSL_PREFIX /local32/src/openssl-1.0.2e $ make -j 4 /local32/src/openssl-1.0.2e $ make test /local32/src/openssl-1.0.2e $ make install
/local32/src/libssh2-1.8.0 $ sh ./configure --prefix=$LIBSSH2_PREFIX --with-libz-prefix=$ZLIB_PREFIX --with-libssl-prefix=$OPENSSL_PREFIX /local32/src/libssh2-1.8.0 $ make /local32/src/libssh2-1.8.0 $ make install
Host type: i686-pc-mingw32 Install prefix: /local32/dst/libssh2 Compiler: gcc Compiler flags: -I/local32/dst/libssh2/include -I/local32/ -I/local32/dst/libusbx/include -I/local32/dst/boost/include nclude -I/local32/dst/gettext/include -I/local32/dst/pkg-conf dst/botan/include -I/local32/dst/fftw/include -I/local32/dst/ -I/local32/dst/libxml2/include -I/local32/dst/libtool/include e=pentium3 -DLIBSSH2_WIN32 Library types: Shared=yes, Static=yes Crypto library: OpenSSL (AES-CTR: yes) Clear memory: unsupported Debug build: no Build examples: yes Path to sshd: (only for self-tests) zlib compression: yes
/local32/src $ wget https://curl.haxx.se/download/curl-7.53.1.tar.gz ... /local32/src/curl-7.53.1 $ sh ./configure --prefix=$LIBCURL_PREFIX /local/src/curl-7.53.1 $ make /local64/src/curl-7.53.1 $ make install
编译准备工作:使用MingW编译64位的下列动态库和静态库:
进入MSYS-x64-Shell, 运行:
$ source /local64/etc/profile.local
编辑:/local64/etc/profile.local,增加下面4行(ZLIB_, OPENSSL_, LIBSSH2_, LIBCURL_):
# Configure PATH and FLAGS. ... APPLICATION_ARRAY=( ... "ZLIB_PREFIX:$DST_DIR/zlib" "OPENSSL_PREFIX:$DST_DIR/openssl" "LIBSSH2_PREFIX:$DST_DIR/libssh2" "LIBCURL_PREFIX:$DST_DIR/libcurl" )
$ cd $SRC_DIR
/local64/src/zlib-1.2.8 $ 1 make -f win32/Makefile.gcc clean /local64/src/zlib-1.2.8 $ 1 export "INCLUDE_PATH=$ZLIB_PREFIX/include" /local64/src/zlib-1.2.8 $ 1 export "LIBRARY_PATH=$ZLIB_PREFIX/lib" /local64/src/zlib-1.2.8 $ 1 export "BINARY_PATH=$ZLIB_PREFIX/bin" /local64/src/zlib-1.2.8 $ make -f win32/Makefile.gcc SHARED_MODE=1 install
/local64/src/openssl-1.0.2e $ perl Configure mingw64 shared --prefix=$OPENSSL_PREFIX
/local64/src/openssl-1.0.2e $ make -j 4
/local64/src/openssl-1.0.2e $ make test
/local64/src/openssl-1.0.2e $ make install
/local64/src/libssh2-1.8.0 $ sh ./configure --prefix=$LIBSSH2_PREFIX --with-libz-prefix=$ZLIB_PREFIX --with-libssl-prefix=$OPENSSL_PREFIX /local64/src/libssh2-1.8.0 $ make /local64/src/libssh2-1.8.0 $ make install
/local64/src $ wget https://curl.haxx.se/download/curl-7.53.1.tar.gz ... /local64/src/curl-7.53.1 $ sh ./configure --prefix=$LIBCURL_PREFIX /local64/src/curl-7.53.1 $ make /local64/src/curl-7.53.1 $ make install
/local64/dst/libcurl/bin$ ./curl.exe -V curl 7.53.1 (i686-pc-mingw32) libcurl/7.53.1 OpenSSL/1.0.2e zlib/1.2.8 libssh2/1.8.0 Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp Features: IPv6 Largefile NTLM SSL libz TLS-SRP HTTPS-proxy