You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2017/01/31 14:25:18 UTC

svn commit: r1781086 - in /tomcat/native/trunk: native/BUILDING xdocs/index.xml xdocs/miscellaneous/changelog.xml

Author: markt
Date: Tue Jan 31 14:25:18 2017
New Revision: 1781086

URL: http://svn.apache.org/viewvc?rev=1781086&view=rev
Log:
Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=55114
Expand information for building on Windows.

Modified:
    tomcat/native/trunk/native/BUILDING
    tomcat/native/trunk/xdocs/index.xml
    tomcat/native/trunk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/native/trunk/native/BUILDING
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/BUILDING?rev=1781086&r1=1781085&r2=1781086&view=diff
==============================================================================
--- tomcat/native/trunk/native/BUILDING (original)
+++ tomcat/native/trunk/native/BUILDING Tue Jan 31 14:25:18 2017
@@ -15,88 +15,118 @@
   limitations under the License.
 ================================================================================
 
-Prerequisites
--------------
+Linux / Unix / OSX (dynamic linking)
+====================================
 
-You need OpenSSL version 1.0.2 or higher and APR version 1.4.0 or higher.
+1. Prerequisites
 
-Building from source package
------------------------------
+   Install OpenSSL version 1.0.2 or higher
+   Install APR version 1.4.0 or higher.
+   Download and expand the source package or use an svn checkout
 
->  configure --with-apr=apr_install_location --with-ssl=openssl_install_location
->  make
+   > cd native
 
-Building from the svn tree
---------------------------
+2. Configure build environment
 
->  sh buildconf --with-apr=apr_source_location.
->  configure --with-apr=apr_install_location --with-ssl=openssl_install_location
->  make
+   Note: This step is only required if you are building from an svn checkout. It
+         is not required when building from a source package.
 
-Testing the build
------------------
+   >  sh buildconf --with-apr=apr_source_location.
 
-The make should produce a .so file named libtcnative-1.so.
-Build the jar containing the examples by
+3. Build
 
-> cd ..
->  ant jar
-  Run one of the example (the echo one):
->  ant run-echo
+   >  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 (dynamic linking)
+====================================
+
+1. Build static version of OpenSSL 1.0.2 or later
+
+   > ./config --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.4.0 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 svn 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
+ 
+   > c:\cmsc\setenv.bat /x64
+   > nmake -f NMAKEmakefile BUILD_CPU=x64 APR_DECLARE_STATIC=1
+   
+4. Build OpenSSL
+
+   Unpack the OpenSSL source distribution into native\srclib\openssl
+   Apply openssl-msvcrt.patch
+   
+   > c:\cmsc\setenv.bat /x86
+   > perl Configure VC-WIN32
+   > ms\do_nasm
+   > nmake -f ms\nt.mak
+   > move out32 out32-x86
  
-Using it in Tomcat
-------------------
+   > c:\cmsc\setenv.bat /x64
+   > perl Configure VC-WIN64A
+   > ms\do_win64a
+   > nmake -f ms\nt.mak clean
+   > nmake -f ms\nt.mak
+   > move out32 out32-x64
 
-1. In <Connector> use of conf/server.xml:
-   protocol="org.apache.coyote.http11.Http11AprProtocol"
-2. In bin/setenv.sh add the following:
-   CATALINA_OPTS="$CATALINA_OPTS -Djava.library.path=tclib_location"
-   In my machine I am using:
-   /home/jfclere/native/native/.libs for tclib_location
-
-NOTES
------
-  - configure --disable-openssl: Configure without ssl support.
-  - To use it in Tomcat you may have to add in bin/setenv.sh:
-    LD_LIBRARY_PATH=openssl_install_location/lib; export LD_LIBRARY_PATH
-    (use ldd ./.libs/libtcnative-1.so to check it).
-  - quick testing: openssl s_client -connect localhost:8443
-  - For MAC OS X you must manually add a link
-    cd ${tcnative installdir}
-    ln -d libtcnative-1.dylib libtcnative-1.jnilib
-
-
-Building statically linked library on Unixes
---------------------------------------------
-
-To statically link apr and openssl dependencies use the following
-procedure.
-
-You will need to build static version of openssl library.
-
-> ./config --prefix=~/natives/openssl no-shared -fPIC
-> make
-> make install_sw
-
-Note that for Solaris platform you should use -KPIC instead -fPIC
-so that library is compiled with position independent code.
-
-Apr by default builds both static and dynamic libraries.
-
-> ./configure --prefix=~/natives/apr
-> make
-> make install
-
-After that 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.
-
-Build Tomcat native by executing
-
-> ./configure --with-apr=~/natives/apr --with-ssl=~/natives/openssl --prefix=~/natives/tomcat
-> make
-> make install
+5. Build tc-native
 
-That's it. You have just build libtcnative-1.so with statically linked
-apr and openssl.
+   > 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\apr-1.lib WITH_OPENSSL=srclib\openssl\out32-x86 APR_DECLARE_STATIC=1
+ 
+   > c:\cmsc\setenv.bat /x64
+   > nmake -f NMAKEMakefile WITH_APR=srclib\apr\WINXP_X64_LIB_RELEASE\apr-1.lib WITH_OPENSSL=srclib\openssl\out32-x64 APR_DECLARE_STATIC=1
+ 
+   Note: Use ENABLE_OCSP=1 to create OCSP enabled builds

Modified: tomcat/native/trunk/xdocs/index.xml
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/xdocs/index.xml?rev=1781086&r1=1781085&r2=1781086&view=diff
==============================================================================
--- tomcat/native/trunk/xdocs/index.xml (original)
+++ tomcat/native/trunk/xdocs/index.xml Tue Jan 31 14:25:18 2017
@@ -145,23 +145,22 @@ list of changes.
 
 <subsection name="Windows">
   <p>
-   Download the windows sources of tc-native and extract them.
+   Download the Windows sources of tc-native and extract them.
   </p>
   <p>
-    Download OpenSSL sources (See <a href="http://www.openssl.org/related/binaries.html"><b>Binary Distributions</b></a>)
-    OpenSSL is a crypto software so check if you are allowed to download it. If not you can still use tc-native without SSL.
+   Obtain the Windows sources for
+   <a href="http://apr.apache.org/download.cgi">APR</a> and
+   <a href="https://www.openssl.org/source/">OpenSSL</a>. Apply the patches from
+   native/srclib and build APR and OpenSSL for your platform (X86 or X64).  
   </p>
   <p>
-    Download APR sources for Windows. (See <a href="http://apr.apache.org/download.cgi"><b>Download</b></a>)
-    Extract them in jni and rename the apr-1.x.y directory to apr.
+    Build with <source
+>nmake -f NMAKEMakefile WITH_APR=... WITH_OPENSSL=... APR_DECLARE_STATIC=1</source>
   </p>
   <p>
-    Use MS Visual Studio to open the workspace of the APR sources and build the library (libapr).
-  </p>
-  <p>
-    Use MS Visual Studio to open the workspace of the tc-native sources, adjust the OpenSSL includes and libraries location
-    change the name of the libraries libeay32 and libssleay to libeay32MT and libssleayMT and build the tcn-native library.
-    That should create a tcnative-1.dll.
+    More detailed instructions including the steps to create a standard release
+    distribution are provided on the <a
+    href="https://cwiki.apache.org/confluence/display/TOMCAT/Building+the+Tomcat+Native+Connector+binaries+for+Windows">Wiki</a>.
   </p>
 </subsection>
 

Modified: tomcat/native/trunk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/xdocs/miscellaneous/changelog.xml?rev=1781086&r1=1781085&r2=1781086&view=diff
==============================================================================
--- tomcat/native/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/native/trunk/xdocs/miscellaneous/changelog.xml Tue Jan 31 14:25:18 2017
@@ -37,6 +37,10 @@
 <section name="Changes in 1.2.11">
   <changelog>
     <fix>
+      <bug>55114</bug>: Clean up building instructions for the native component
+      and expand the instructions for building for Windows platforms. (markt)
+    </fix>
+    <fix>
       <bug>58082</bug>: Update unit tests to use JUnit 4. Refactor unit tests
       into separate tests and use an external to reference them in the same way
       an external is used to reference the main code. (markt)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org