On 21/05/2012 17:52, Mladen Turk wrote:
> On 05/21/2012 02:05 PM, Mark Thomas wrote:
>> I am trying to build the 1.1.x native connector from trunk so I can test
>> the changes I plan to make to support per socket time outs. I can build
>> using dynamic linking but not statically. What tool chain are folks
>> currently using to build the native connector binaries we currently ship?
>>
>> My current issue relates to statically linking to OpenSSL. I get the
>> same failure with 1.0.c, 0.9.8x and 0.9.8k. I am using:
>> - Visual Studio 6 + SP6
>> - Win 2003 r2 Platform SDK
>> - OpenSSL binaries from http://slproweb.com/products/Win32OpenSSL.html
> 
> If those binaries were not compiled with VS6 you can't statically link
> them. When I build binaries I build both of those (and apr) with the
> same compiler.
> 
> Yeah, it's not trivial task.

:) Got it working!

For the benefit of the archives, I ended up using:
- Visual Studio 6 + SP6
- Win 2003 r2 Platform SDK
- OpenSSL source bundle 0.9.x
- APR 1.4.x src (I used the 1.4.6 tag)
- native source (I used the 1.1.x branch)

OpenSSL 1.x will not work with the VS6 tool chain.

My aim is to build the 64-bit APR/native DLL. 32-bit should be pretty similar.

Stage 1: OpenSSL build
This is pretty close to the OpenSSL docs INSTALL.W64
- Set up the environment to build with the Platform SDK
  %PLATFORM_SDK_HOME%\SetEnv.Cmd /X64 /RETAIL
- Follow the OpenSSL build instructions
  perl Configure VC-WIN64A
  ms\do_win64a
  nmake -f ms\nt.mak

The *.lib files you'll need are in the out32 directory.

Stage 2: Start VS6 in x64 mode
You'll need a batch file that looks something like this:
call "C:\Program Files\PlatformSDK\SetEnv.Cmd" /X64 /RETAIL
start "" "C:\Program Files (x86)\Microsoft Visual 
Studio\Common\MSDev98\Bin\MSDEV.EXE" /useenv

Stage 3: Open the workspace
Depending on where APR is, you'll need to specify paths to the projects

Stage 4: Build APR
Make sure you can build the "apr x64" Release target
You may need to tweak src and library paths.

Stage 5: Create a tcnative x64 target
Copy the Win32 release configuration and name it x64 Release
Add /machine:AMD64 to the link options (you can't remove the I368 option - just 
make sure you add the new one after it)
Tweak the src and library paths as required.

For both stage 4 and 5 you may need to add additional standard libraries. 
Google the linking error you get to figure out which.

HTH,

Mark

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

Reply via email to