build-openssl.bat 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  1. @echo off
  2. rem ***************************************************************************
  3. rem * _ _ ____ _
  4. rem * Project ___| | | | _ \| |
  5. rem * / __| | | | |_) | |
  6. rem * | (__| |_| | _ <| |___
  7. rem * \___|\___/|_| \_\_____|
  8. rem *
  9. rem * Copyright (C) 2012 - 2020, Steve Holme, <steve_holme@hotmail.com>.
  10. rem *
  11. rem * This software is licensed as described in the file COPYING, which
  12. rem * you should have received as part of this distribution. The terms
  13. rem * are also available at https://curl.se/docs/copyright.html.
  14. rem *
  15. rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. rem * copies of the Software, and permit persons to whom the Software is
  17. rem * furnished to do so, under the terms of the COPYING file.
  18. rem *
  19. rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  20. rem * KIND, either express or implied.
  21. rem *
  22. rem ***************************************************************************
  23. :begin
  24. rem Check we are running on a Windows NT derived OS
  25. if not "%OS%" == "Windows_NT" goto nodos
  26. rem Set our variables
  27. setlocal ENABLEDELAYEDEXPANSION
  28. set VC_VER=
  29. set BUILD_PLATFORM=
  30. set BUILD_CONFIG=
  31. rem Ensure we have the required arguments
  32. if /i "%~1" == "" goto syntax
  33. rem Calculate the program files directory
  34. if defined PROGRAMFILES (
  35. set "PF=%PROGRAMFILES%"
  36. set OS_PLATFORM=x86
  37. )
  38. if defined PROGRAMFILES(x86) (
  39. set "PF=%PROGRAMFILES(x86)%"
  40. set OS_PLATFORM=x64
  41. )
  42. :parseArgs
  43. if not "%~1" == "" (
  44. if /i "%~1" == "vc6" (
  45. set VC_VER=6.0
  46. set VC_DESC=VC6
  47. set "VC_PATH=Microsoft Visual Studio\VC98"
  48. ) else if /i "%~1" == "vc7" (
  49. set VC_VER=7.0
  50. set VC_DESC=VC7
  51. set "VC_PATH=Microsoft Visual Studio .NET\Vc7"
  52. ) else if /i "%~1" == "vc7.1" (
  53. set VC_VER=7.1
  54. set VC_DESC=VC7.1
  55. set "VC_PATH=Microsoft Visual Studio .NET 2003\Vc7"
  56. ) else if /i "%~1" == "vc8" (
  57. set VC_VER=8.0
  58. set VC_DESC=VC8
  59. set "VC_PATH=Microsoft Visual Studio 8\VC"
  60. ) else if /i "%~1" == "vc9" (
  61. set VC_VER=9.0
  62. set VC_DESC=VC9
  63. set "VC_PATH=Microsoft Visual Studio 9.0\VC"
  64. ) else if /i "%~1" == "vc10" (
  65. set VC_VER=10.0
  66. set VC_DESC=VC10
  67. set "VC_PATH=Microsoft Visual Studio 10.0\VC"
  68. ) else if /i "%~1" == "vc11" (
  69. set VC_VER=11.0
  70. set VC_DESC=VC11
  71. set "VC_PATH=Microsoft Visual Studio 11.0\VC"
  72. ) else if /i "%~1" == "vc12" (
  73. set VC_VER=12.0
  74. set VC_DESC=VC12
  75. set "VC_PATH=Microsoft Visual Studio 12.0\VC"
  76. ) else if /i "%~1" == "vc14" (
  77. set VC_VER=14.0
  78. set VC_DESC=VC14
  79. set "VC_PATH=Microsoft Visual Studio 14.0\VC"
  80. ) else if /i "%~1" == "vc14.1" (
  81. set VC_VER=14.1
  82. set VC_DESC=VC14.1
  83. rem Determine the VC14.1 path based on the installed edition in descending
  84. rem order (Enterprise, then Professional and finally Community)
  85. if exist "%PF%\Microsoft Visual Studio\2017\Enterprise\VC" (
  86. set "VC_PATH=Microsoft Visual Studio\2017\Enterprise\VC"
  87. ) else if exist "%PF%\Microsoft Visual Studio\2017\Professional\VC" (
  88. set "VC_PATH=Microsoft Visual Studio\2017\Professional\VC"
  89. ) else (
  90. set "VC_PATH=Microsoft Visual Studio\2017\Community\VC"
  91. )
  92. ) else if /i "%~1" == "vc14.2" (
  93. set VC_VER=14.2
  94. set VC_DESC=VC14.2
  95. rem Determine the VC14.2 path based on the installed edition in descending
  96. rem order (Enterprise, then Professional and finally Community)
  97. if exist "%PF%\Microsoft Visual Studio\2019\Enterprise\VC" (
  98. set "VC_PATH=Microsoft Visual Studio\2019\Enterprise\VC"
  99. ) else if exist "%PF%\Microsoft Visual Studio\2019\Professional\VC" (
  100. set "VC_PATH=Microsoft Visual Studio\2019\Professional\VC"
  101. ) else (
  102. set "VC_PATH=Microsoft Visual Studio\2019\Community\VC"
  103. )
  104. ) else if /i "%~1%" == "x86" (
  105. set BUILD_PLATFORM=x86
  106. ) else if /i "%~1%" == "x64" (
  107. set BUILD_PLATFORM=x64
  108. ) else if /i "%~1%" == "debug" (
  109. set BUILD_CONFIG=debug
  110. ) else if /i "%~1%" == "release" (
  111. set BUILD_CONFIG=release
  112. ) else if /i "%~1" == "-?" (
  113. goto syntax
  114. ) else if /i "%~1" == "-h" (
  115. goto syntax
  116. ) else if /i "%~1" == "-help" (
  117. goto syntax
  118. ) else if /i "%~1" == "-VSpath" (
  119. if "%~2" == "" (
  120. echo.
  121. echo Error. Please provide VS Path.
  122. goto error
  123. ) else (
  124. set "ABS_VC_PATH=%~2\VC"
  125. shift
  126. )
  127. ) else if /i "%~1" == "-perlpath" (
  128. if "%~2" == "" (
  129. echo.
  130. echo Error. Please provide Perl root Path.
  131. goto error
  132. ) else (
  133. set "PERL_PATH=%~2"
  134. shift
  135. )
  136. ) else (
  137. if not defined START_DIR (
  138. set START_DIR=%~1%
  139. ) else (
  140. goto unknown
  141. )
  142. )
  143. shift & goto parseArgs
  144. )
  145. :prerequisites
  146. rem Compiler is a required parameter
  147. if not defined VC_VER goto syntax
  148. rem Default the start directory if one isn't specified
  149. if not defined START_DIR set START_DIR=..\..\openssl
  150. if not defined ABS_VC_PATH (
  151. rem Check we have a program files directory
  152. if not defined PF goto nopf
  153. set "ABS_VC_PATH=%PF%\%VC_PATH%"
  154. )
  155. rem Check we have Visual Studio installed
  156. if not exist "%ABS_VC_PATH%" goto novc
  157. if not defined PERL_PATH (
  158. rem Check we have Perl in our path
  159. perl --version <NUL 1>NUL 2>&1
  160. if errorlevel 1 (
  161. rem It isn't so check we have it installed and set the path if it is
  162. if exist "%SystemDrive%\Perl" (
  163. set "PATH=%SystemDrive%\Perl\bin;%PATH%"
  164. ) else (
  165. if exist "%SystemDrive%\Perl64" (
  166. set "PATH=%SystemDrive%\Perl64\bin;%PATH%"
  167. ) else (
  168. goto noperl
  169. )
  170. )
  171. )
  172. ) else (
  173. set "PATH=%PERL_PATH%\Perl\bin;%PATH%"
  174. )
  175. rem Check the start directory exists
  176. if not exist "%START_DIR%" goto noopenssl
  177. :setup
  178. if "%BUILD_PLATFORM%" == "" (
  179. if "%VC_VER%" == "6.0" (
  180. set BUILD_PLATFORM=x86
  181. ) else if "%VC_VER%" == "7.0" (
  182. set BUILD_PLATFORM=x86
  183. ) else if "%VC_VER%" == "7.1" (
  184. set BUILD_PLATFORM=x86
  185. ) else (
  186. set BUILD_PLATFORM=%OS_PLATFORM%
  187. )
  188. )
  189. if "%BUILD_PLATFORM%" == "x86" (
  190. set VCVARS_PLATFORM=x86
  191. ) else if "%BUILD_PLATFORM%" == "x64" (
  192. if "%VC_VER%" == "6.0" goto nox64
  193. if "%VC_VER%" == "7.0" goto nox64
  194. if "%VC_VER%" == "7.1" goto nox64
  195. if "%VC_VER%" == "8.0" set VCVARS_PLATFORM=x86_amd64
  196. if "%VC_VER%" == "9.0" set VCVARS_PLATFORM=%BUILD_PLATFORM%
  197. if "%VC_VER%" == "10.0" set VCVARS_PLATFORM=%BUILD_PLATFORM%
  198. if "%VC_VER%" == "11.0" set VCVARS_PLATFORM=amd64
  199. if "%VC_VER%" == "12.0" set VCVARS_PLATFORM=amd64
  200. if "%VC_VER%" == "14.0" set VCVARS_PLATFORM=amd64
  201. if "%VC_VER%" == "14.1" set VCVARS_PLATFORM=amd64
  202. if "%VC_VER%" == "14.2" set VCVARS_PLATFORM=amd64
  203. )
  204. if exist "%START_DIR%\ms\do_ms.bat" (
  205. set LEGACY_BUILD=TRUE
  206. ) else (
  207. set LEGACY_BUILD=FALSE
  208. )
  209. :start
  210. echo.
  211. set SAVED_PATH=%CD%
  212. if "%VC_VER%" == "6.0" (
  213. call "%ABS_VC_PATH%\bin\vcvars32"
  214. ) else if "%VC_VER%" == "7.0" (
  215. call "%ABS_VC_PATH%\bin\vcvars32"
  216. ) else if "%VC_VER%" == "7.1" (
  217. call "%ABS_VC_PATH%\bin\vcvars32"
  218. ) else if "%VC_VER%" == "14.1" (
  219. call "%ABS_VC_PATH%\Auxiliary\Build\vcvarsall" %VCVARS_PLATFORM%
  220. ) else if "%VC_VER%" == "14.2" (
  221. call "%ABS_VC_PATH%\Auxiliary\Build\vcvarsall" %VCVARS_PLATFORM%
  222. ) else (
  223. call "%ABS_VC_PATH%\vcvarsall" %VCVARS_PLATFORM%
  224. )
  225. echo.
  226. cd /d %SAVED_PATH%
  227. if defined START_DIR cd /d %START_DIR%
  228. goto %BUILD_PLATFORM%
  229. :x64
  230. rem Calculate our output directory
  231. set OUTDIR=build\Win64\%VC_DESC%
  232. if not exist %OUTDIR% md %OUTDIR%
  233. if not "%BUILD_CONFIG%" == "release" (
  234. rem Configuring 64-bit Static Library Debug Build
  235. call :configure x64 debug static %LEGACY_BUILD%
  236. rem Perform the build
  237. call :build x64 static %LEGACY_BUILD%
  238. rem Perform the install
  239. call :install debug static %LEGACY_BUILD%
  240. rem Configuring 64-bit Shared Library Debug Build
  241. call :configure x64 debug shared %LEGACY_BUILD%
  242. rem Perform the build
  243. call :build x64 shared %LEGACY_BUILD%
  244. rem Perform the install
  245. call :install debug shared %LEGACY_BUILD%
  246. )
  247. if not "%BUILD_CONFIG%" == "debug" (
  248. rem Configuring 64-bit Static Library Release Build
  249. call :configure x64 release static %LEGACY_BUILD%
  250. rem Perform the build
  251. call :build x64 static %LEGACY_BUILD%
  252. rem Perform the install
  253. call :install release static %LEGACY_BUILD%
  254. rem Configuring 64-bit Shared Library Release Build
  255. call :configure x64 release shared %LEGACY_BUILD%
  256. rem Perform the build
  257. call :build x64 shared %LEGACY_BUILD%
  258. rem Perform the install
  259. call :install release shared %LEGACY_BUILD%
  260. )
  261. goto success
  262. :x86
  263. rem Calculate our output directory
  264. set OUTDIR=build\Win32\%VC_DESC%
  265. if not exist %OUTDIR% md %OUTDIR%
  266. if not "%BUILD_CONFIG%" == "release" (
  267. rem Configuring 32-bit Static Library Debug Build
  268. call :configure x86 debug static %LEGACY_BUILD%
  269. rem Perform the build
  270. call :build x86 static %LEGACY_BUILD%
  271. rem Perform the install
  272. call :install debug static %LEGACY_BUILD%
  273. rem Configuring 32-bit Shared Library Debug Build
  274. call :configure x86 debug shared %LEGACY_BUILD%
  275. rem Perform the build
  276. call :build x86 shared %LEGACY_BUILD%
  277. rem Perform the install
  278. call :install debug shared %LEGACY_BUILD%
  279. )
  280. if not "%BUILD_CONFIG%" == "debug" (
  281. rem Configuring 32-bit Static Library Release Build
  282. call :configure x86 release static %LEGACY_BUILD%
  283. rem Perform the build
  284. call :build x86 static %LEGACY_BUILD%
  285. rem Perform the install
  286. call :install release static %LEGACY_BUILD%
  287. rem Configuring 32-bit Shared Library Release Build
  288. call :configure x86 release shared %LEGACY_BUILD%
  289. rem Perform the build
  290. call :build x86 shared %LEGACY_BUILD%
  291. rem Perform the install
  292. call :install release shared %LEGACY_BUILD%
  293. )
  294. goto success
  295. rem Function to configure the build.
  296. rem
  297. rem %1 - Platform (x86 or x64)
  298. rem %2 - Configuration (release or debug)
  299. rem %3 - Build Type (static or shared)
  300. rem %4 - Build type (TRUE for legacy aka pre v1.1.0; otherwise FALSE)
  301. rem
  302. :configure
  303. setlocal
  304. if "%1" == "" exit /B 1
  305. if "%2" == "" exit /B 1
  306. if "%3" == "" exit /B 1
  307. if "%4" == "" exit /B 1
  308. if "%4" == "TRUE" (
  309. rem Calculate the build directory
  310. set build_dir=%cd%
  311. rem Calculate the configure options
  312. if "%1" == "x86" (
  313. if "%2" == "debug" (
  314. set options=debug-VC-WIN32
  315. ) else if "%2" == "release" (
  316. set options=VC-WIN32
  317. ) else (
  318. exit /B 1
  319. )
  320. set options=!options! no-asm
  321. ) else if "%1" == "x64" (
  322. if "%2" == "debug" (
  323. set options=debug-VC-WIN64A
  324. ) else if "%2" == "release" (
  325. set options=VC-WIN64A
  326. ) else (
  327. exit /B 1
  328. )
  329. ) else (
  330. exit /B 1
  331. )
  332. ) else if "%4" == "FALSE" (
  333. rem Has configure already been ran?
  334. if exist makefile (
  335. rem Clean up the previous build
  336. nmake clean
  337. rem Remove the old makefile
  338. del makefile 1>nul
  339. )
  340. rem Calculate the build directory
  341. set build_dir=%cd%\build\tmp
  342. rem Calculate the configure options
  343. if "%1" == "x86" (
  344. set options=VC-WIN32
  345. ) else if "%1" == "x64" (
  346. set options=VC-WIN64A
  347. ) else (
  348. exit /B 1
  349. )
  350. if "%2" == "debug" (
  351. set options=!options! --debug
  352. ) else if "%2" == "release" (
  353. set options=!options! --release
  354. ) else (
  355. exit /B 1
  356. )
  357. if "%3" == "static" (
  358. set options=!options! no-shared
  359. ) else if not "%3" == "shared" (
  360. exit /B 1
  361. )
  362. set options=!options! no-asm
  363. ) else (
  364. exit /B 1
  365. )
  366. set options=%options% --prefix=%build_dir%
  367. rem Run the configure
  368. perl Configure %options%
  369. exit /B %ERRORLEVEL
  370. rem Main build function.
  371. rem
  372. rem %1 - Platform (x86 or x64)
  373. rem %2 - Build Type (static or shared)
  374. rem %3 - Build type (TRUE for legacy aka pre v1.1.0; otherwise FALSE)
  375. rem
  376. :build
  377. setlocal
  378. if "%1" == "" exit /B 1
  379. if "%2" == "" exit /B 1
  380. if "%3" == "" exit /B 1
  381. if "%3" == "TRUE" (
  382. if "%1" == "x86" (
  383. call ms\do_ms.bat
  384. ) else if "%1" == "x64" (
  385. call ms\do_win64a.bat
  386. ) else (
  387. exit /B 1
  388. )
  389. if "%2" == "static" (
  390. nmake -f ms\nt.mak
  391. ) else if "%2" == "shared" (
  392. nmake -f ms\ntdll.mak
  393. ) else (
  394. exit /B 1
  395. )
  396. ) else if "%2" == "FALSE" (
  397. nmake
  398. ) else (
  399. exit /B 1
  400. )
  401. exit /B 0
  402. rem Main installation function.
  403. rem
  404. rem %1 - Configuration (release or debug)
  405. rem %2 - Build Type (static or shared)
  406. rem %3 - Build type (TRUE for legacy aka pre v1.1.0; otherwise FALSE)
  407. rem
  408. :install
  409. setlocal
  410. if "%1" == "" exit /B 1
  411. if "%2" == "" exit /B 1
  412. if "%3" == "" exit /B 1
  413. rem Copy the generated files to our directory structure
  414. if "%3" == "TRUE" (
  415. if "%1" == "debug" (
  416. if "%2" == "static" (
  417. rem Move the output directories
  418. if exist "%OUTDIR%\LIB Debug" (
  419. copy /y out32.dbg\* "%OUTDIR%\LIB Debug" 1>nul
  420. rd out32.dbg /s /q
  421. ) else (
  422. move out32.dbg "%OUTDIR%\LIB Debug" 1>nul
  423. )
  424. rem Move the PDB files
  425. move tmp32.dbg\lib.pdb "%OUTDIR%\LIB Debug" 1>nul
  426. rem Remove the intermediate directories
  427. rd tmp32.dbg /s /q
  428. ) else if "%2" == "shared" (
  429. if exist "%OUTDIR%\DLL Debug" (
  430. copy /y out32dll.dbg\* "%OUTDIR%\DLL Debug" 1>nul
  431. rd out32dll.dbg /s /q
  432. ) else (
  433. move out32dll.dbg "%OUTDIR%\DLL Debug" 1>nul
  434. )
  435. rem Move the PDB files
  436. move tmp32dll.dbg\lib.pdb "%OUTDIR%\DLL Debug" 1>nul
  437. rem Remove the intermediate directories
  438. rd tmp32dll.dbg /s /q
  439. ) else (
  440. exit /B 1
  441. )
  442. ) else if "%1" == "release" (
  443. if "%2" == "static" (
  444. rem Move the output directories
  445. if exist "%OUTDIR%\LIB Release" (
  446. copy /y out32\* "%OUTDIR%\LIB Release" 1>nul
  447. rd out32 /s /q
  448. ) else (
  449. move out32 "%OUTDIR%\LIB Release" 1>nul
  450. )
  451. rem Move the PDB files
  452. move tmp32\lib.pdb "%OUTDIR%\LIB Release" 1>nul
  453. rem Remove the intermediate directories
  454. rd tmp32 /s /q
  455. ) else if "%2" == "shared" (
  456. if exist "%OUTDIR%\DLL Release" (
  457. copy /y out32dll\* "%OUTDIR%\DLL Release" 1>nul
  458. rd out32dll /s /q
  459. ) else (
  460. move out32dll "%OUTDIR%\DLL Release" 1>nul
  461. )
  462. rem Move the PDB files
  463. move tmp32dll\lib.pdb "%OUTDIR%\DLL Release" 1>nul
  464. rem Remove the intermediate directories
  465. rd tmp32dll /s /q
  466. ) else (
  467. exit /B 1
  468. )
  469. )
  470. ) else if "%3" == "FALSE" (
  471. rem Calculate the build directory
  472. set build_dir=%cd%\build\tmp
  473. rem Perform the installation
  474. nmake install_sw
  475. rem Move the output directories
  476. if "%1" == "debug" (
  477. if "%2" == "static" (
  478. if not exist "%OUTDIR%\LIB Debug" (
  479. mkdir "%OUTDIR%\LIB Debug" 1>nul
  480. )
  481. move !build_dir!\lib\*.lib "%OUTDIR%\LIB Debug" 1>nul
  482. move !build_dir!\bin\*.exe "%OUTDIR%\LIB Debug" 1>nul
  483. ) else if "%2" == "shared" (
  484. if not exist "%OUTDIR%\DLL Debug" (
  485. mkdir "%OUTDIR%\DLL Debug" 1>nul
  486. )
  487. move !build_dir!\lib\*.lib "%OUTDIR%\DLL Debug" 1>nul
  488. move !build_dir!\bin\*.dll "%OUTDIR%\DLL Debug" 1>nul
  489. move !build_dir!\bin\*.exe "%OUTDIR%\DLL Debug" 1>nul
  490. move !build_dir!\bin\*.pdb "%OUTDIR%\DLL Debug" 1>nul
  491. ) else (
  492. exit /B 1
  493. )
  494. ) else if "%1" == "release" (
  495. if "%2" == "static" (
  496. if not exist "%OUTDIR%\LIB Release" (
  497. mkdir "%OUTDIR%\LIB Release" 1>nul
  498. )
  499. move !build_dir!\lib\*.lib "%OUTDIR%\LIB Release" 1>nul
  500. move !build_dir!\bin\*.exe "%OUTDIR%\LIB Release" 1>nul
  501. ) else if "%2" == "shared" (
  502. if not exist "%OUTDIR%\DLL Release" (
  503. mkdir "%OUTDIR%\DLL Release" 1>nul
  504. )
  505. move !build_dir!\lib\*.lib "%OUTDIR%\DLL Release" 1>nul
  506. move !build_dir!\bin\*.dll "%OUTDIR%\DLL Release" 1>nul
  507. move !build_dir!\bin\*.exe "%OUTDIR%\DLL Release" 1>nul
  508. ) else (
  509. exit /B 1
  510. )
  511. ) else (
  512. exit /B 1
  513. )
  514. rem Remove the output directories
  515. rd !build_dir! /s /q
  516. ) else (
  517. exit /B 1
  518. )
  519. exit /B 0
  520. :syntax
  521. rem Display the help
  522. echo.
  523. echo Usage: build-openssl ^<compiler^> [platform] [configuration] [directory] [-VSpath] ["VSpath"] [-perlpath] ["perlpath"]
  524. echo.
  525. echo Compiler:
  526. echo.
  527. echo vc6 - Use Visual Studio 6
  528. echo vc7 - Use Visual Studio .NET
  529. echo vc7.1 - Use Visual Studio .NET 2003
  530. echo vc8 - Use Visual Studio 2005
  531. echo vc9 - Use Visual Studio 2008
  532. echo vc10 - Use Visual Studio 2010
  533. echo vc11 - Use Visual Studio 2012
  534. echo vc12 - Use Visual Studio 2013
  535. echo vc14 - Use Visual Studio 2015
  536. echo vc14.1 - Use Visual Studio 2017
  537. echo vc14.2 - Use Visual Studio 2019
  538. echo.
  539. echo Platform:
  540. echo.
  541. echo x86 - Perform a 32-bit build
  542. echo x64 - Perform a 64-bit build
  543. echo.
  544. echo Configuration:
  545. echo.
  546. echo debug - Perform a debug build
  547. echo release - Perform a release build
  548. echo.
  549. echo Other:
  550. echo.
  551. echo directory - Specifies the OpenSSL source directory
  552. echo.
  553. echo -VSpath - Specify the custom VS path if Visual Studio is installed at other location
  554. echo then "C:/<ProgramFiles>/Microsoft Visual Studio[version]
  555. echo For e.g. -VSpath "C:\apps\MVS14"
  556. echo.
  557. echo -perlpath - Specify the custom perl root path if perl is not located at "C:\Perl" and it is a
  558. echo portable copy of perl and not installed on the win system
  559. echo For e.g. -perlpath "D:\strawberry-perl-5.24.3.1-64bit-portable"
  560. goto error
  561. :unknown
  562. echo.
  563. echo Error: Unknown argument '%1'
  564. goto error
  565. :nodos
  566. echo.
  567. echo Error: Only a Windows NT based Operating System is supported
  568. goto error
  569. :nopf
  570. echo.
  571. echo Error: Cannot obtain the directory for Program Files
  572. goto error
  573. :novc
  574. echo.
  575. echo Error: %VC_DESC% is not installed
  576. echo Error: Please check whether Visual compiler is installed at the path "%ABS_VC_PATH%"
  577. echo Error: Please provide proper VS Path by using -VSpath
  578. goto error
  579. :noperl
  580. echo.
  581. echo Error: Perl is not installed
  582. echo Error: Please check whether Perl is installed or it is at location "C:\Perl"
  583. echo Error: If Perl is portable please provide perl root path by using -perlpath
  584. goto error
  585. :nox64
  586. echo.
  587. echo Error: %VC_DESC% does not support 64-bit builds
  588. goto error
  589. :noopenssl
  590. echo.
  591. echo Error: Cannot locate OpenSSL source directory
  592. goto error
  593. :error
  594. if "%OS%" == "Windows_NT" endlocal
  595. exit /B 1
  596. :success
  597. cd /d %SAVED_PATH%
  598. endlocal
  599. exit /B 0