Openssl编译与安装

来源:互联网 发布:js array get set 编辑:程序博客网 时间:2024/06/05 22:49

 

 重点参考其中的源码包中的readme

 

 在编译中还是越到了一些问题,其实readme中也提到了。不注意看的话很容易错。

 

看下面说明即可

If you want to compile in the assembly language routines with Visual
 C++, then you will need already mentioned Netwide Assembler binary,
 nasmw.exe or nasm.exe,
to be available on your %PATH%.

 Firstly you should run Configure with platform VC-WIN32:

 > perl Configure VC-WIN32 --prefix=c:\some\openssl\dir

 Where the prefix argument specifies where OpenSSL will be installed to.

 Next you need to build the Makefiles and optionally the assembly
 language files:

 - If you are using NASM then run:

   > ms\do_nasm

 - If you don't want to use the assembly language files at all then run:

   > perl Configure VC-WIN32 no-asm --prefix=c:/some/openssl/dir
   > ms\do_ms

 If you get errors about things not having numbers assigned then check the
 troubleshooting section: you probably won't be able to compile it as it
 stands.

 Then from the VC++ environment at a prompt do:

 > nmake -f ms\ntdll.mak

 If all is well it should compile and you will have some DLLs and
 executables in out32dll. If you want to try the tests then do:
 
 > nmake -f ms\ntdll.mak test


 To install OpenSSL to the specified location do:

 > nmake -f ms\ntdll.mak install

 

在FAQ中找到错误

* Why does the OpenSSL compilation fail on Win32 with VC++?

Sometimes, you may get reports from VC++ command line (cl) that it
can't find standard include files like stdio.h and other weirdnesses.
One possible cause is that the environment isn't correctly set up.
To solve that problem for VC++ versions up to 6, one should run
VCVARS32.BAT which is found in the 'bin' subdirectory of the VC++
installation directory (somewhere under 'Program Files').  For VC++
version 7 (and up?), which is also called VS.NET, the file is called
VSVARS32.BAT instead.
This needs to be done prior to running NMAKE, and the changes are only
valid for the current DOS session.

 

注意点总结:

1 nmake必选在搜索路径中,将D:\Program Files\Microsoft Visual Studio 8\VC\bin加入到path
2 需要有nasmw.exe or nasm.exe在搜索路径中,该文件用于汇编代码的处理

3 有的时候在编的过程中会报错误,通常是cl提示错误,在FAQ中有说明,解决方法是先执行D:\Program Files\Microsoft Visual Studio 8\VC\bin下的VSVARS32.BAT