Skip to content

Commit fcbee88

Browse files
committed
configure.ps1: do not test SpiderMonkey libs when it is disabled
When Windows users decide to disable SpiderMonkey, it is likely the case they do not have it installed either. In those scenarios it makes no sense to check for the presence of the static libraries. Instead, `configure.ps1` fails to proceed untruly, which has to be fixed.
1 parent 9154aa2 commit fcbee88

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

configure.ps1

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,22 @@ If ($Test) {
123123
exit 0
124124
}
125125

126-
# Use the MSVC linker to determine if the respective SpiderMonkey library
127-
# is available on the linker path. This heuristic is taken from
128-
# src/couch/rebar.config.script, please keep them in sync.
129-
If ($SpiderMonkeyVersion -eq "1.8.5") {
130-
$SpiderMonkeyLib = "mozjs185-1.0.lib"
131-
}
132-
else {
133-
$SpiderMonkeyLib = "mozjs-$SpiderMonkeyVersion.lib"
134-
}
126+
If (-Not $DisableSpiderMonkey) {
127+
# Use the MSVC linker to determine if the respective SpiderMonkey library
128+
# is available on the linker path. This heuristic is taken from
129+
# src/couch/rebar.config.script, please keep them in sync.
130+
If ($SpiderMonkeyVersion -eq "1.8.5") {
131+
$SpiderMonkeyLib = "mozjs185-1.0.lib"
132+
}
133+
else {
134+
$SpiderMonkeyLib = "mozjs-$SpiderMonkeyVersion.lib"
135+
}
135136

136-
&link $SpiderMonkeyLib /SUBSYSTEM:CONSOLE /NOENTRY /DLL /OUT:NUL *> $null
137-
If ($LASTEXITCODE -ne 0) {
138-
Write-Output "ERROR: SpiderMonkey $SpiderMonkeyVersion is not found. Please specify with -SpiderMonkeyVersion."
139-
exit 1
137+
&link $SpiderMonkeyLib /SUBSYSTEM:CONSOLE /NOENTRY /DLL /OUT:NUL *> $null
138+
If ($LASTEXITCODE -ne 0) {
139+
Write-Output "ERROR: SpiderMonkey $SpiderMonkeyVersion is not found. Please specify with -SpiderMonkeyVersion."
140+
exit 1
141+
}
140142
}
141143

142144
# Translate ./configure variables to CouchDB variables

0 commit comments

Comments
 (0)