Last active
September 16, 2022 08:32
-
-
Save artynet/ee042155c93fc110e9422b5d458d9c6b to your computer and use it in GitHub Desktop.
Cross compile OpenSSL for mingw32-w64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
WORKSPACE=/home/arturo/Programmi/win32-cross | |
sed -i 's/:.dll.a/ -Wl,--export-all -shared:.dll.a/g' Configure | |
sed -i 's,.*target already defined.*,$target=$_;,g' Configure | |
./Configure mingw shared --cross-compile-prefix=i686-w64-mingw32- --prefix=${WORKSPACE} | |
# ./Configure mingw shared --cross-compile-prefix=x86_64-w64-mingw32- --prefix=${WORKSPACE} | |
make -j2 | |
make -j2 install | |
cp *.dll ${WORKSPACE}/lib/ | |
cd ${WORKSPACE}/include | |
# Fix compile bug in OpenSSL | |
sed -i '/# define HEADER_X509V3_H/a \\n#ifdef X509_NAME\n#undef X509_NAME\n#endif' openssl/x509v3.h |
./Configure mingw shared --cross-compile-prefix=x86_64-w64-mingw32- --prefix=${WORKSPACE}
worked for me
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for that!
For x86_64 you need to Configure for mingw64 though :)
I didn't need any seds for compilation to work for openssl-1.1.1h