Home > Fresh News > Compile OpenSSL by Visual Studio C++ 2010 Express

Compile OpenSSL by Visual Studio C++ 2010 Express

December 10th, 2011 Leave a comment Go to comments
@rem @echo off
@cls

@rem 1. Download and unzip Netwide Assembler (http://nasm.us/) to some folder
@rem 2. Download and uzip Strawberry Perl (http://strawberryperl.com/)
@rem    or ActivePerl (http://www.activestate.com/activeperl/downloads)
@rem 3. Download and uzip (xxx.tar.gz) latest version of OpenSSL (http://www.openssl.org/)

@rem NOTE: For more info, please read INSTALL.W32 file in OpenSSL folder

@rem ***************************************************************
@rem Setup paths
@rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@set strPathNetwideAssembler=D:\Development\Tools\nasm-2.09.10
@set strPathStrawberryPerl=D:\Development\Tools\strawberry
@set strPathActivePerl=
@rem set strPathActivePerl=D:\Development\Tools\Perl64\bin
@set strPathOpenSSLDir=d:
@set strPathOpenSSL=%strPathOpenSSLDir%\Qt\openssl-1.0.0e
@set strPathTargetOpenSSLDir=d:\openSSL-1.0.0e
@set bEnableStaticEngine=True
@rem True -> the shared library build will compile the engines into libeay32.dll
@rem ***************************************************************

@IF NOT "%strPathNetwideAssembler%" == "" set PATH=%strPathNetwideAssembler%;%PATH%
@IF NOT "%strPathStrawberryPerl%" == "" set PATH=%strPathStrawberryPerl%\c\bin;%strPathStrawberryPerl%\perl\site\bin;%strPathStrawberryPerl%\perl\bin;%PATH%
@IF NOT "%strPathActivePerl%" == "" set PATH=%strPathActivePerl%;%PATH%
@set strEnableStaticEngine=
@IF "%bEnableStaticEngine%"=="True" set strEnableStaticEngine=enable-static-engine

@rem START

@rem Create OpenSSL installation dir
@rmdir /S /Q %strPathTargetOpenSSLDir%
@mkdir %strPathTargetOpenSSLDir%
@echo OpenSSL will be installed into %strPathTargetOpenSSLDir%

@%strPathOpenSSLDir%
@cd %strPathOpenSSL%

@IF NOT "%strPathNetwideAssembler%" == "" call :ConfigureMakefileWithASM
@IF "%strPathNetwideAssembler%" == ""     call :ConfigureMakefileWithoutASM

@if "%VS100COMNTOOLS%" == "" goto ErrorNoVS2010
@call "%VS100COMNTOOLS%vsvars32.bat"

@cls
@echo ***************************************************************
@echo Compile OpenSSL
@echo ***************************************************************
@pause
@nmake -f ms\ntdll.mak
@echo ***************************************************************
@echo Compile OpenSSL DONE
@echo ***************************************************************
@echo .
@echo ***************************************************************
@echo Test OpenSSL
@echo ***************************************************************
@pause
@nmake -f ms\ntdll.mak test
@echo ***************************************************************
@echo Test OpenSSL DONE
@echo ***************************************************************
@echo .
@echo ***************************************************************
@echo install OpenSSL to the specified location (%strPathTargetOpenSSLDir%)
@echo ***************************************************************
@pause
@nmake -f ms\ntdll.mak install
@echo ***************************************************************
@echo install OpenSSL to %strPathTargetOpenSSLDir% DONE
@echo ***************************************************************
@pause

goto EOF



:ConfigureMakefileWithoutASM
@rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@rem Configure with platform VC-WIN32 but without Assembler and Build Makefiles
@rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo ***************************************************************
@echo Configure with platform VC-WIN32 but without Assembler
@echo ***************************************************************
@perl Configure VC-WIN32 no-asm %strEnableStaticEngine% --prefix=%strPathTargetOpenSSLDir%
@echo ***************************************************************
@echo Configure with platform VC-WIN32 but without Assembler. DONE
@echo ***************************************************************
@echo .
@echo ***************************************************************
@echo Build the Makefiles
@echo ***************************************************************
@call ms\do_ms.bat
@echo ***************************************************************
@echo Build the Makefiles DONE
@echo ***************************************************************
@pause
@cls
goto EOF

:ConfigureMakefileWithASM
@rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@rem Configure with platform VC-WIN32 and with Assembler, and Build Makefiles
@rem ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@echo ***************************************************************
@echo Configure with platform VC-WIN32 and Assembler
@echo ***************************************************************
perl Configure VC-WIN32 %strEnableStaticEngine% --prefix=%strPathTargetOpenSSLDir%
@echo ***************************************************************
@echo Configure with platform VC-WIN32 and Assembler. DONE
@echo ***************************************************************
@echo .
@echo ***************************************************************
@echo Build the Makefiles and optionally the assembly language files:
@echo ***************************************************************
@call ms\do_nasm.bat
@echo ***************************************************************
@echo Build the Makefiles DONE
@echo ***************************************************************
@pause
@cls
goto EOF

rem Errors
rem ***********************************************************
:ErrorNoVS2010
echo Visual Studio 2010 is not installed on your computer. Please install it and run this file again.
goto EOF

:EOF
Tags:
  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.