Hi Christopher,

> -----Original Message-----
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Friday, June 13, 2014 11:36 PM
> To: dev@tomcat.apache.org
> Subject: Building tcnative on win32
> 
> All,
> 
> I've spent some time trying to script a soup-to-nuts repeatable build of
> tcnative on win32. I've made some progress but I'm hitting a few snags
> that perhaps some folks could help with.
> 
> First, I want the script to fetch as much stuff as possible for the user
> instead of relying on a great deal of previously-installed software. My
> current requirements -- other than MSVC++ -- are for wget.exe and
> 7za.exe to be available. If anyone knows how to script an HTTP download
> or a ZIP-decompress from a Windows command-line without either of those
> tools, I'd greatly appreciate some insight.

If you look for a more powerful scripting environment included in Windows than 
cmd.exe, you can take a look at Windows Powershell [1] which has been 
introduced with Vista.
I haven't worked much with Powershell yet so I can't comment on how useful it 
is, but I know that is based on .Net so you should be able to do anything that 
you could do in C#/.Net.

For example, to download a file you should be able to use System.Web.WebClient 
like it is described at [2].
For extracting a ZIP file, you could use 
System.IO.Compression.ZipFile.ExtractToDirectory() as described at [3].


Regards,
Konstantin Preißer


[1] http://en.wikipedia.org/wiki/Windows_PowerShell
[2] 
http://answers.oreilly.com/topic/2006-how-to-download-a-file-from-the-internet-with-windows-powershell/
[3] http://serverfault.com/a/461812


> (This is where I mention that, really, getting anything done on Windows
> that doesn't involve Microsoft Excel and nothing else is absolutely
> excruciating. Running Windows 8 in a VM means that even editing my batch
> script is a challenge, as the meta keys from Mac -> Windows don't match
> up and I feel like I'm learning to type all over again. Sign.)
> 
> We need to patch both openssl and libapr before building them, so we
> need "patch". There's a GNU win32 ports project where I can get
> patch.exe, but its got two problems:
> 
> 1. It needs to be patched (ha!) to *not* require administrator access.
> Why does patch.exe need administrator access to run? Your guess is as
> good as mine.
> 
> 2. It seems to be crashing when I try to actually patch something:
> C:\Users\IEUser\AppData\Local\Temp\build-tcnative\build\openssl-
> 1.0.1h>\Users\IEUser\Desktop\tools\patch.exe
> -i
> ..\tomcat-native-1.1.30-win32-src\jni\native\srclib\openssl\openssl-
> msvcrt.patch
> -p 0 --dry-run
> patching file util/pl/VC-32.pl
> 
> Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354
> 
> This application has requested the Runtime to terminate it in an unusual
> way.
> Please contact the application's support team for more information.
> 
> If anyone knows of a good "patch" program for win32, I'd really
> appreciate that, too.
> 
> I've gotten some help from the apr folks with building APR on win32 as
> well. Their instructions on the web site are outright lies, but it seems
> that instructions that can be found elsewhere (like in the source
> distro) that are significantly less complicated (e.g. "run nmake") and
> seem to work. I have to get apr building against OpenSSL but that is
> apparently fairly trivial. Once I get get those beasts built, I can
> follow Mladen's instructions for building tcnative which are fairly
> straightforward.
> 
> Ultimately, my goal is to get a script that can be maintained that does
> the following:
> 1. Obtains all sources necessary (openssl, apr, tcnative)
> 2. Patches all sources as necessary
> 3. Builds each component
> 4. Produces a statically-linked binary for distribution
> 
> Does anyone know why we bother with a statically-linked tcnative.dll
> rather than just shipping a "regular" DLL and have users provide their
> own apr.dll and openssl.dll? It seems like it might be easier if we
> didn't have to build everything ourselves. Also, for things like
> "upgrading OpenSSL", it would often be a drop-in replacement instead of
> having to re-build everything from scratch.
> 
> Thanks,
> -chris


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

Reply via email to