Skip to content

Commit

Permalink
Bug 1356191 - better platform detection for gyp, r=mt
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : a9d844638f07e2f169d97075d729e58614986966
extra : amend_source : 7c5d39c7d4651d29022b79edb1574e604402d97f
  • Loading branch information
franziskuskiefer committed Apr 13, 2017
1 parent f07680d commit ee713af
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 56 deletions.
5 changes: 4 additions & 1 deletion build.sh
Expand Up @@ -49,6 +49,7 @@ fuzz=0
fuzz_tls=0
fuzz_oss=0
no_local_nspr=0
armhf=0

gyp_params=(--depth="$cwd" --generator-output=".")
nspr_params=()
Expand All @@ -58,6 +59,8 @@ ninja_params=()
arch=$(python "$cwd"/coreconf/detect_host_arch.py)
if [ "$arch" = "x64" -o "$arch" = "aarch64" ]; then
build_64=1
elif [ "$arch" = "arm" ]; then
armhf=1
fi

# parse command line arguments
Expand Down Expand Up @@ -101,7 +104,7 @@ else
fi
if [ "$build_64" = 1 ]; then
nspr_params+=(--enable-64bit)
else
elif [ ! "$armhf" = 1 ]; then
gyp_params+=(-Dtarget_arch=ia32)
fi
if [ "$fuzz" = 1 ]; then
Expand Down
41 changes: 41 additions & 0 deletions coreconf/config.gypi
Expand Up @@ -141,6 +141,47 @@
'debug_optimization_level%': '1',
},
}],
[ 'target_arch=="ia32" or target_arch=="x64"', {
'defines': [
'NSS_X86_OR_X64',
],
# For Windows.
'msvs_settings': {
'VCCLCompilerTool': {
'PreprocessorDefinitions': [
'NSS_X86_OR_X64',
],
},
},
}],
[ 'target_arch=="ia32"', {
'defines': [
'NSS_X86',
],
# For Windows.
'msvs_settings': {
'VCCLCompilerTool': {
'PreprocessorDefinitions': [
'NSS_X86',
],
},
},
}],
[ 'target_arch=="x64"', {
'defines': [
'NSS_X64',
'NSS_USE_64',
],
# For Windows.
'msvs_settings': {
'VCCLCompilerTool': {
'PreprocessorDefinitions': [
'NSS_X64',
'NSS_USE_64',
],
},
},
}],
],
'target_conditions': [
# If we want to properly export a static library, and copy it to lib,
Expand Down
17 changes: 5 additions & 12 deletions lib/freebl/freebl.gyp
Expand Up @@ -158,8 +158,6 @@
'VCCLCompilerTool': {
#TODO: -Ox optimize flags
'PreprocessorDefinitions': [
'NSS_X86_OR_X64',
'NSS_X86',
'MP_ASSEMBLY_MULTIPLY',
'MP_ASSEMBLY_SQUARE',
'MP_ASSEMBLY_DIV_2DX1D',
Expand All @@ -177,8 +175,6 @@
#TODO: -Ox optimize flags
'PreprocessorDefinitions': [
'NSS_USE_64',
'NSS_X86_OR_X64',
'NSS_X64',
'MP_IS_LITTLE_ENDIAN',
'NSS_BEVAND_ARCFOUR',
'MPI_AMD64',
Expand All @@ -195,8 +191,10 @@
[ 'target_arch=="x64"', {
'defines': [
'NSS_USE_64',
'NSS_X86_OR_X64',
'NSS_X64',
],
}],
[ 'target_arch=="x64" or target_arch=="arm64" or target_arch=="aarch64"', {
'defines': [
# The Makefile does version-tests on GCC, but we're not doing that here.
'HAVE_INT128_SUPPORT',
],
Expand All @@ -205,12 +203,6 @@
'ecl/uint128.c',
],
}],
[ 'target_arch=="ia32"', {
'defines': [
'NSS_X86_OR_X64',
'NSS_X86',
],
}],
],
}],
[ 'OS=="linux"', {
Expand Down Expand Up @@ -251,6 +243,7 @@
'MP_ASSEMBLY_SQUARE',
'MP_USE_UINT_DIGIT',
'SHA_NO_LONG_LONG',
'ARMHF',
],
}],
[ 'target_arch=="arm64" or target_arch=="aarch64"', {
Expand Down
43 changes: 0 additions & 43 deletions lib/jar/jar.gyp
Expand Up @@ -26,49 +26,6 @@
'defines': [
'MOZILLA_CLIENT=1',
],
'conditions': [
[ 'OS=="win"', {
'configurations': {
'x86_Base': {
'msvs_settings': {
'VCCLCompilerTool': {
'PreprocessorDefinitions': [
'NSS_X86_OR_X64',
'NSS_X86',
],
},
},
},
'x64_Base': {
'msvs_settings': {
'VCCLCompilerTool': {
'PreprocessorDefinitions': [
'NSS_USE_64',
'NSS_X86_OR_X64',
'NSS_X64',
],
},
},
},
},
}, {
'conditions': [
[ 'target_arch=="x64"', {
'defines': [
'NSS_USE_64',
'NSS_X86_OR_X64',
'NSS_X64',
],
}],
[ 'target_arch=="ia32"', {
'defines': [
'NSS_X86_OR_X64',
'NSS_X86',
],
}],
],
}],
],
},
'variables': {
'module': 'nss'
Expand Down

0 comments on commit ee713af

Please sign in to comment.