Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page describes the process for building the Tomcat Native for Windows. Version 2.x onwards makes OpenSSL available to the NIO and NIO2 connectors. Version 1.3.x also provides the native part of the APR/native connector.

Prerequisites

  • Currently supported Windows OS (release builds use a Windows 2022 VM running on VMware)
  • Currently support JDK installed (release builds use Temurin 21.0.7)
  • git (if you wish to build from source)
  • Perl - see OpenSSL build instructions for Windows (release builds use Strawberry Perl 5.40.2001)
  • NASM - see OpenSSL build instructions for Windows (release builds use 2.16.01 included in Strawberry Perl 5.40.2001)
  • Microsoft Visual C compiler (release builds use Visual Studio 2022 17.1.4.1)

Building

While tcnative itself needs to be built built last, we unpack it first because it provides the structure for the build as well as the nmake file for APR.

Obtain the tcnative source from one ofby either:

...

 "c:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
nmake -f NMAKEmakefile CPU=X86 APR_DECLARE_STATIC=1   "c:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"  nmake -f NMAKEmakefile CPU=X64 APR_DECLARE_STATIC=1    cd ..\openssl

OpenSSL 3.0.x and later

Unpack the OpenSSL 3.5.x source distribution in this directory (C:\tomcat-native-2.0.x\native\srclib\openssl).

 "c:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
perl Configure no-shared VC-WIN32
 nmake
mkdir out32-x86
copy libssl.lib out32-x86\
copy libcrypto.lib out32-x86\
copy ossl_static.pdb out32-x86\
copy apps\openssl.exe out32-x86\

nmake clean

"c:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
perl Configure no-shared VC-WIN64A
 nmake
mkdir out32-x64
copy libssl.lib out32-x64\
copy libcrypto.lib out32-x64\
copy ossl_static.pdb out32-x64\
copy apps\openssl.exe out32-x64\

Tomcat Native

Keeping the various libraries in versioned directories saves having to rebuild them next time if the version remains unchanged.    

...