File: BUILDING

package info (click to toggle)
tomcat-native 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,956 kB
  • sloc: ansic: 12,920; sh: 3,809; java: 2,432; xml: 709; perl: 327; makefile: 46
file content (158 lines) | stat: -rw-r--r-- 4,997 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
================================================================================
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
================================================================================

Linux / Unix / OSX (dynamic linking)
====================================

1. Prerequisites

   Install OpenSSL version 1.1.1 or higher
   Install APR version 1.6.3 or higher.
   Download and expand the source package or use an git checkout

   > cd native

2. Configure build environment

   Note: This step is only required if you are building from an git checkout. It
         is not required when building from a source package.

   >  sh buildconf --with-apr=apr_source_location.

3. Build

   >  configure --with-apr=apr_install_location --with-ssl=openssl_install_location
   >  make

   This should produce a file named libtcnative-1.so

   Note: To build without SSL support use:
   
   > configure --disable-openssl --with-apr=apr_install_location
   

Linux / Unix / OSX (static linking)
===================================

1. Build static version of OpenSSL 1.1.1 or later

   > ./Configure --prefix=~/natives/openssl no-shared -fPIC
   > make
   > make install_sw

   Note: For the Solaris platform you should use -KPIC instead -fPIC so that the
         library is compiled with position independent code.

2. Build static version of APR 1.6.3 or later

   > ./configure --prefix=~/natives/apr
   > make
   > make install

   Note: APR builds both static and dynamic libraries by default.

3. Ensure the static APR library is used

   Edit the ~/natives/apr/lib/libapr-1.la file and comment or delete the
   following sections: dlname='...' and library_names='...'
   This is needed so that libtool picks the static version of the library.

4. Build tc-native

   > ./configure --with-apr=~/natives/apr --with-ssl=~/natives/openssl --prefix=~/natives/tomcat
   > make
   > make install


Windows
=======

1. Prerequisites

   These steps assume a suitable build environment has been set up.
   https://cwiki.apache.org/confluence/display/TOMCAT/Common+Native+Build+Environment
   
2. Obtain tc-native source

   Download and expand the source package or use an git checkout

3. Build APR

   Unpack the APR source distribution into native\srclib\apr
   Apply apr-enable-ipv6.patch
   
   > c:\cmsc\setenv.bat x86 
   > nmake -f NMAKEmakefile BUILD_CPU=x86 APR_DECLARE_STATIC=1
   > mkdir WINXP_X86_LIB_RELEASE\include
   > mkdir WINXP_X86_LIB_RELEASE\lib
   > xcopy /E include WINXP_X86_LIB_RELEASE\include\
   > copy WINXP_X86_LIB_RELEASE\apr-1.lib WINXP_X86_LIB_RELEASE\lib
   
   > c:\cmsc\setenv.bat x64
   > nmake -f NMAKEmakefile BUILD_CPU=x64 APR_DECLARE_STATIC=1
   > mkdir WINXP_X64_LIB_RELEASE\include
   > mkdir WINXP_X64_LIB_RELEASE\lib
   > xcopy /E include WINXP_X64_LIB_RELEASE\include\
   > copy WINXP_X64_LIB_RELEASE\apr-1.lib WINXP_X64_LIB_RELEASE\lib
   
4. Build OpenSSL

   Unpack the OpenSSL source distribution into native\srclib\openssl
   Apply openssl-msvcrt-3.0.x.patch
   
   > c:\cmsc\setenv.bat x86
   > perl Configure VC-WIN32
   > ms\do_nasm
   > nmake -f ms\nt.mak
   > mkdir release-x86
   > mkdir release-x86\include
   > mkdir release-x86\lib
   > xcopy /E inc32 release-x86\include\
   > copy out32\*.lib release-x86\lib\
 
   > c:\cmsc\setenv.bat x64
   > perl Configure VC-WIN64A
   > ms\do_win64a
   > nmake -f ms\nt.mak clean
   > nmake -f ms\nt.mak
   > mkdir release-x64
   > mkdir release-x64\include
   > mkdir release-x64\lib
   > xcopy /E inc32 release-x64\include\
   > copy out32\*.lib release-x64\lib\

5. Build tc-native

   > SET JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71

   > c:\cmsc\setenv.bat x86
   > nmake -f NMAKEMakefile WITH_APR=srclib\apr\WINXP_X86_LIB_RELEASE WITH_OPENSSL=srclib\openssl\release-x86 APR_DECLARE_STATIC=1
 
   > c:\cmsc\setenv.bat x64
   > nmake -f NMAKEMakefile WITH_APR=srclib\apr\WINXP_X64_LIB_RELEASE WITH_OPENSSL=srclib\openssl\release-x64 APR_DECLARE_STATIC=1
 
   Note: Use ENABLE_OCSP=1 to create OCSP enabled builds


FIPS
====

No additional build steps are required. Configure OpenSSL to use the FIPS
certified provider as the default provider as described in the OpenSSL
documentation:

  https://www.openssl.org/docs/man3.0/man7/fips_module.html