: Makeįinally, we will issue make install: Make install configure script with some very specific parameters indicating our desire for cross-compilation: chmod +x. Since cross compilation is a little more advanced than what. Issue the following to clone the source for OpenSSL 1.1.1, the latest stable branch at this time, into a directory under our home directory named openssl: git clone -branch OpenSSL_1_1_1-stable Next, let’s CD to our home directory: cd ~ I like to uninstall the system packaged version of OpenSSL on my build machine to avoid any confusion: apt-get remove openssl We will also need zip in order to zip up our binary for transporting to the windows system which it will ultimately live: apt-get install zip We have an additional for the compilation dependency, mingw-64: sudo apt-get install mingw-w64 Now, let’s install some dependencies needed to build OpenSSL for Linux: apt-get install build-essential checkinstall zlib1g-dev -y Cross Compiling OpenSSL for Windows on Ubuntu 20.04 This indicates that our build was successful. Notice in the above that the “version” command against the binary functions, outputting the specific revision (j). Now, let’s make sure OpenSSL works correctly: cd /usr/local/bin/ Issue Ldconfig in order to rebuild the search path for libraries we've added to our installation ldconfig This will place a binary named openssl in /usr/local/bin/ Assuming it finishes successfully, issue make install Make install This will take several minutes to complete. configure script provided with the source, OpenSSL’s source directory includes a friendlier. I like to uninstall the system packaged version of OpenSSL on my build machine to avoid any confusion. We need to install Git so that we can pull down the source for OpenSSL apt-get install git apt-get install build-essential checkinstall zlib1g-dev -y Now, let’s install some dependencies needed to build OpenSSL for Linux. Start by making sure everything is up to date: apt-get update Compiling OpenSSL for Linux on Ubuntu 20.04 Therefore, we will be using Ubuntu 20.04 to compile OpenSSL natively with GCC, as well as to cross-compile OpenSSL for Windows via mingw-w64. However, it is the aim of this guide to produce an OpenSSL binary for both Linux and Windows with as little friction as possible. On Linux, GCC is the most common choice, but there is no reason you couldn’t use a compiler such as clang. In theory it is possible to compile OpenSSL for Windows directly on a windows machine using either Borland or Visual Studio. There are many compilers available for C on both Windows and Linux.
0 Comments
Leave a Reply. |