User Tools

Site Tools


c:build:build-openssl-statically-on-windows-vs2017

This is an old revision of the document!


Prerequisites

  1. Download and install strawberryperl
  2. Add it to the system environment PATH variable
  3. Download and install nasm
  4. Add it to the system environment PATH variable
  5. Download openssl sources
  6. Extract it to a folder - D:\OpenSSL
  7. Open Visual Studio 2017 native tools x86 (or x64 to build 64 bit library)
  8. cd D:\OpenSSL
  9. cpan -i TextTemplate - cpan -i TestMore
  10. mkdir out
  11. mkdir out\SSL

Win 32 static debug build

perl Configure debug-VC-WIN32 no-shared --debug zlib enable-zlib --with-zlib-include=D:/zlib --with-zlib-lib=D:/zlib/zlib.lib --prefix=D:\OpenSSL\out --openssldir=D:\OpenSSL\out\SSL
Configuring OpenSSL version 1.1.1g (0x1010107fL) for debug-VC-WIN32
Using os-specific seed configuration
Creating configdata.pm
Creating makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL file first)         ***
***                                                                ***
**********************************************************************

nmake

Microsoft (R) Program Maintenance Utility Version 14.16.27034.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        "C:\Strawberry\perl\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "include\crypto\bn_conf.h.in" > include\crypto\bn_conf.h
        "C:\Strawberry\perl\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "include\crypto\dso_conf.h.in" > include\crypto\dso_conf.h
        "C:\Strawberry\perl\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "include\openssl\opensslconf.h.in" > include\openssl\opensslconf.h
        "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe" /                   depend && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe" /                   _all

Microsoft (R) Program Maintenance Utility Version 14.16.27034.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Microsoft (R) Program Maintenance Utility Version 14.16.27034.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl  /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MDd /W3 /wd4090 /nologo /Od /I "." /I "include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSL_CPUID_OBJ" -D"OPENSSL_BN_ASM_PART_WORDS" -D"OPENSSL_IA32_SSE2" -D"OPENSSL_BN_ASM_MONT" -D"OPENSSL_BN_ASM_GF2m" -D"SHA1_ASM" -D"SHA256_ASM" -D"SHA512_ASM" -D"RC4_ASM" -D"MD5_ASM" -D"RMD160_ASM" -D"AESNI_ASM" -D"VPAES_ASM" -D"WHIRLPOOL_ASM" -D"GHASH_ASM" -D"ECP_NISTZ256_ASM" -D"POLY1305_ASM" -D"OPENSSLDIR=\"D:\\OpenSSL\\out\\SSL\"" -D"ENGINESDIR=\"D:\\OpenSSL\\out\\lib\\engines-1_1\"" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -D"OPENSSL_USE_APPLINK"  -c /Foapps\app_rand.obj "apps\app_rand.c"
app_rand.c
        cl  /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MDd /W3 /wd4090 /nologo /Od /I "." /I "include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSL_CPUID_OBJ" -D"OPENSSL_BN_ASM_PART_WORDS" -D"OPENSSL_IA32_SSE2" -D"OPENSSL_BN_ASM_MONT" -D"OPENSSL_BN_ASM_GF2m" -D"SHA1_ASM" -D"SHA256_ASM" -D"SHA512_ASM" -D"RC4_ASM" -D"MD5_ASM" -D"RMD160_ASM" -D"AESNI_ASM" -D"VPAES_ASM" -D"WHIRLPOOL_ASM" -D"GHASH_ASM" -D"ECP_NISTZ256_ASM" -D"POLY1305_ASM" -D"OPENSSLDIR=\"D:\\OpenSSL\\out\\SSL\"" -D"ENGINESDIR=\"D:\\OpenSSL\\out\\lib\\engines-1_1\"" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -D"OPENSSL_USE_APPLINK"  /Zs /showIncludes "apps\app_rand.c" 2>&1 > apps\app_rand.d
        cl  /Zi /Fdossl_static.pdb /Gs0 /GF /Gy /MDd /W3 /wd4090 /nologo /Od /I "." /I "include" -D"L_ENDIAN" -D"OPENSSL_PIC" -D"OPENSSL_CPUID_OBJ" -D"OPENSSL_BN_ASM_PART_WORDS" -D"OPENSSL_IA32_SSE2" -D"OPENSSL_BN_ASM_MONT" -D"OPENSSL_BN_ASM_GF2m" -D"SHA1_ASM" -D"SHA256_ASM" -D"SHA512_ASM" -D"RC4_ASM" -D"MD5_ASM" -D"RMD160_ASM" -D"AESNI_ASM" -D"VPAES_ASM" -D"WHIRLPOOL_ASM" -D"GHASH_ASM" -D"ECP_NISTZ256_ASM" -D"POLY1305_ASM" -D"OPENSSLDIR=\"D:\\OpenSSL\\out\\SSL\"" -D"ENGINESDIR=\"D:\\OpenSSL\\out\\lib\\engines-1_1\"" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -D"OPENSSL_USE_APPLINK"  -c /Foapps\apps.obj "apps\apps.c"
apps.c
...
x509_time_test.c
        cl  /Zi /Fdapp.pdb /MDd /Gs0 /GF /Gy /MDd /W3 /wd4090 /nologo /Od /I "include" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -D"OPENSSL_USE_APPLINK"  /Zs /showIncludes "test\x509_time_test.c" 2>&1 > test\x509_time_test.d
        IF EXIST test\x509_time_test.exe.manifest DEL /F /Q test\x509_time_test.exe.manifest
        link /nologo /debug /subsystem:console /opt:ref  /nologo /debug /out:test\x509_time_test.exe @C:\Users\ovidi\AppData\Local\Temp\nmE3EA.tmp
        IF EXIST test\x509_time_test.exe.manifest  mt -nologo -manifest test\x509_time_test.exe.manifest -outputresource:test\x509_time_test.exe
        cl  /Zi /Fdapp.pdb /MDd /Gs0 /GF /Gy /MDd /W3 /wd4090 /nologo /Od /I "include" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -D"OPENSSL_USE_APPLINK"  -c /Fotest\x509aux.obj "test\x509aux.c"
x509aux.c
        cl  /Zi /Fdapp.pdb /MDd /Gs0 /GF /Gy /MDd /W3 /wd4090 /nologo /Od /I "include" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"DEBUG" -D"_DEBUG" -D"OPENSSL_USE_APPLINK"  /Zs /showIncludes "test\x509aux.c" 2>&1 > test\x509aux.d
        IF EXIST test\x509aux.exe.manifest DEL /F /Q test\x509aux.exe.manifest
        link /nologo /debug /subsystem:console /opt:ref  /nologo /debug /out:test\x509aux.exe @C:\Users\ovidi\AppData\Local\Temp\nmE63D.tmp
        IF EXIST test\x509aux.exe.manifest  mt -nologo -manifest test\x509aux.exe.manifest -outputresource:test\x509aux.exe
        "C:\Strawberry\perl\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "apps\CA.pl.in" > "apps\CA.pl"
        "C:\Strawberry\perl\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "apps\tsget.in" > "apps\tsget.pl"
        "C:\Strawberry\perl\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl"  "-omakefile" "tools\c_rehash.in" > "tools\c_rehash.pl"

nmake install

Microsoft (R) Program Maintenance Utility Version 14.16.27034.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe" /                   depend && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe" /                   _build_libs

Microsoft (R) Program Maintenance Utility Version 14.16.27034.0
Copyright (C) Microsoft Corporation.  All rights reserved.


Microsoft (R) Program Maintenance Utility Version 14.16.27034.0
Copyright (C) Microsoft Corporation.  All rights reserved.

*** Installing runtime libraries
*** Installing development files
Copying: ./include/openssl/aes.h to D:/OpenSSL/out/include/openssl/aes.h
Copying: ./include/openssl/asn1.h to D:/OpenSSL/out/include/openssl/asn1.h
Copying: ./include/openssl/asn1_mac.h to D:/OpenSSL/out/include/openssl/asn1_mac.h
Copying: ./include/openssl/asn1err.h to D:/OpenSSL/out/include/openssl/asn1err.h
...
D:\OpenSSL\out\html\man7\ossl_store.html
D:\OpenSSL\out\html\man7\passphrase-encoding.html
D:\OpenSSL\out\html\man7\proxy-certificates.html
D:\OpenSSL\out\html\man7\RAND.html
D:\OpenSSL\out\html\man7\RAND_DRBG.html
D:\OpenSSL\out\html\man7\RSA-PSS.html
D:\OpenSSL\out\html\man7\scrypt.html
D:\OpenSSL\out\html\man7\SM2.html
D:\OpenSSL\out\html\man7\ssl.html
D:\OpenSSL\out\html\man7\X25519.html
D:\OpenSSL\out\html\man7\X448.html -> D:\OpenSSL\out\html\man7\X25519.html
D:\OpenSSL\out\html\man7\x509.html

Output library files (D:\OpenSSL\out\lib):


Win 32 static release build

nmake clean

perl Configure VC-WIN32 no-shared zlib enable-zlib --with-zlib-include=D:/zlib --with-zlib-lib=D:/zlib/zlib.lib --prefix=D:\OpenSSL\out --openssldir=D:\OpenSSL\out\SSL

nmake
nmake install

c/build/build-openssl-statically-on-windows-vs2017.1593543155.txt.gz · Last modified: 2023/07/04 19:36 (external edit)