| 1 |
rem OpenSSLのビルド |
| 2 |
|
| 3 |
cd openssl |
| 4 |
|
| 5 |
|
| 6 |
rem Visual Studio 2005 の場合はパッチを適用 |
| 7 |
set CL_VER= |
| 8 |
for /f "delims=" %%o in ('cl 2^>^&1') do set CL_VER=%%o & goto end_clver_chk |
| 9 |
:end_clver_chk |
| 10 |
|
| 11 |
echo %CL_VER% | find "Compiler Version 14" >nul |
| 12 |
if ERRORLEVEL 1 goto patch_end |
| 13 |
pushd ..\openssl_patch |
| 14 |
call apply_patch.bat |
| 15 |
if ERRORLEVEL 1 ( |
| 16 |
popd |
| 17 |
goto fail |
| 18 |
) |
| 19 |
popd |
| 20 |
|
| 21 |
:patch_end |
| 22 |
|
| 23 |
|
| 24 |
rem ossl_static.pdb は *.pdb なので nmake clean すると削除されてしまう。 |
| 25 |
rem debug のときのほうが必要だと思われるので、 |
| 26 |
rem release を先にビルドして debug の ossl_static.pdb が残るようにする。 |
| 27 |
|
| 28 |
if exist "out32\libcrypto.lib" goto build_end |
| 29 |
perl Configure no-asm no-async no-shared no-capieng no-dso no-engine VC-WIN32 -D_WIN32_WINNT=0x0501 |
| 30 |
perl -e "open(IN,'makefile');while(<IN>){s| /MD| /MT|;print $_;}close(IN);" > makefile.tmp |
| 31 |
if exist "makefile" del makefile |
| 32 |
ren makefile.tmp makefile |
| 33 |
nmake clean |
| 34 |
nmake |
| 35 |
mkdir out32 |
| 36 |
move libcrypto* out32 |
| 37 |
move libssl* out32 |
| 38 |
move apps\openssl.exe out32 |
| 39 |
move ossl_static.pdb out32 |
| 40 |
:build_end |
| 41 |
|
| 42 |
if exist "out32.dbg\libcrypto.lib" goto build_dbg_end |
| 43 |
perl Configure no-asm no-async no-shared no-capieng no-dso no-engine VC-WIN32 -D_WIN32_WINNT=0x0501 --debug |
| 44 |
perl -e "open(IN,'makefile');while(<IN>){s| /MDd| /MTd|;print $_;}close(IN);" > makefile.tmp |
| 45 |
if exist "makefile.dbg" del makefile.dbg |
| 46 |
ren makefile.tmp makefile.dbg |
| 47 |
nmake -f makefile.dbg clean |
| 48 |
nmake -f makefile.dbg |
| 49 |
mkdir out32.dbg |
| 50 |
move libcrypto* out32.dbg |
| 51 |
move libssl* out32.dbg |
| 52 |
move apps\openssl.exe out32.dbg |
| 53 |
move ossl_static.pdb out32.dbg |
| 54 |
:build_dbg_end |
| 55 |
|
| 56 |
|
| 57 |
rem Visual Studio 2005 の場合は 2003 R2 Platform SDK の導入を確認する |
| 58 |
echo %CL_VER% | find "Compiler Version 14" >nul |
| 59 |
if ERRORLEVEL 1 goto end |
| 60 |
@echo off |
| 61 |
if exist out32\openssl.exe ( |
| 62 |
echo OpenSSLのビルドが正常終了しました。 |
| 63 |
goto end |
| 64 |
) |
| 65 |
echo crypt32.lib がリンクできずにバイナリが作成できていません。 |
| 66 |
echo Platform SDKが導入されていない可能性があります。 |
| 67 |
set /P ANS2003SDK="続行しますか?(y/n)" |
| 68 |
if "%ANS2003SDK%"=="y" ( |
| 69 |
goto end |
| 70 |
) else ( |
| 71 |
goto fail |
| 72 |
) |
| 73 |
|
| 74 |
:end |
| 75 |
cd .. |
| 76 |
@echo on |
| 77 |
exit /b 0 |
| 78 |
|
| 79 |
|
| 80 |
:fail |
| 81 |
cd .. |
| 82 |
echo "buildopenssl11.bat を終了します" |
| 83 |
@echo on |
| 84 |
exit /b 1 |