compile binary fow windows on linux with mingw

with mingw we can compile 3rd party project for windows on linux.

compile openssl for example:
参考: OpenSSL for Windows

  1. setup cross compile environment.
    sudo apt-get install mingw-w64 binutils-mingw-w64

  2. download openssl source code
    git clone https://github.com/openssl/openssl.git

  3. cross compile with mingw
    cd openssl
    ./Configure —cross-compile-prefix=i686-w64-mingw32- mingw64 no-asm shared —prefix=xxx
    make
    make install

    ├── bin
    │ ├── c_rehash
    │ ├── libeay32.dll
    │ ├── openssl.exe
    │ └── ssleay32.dll
    ├── include
    │ └── openssl
    ├── lib
    │ ├── engines
    │ ├── libcrypto.a
    │ ├── libcrypto.dll.a
    │ ├── libssl.a
    │ ├── libssl.dll.a
    │ └── pkgconfig
    └── ssl

    ├── certs
    ├── man
    ├── misc
    ├── openssl.cnf
    └── private