You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2023/01/26 14:56:31 UTC

[couchdb] 03/03: Port the SpiderMonkey check to Windows

This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 23efd8e5b1aa96ef01640fec03a5fedc945ba8b9
Author: Gabor Pali <ga...@ibm.com>
AuthorDate: Fri Jan 20 23:17:51 2023 +0100

    Port the SpiderMonkey check to Windows
---
 configure.ps1 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/configure.ps1 b/configure.ps1
index ad08f80f4..0fe92ed1e 100644
--- a/configure.ps1
+++ b/configure.ps1
@@ -103,6 +103,22 @@ If ($Test) {
     exit 0
 }
 
+# Use the MSVC linker to determine if the respective SpiderMonkey library
+# is available on the linker path.  This heuristic is taken from
+# src/couch/rebar.config.script, please keep them in sync.
+If ($SpiderMonkeyVersion -eq "1.8.5") {
+    $SpiderMonkeyLib = "mozjs185-1.0.lib"
+}
+else {
+    $SpiderMonkeyLib = "mozjs-$SpiderMonkeyVersion.lib"
+}
+
+&link $SpiderMonkeyLib /SUBSYSTEM:CONSOLE /NOENTRY /DLL /OUT:NUL *> $null
+If ($LASTEXITCODE -ne 0) {
+    Write-Output "ERROR: SpiderMonkey $SpiderMonkeyVersion is not found. Please specify with -SpiderMonkeyVersion."
+    exit 1
+}
+
 # Translate ./configure variables to CouchDB variables
 $PackageAuthorName="The Apache Software Foundation"
 $InstallDir="$LibDir\couchdb"