Skip to content

Commit

Permalink
Bug 1312397 - add test builds to gyp, r=ttaubert
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 1edaf257f6392c44b8e05fcfe1d12d733299442a
extra : amend_source : 917d5029a78f7db0cf396eb9a71ed75d8fafa61f
  • Loading branch information
franziskuskiefer committed Oct 24, 2016
1 parent 93339d6 commit d29d2a3
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 49 deletions.
4 changes: 3 additions & 1 deletion build.sh
Expand Up @@ -7,6 +7,7 @@
# -c = clean before build
# -g = force a rebuild of gyp (and NSPR, because why not)
# -v = verbose build
# --test = ignore map files and export everything we have

set -e

Expand All @@ -23,6 +24,7 @@ while [ $# -gt 0 ]; do
-c) CLEAN=1 ;;
-g) REBUILD_GYP=1 ;;
-v) VERBOSE=1 ;;
--test) GYP_PARAMS="$GYP_PARAMS -Dtest_build=1" ;;
esac
shift
done
Expand All @@ -40,7 +42,7 @@ fi
if [ "$USE_64" == "1" ]; then
TARGET="${TARGET}_x64"
else
GYP_PARAMS="-Dtarget_arch=ia32"
GYP_PARAMS="$GYP_PARAMS -Dtarget_arch=ia32"
fi
TARGET_DIR="$CWD/out/$TARGET"

Expand Down
1 change: 1 addition & 0 deletions cmd/lib/lib.gyp
Expand Up @@ -9,6 +9,7 @@
{
'target_name': 'sectool',
'type': 'static_library',
'standalone_static_library': 1,
'sources': [
'basicutil.c',
'derprint.c',
Expand Down
97 changes: 53 additions & 44 deletions coreconf/config.gypi
Expand Up @@ -97,13 +97,15 @@
'moz_folded_library_name%': '',
'ssl_enable_zlib%': 1,
'use_asan%': 0,
'test_build%': 0,
},
'target_defaults': {
# Settings specific to targets should go here.
# This is mostly for linking to libraries.
'variables': {
'mapfile%': '',
},
'standalone_static_library': 0,
'include_dirs': [
'<(nspr_include_dir)',
'<(nss_dist_dir)/private/<(module)',
Expand All @@ -116,57 +118,64 @@
'-lc',
],
}],
[ 'test_build!=1', {
# skip the maps for test builds
'target_conditions': [
# mapfile handling
[ 'mapfile!=""', {
# Work around a gyp bug. Fixed upstream but not in Ubuntu packages:
# https://chromium.googlesource.com/external/gyp/+/b85ad3e578da830377dbc1843aa4fbc5af17a192%5E%21/
'sources': [
'<(DEPTH)/coreconf/empty.c',
] ,
'xcode_settings': {
'OTHER_LDFLAGS': [
'-exported_symbols_list',
'<(INTERMEDIATE_DIR)/out.>(mapfile)',
],
},
'conditions': [
[ 'OS=="linux" or OS=="android"', {
'ldflags': [
'-Wl,--version-script,<(INTERMEDIATE_DIR)/out.>(mapfile)',
],
}],
[ 'OS=="win"', {
# On Windows, .def files are used directly as sources.
'sources': [
'>(mapfile)',
],
}, {
# On other platforms, .def files need processing.
'sources': [
'<(INTERMEDIATE_DIR)/out.>(mapfile)',
],
'actions': [{
'action_name': 'generate_mapfile',
'inputs': [
'>(mapfile)',
],
'outputs': [
'<(INTERMEDIATE_DIR)/out.>(mapfile)',
],
'action': ['<@(process_map_file)'],
}],
}]
],
}],
],
}]
],
'target_conditions': [
# If we ever want to properly export a static library, and copy it to lib,
# we will need to mark it as a 'standalone_static_library'. Otherwise,
# If we want to properly export a static library, and copy it to lib,
# we need to mark it as a 'standalone_static_library'. Otherwise,
# the relative paths in the thin archive will break linking.
[ '_type=="shared_library"', {
'product_dir': '<(nss_dist_obj_dir)/lib'
}, '_type=="executable"', {
'product_dir': '<(nss_dist_obj_dir)/bin'
}],
# mapfile handling
[ 'mapfile!=""', {
# Work around a gyp bug. Fixed upstream but not in Ubuntu packages:
# https://chromium.googlesource.com/external/gyp/+/b85ad3e578da830377dbc1843aa4fbc5af17a192%5E%21/
'sources': [
'<(DEPTH)/coreconf/empty.c',
],
'xcode_settings': {
'OTHER_LDFLAGS': [
'-exported_symbols_list',
'<(INTERMEDIATE_DIR)/out.>(mapfile)',
],
},
'conditions': [
[ 'OS=="linux" or OS=="android"', {
'ldflags': [
'-Wl,--version-script,<(INTERMEDIATE_DIR)/out.>(mapfile)',
],
}],
[ 'OS=="win"', {
# On Windows, .def files are used directly as sources.
'sources': [
'>(mapfile)',
],
}, {
# On other platforms, .def files need processing.
'sources': [
'<(INTERMEDIATE_DIR)/out.>(mapfile)',
],
'actions': [{
'action_name': 'generate_mapfile',
'inputs': [
'>(mapfile)',
],
'outputs': [
'<(INTERMEDIATE_DIR)/out.>(mapfile)',
],
'action': ['<@(process_map_file)'],
}],
}]
],
}, '_standalone_static_library==1', {
'product_dir': '<(nss_dist_obj_dir)/lib'
}],
[ '_type=="shared_library" or _type=="executable"', {
'libraries': [
Expand Down
19 changes: 15 additions & 4 deletions lib/freebl/freebl.gyp
Expand Up @@ -99,6 +99,11 @@
'stubs.c',
],
'conditions': [
[ 'test_build==1', {
'dependencies': [
'<(DEPTH)/lib/util/util.gyp:nssutil3',
],
}],
[ 'target_arch=="x64"', {
'sources': [
'arcfour-amd64-gas.s',
Expand Down Expand Up @@ -248,6 +253,10 @@
{
'target_name': 'freebl3',
'type': 'shared_library',
'defines': [
'FREEBL_NO_DEPEND',
'FREEBL_LOWHASH',
],
'sources': [
'lowhash_vector.c'
],
Expand Down Expand Up @@ -339,11 +348,13 @@
],
}],
[ 'OS=="linux"', {
'defines': [
'FREEBL_NO_DEPEND',
'FREEBL_LOWHASH',
],
'conditions': [
[ 'test_build==0', {
'defines': [
'FREEBL_NO_DEPEND',
'FREEBL_LOWHASH',
],
}],
[ 'target_arch=="x64"', {
'defines': [
'MP_IS_LITTLE_ENDIAN',
Expand Down

0 comments on commit d29d2a3

Please sign in to comment.