Skip to content

Commit eec659c

Browse files
joaocgreisshigeki
authored andcommitted
build, tools, win: add nasm detection for OpenSSL
OpenSSL-1.1.0 requires the nasm assembler for building asm files on Windows. This finds nasm at \Program Files\NASM\nasm.exe or \ProgramFiles(x86)\NASM\nasm.exe in vcbuild.bat for users who did not add its path in their enviroments. Fixes: nodejs/build#1190 Fixes: #4270 PR-URL: #19794 Reviewed-By: Shigeki Ohtsu <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Rod Vagg <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent ae096ba commit eec659c

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

BUILDING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ Prerequisites:
258258
* Basic Unix tools required for some tests,
259259
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
260260
and tools which can be included in the global `PATH`.
261+
* **Optional** (for OpenSSL assembler modules): the [NetWide Assembler](http://www.nasm.us/),
262+
if not installed in the default location it needs to be manually added
263+
to `PATH`.
261264
* **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/)
262265
and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension).
263266

tools/msvs/find_nasm.cmd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@IF NOT DEFINED DEBUG_HELPER @ECHO OFF
2+
3+
ECHO Looking for NASM
4+
5+
FOR /F "delims=" %%a IN ('where nasm 2^> NUL') DO (
6+
EXIT /B 0
7+
)
8+
9+
IF EXIST "%ProgramFiles%\NASM\nasm.exe" (
10+
SET "Path=%Path%;%ProgramFiles%\NASM"
11+
EXIT /B 0
12+
)
13+
14+
IF EXIST "%ProgramFiles(x86)%\NASM\nasm.exe" (
15+
SET "Path=%Path%;%ProgramFiles(x86)%\NASM"
16+
EXIT /B 0
17+
)
18+
19+
EXIT /B 1

vcbuild.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ if "%target%"=="Clean" rmdir /S /Q %~dp0deps\icu
170170
call tools\msvs\find_python.cmd
171171
if errorlevel 1 goto :exit
172172

173+
call tools\msvs\find_nasm.cmd
174+
if errorlevel 1 echo Could not find NASM, it will not be used.
175+
173176
call :getnodeversion || exit /b 1
174177

175178
if defined TAG set configure_flags=%configure_flags% --tag=%TAG%

0 commit comments

Comments
 (0)