Skip to content

Commit

Permalink
build, tools, win: add nasm detection for OpenSSL
Browse files Browse the repository at this point in the history
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: nodejs#4270
PR-URL: nodejs#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]>
  • Loading branch information
joaocgreis authored and shigeki committed Apr 9, 2018
1 parent ae096ba commit eec659c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ Prerequisites:
* Basic Unix tools required for some tests,
[Git for Windows](http://git-scm.com/download/win) includes Git Bash
and tools which can be included in the global `PATH`.
* **Optional** (for OpenSSL assembler modules): the [NetWide Assembler](http://www.nasm.us/),
if not installed in the default location it needs to be manually added
to `PATH`.
* **Optional** (to build the MSI): the [WiX Toolset v3.11](http://wixtoolset.org/releases/)
and the [Wix Toolset Visual Studio 2017 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WixToolsetVisualStudio2017Extension).

Expand Down
19 changes: 19 additions & 0 deletions tools/msvs/find_nasm.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@IF NOT DEFINED DEBUG_HELPER @ECHO OFF

ECHO Looking for NASM

FOR /F "delims=" %%a IN ('where nasm 2^> NUL') DO (
EXIT /B 0
)

IF EXIST "%ProgramFiles%\NASM\nasm.exe" (
SET "Path=%Path%;%ProgramFiles%\NASM"
EXIT /B 0
)

IF EXIST "%ProgramFiles(x86)%\NASM\nasm.exe" (
SET "Path=%Path%;%ProgramFiles(x86)%\NASM"
EXIT /B 0
)

EXIT /B 1
3 changes: 3 additions & 0 deletions vcbuild.bat
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ if "%target%"=="Clean" rmdir /S /Q %~dp0deps\icu
call tools\msvs\find_python.cmd
if errorlevel 1 goto :exit

call tools\msvs\find_nasm.cmd
if errorlevel 1 echo Could not find NASM, it will not be used.

call :getnodeversion || exit /b 1

if defined TAG set configure_flags=%configure_flags% --tag=%TAG%
Expand Down

0 comments on commit eec659c

Please sign in to comment.