lunedì 3 novembre 2008

How to compile OpenSSL 0.9.8i windows xp for dummies

What you need:

  • Active Perl available from http://www.activestate.com/ActivePerl

  • OpenSSL Source 0.9.8i

  • Visual C++ ( in my case Visual Studio 2008, VC90)

  • Microsoft Windows ( in my case Windows XP SP3)

Now Start

  1. Unpack openssl-0.9.8i.tar.gz in "c:\openssl-0.9.8i"

  2. Make a new directory for target build "c:\openssl-build"

Note: If we don't use the same level for the target director the build fail with error:

.\crypto\cversion.c(105) : error C2220: warning treated as error - no 'object' file generated

.\crypto\cversion.c(105) : warning C4129: 'o' : unrecognized character escape sequence

NMAKE : fatal error U1077: 'cl' : return code '0x2'

Stop.

I have browse various case and the bast case "for me" is use this configuration "c:\openssl-0.9.8i" and "c:\openssl-build"

  1. Open console

  2. Enable visual studio environment variable type:

C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\vsvars32.bat

Go in to source direcory

cd c:\openssl-0.9.8i

  1. Use perl to configure compilation file

perl Configure VC-WIN32 --prefix=c:/openssl-build

Note 1: it's very important type the directory in unix format (c:/openssl-build )and avoid the ms format (c:\openssl-build)

    Note 2: if you wont a software copatible with GPL licensise you don't want IDEA, RC5 and MDC2. Add to config command no-idea no-mdc2 no-rc5
    example :perl Configure no-idea no-mdc2 no-rc5 VC-WIN32 --prefix=c:/openssl-build

  1. Enable masm code type

    ms\do_masm

Compile the dll library type:

    nmake -f ms\ntdll.mak

    or static library

    nmake -f ms\nt.mak

Verify the correct status of lib

    make -f ms\ntdll.mak test or nmake -f ms\nt.mak test

  1. Finally install the lib in target directory (c:/openssl-build)

    make -f ms\ntdll.mak install or nmake -f ms\nt.mak install

Move in your project the target directory

  1. Delete c:/openssl-build and c:\openssl-0.9.8i

Good work








1 commento:

Soccer Man ha detto...

Well, it went good execept for the last instruction:

"Move in your project the target directory' I don't know what that means. Right now in the build directory I have 3 folders and 1 exe:

Dir - bin: with two dll files and an openssl.exe file.

Dir - Include: which contains an openss directory with a lot of header files.

Dir - lib: which has two lib files
1) libeay32.lib
2) ssleay32.lib

finally I have the program called openssl Speeddial.

What am I supposed to do with all of this before I delete the version and build directories?