1.å¦ä½å¨ Windows ä¸ç¼è¯ OpenSSL
2.å¦ä½å¨Windowsä¸ç¼è¯OpenSSL
å¦ä½å¨ Windows ä¸ç¼è¯ OpenSSL
å¦ä½å¨Windowsä¸ç¼è¯OpenSSL ï¼VS使ç¨VCçclç¼è¯å¨ï¼
1ãå®è£ ActivePerl//åå§åçæ¶å,源码hadoop源码剖析éè¦ç¨å°perl解éå¨
2ã使ç¨VSä¸çVisual Studio Command Promptè¿å ¥æ§å¶å°æ¨¡å¼ï¼è¿ä¸ªæ¨¡å¼ä¼èªå¨è®¾ç½®åç§ç¯å¢åéï¼
3ã解å缩opensslçå ,è¿å ¥opensslçç®å½
4ãperl configure VC-WIN
å°½éå¨è¿ä¸ªç®å½ä¸æ§è¡è¯¥å½ä»¤ï¼å¦åæ¾ä¸å°Configureæ件ï¼æè æå®å®æ´çConfigureæ件路å¾ã
5ãms\do_ms.bat
å¨è§£åç®å½ä¸æ§è¡ms\do_ms.batå½ä»¤
6ãnmake -f ms\ntdll.mak
7ãnmake -f ms\nt.mak
ç¼è¯å
å¨openssl解åç®å½ä¸æ§è¡ï¼å®æç¼è¯åãè¾åºçæ件å¨outdll (6), out (7)éé¢ï¼å æ¬åºç¨ç¨åºçå¯æ§è¡æ件ãlibæ件ådllæ件
注æï¼å¨è¿è¡ç¬¬äºæ¥æ¶ï¼clç¼è¯å¨ä¼æ±æ¨è¯´.\crypto\des\enc_read.cæ件çreadæ¯The POSIX name for this item is deprecatedï¼ä¸è¢«æ¨èçï¼ï¼å»ºè®®ä½¿ç¨_readãåµåµï¼æå¯ä¸æ³å°OpenSSLä¸çææçreadå½æ°ä¿®æ¹ä¸º_readãåçclçé误代ç error Cï¼äºæ¯ä¸MSDNä¸æ¥æ¾ï¼
warning treated as error - no object file generated
/WX tells the compiler to treat all warnings as errors. Since an error occurred, no object or executable file was generated.
æ¯ç±äºè®¾ç½®äº/WXé项ï¼å°ææçè¦åé½ä½ä¸ºéè¯¯å¯¹å¾ ï¼æ以ããã
äºæ¯æå¼OpenSSLç®å½ä¸çMSç®å½ä¸çntdll.makæ件ï¼å°CFLAGç/WXé项å»æï¼åçããã
继ç»æ§è¡nmake -f ms\ntdll.mak
=================================
ä¸ãç¼è¯å¹¶å®è£ OpenSSL
1ãæç §æ åæ¥éª¤ä»æºä»£ç ç¼è¯å®è£ OpenSSL
å¨ç¼è¯OpenSSLåï¼éè¦æ£ç¡®å®è£ Perlï¼å 为å¨ç¼è¯OpenSSLæ¶éè¦ä½¿ç¨å°è¯¥ç¨åºã
ä¸è½½ææ°çæ¬çPerlç¶åå®è£ ä¹ã
ä¸è½½ææ°çæ¬çOpenSSL
ç¶åå°æºç 解å缩å°æ个ç®å½ï¼å¦ C:\openssl-0.9.8jï¼ä¸ã
è¿å ¥opensslæºç ç®å½ã
cd c:\openssl-1.0.1e
以ä¸ä¸ºåç §è¯¥ç®å½ä¸çæ件INSTALL.Wçæ§è¡è¿ç¨ï¼
è¿è¡configureï¼
perl Configure VC-WIN
å建Makefileæ件ï¼
ms\do_ms.bat
ç¼è¯å¨æåºï¼
nmake -f ms\ntdll.mak
ç¼è¯éæåºï¼
nmake -f ms\nt.mak
æµè¯å¨æåºï¼
nmake -f ms\ntdll.mak test
æµè¯éæåºï¼
nmake -f ms\nt.mak test
å®è£ å¨æåºï¼
nmake -f ms\ntdll.mak install
å®è£ éæåºï¼
nmake -f ms\nt.mak install
æ¸ é¤ä¸æ¬¡å¨æåºçç¼è¯ï¼ä»¥ä¾¿éæ°ç¼è¯ï¼
nmake -f ms\ntdll.mak clean
æ¸ é¤ä¸æ¬¡éæåºçç¼è¯ï¼ä»¥ä¾¿éæ°ç¼è¯ï¼
nmake -f ms\nt.mak clean
2ãå¦æå«éº»ç¦ï¼ä¸æ³ç¼è¯ï¼å¯ä»¥ç´æ¥ç¨å«äººå好çwindows OpenSSL å®è£ å ï¼æç¨çæ¯0.9.8jçï¼ï¼
å¯ä»¥ä¸è½½ OpenSSL for Windowsï¼ç´æ¥å®è£ ã
P.S. OpenSSL for Windows çæºä»£ç æä¸äºæ°æ®ç±»ååVC6çç¼è¯å¨ä¸å ¼å®¹ï¼æåç°çä¸å ¼å®¹çæ°æ®ç±»åå¦ä¸ï¼
å¨OpenSSLå®è£ ç®å½çä¸çinclude/bn.hæ件ä¸ï¼å°
#define BN_ULLONG unsigned long long
#define BN_ULONG unsigned long long
#define BN_LONG long long
åå«ä¿®æ¹ä¸ºï¼
#define BN_ULLONG ULONGLONG
#define BN_ULONG ULONGLONG
#define BN_LONG LONGLONG
å¦åï¼ä¼åºç°ç¼è¯é误ã
äºã使ç¨OpenSSL
å¨VCä¸é 置使ç¨ä»¥ä¸çå½æ°åºï¼
ç¹å»èåï¼Tools -> Optionsï¼å¼¹åºå¯¹è¯æ¡"Options"ï¼å¨è¯¥å¯¹è¯æ¡ä¸éæ©"Directories"æ ç¾ã
å¨"Show directories for:"ç"Include files"é项ä¸æ°å¢ç®å½"C:\openssl\include"ï¼
"Library files"éæ©ä¸æ°å¢ç®å½"C:\openssl\lib"ã
ç¶åå¨éè¦é¾æ¥OpenSSLå½æ°åºçå·¥ç¨ä¸å å ¥å¦ä¸ä¸¤å¥ï¼
#pragma comment(lib, "ssleay.lib")
#pragma comment(lib, "libeay.lib")
å ¶ä½ç¨æ¯å°OpenSSLæéçåºå¯¼å ¥å·¥ç¨ä¸ã
ä¸ãé®é¢
æå¨é¾æ¥OpenSSLçéæå½æ°åºæ¶éå°ç±»ä¼¼ä»¥ä¸çé®é¢ï¼
Linking...
msvcrt.lib(MSVCRT.dll) : error LNK: _strchr already defined in libcmtd.lib(strchr.obj)
...
è¿æ¯ç±äºOpenSSLçéæå½æ°åºä½¿ç¨çæ¯äºVCçå¤çº¿ç¨DLLçReleaseçæ¬ï¼èæçç¨åºä½¿ç¨äºå¤çº¿ç¨éæé¾æ¥çReleaseçæ¬ã
è°æ´OpenSSLçéæå½æ°åºä½¿ç¨çåºå½æ°çæ¬å³å¯ï¼è°æ´è¿ç¨å¦ä¸ï¼
ç¼è¾æ件 ms\nt.makï¼å°è¯¥æ件第è¡
"CFLAG= /MD /Ox /O2 /Ob2 /W3 /WX /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN -DWIN_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN -D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE /Fdout -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_TLSEXT -DOPENSSL_NO_KRB5 -
DOPENSSL_NO_DYNAMIC_ENGINE"
ä¸ç"/MD"ä¿®æ¹ä¸º"/MT"ãç¶åéæ°ç¼è¯å®è£ OpenSSLå³å¯ã
åãéå½ï¼å¨VCä¸å¯¹C/C++ è¿è¡æ¶åºä¸åçæ¬ç¼è¯æ令说æ
ãå¨VCä¸å¯¹C/C++ è¿è¡æ¶åºä¸åçæ¬ç¼è¯æ令说æãä¸æä¸è¯¦ç»ä»ç»äºè¿æ¥ä¸åçæ¬åºçç¼è¯æ令å¦ä¸ï¼
C Runtime Libraryï¼
/MD MSVCRT.LIB å¤çº¿ç¨DLLçReleaseçæ¬
/MDd MSVCRTD.LIB å¤çº¿ç¨DLLçDebugçæ¬
/MT LIBCMT.LIB å¤çº¿ç¨éæé¾æ¥çReleaseçæ¬
/MTd LIBCMTD.LIB å¤çº¿ç¨éæé¾æ¥çDebugçæ¬
/clr MSVCMRT.LIB æ管代ç åéæ管代ç æ··å
/clr:pure MSVCURT.LIB 纯æ管代ç
C++ Standard Libraryï¼
/MD MSVCPRT.LIB å¤çº¿ç¨DLLçReleaseçæ¬
/MDd MSVCPRTD.LIB å¤çº¿ç¨DLLçDebugçæ¬
/MT LIBCPMT.LIB å¤çº¿ç¨éæé¾æ¥çReleaseçæ¬
/MTd LIBCPMTD.LIB å¤çº¿ç¨éæé¾æ¥çDebugçæ¬
===============================================
ä¸ é ç½®ç¼è¯åæ°
é ç½®ç¼è¯åæ°æ¯è¿è¡OpenSSLç¼è¯ç第ä¸æ¥,è¿ä¸æ¥å¯ä»¥ç¡®å®ç³»ç»çç¯å¢,使ç¨ä»ä¹ç¼è¯å¨,é»è®¤å®è£ è·¯å¾ä»¥åå ¶ä»ä¸äºé项.æ¥éª¤å¦ä¸:
1.å®è£ perl:ä¸è½½ActivePerl-5.8.8.-MSWin-x-.msi,ç¶åç¹å»msiæ件è¿è¡å®è£ !
2..é ç½®ç¼è¯åæ°:ä¸è½½openssl-1.0.1e.tar.gz,解å.
vc:é¦å å¨C:\Program Files\Microsoft Visual Studio .NET \VC\bin\ç®å½ä¸æ§è¡vcvars.bat,ç¶åå¨è§£ååçopenssl-1.0.1eç®å½,æ§è¡å½ä»¤é ç½®ç¼è¯åæ°:perl Configure VC-WIN
bc:å¨è§£ååçopenssl-0.9.8gç®å½ä¸æ§è¡:perl Configure BC-
äº çææ¹å¤çæ件
å¨ä½¿ç¨configureèæ¬é 置好çç¼è¯åæ°å,å°±å¯ä»¥ä½¿ç¨æ¹å¤çå½ä»¤æ¥çæç¼è¯èæ¬.çæç¼è¯èæ¬æ ¹æ®éç¨ç¼è¯å¨çä¸åé常使ç¨ä¸åçæ¹å¤çæ件.å°±ç®åæ¥è¯´,使ç¨vcç¼è¯çæ¶åæä¸ç§éæ©:do_ms,do_masmådo_nasmæ¥å建ä¸ç³»åç¼è¯èæ¬æ件,å³.makèæ¬.æ¥éª¤å¦ä¸:
vc:å¨openssl-1.0.1eç®å½ä¸,æ§è¡å½ä»¤æ¥æ¹å¤çæ件:do_ms,do_masmådo_nasm
bc:1.ä¸è½½nsm.zip微软æ±ç¼ç¼è¯å¨,解å,æ·è´å°c:/windowsç®å½ä¸,ä¿®æ¹å称为nasmw.exe;2.å¨openssl-1.0.1eç®å½ä¸,æ§è¡å½ä»¤æ¥æ¹å¤çæ件:ms\do_nasm
ä¸ ä»£ç ç¼è¯
vc:
å®æä¸é¢æ¥éª¤å,å¯ä»¥çå°ä¸¤ä¸ªå ³é®èæ¬æ件:nt.makåntdll.mak.å¦ææ们éè¦ç¼è¯åçOpenSSLåºæ¯æ¯æå¨æDLLå½¢å¼ç,é£ä¹åºè¯¥ä½¿ç¨ntddll.makæ件è¿è¡ç¼è¯,è¿æ ·ç¼è¯å®ææ们ä¼å¾å°å个ä¸OpenSSLçAPIåºæå ³æ件:ssleay.lib,libeay.lib,ssleay.dllålibeay.dll.æ§è¡çç¼è¯å½ä»¤å½¢å¼å¦ä¸:nmake -f ms\ntdll.mak
å¦æä¸å¸æ以å¨æåºçå½¢å¼ä½¿ç¨OpenSSL,é£ä¹å¯ä»¥ä½¿ç¨nt.makæ件è¿è¡ç¼è¯.è¿æ ·ç¼è¯å使ç¨OpenSSLçæ¶å,åç´æ¥å°ä»£ç é¾æ¥è¿æ们çç¨åºéé¢.æ§è¡å½ä»¤å¦ä¸:nmake -f ms\nt.mak
bc:æ§è¡å½ä»¤æ¥å®æ代ç ç¼è¯:make -f ms\bcb.mak
å ELSE
1)
æµè¯å¨æåºï¼
nmake -f ms\ntdll.mak test
æµè¯éæåºï¼
nmake -f ms\nt.mak test
å®è£ å¨æåºï¼
nmake -f ms\ntdll.mak install
å®è£ éæåºï¼
nmake -f ms\nt.mak install
æ¸ é¤ä¸æ¬¡å¨æåºçç¼è¯ï¼ä»¥ä¾¿éæ°ç¼è¯ï¼
nmake -f ms\ntdll.mak clean
æ¸ é¤ä¸æ¬¡éæåºçç¼è¯ï¼ä»¥ä¾¿éæ°ç¼è¯ï¼
nmake -f ms\nt.mak clean
2)
使ç¨OpenSSL
å¨VCä¸é 置使ç¨ä»¥ä¸çå½æ°åºï¼
ç¹å»èåï¼Tools -> Optionsï¼å¼¹åºå¯¹è¯æ¡"Options"ï¼å¨è¯¥å¯¹è¯æ¡ä¸éæ©"Directories"æ ç¾ã
å¨"Show directories for:"ç"Include files"é项ä¸æ°å¢ç®å½"C:\openssl\include"ï¼"Library files"éæ©ä¸æ°å¢ç®å½"C:\openssl\lib"ã
ç¶åå¨éè¦é¾æ¥OpenSSLå½æ°åºçå·¥ç¨ä¸ç¼è¯æ¶å å ¥"libeay.lib"å°±å¯ä»¥äºã
å¦ä½å¨Windowsä¸ç¼è¯OpenSSL
å¦ä½å¨Windowsä¸ç¼è¯OpenSSL ï¼VS使ç¨VCçclç¼è¯å¨ï¼
1ãå®è£ ActivePerl//åå§åçæ¶å,éè¦ç¨å°perl解éå¨
2ã使ç¨VSä¸çVisual Studio Command Promptè¿å ¥æ§å¶å°æ¨¡å¼ï¼è¿ä¸ªæ¨¡å¼ä¼èªå¨è®¾ç½®åç§ç¯å¢åéï¼
3ã解å缩opensslçå ,è¿å ¥opensslçç®å½
4ãperl configure VC-WIN
å°½éå¨è¿ä¸ªç®å½ä¸æ§è¡è¯¥å½ä»¤ï¼å¦åæ¾ä¸å°Configureæ件ï¼æè æå®å®æ´çConfigureæ件路å¾ã
5ãms\do_ms.bat
å¨è§£åç®å½ä¸æ§è¡ms\do_ms.batå½ä»¤
6ãnmake -f ms\ntdll.mak
7ãnmake -f ms\nt.mak
ç¼è¯å
å¨openssl解åç®å½ä¸æ§è¡ï¼å®æç¼è¯åãè¾åºçæ件å¨outdll (6), out (7)éé¢ï¼å æ¬åºç¨ç¨åºçå¯æ§è¡æ件ãlibæ件ådllæ件
注æï¼å¨è¿è¡ç¬¬äºæ¥æ¶ï¼clç¼è¯å¨ä¼æ±æ¨è¯´.\crypto\des\enc_read.cæ件çreadæ¯The POSIX name for this item is deprecatedï¼ä¸è¢«æ¨èçï¼ï¼å»ºè®®ä½¿ç¨_readãåµåµï¼æå¯ä¸æ³å°OpenSSLä¸çææçreadå½æ°ä¿®æ¹ä¸º_readãåçclçé误代ç error Cï¼äºæ¯ä¸MSDNä¸æ¥æ¾ï¼
warning treated as error - no object file generated
/WX tells the compiler to treat all warnings as errors. Since an error occurred, no object or executable file was generated.
æ¯ç±äºè®¾ç½®äº/WXé项ï¼å°ææçè¦åé½ä½ä¸ºéè¯¯å¯¹å¾ ï¼æ以ããã
äºæ¯æå¼OpenSSLç®å½ä¸çMSç®å½ä¸çntdll.makæ件ï¼å°CFLAGç/WXé项å»æï¼åçããã
继ç»æ§è¡nmake -f ms\ntdll.mak
=================================
ä¸ãç¼è¯å¹¶å®è£ OpenSSL
1ãæç §æ åæ¥éª¤ä»æºä»£ç ç¼è¯å®è£ OpenSSL
å¨ç¼è¯OpenSSLåï¼éè¦æ£ç¡®å®è£ Perlï¼å 为å¨ç¼è¯OpenSSLæ¶éè¦ä½¿ç¨å°è¯¥ç¨åºã
ä¸è½½ææ°çæ¬çPerlç¶åå®è£ ä¹ã
ä¸è½½ææ°çæ¬çOpenSSL
ç¶åå°æºç 解å缩å°æ个ç®å½ï¼å¦ C:\openssl-0.9.8jï¼ä¸ã
è¿å ¥opensslæºç ç®å½ã
cd c:\openssl-1.0.1e
以ä¸ä¸ºåç §è¯¥ç®å½ä¸çæ件INSTALL.Wçæ§è¡è¿ç¨ï¼
è¿è¡configureï¼
perl Configure VC-WIN
å建Makefileæ件ï¼
ms\do_ms.bat
ç¼è¯å¨æåºï¼
nmake -f ms\ntdll.mak
ç¼è¯éæåºï¼
nmake -f ms\nt.mak
æµè¯å¨æåºï¼
nmake -f ms\ntdll.mak test
æµè¯éæåºï¼
nmake -f ms\nt.mak test
å®è£ å¨æåºï¼
nmake -f ms\ntdll.mak install
å®è£ éæåºï¼
nmake -f ms\nt.mak install
æ¸ é¤ä¸æ¬¡å¨æåºçç¼è¯ï¼ä»¥ä¾¿éæ°ç¼è¯ï¼
nmake -f ms\ntdll.mak clean
æ¸ é¤ä¸æ¬¡éæåºçç¼è¯ï¼ä»¥ä¾¿éæ°ç¼è¯ï¼
nmake -f ms\nt.mak clean
2ãå¦æå«éº»ç¦ï¼ä¸æ³ç¼è¯ï¼å¯ä»¥ç´æ¥ç¨å«äººå好çwindows OpenSSL å®è£ å ï¼æç¨çæ¯0.9.8jçï¼ï¼
å¯ä»¥ä¸è½½ OpenSSL for Windowsï¼ç´æ¥å®è£ ã
P.S. OpenSSL for Windows çæºä»£ç æä¸äºæ°æ®ç±»ååVC6çç¼è¯å¨ä¸å ¼å®¹ï¼æåç°çä¸å ¼å®¹çæ°æ®ç±»åå¦ä¸ï¼
å¨OpenSSLå®è£ ç®å½çä¸çinclude/bn.hæ件ä¸ï¼å°
#define BN_ULLONG unsigned long long
#define BN_ULONG unsigned long long
#define BN_LONG long long
åå«ä¿®æ¹ä¸ºï¼
#define BN_ULLONG ULONGLONG
#define BN_ULONG ULONGLONG
#define BN_LONG LONGLONG
å¦åï¼ä¼åºç°ç¼è¯é误ã
äºã使ç¨OpenSSL
å¨VCä¸é 置使ç¨ä»¥ä¸çå½æ°åºï¼
ç¹å»èåï¼Tools -> Optionsï¼å¼¹åºå¯¹è¯æ¡"Options"ï¼å¨è¯¥å¯¹è¯æ¡ä¸éæ©"Directories"æ ç¾ã
å¨"Show directories for:"ç"Include files"é项ä¸æ°å¢ç®å½"C:\openssl\include"ï¼
"Library files"éæ©ä¸æ°å¢ç®å½"C:\openssl\lib"ã
ç¶åå¨éè¦é¾æ¥OpenSSLå½æ°åºçå·¥ç¨ä¸å å ¥å¦ä¸ä¸¤å¥ï¼
#pragma comment(lib, "ssleay.lib")
#pragma comment(lib, "libeay.lib")
å ¶ä½ç¨æ¯å°OpenSSLæéçåºå¯¼å ¥å·¥ç¨ä¸ã
ä¸ãé®é¢
æå¨é¾æ¥OpenSSLçéæå½æ°åºæ¶éå°ç±»ä¼¼ä»¥ä¸çé®é¢ï¼
Linking...
msvcrt.lib(MSVCRT.dll) : error LNK: _strchr already defined in libcmtd.lib(strchr.obj)
...
è¿æ¯ç±äºOpenSSLçéæå½æ°åºä½¿ç¨çæ¯äºVCçå¤çº¿ç¨DLLçReleaseçæ¬ï¼èæçç¨åºä½¿ç¨äºå¤çº¿ç¨éæé¾æ¥çReleaseçæ¬ã
è°æ´OpenSSLçéæå½æ°åºä½¿ç¨çåºå½æ°çæ¬å³å¯ï¼è°æ´è¿ç¨å¦ä¸ï¼
ç¼è¾æ件 ms\nt.makï¼å°è¯¥æ件第è¡
"CFLAG= /MD /Ox /O2 /Ob2 /W3 /WX /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN -DWIN_LEAN_AND_MEAN -DL_ENDIAN -DDSO_WIN -D_CRT_SECURE_NO_DEPRECATE -
D_CRT_NONSTDC_NO_DEPRECATE /Fdout -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_SEED -DOPENSSL_NO_RC5 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_TLSEXT -DOPENSSL_NO_KRB5 -
DOPENSSL_NO_DYNAMIC_ENGINE"
ä¸ç"/MD"ä¿®æ¹ä¸º"/MT"ãç¶åéæ°ç¼è¯å®è£ OpenSSLå³å¯ã
åãéå½ï¼å¨VCä¸å¯¹C/C++ è¿è¡æ¶åºä¸åçæ¬ç¼è¯æ令说æ
ãå¨VCä¸å¯¹C/C++ è¿è¡æ¶åºä¸åçæ¬ç¼è¯æ令说æãä¸æä¸è¯¦ç»ä»ç»äºè¿æ¥ä¸åçæ¬åºçç¼è¯æ令å¦ä¸ï¼
C Runtime Libraryï¼
/MD MSVCRT.LIB å¤çº¿ç¨DLLçReleaseçæ¬
/MDd MSVCRTD.LIB å¤çº¿ç¨DLLçDebugçæ¬
/MT LIBCMT.LIB å¤çº¿ç¨éæé¾æ¥çReleaseçæ¬
/MTd LIBCMTD.LIB å¤çº¿ç¨éæé¾æ¥çDebugçæ¬
/clr MSVCMRT.LIB æ管代ç åéæ管代ç æ··å
/clr:pure MSVCURT.LIB 纯æ管代ç
C++ Standard Libraryï¼
/MD MSVCPRT.LIB å¤çº¿ç¨DLLçReleaseçæ¬
/MDd MSVCPRTD.LIB å¤çº¿ç¨DLLçDebugçæ¬
/MT LIBCPMT.LIB å¤çº¿ç¨éæé¾æ¥çReleaseçæ¬
/MTd LIBCPMTD.LIB å¤çº¿ç¨éæé¾æ¥çDebugçæ¬
===============================================
ä¸ é ç½®ç¼è¯åæ°
é ç½®ç¼è¯åæ°æ¯è¿è¡OpenSSLç¼è¯ç第ä¸æ¥,è¿ä¸æ¥å¯ä»¥ç¡®å®ç³»ç»çç¯å¢,使ç¨ä»ä¹ç¼è¯å¨,é»è®¤å®è£ è·¯å¾ä»¥åå ¶ä»ä¸äºé项.æ¥éª¤å¦ä¸:
1.å®è£ perl:ä¸è½½ActivePerl-5.8.8.-MSWin-x-.msi,ç¶åç¹å»msiæ件è¿è¡å®è£ !
2..é ç½®ç¼è¯åæ°:ä¸è½½openssl-1.0.1e.tar.gz,解å.
vc:é¦å å¨C:\Program Files\Microsoft Visual Studio .NET \VC\bin\ç®å½ä¸æ§è¡vcvars.bat,ç¶åå¨è§£ååçopenssl-1.0.1eç®å½,æ§è¡å½ä»¤é ç½®ç¼è¯åæ°:perl Configure VC-WIN
bc:å¨è§£ååçopenssl-0.9.8gç®å½ä¸æ§è¡:perl Configure BC-
äº çææ¹å¤çæ件
å¨ä½¿ç¨configureèæ¬é 置好çç¼è¯åæ°å,å°±å¯ä»¥ä½¿ç¨æ¹å¤çå½ä»¤æ¥çæç¼è¯èæ¬.çæç¼è¯èæ¬æ ¹æ®éç¨ç¼è¯å¨çä¸åé常使ç¨ä¸åçæ¹å¤çæ件.å°±ç®åæ¥è¯´,使ç¨vcç¼è¯çæ¶åæä¸ç§éæ©:do_ms,do_masmådo_nasmæ¥å建ä¸ç³»åç¼è¯èæ¬æ件,å³.makèæ¬.æ¥éª¤å¦ä¸:
vc:å¨openssl-1.0.1eç®å½ä¸,æ§è¡å½ä»¤æ¥æ¹å¤çæ件:do_ms,do_masmådo_nasm
bc:1.ä¸è½½nsm.zip微软æ±ç¼ç¼è¯å¨,解å,æ·è´å°c:/windowsç®å½ä¸,ä¿®æ¹å称为nasmw.exe;2.å¨openssl-1.0.1eç®å½ä¸,æ§è¡å½ä»¤æ¥æ¹å¤çæ件:ms\do_nasm
ä¸ ä»£ç ç¼è¯
vc:
å®æä¸é¢æ¥éª¤å,å¯ä»¥çå°ä¸¤ä¸ªå ³é®èæ¬æ件:nt.makåntdll.mak.å¦ææ们éè¦ç¼è¯åçOpenSSLåºæ¯æ¯æå¨æDLLå½¢å¼ç,é£ä¹åºè¯¥ä½¿ç¨ntddll.makæ件è¿è¡ç¼è¯,è¿æ ·ç¼è¯å®ææ们ä¼å¾å°å个ä¸OpenSSLçAPIåºæå ³æ件:ssleay.lib,libeay.lib,ssleay.dllålibeay.dll.æ§è¡çç¼è¯å½ä»¤å½¢å¼å¦ä¸:nmake -f ms\ntdll.mak
å¦æä¸å¸æ以å¨æåºçå½¢å¼ä½¿ç¨OpenSSL,é£ä¹å¯ä»¥ä½¿ç¨nt.makæ件è¿è¡ç¼è¯.è¿æ ·ç¼è¯å使ç¨OpenSSLçæ¶å,åç´æ¥å°ä»£ç é¾æ¥è¿æ们çç¨åºéé¢.æ§è¡å½ä»¤å¦ä¸:nmake -f ms\nt.mak
bc:æ§è¡å½ä»¤æ¥å®æ代ç ç¼è¯:make -f ms\bcb.mak
å ELSE
1)
æµè¯å¨æåºï¼
nmake -f ms\ntdll.mak test
æµè¯éæåºï¼
nmake -f ms\nt.mak test
å®è£ å¨æåºï¼
nmake -f ms\ntdll.mak install
å®è£ éæåºï¼
nmake -f ms\nt.mak install
æ¸ é¤ä¸æ¬¡å¨æåºçç¼è¯ï¼ä»¥ä¾¿éæ°ç¼è¯ï¼
nmake -f ms\ntdll.mak clean
æ¸ é¤ä¸æ¬¡éæåºçç¼è¯ï¼ä»¥ä¾¿éæ°ç¼è¯ï¼
nmake -f ms\nt.mak clean
2)
使ç¨OpenSSL
å¨VCä¸é 置使ç¨ä»¥ä¸çå½æ°åºï¼
ç¹å»èåï¼Tools -> Optionsï¼å¼¹åºå¯¹è¯æ¡"Options"ï¼å¨è¯¥å¯¹è¯æ¡ä¸éæ©"Directories"æ ç¾ã
å¨"Show directories for:"ç"Include files"é项ä¸æ°å¢ç®å½"C:\openssl\include"ï¼"Library files"éæ©ä¸æ°å¢ç®å½"C:\openssl\lib"ã
ç¶åå¨éè¦é¾æ¥OpenSSLå½æ°åºçå·¥ç¨ä¸ç¼è¯æ¶å å ¥"libeay.lib"å°±å¯ä»¥äºã