Skip to content

Commit cea6e02

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
1 parent 03f2ae1 commit cea6e02

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

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
@@ -168,6 +168,9 @@ if "%target%"=="Clean" rmdir /S /Q %~dp0deps\icu
168168
call tools\msvs\find_python.cmd
169169
if errorlevel 1 goto :exit
170170

171+
call tools\msvs\find_nasm.cmd
172+
if errorlevel 1 echo Could not find NASM, it will not be used.
173+
171174
call :getnodeversion || exit /b 1
172175

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

0 commit comments

Comments
 (0)