Bug 1528669 - Pass -D options directly to gyp, r=jcj
authorMartin Thomson <martin.thomson@gmail.com>
Tue, 26 Feb 2019 09:45:29 +1100
changeset 15032 a2b586f90e0ae2fdbe8bc6e942e188fa8f4a62c6
parent 15031 f7be0a534e89f5b8c67a8cf1f7931f8f8801fbd1
child 15033 ee8e4996a6b364a2d7c65fd734afcb63c865ac7b
push id3283
push usermartin.thomson@gmail.com
push dateMon, 25 Feb 2019 23:42:25 +0000
reviewersjcj
bugs1528669
Bug 1528669 - Pass -D options directly to gyp, r=jcj Reviewers: jcj Reviewed By: jcj Bug #: 1528669 Differential Revision: https://phabricator.services.mozilla.com/D20120
build.sh
help.txt
--- a/build.sh
+++ b/build.sh
@@ -98,16 +98,17 @@ while [ $# -gt 0 ]; do
         --ct-verif) gyp_params+=(-Dct_verif=1) ;;
         --nspr) nspr_clean; rebuild_nspr=1 ;;
         --with-nspr=?*) set_nspr_path "${1#*=}"; no_local_nspr=1 ;;
         --system-nspr) set_nspr_path "/usr/include/nspr/:"; no_local_nspr=1 ;;
         --system-sqlite) gyp_params+=(-Duse_system_sqlite=1) ;;
         --enable-fips) gyp_params+=(-Ddisable_fips=0) ;;
         --enable-libpkix) gyp_params+=(-Ddisable_libpkix=0) ;;
         --mozpkix-only) gyp_params+=(-Dmozpkix_only=1 -Ddisable_tests=1 -Dsign_libs=0) ;;
+	-D*) gyp_params+=("$1") ;;
         *) show_help; exit 2 ;;
     esac
     shift
 done
 
 # Set the target architecture and build type.
 gyp_params+=(-Dtarget_arch="$target_arch")
 if [ "$opt_build" = 1 ]; then
--- a/help.txt
+++ b/help.txt
@@ -1,17 +1,17 @@
 Usage: build.sh [-h] [-c|-cc] [-v] [-j <n>] [--gyp|-g] [--opt|-o]
                 [-t <x64|x86|...>|--target=<x64|x86|...>]
                 [--clang|--gcc|--msvc] [--scan-build[=dir]] [--disable-tests]
                 [--pprof] [--asan] [--msan] [--ubsan[=bool,shift,...]
                 [--fuzz[=tls|oss]] [--sancov[=edge|bb|func|...]]
                 [--emit-llvm] [--no-zdefs] [--test] [--ct-verif]
                 [--nspr|--with-nspr=<include>:<lib>|--system-nspr]
                 [--system-sqlite] [--enable-fips] [--enable-libpkix]
-                [--mozpkix-only]
+                [--mozpkix-only] [-D<gyp-option>]
 
 This script builds NSS with gyp and ninja.
 
 NSS build tool options:
 
     -h               display this help and exit
     -c               clean before build
     -cc              clean without building
@@ -46,8 +46,9 @@ NSS build tool options:
                      --with-nspr=<include>:<lib> sets include and lib paths
     --system-nspr    attempt to use system nspr
                      shorthand for --with-nspr=/usr/include/nspr:
     --system-sqlite  use system sqlite
     --enable-fips    enable FIPS checks
     --enable-libpkix make libpkix part of the build
     --mozpkix-only   build only static mozpkix and mozpkix-test libraries
                      support for this build option is limited
+    -D<gyp-option>   pass an option directly to gyp