You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2020/02/10 03:20:32 UTC

[couchdb] 01/11: Add SpiderMonkey version option to configure

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

jiangphcn pushed a commit to branch spidermonkey60-porting
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 02e4456fb3332260de2b127cfcd29b5debf3fe1f
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Mon Dec 2 13:52:08 2019 -0600

    Add SpiderMonkey version option to configure
---
 configure     | 23 +++++++++++++++++++++++
 configure.ps1 |  8 +++++++-
 2 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index bcd7619..a77f4ea 100755
--- a/configure
+++ b/configure
@@ -30,6 +30,7 @@ ERLANG_MD5="false"
 SKIP_DEPS=0
 
 COUCHDB_USER="$(whoami 2>/dev/null || echo couchdb)"
+SM_VSN="1.8.5"
 
 . ${rootdir}/version.mk
 COUCHDB_VERSION=${vsn_major}.${vsn_minor}.${vsn_patch}
@@ -50,6 +51,7 @@ Options:
   --disable-docs              do not build any documentation or manpages
   --erlang-md5                use erlang for md5 hash operations
   --dev                       alias for --with-curl --disable-docs --disable-fauxton
+  --spidermonkey-version VSN  specify the version of SpiderMonkey to use (defaults to $SM_VSN)
   --skip-deps                 do not update erlang dependencies
   --rebar=PATH                use rebar by specified path (version >=2.6.0 && <3.0 required)
 EOF
@@ -140,6 +142,24 @@ parse_opts() {
                 printf 'ERROR: "--user" requires a non-empty argument.\n' >&2
                 exit 1
                 ;;
+
+            --spidermonkey-version)
+                if [ -n "$2" ]; then
+                    eval SM_VSN=$2
+                    shift 2
+                    continue
+                else
+                    printf 'ERROR: "--spidermonkey-version" requires a non-empty argument.\n' >&2
+                    exit 1
+                fi
+                ;;
+            --spidermonkey-version=?*)
+                eval SM_VSN=${1#*=}
+                ;;
+            --spidermonkey-version=)
+                printf 'ERROR: "--spidermonkey-version" requires a non-empty argument.\n' >&2
+                exit 1
+                ;;
             --) # End of options
                 shift
                 break
@@ -180,6 +200,7 @@ cat > rel/couchdb.config << EOF
 {log_file, "$LOG_FILE"}.
 {fauxton_root, "./share/www"}.
 {user, "$COUCHDB_USER"}.
+{spidermonkey_version, "$SM_VSN"}.
 {node_name, "-name couchdb@127.0.0.1"}.
 {cluster_port, 5984}.
 {backend_port, 5986}.
@@ -206,12 +227,14 @@ with_fauxton = $WITH_FAUXTON
 with_docs = $WITH_DOCS
 
 user = $COUCHDB_USER
+spidermonkey_version = $SM_VSN
 EOF
 
 cat > $rootdir/config.erl << EOF
 {with_curl, $WITH_CURL}.
 {with_proper, $WITH_PROPER}.
 {erlang_md5, $ERLANG_MD5}.
+{spidermonkey_version, "$SM_VSN"}.
 EOF
 
 install_local_rebar() {
diff --git a/configure.ps1 b/configure.ps1
index 418cac3..9888a9f 100644
--- a/configure.ps1
+++ b/configure.ps1
@@ -10,6 +10,7 @@
   -DisableDocs               request build process skip building documentation (default false)
   -SkipDeps                  do not update Erlang dependencies (default false)
   -CouchDBUser USER          set the username to run as (defaults to current user)
+  -SpiderMonkeyVersion VSN   select the version of SpiderMonkey to use (defaults to 1.8.5)
 
   Installation directories:
   -Prefix PREFIX             install architecture-independent files in PREFIX
@@ -49,6 +50,8 @@ Param(
     [ValidateNotNullOrEmpty()]
     [string]$CouchDBUser = [Environment]::UserName, # set the username to run as (defaults to current user)
     [ValidateNotNullOrEmpty()]
+    [string]$SpiderMonkeyVersion = "1.8.5", # select the version of SpiderMonkey to use (default 1.8.5)
+    [ValidateNotNullOrEmpty()]
     [string]$Prefix = "C:\Program Files\Apache\CouchDB", # install architecture-independent file location (default C:\Program Files\Apache\CouchDB)
     [ValidateNotNullOrEmpty()]
     [string]$ExecPrefix = $Prefix, # install architecture-dependent file location (default C:\Program Files\Apache\CouchDB)
@@ -133,6 +136,7 @@ $CouchDBConfig = @"
 {log_file, ""}.
 {fauxton_root, "./share/www"}.
 {user, "$CouchDBUser"}.
+{spidermonkey_version, "$SpiderMonkeyVersion"}.
 {node_name, "-name couchdb@localhost"}.
 {cluster_port, 5984}.
 {backend_port, 5986}.
@@ -144,7 +148,7 @@ $InstallMk = @"
 # Licensed under the Apache License, Version 2.0 (the "License"); you may not
 # use this file except in compliance with the License. You may obtain a copy of
 # the License at
-# 
+#
 #   http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
@@ -175,12 +179,14 @@ with_fauxton = $BuildFauxton
 with_docs = $BuildDocs
 
 user = $CouchDBUser
+spidermonkey_version = $SpiderMonkeyVersion
 "@
 $InstallMk | Out-File "$rootdir\install.mk" -encoding ascii
 
 $lowercurl = "$WithCurl".ToLower()
 $ConfigERL = @"
 {with_curl, $lowercurl}.
+{spidermonkey_version, "$SpiderMonkeyVersion"}.
 "@
 $ConfigERL | Out-File "$rootdir\config.erl" -encoding ascii