Build differently named 32 and 64 bit binaries for OpenSSL on Windows
Ideas were borrowed from here.
- openssl source: tested with openssl-1.0.2s.tar.gz.
- nasm binary: tested with nasm-2.14.02-win32.zip.
- fnr binary: tested with fnr.zip.
- perl 5: tested with ActivePerl 5.28.1.2801 x64.
- msvc: tested with MSVS 2019 Community Edition.
- openssl build scripts: tested with these scripts.
- Place nasm.exe in C:\local\libs\nasm\bin
- Place fnr.exe in C:\local\libs\fnr\bin
- Install Perl 5 (ActivePerl recommented; it will install to C:\Perl64)
- Extract scripts in openssl_1.0.x_build_scripts.7z to C:\local\temp\openssl
- Extract openssl source to C:\local\temp\openssl (so that source is in C:\local\temp\openssl\openssl-1.0.x)
At this point, the build process can be fully automated by placing these scripts into C:\local\temp\openssl and running Build.bat. The automated scripts makes steps 7 and 8 unnecessary, but they've been added here for convenience and reference, and in case issues with the automated scripts arise in the future.
Steps 7 and 8 require saving these scripts into C:\local\temp\openssl.
-
Build the x64 binaries (scripts assume the above mentioned locations)
- copy the folder openssl-1.0.x to openssl-1.0.x_x64. If the folder already existed, delete it first!
- Use MSVS to replace all occurrences (in openssl-1.0.x_x64 folder) of the text listed below (Open MSVS without a project, Edit -> Find and Replace -> Replace in Files (include subfolders, match case)):
- eay32 -> eay64 (70 occurrences)
- 32dll -> 64dll (23 occurrences)
- openssl.exe -> openssl64.exe (28 occurrences)
- Run Buildx64_1.bat. Should report 'Configured for VC-WIN64A'.
- Use MSVS to replace all occurrences (in openssl-1.0.x_x64 folder) of the following text:
- EAY32 -> EAY64 (2 occurrences)
- 32dll -> 64dll (2 occurrences)
- E_EXE=openssl -> E_EXE=openssl64 (3 occurrences)
- Run Buildx64_2.bat
- Should report 'passed all tests'
- Files will be placed in C:\local\libs\openssl
- Output is libeay64.dll (uses libeay64.lib)
-
Build the x86 binaries (scripts assume the above mentioned locations)
- copy the folder openssl-1.0.x to openssl-1.0.x_x86. If the folder already existed, delete it first!
- Use MSVS to replace all occurrences (in openssl-1.0.x_86 folder) of the following text:
- openssl.exe -> openssl32.exe (28 occurrences)
- Run Buildx64_1.bat
- Should report 'Configured for VC-WIN32'
- Use MSVS to replace all occurrences (in openssl-1.0.x_x86 folder) of the following text:
- E_EXE=openssl -> E_EXE=openssl32 (4 occurrences)
- Run Buildx64_2.bat
- Should report 'passed all tests'
- Files will be placed in C:\local\libs\openssl
- Output is libeay64.dll (uses libeay64.lib)