Compiling OpenSSL for Windows

Short descriptions on how to use the SDK, the build environment and giving hints on some tricky issues.
Post Reply
User avatar
Support Team
Hero Member
Hero Member
Posts: 2521
Joined: 18 Mar 2011, 15:09

Compiling OpenSSL for Windows

Post by Support Team »

Requirements: Common Explanations:
The delivered third-party files (libxml2 and openssl) are just an example of how to use these files in combination with the Unified Automation SDK. These files are not part of the Unified Automation SDK. They are a snapshot of the respective library at the point in time when the dedicated UA SDK was released. It is strongly recommended that you build the third-party files yourself to get the latest updates of these open source libraries.
When compiling OpenSSL on your own you must ensure that you do not use any patent-registered algorithms. To build the Unified Automation SDK with new or updated third-party files, you must adapt the SDK to point to the location of the new compiled third-party files.

Work Order Instructions:
  1. download and install Perl
  2. download the source of latest stable release of OpenSSL
  3. build the third party library (32bit or 64bit)
    Note: use the same Visual Studio or compiler as for the SDK compilation
  4. copy the third party files to the ThirdParty folder within the SDK folder structure
    Note: use the suggestes subfolder names: "win32" and "win64" (see section Third-Party components - Important note for Windows)
  5. use CMake to generate new Visual Studio solution file for the SDK
  6. recompile solution
Creating and Compiling 32Bit Visual Studio NMake Makefiles (Release):
- Start your Visual Studio Command Prompt and locate the unzipped Openssl folder.
- Configure the Makefiles without patent-registered algorithms:

Code: Select all

perl Configure no-idea no-mdc2 no-ntt no-rc5 VC-WIN32 
- Create the Makefiles:

Code: Select all

ms\do_ms.bat 
- Now compile the library with the following order:

Code: Select all

nmake -f ms\ntdll.mak (or "nmake -f ms\nt.mak" for static libraries) 
Creating and Compiling 32Bit Visual Studio NMake Makefiles (Debug):
- Start your Visual Studio Command Prompt and locate the unzipped Openssl folder.
- Configure the Makefiles without patent-registered algorithms:

Code: Select all

perl Configure no-idea no-mdc2 no-ntt no-rc5 VC-WIN32 
- Now locate the "do_ms.bat" file in the ms folder and edit this file like this:

Code: Select all

perl util\mk1mf.pl debug dll no-asm VC-WIN32 >ms\ntdll.mak 
- After that call the batch file:

Code: Select all

ms\do_ms.bat 
- Now you have to edit 2 new files:
- The first file is called "libeay32.def" located in the ms folder. Add a single "d" like here:

Code: Select all

LIBRARY         LIBEAY32d 
- The second file is called "ntdll.mak" located in the ms folder. Edit the "CRYPTO" varibale as follows:

Code: Select all

CRYPTO=libeay32d 
- Compile the library as follows:

Code: Select all

nmake -f ms\ntdll.mak (or "nmake -f ms\nt.mak" for static libraries) 
Creating and Compiling 64Bit Visual Studio NMake Makefiles (Release):
- Start your Visual Studio x64 Win64 Command Prompt and locate the unzipped Openssl folder.
- Configure the Makefiles without patent-registered algorithms:

Code: Select all

perl Configure no-idea no-mdc2 no-ntt no-rc5 VC-WIN64A 
- Create the Makefiles:

Code: Select all

ms\do_win64a.bat 
- Now compile the library with the following order:

Code: Select all

nmake -f ms\ntdll.mak (or "nmake -f ms\nt.mak" for static libraries) 
Creating and Compiling 64Bit Visual Studio NMake Makefiles (Debug):
- Start your Visual Studio x64 Win64 Command Prompt and locate the unzipped Openssl folder.
- Configure the Makefiles without patent-registered algorithms:

Code: Select all

perl Configure no-idea no-mdc2 no-ntt no-rc5 VC-WIN64A 
- Now locate the "do_ms.bat" file in the ms folder and edit this file like this:

Code: Select all

perl util\mk1mf.pl debug dll no-asm VC-WIN64A >ms\ntdll.mak 
- After that call the batch file:

Code: Select all

ms\do_win64a.bat 
- Now you have to edit 2 new files:
- The first file is called "libeay32.def" located in the ms folder. Add a single "d" like here:

Code: Select all

LIBRARY         LIBEAY32d 
- The second file is called "ntdll.mak" located in the ms folder. Edit the "CRYPTO" varibale as follows:

Code: Select all

CRYPTO=libeay32d 
- Compile the library as follows:

Code: Select all

nmake -f ms\ntdll.mak (or "nmake -f ms\nt.mak" for static libraries) 
Best regards
Unified Automation Support Team

Post Reply