Hi,

[I originally sent this patch direct to [EMAIL PROTECTED] - 
following a lack of response, I'm now resending it via rt.  Please let me 
know if I should send it elsewhere or if there's some problem with the 
patch]

The attached patch allows OpenSSL to build with Borland Builder and nasm
on Win32.  Although I've only tested with Builder 5, I see no reason why
Builders 3, 4 or 6 shouldn't also work.  The Patch is against 0.9.7, but 
should probably apply against any recent version.

A comment regarding each changed file:

x86nasm.pl : Make nasm use 32-bit sections.  The 2-year-old commit comment
from steve indicates he didn't get nasm support to work previously.  Since 
nasm apparently defaults to outputting 16-bit section types, this may be 
the reason.

rand.h : Various files in the tree (crypto/des/rand_key.c, for example)  
include rand.h without including anything that would drag in windows.h and
hence windef.h under Win32.  This causes a problem with the prototype of 
RAND_event, which uses the windows-specific types WPARAM, LPARAM and UINT.  
The patch therefore adds an addition #if defined() protection, checking 
for BASENAMES, a macro which is defined by windef.h, the same file that 
defines these three types.  I don't really follow how other Windows 
environments have been compiling rand_key.c and others without this 
change.

x509.h : This is the change I'm genuinely unsure about.  x509.h includes
asn1.h, but both x509/x_all.c and x509v3/v3_bitst.c reference (via macros)  
struct ASN1_ITEM_st, which is defined not in asn1.h but in asn1t.h.  
Since both files include x509.h, which includes asn1.h, and since asn1t.h
includes asn1.h, I've changed x509.h to include asn1t.h instead of asn1.h.  
Someone who knows the code better may be able to come up with a better
solution.

do_nasm.bat : Change all xx-win32.asm files to xx_win32.asm.  If the
filenames have hyphens in them, this gets interpreted by the dumb borland
linker as an option later on in the build.  Since according to the commit
on x86nasm.pl, nasm never worked anyway under Windows, this change
shouldn't bother anyone.  Also, generate a bcb.mak using mk1mf.pl and
'nasm'.

BC-32.pl : One ugly hack to get around the fact that _stricmp is called 
stricmp by Borland.  Change the assembler to nasm (from nothing), change 
the assembler flags.  Perform the same hyphen->underscore conversion as 
above.

...and that's it.  Apologies if the explanation's on the long side, but 
since it's the first involvement I've had with the project and I'd quite 
like the patch to be applied, I figured I'd better explain myself.  If the 
patch would more appropriately be sent elsewhere, please let me know.  
After this patch, the following instructions will build OpenSSL on a 
machine with perl, builder (including Builder's 'make') and nasm in the 
path:

perl Configure BC-32
ms\do_nasm.bat
make -f ms\bcb.mak

I've only just subscribed to this list, so I don't know if patches are 
preferred as attachments or included directly.  I've therefore attached 
it.

-- 
Jon Bright
Lead Programmer, Silicon Circus Ltd.
http://www.siliconcircus.com

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to