----- Original Message ----- 
From: "Brian Lewis" <br...@lorf.org>
To: <mingw-w64-public@lists.sourceforge.net>
Sent: Tuesday, May 18, 2010 7:57 AM
Subject: [Mingw-w64-public] openssl


> Has anyone built openssl 0.9.8n?

Been bangin' my head against the same wall for more hours than I care to 
admit.
Here's how I've hacked my way through it.

I've persevered with the MSYS shell, where I'm trying to build a static lib. 
Because I'm using the mingw64 cross-compiler (where the gcc executable is 
called 'x86_64-w64-mingw32-gcc.exe') I need to use the os/compile switch 
with ./config.

I don't yet know how to tell the build processs to use 
'x86_64-w64-mingw32-ar.exe' instead of 'ar.exe'  (which doesn't exist), so 
I've cheated and copied 'bin/x86_64-w64-mingw32-ar.exe' to 'bin/ar.exe'.

Here's the ./config command I start with:

./config no-shared no-asm 
os/compiler:x86_64-w64-mingw32-gcc -DDSO_WIN32 -mno-cygwin -DL_ENDIAN 
-fomit-frame-pointer 
 -O3 -D_WIN32_WINNT=0x333

All of those compiler defines and switches are the same as used by the 
32-bit gcc-3.4.5 from mingw.org (which builds openssl-0.9.8n just fine for 
me, btw). I've dropped the '-march=i486' switch, but kept the rest. Does 
anyone know what should be specified for '-march' when using this compiler ?

After running that, I place the following near the beginning (before any 
#includes) of include/openssl/store.h and include/openssl/pem.h:

#if defined(OPENSSL_SYS_WINDOWS)
#include <windows.h>
#undef X509_NAME
#undef X509_EXTENSIONS
#undef X509_CERT_PAIR
#undef PKCS7_ISSUER_AND_SERIAL
#undef OCSP_REQUEST
#undef OCSP_RESPONSE
#endif

And, at the start of engines/e_aep.c:

#ifndef NO_OLDNAMES
#define NO_OLDNAMES
#endif

(The former was based on a posting at 
http://rt.openssl.org/Ticket/Display.html?id=2182&user=guest&pass=guest and 
the latter just fixes a pid_t redefinition error. If NO_OLDNAMES is defined, 
then sys/types.h doesn't typedef the 'pid_t' and there's no problem. I first 
tried a -DNO_OLDNAMES switch in the ./config command, but there are other 
files in the openssl source that want that symbol to be undefined.)

'store.h' (and perhaps also 'pem.h') gets re-generated when running the 
initial ./config command - so don't modify those files until after running 
./config.

Then, in the test/Makefile, add ' -lws2_32 -lgdi32' to LIBDEPS (wherever I 
find an assignment to 'LIBDEPS' in that Makefile).

Thne run 'make', and it's all built !!
'make test' runs fine.

As a final hurdle, 'make install' croaks with:
chmod: changing permissions of `/usr/local/ssl/bin/openssl.new': Bad file 
number

The files is actually called `/usr/local/ssl/bin/openssl.new.exe'. For the 
moment, I'll just manually rename it to 'openssl.exe' and complete the 
installation by hand - there's only a handful of files yet to be installed.

`/usr/local/ssl/bin/openssl.new'If there's something there that helps, 
that's good.

I'll just go back to a fresh install and check that it builds as I've stated 
above (in case I've missed a detail or two). Then I can look at how these 
fixes *ought* to be implemented. (Advice on how that might be done is most 
welcome.)

Cheers,
Rob 


------------------------------------------------------------------------------

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to