Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Bug 1372515 - allow enabling libpkix in gyp builds, r=ttaubert
Differential Revision: https://nss-review.dev.mozaws.net/D350

--HG--
extra : rebase_source : 0681eb9be3886a8832d70ffac5f6aa56e48d4a90
extra : histedit_source : ea1472a1175adbf6dc293151ea21776ed3467a23%2C6517c85322d5b1c39faff8290a8e3c46a0437c52
  • Loading branch information
franziskuskiefer committed Jun 9, 2017
1 parent 8744732 commit f1d3d05
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 85 deletions.
1 change: 1 addition & 0 deletions build.sh
Expand Up @@ -93,6 +93,7 @@ while [ $# -gt 0 ]; do
--system-sqlite) gyp_params+=(-Duse_system_sqlite=1) ;;
--with-nspr=?*) set_nspr_path "${1#*=}"; no_local_nspr=1 ;;
--system-nspr) set_nspr_path "/usr/include/nspr/:"; no_local_nspr=1 ;;
--enable-libpkix) gyp_params+=(-Ddisable_libpkix=0) ;;
*) show_help; exit 2 ;;
esac
shift
Expand Down
16 changes: 1 addition & 15 deletions cmd/platlibs.gypi
Expand Up @@ -33,6 +33,7 @@
'<(DEPTH)/lib/base/base.gyp:nssb',
'<(DEPTH)/lib/freebl/freebl.gyp:freebl',
'<(DEPTH)/lib/sqlite/sqlite.gyp:sqlite3',
'<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
],
'conditions': [
[ 'disable_dbm==0', {
Expand All @@ -41,21 +42,6 @@
'<(DEPTH)/lib/softoken/legacydb/legacydb.gyp:nssdbm',
],
}],
[ 'disable_libpkix==0', {
'dependencies': [
'<(DEPTH)/lib/libpkix/pkix/certsel/certsel.gyp:pkixcertsel',
'<(DEPTH)/lib/libpkix/pkix/checker/checker.gyp:pkixchecker',
'<(DEPTH)/lib/libpkix/pkix/params/params.gyp:pkixparams',
'<(DEPTH)/lib/libpkix/pkix/results/results.gyp:pkixresults',
'<(DEPTH)/lib/libpkix/pkix/top/top.gyp:pkixtop',
'<(DEPTH)/lib/libpkix/pkix/util/util.gyp:pkixutil',
'<(DEPTH)/lib/libpkix/pkix/crlsel/crlsel.gyp:pkixcrlsel',
'<(DEPTH)/lib/libpkix/pkix/store/store.gyp:pkixstore',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/pki/pki.gyp:pkixpki',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/system/system.gyp:pkixsystem',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/module/module.gyp:pkixmodule'
],
}],
]},{ # !use_static_libs
'conditions': [
['moz_fold_libs==0', {
Expand Down
1 change: 1 addition & 0 deletions gtests/freebl_gtest/freebl_gtest.gyp
Expand Up @@ -51,6 +51,7 @@
'<(DEPTH)/lib/dev/dev.gyp:nssdev',
'<(DEPTH)/lib/pki/pki.gyp:nsspki',
'<(DEPTH)/lib/ssl/ssl.gyp:ssl',
'<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
],
'conditions': [
[ 'OS=="win"', {
Expand Down
18 changes: 2 additions & 16 deletions gtests/nss_bogo_shim/nss_bogo_shim.gyp
Expand Up @@ -35,29 +35,15 @@
'<(DEPTH)/lib/dev/dev.gyp:nssdev',
'<(DEPTH)/lib/base/base.gyp:nssb',
'<(DEPTH)/lib/freebl/freebl.gyp:freebl',
'<(DEPTH)/lib/zlib/zlib.gyp:nss_zlib'
'<(DEPTH)/lib/zlib/zlib.gyp:nss_zlib',
'<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
],
'conditions': [
[ 'disable_dbm==0', {
'dependencies': [
'<(DEPTH)/lib/dbm/src/src.gyp:dbm',
],
}],
[ 'disable_libpkix==0', {
'dependencies': [
'<(DEPTH)/lib/libpkix/pkix/certsel/certsel.gyp:pkixcertsel',
'<(DEPTH)/lib/libpkix/pkix/checker/checker.gyp:pkixchecker',
'<(DEPTH)/lib/libpkix/pkix/crlsel/crlsel.gyp:pkixcrlsel',
'<(DEPTH)/lib/libpkix/pkix/params/params.gyp:pkixparams',
'<(DEPTH)/lib/libpkix/pkix/results/results.gyp:pkixresults',
'<(DEPTH)/lib/libpkix/pkix/store/store.gyp:pkixstore',
'<(DEPTH)/lib/libpkix/pkix/top/top.gyp:pkixtop',
'<(DEPTH)/lib/libpkix/pkix/util/util.gyp:pkixutil',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/system/system.gyp:pkixsystem',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/module/module.gyp:pkixmodule',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/pki/pki.gyp:pkixpki',
],
}],
],
}
],
Expand Down
16 changes: 1 addition & 15 deletions gtests/ssl_gtest/ssl_gtest.gyp
Expand Up @@ -62,6 +62,7 @@
'<(DEPTH)/lib/base/base.gyp:nssb',
'<(DEPTH)/lib/zlib/zlib.gyp:nss_zlib',
'<(DEPTH)/cpputil/cpputil.gyp:cpputil',
'<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
],
'conditions': [
[ 'test_build==1', {
Expand All @@ -81,21 +82,6 @@
'<(DEPTH)/lib/dbm/src/src.gyp:dbm',
],
}],
[ 'disable_libpkix==0', {
'dependencies': [
'<(DEPTH)/lib/libpkix/pkix/certsel/certsel.gyp:pkixcertsel',
'<(DEPTH)/lib/libpkix/pkix/checker/checker.gyp:pkixchecker',
'<(DEPTH)/lib/libpkix/pkix/crlsel/crlsel.gyp:pkixcrlsel',
'<(DEPTH)/lib/libpkix/pkix/params/params.gyp:pkixparams',
'<(DEPTH)/lib/libpkix/pkix/results/results.gyp:pkixresults',
'<(DEPTH)/lib/libpkix/pkix/store/store.gyp:pkixstore',
'<(DEPTH)/lib/libpkix/pkix/top/top.gyp:pkixtop',
'<(DEPTH)/lib/libpkix/pkix/util/util.gyp:pkixutil',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/system/system.gyp:pkixsystem',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/module/module.gyp:pkixmodule',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/pki/pki.gyp:pkixpki',
],
}],
],
}
],
Expand Down
1 change: 1 addition & 0 deletions gtests/util_gtest/util_gtest.gyp
Expand Up @@ -29,6 +29,7 @@
'<(DEPTH)/lib/dev/dev.gyp:nssdev',
'<(DEPTH)/lib/pki/pki.gyp:nsspki',
'<(DEPTH)/lib/ssl/ssl.gyp:ssl',
'<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
],
'conditions': [
[ 'OS=="win"', {
Expand Down
3 changes: 2 additions & 1 deletion help.txt
Expand Up @@ -2,7 +2,7 @@ Usage: build.sh [-hcv] [-j <n>] [--nspr] [--gyp|-g] [--opt|-o] [-m32]
[--test] [--pprof] [--scan-build[=output]] [--ct-verif]
[--asan] [--ubsan] [--msan] [--sancov[=edge|bb|func|...]]
[--disable-tests] [--fuzz[=tls|oss]] [--system-sqlite]
[--no-zdefs] [--with-nspr] [--system-nspr]
[--no-zdefs] [--with-nspr] [--system-nspr] [--enable-libpkix]

This script builds NSS with gyp and ninja.

Expand Down Expand Up @@ -40,3 +40,4 @@ NSS build tool options:
--with-nspr=/path/to/nspr/include:/path/to/nspr/lib
--system-nspr use system nspr. This requires an installation of NSPR and
might not work on all systems.
--enable-libpkix make libpkix part of the build.
31 changes: 31 additions & 0 deletions lib/libpkix/libpkix.gyp
@@ -0,0 +1,31 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
{
'includes': [
'../../coreconf/config.gypi'
],
'targets': [
{
'target_name': 'libpkix',
'type': 'none',
'conditions': [
[ 'disable_libpkix==0', {
'dependencies': [
'pkix/certsel/certsel.gyp:pkixcertsel',
'pkix/checker/checker.gyp:pkixchecker',
'pkix/crlsel/crlsel.gyp:pkixcrlsel',
'pkix/params/params.gyp:pkixparams',
'pkix/results/results.gyp:pkixresults',
'pkix/store/store.gyp:pkixstore',
'pkix/top/top.gyp:pkixtop',
'pkix/util/util.gyp:pkixutil',
'pkix_pl_nss/module/module.gyp:pkixmodule',
'pkix_pl_nss/pki/pki.gyp:pkixpki',
'pkix_pl_nss/system/system.gyp:pkixsystem',
],
}],
],
},
],
}
18 changes: 1 addition & 17 deletions lib/nss/nss.gyp
Expand Up @@ -33,24 +33,8 @@
'<(DEPTH)/lib/pki/pki.gyp:nsspki',
'<(DEPTH)/lib/dev/dev.gyp:nssdev',
'<(DEPTH)/lib/base/base.gyp:nssb',
'<(DEPTH)/lib/libpkix/libpkix.gyp:libpkix',
],
'conditions': [
[ 'disable_libpkix==0', {
'dependencies': [
'<(DEPTH)/lib/libpkix/pkix/certsel/certsel.gyp:pkixcertsel',
'<(DEPTH)/lib/libpkix/pkix/checker/checker.gyp:pkixchecker',
'<(DEPTH)/lib/libpkix/pkix/params/params.gyp:pkixparams',
'<(DEPTH)/lib/libpkix/pkix/results/results.gyp:pkixresults',
'<(DEPTH)/lib/libpkix/pkix/top/top.gyp:pkixtop',
'<(DEPTH)/lib/libpkix/pkix/util/util.gyp:pkixutil',
'<(DEPTH)/lib/libpkix/pkix/crlsel/crlsel.gyp:pkixcrlsel',
'<(DEPTH)/lib/libpkix/pkix/store/store.gyp:pkixstore',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/pki/pki.gyp:pkixpki',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/system/system.gyp:pkixsystem',
'<(DEPTH)/lib/libpkix/pkix_pl_nss/module/module.gyp:pkixmodule'
],
}],
],
},
{
'target_name': 'nss3',
Expand Down
10 changes: 8 additions & 2 deletions mach
Expand Up @@ -100,7 +100,13 @@ class testAction(argparse.Action):
def runTest(self, test, cycles="standard"):
cwd = os.path.dirname(os.path.abspath(__file__))
domsuf = os.getenv('DOMSUF', "localdomain")
env = {"NSS_TESTS": test, "NSS_CYCLES": cycles, "DOMSUF": domsuf}
host = os.getenv('HOST', "localhost")
env = {
"NSS_TESTS": test,
"NSS_CYCLES": cycles,
"DOMSUF": domsuf,
"HOST": host
}
command = cwd + "/tests/all.sh"
subprocess.check_call(command, env=env)

Expand Down Expand Up @@ -131,7 +137,7 @@ def parse_arguments():
parser_test = subparsers.add_parser(
'tests', help='Run tests through tests/all.sh.')
tests = [
"cipher", "lowhash", "libpkix", "cert", "dbtests", "tools", "fips",
"cipher", "lowhash", "chains", "cert", "dbtests", "tools", "fips",
"sdr", "crmf", "smime", "ssl", "ocsp", "merge", "pkits", "ec",
"gtests", "ssl_gtests"
]
Expand Down
18 changes: 2 additions & 16 deletions nss.gyp
Expand Up @@ -59,7 +59,8 @@
'lib/smime/smime.gyp:smime',
'lib/softoken/softoken.gyp:softokn',
'lib/ssl/ssl.gyp:ssl',
'lib/util/util.gyp:nssutil'
'lib/util/util.gyp:nssutil',
'lib/libpkix/libpkix.gyp:libpkix',
],
'conditions': [
[ 'OS=="linux"', {
Expand All @@ -73,21 +74,6 @@
'lib/softoken/legacydb/legacydb.gyp:nssdbm',
],
}],
[ 'disable_libpkix==0', {
'dependencies': [
'lib/libpkix/pkix/certsel/certsel.gyp:pkixcertsel',
'lib/libpkix/pkix/checker/checker.gyp:pkixchecker',
'lib/libpkix/pkix/crlsel/crlsel.gyp:pkixcrlsel',
'lib/libpkix/pkix/params/params.gyp:pkixparams',
'lib/libpkix/pkix/results/results.gyp:pkixresults',
'lib/libpkix/pkix/store/store.gyp:pkixstore',
'lib/libpkix/pkix/top/top.gyp:pkixtop',
'lib/libpkix/pkix/util/util.gyp:pkixutil',
'lib/libpkix/pkix_pl_nss/module/module.gyp:pkixmodule',
'lib/libpkix/pkix_pl_nss/pki/pki.gyp:pkixpki',
'lib/libpkix/pkix_pl_nss/system/system.gyp:pkixsystem',
],
}],
[ 'use_system_sqlite==0', {
'dependencies': [
'lib/sqlite/sqlite.gyp:sqlite',
Expand Down
16 changes: 13 additions & 3 deletions readme.md
Expand Up @@ -42,9 +42,10 @@ your system environment to use the libraries of your build from the "lib"
directory, e.g., using the `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH`.

Usage: build.sh [-hcv] [-j <n>] [--nspr] [--gyp|-g] [--opt|-o] [-m32]
[--test] [--fuzz] [--pprof] [--scan-build[=output]]
[--test] [--pprof] [--scan-build[=output]] [--ct-verif]
[--asan] [--ubsan] [--msan] [--sancov[=edge|bb|func|...]]
[--ct-verif] [--disable-tests]
[--disable-tests] [--fuzz[=tls|oss]] [--system-sqlite]
[--no-zdefs] [--with-nspr] [--system-nspr] [--enable-libpkix]

This script builds NSS with gyp and ninja.

Expand All @@ -62,7 +63,9 @@ directory, e.g., using the `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH`.
--opt|-o do an opt build
-m32 do a 32-bit build on a 64-bit system
--test ignore map files and export everything we have
--fuzz enable fuzzing mode. this always enables test builds
--fuzz build fuzzing targets (this always enables test builds)
--fuzz=tls to enable TLS fuzzing mode
--fuzz=oss to build for OSS-Fuzz
--pprof build with gperftool support
--ct-verif build with valgrind for ct-verif
--scan-build run the build with scan-build (scan-build has to be in the path)
Expand All @@ -74,6 +77,13 @@ directory, e.g., using the `LD_LIBRARY_PATH` or `DYLD_LIBRARY_PATH`.
--sancov do sanitize coverage builds
--sancov=func sets coverage to function level for example
--disable-tests don't build tests and corresponding cmdline utils
--system-sqlite use system sqlite
--no-zdefs don't set -Wl,-z,defs
--with-nspr don't build NSPR but use the one at the given location, e.g.
--with-nspr=/path/to/nspr/include:/path/to/nspr/lib
--system-nspr use system nspr. This requires an installation of NSPR and
might not work on all systems.
--enable-libpkix make libpkix part of the build.

## Building NSS (legacy build system)

Expand Down

0 comments on commit f1d3d05

Please sign in to comment.