config.mk (10503B)
1 # 2 # This Source Code Form is subject to the terms of the Mozilla Public 3 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 6 # Configuration information for building in the "Core Components" source module 7 8 ####################################################################### 9 # [1.0] Master "Core Components" source and release <architecture> # 10 # tags # 11 ####################################################################### 12 ifndef MK_ARCH 13 include $(CORE_DEPTH)/coreconf/arch.mk 14 endif 15 16 ####################################################################### 17 # [2.0] Master "Core Components" default command macros # 18 # (NOTE: may be overridden in $(OS_TARGET)$(OS_RELEASE).mk) # 19 ####################################################################### 20 ifndef MK_COMMAND 21 include $(CORE_DEPTH)/coreconf/command.mk 22 endif 23 24 ####################################################################### 25 # [3.0] Master "Core Components" <architecture>-specific macros # 26 # (dependent upon <architecture> tags) # 27 # # 28 # We are moving towards just having a $(OS_TARGET).mk file # 29 # as opposed to multiple $(OS_TARGET)$(OS_RELEASE).mk files, # 30 # one for each OS release. # 31 ####################################################################### 32 33 TARGET_OSES = FreeBSD NetBSD OpenUNIX QNX Darwin OpenBSD \ 34 AIX WINNT Linux Android 35 36 ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET))) 37 include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk 38 else 39 ifeq ($(OS_TARGET),SunOS) 40 include $(CORE_DEPTH)/coreconf/SunOS5.mk 41 else 42 include $(CORE_DEPTH)/coreconf/$(OS_TARGET)$(OS_RELEASE).mk 43 endif 44 endif 45 46 ####################################################################### 47 # [4.0] Master "Core Components" source and release <platform> tags # 48 # (dependent upon <architecture> tags) # 49 ####################################################################### 50 PLATFORM = $(OBJDIR_NAME) 51 52 ####################################################################### 53 # [5.0] Master "Core Components" release <tree> tags # 54 # (dependent upon <architecture> tags) # 55 ####################################################################### 56 ifndef MK_TREE 57 include $(CORE_DEPTH)/coreconf/tree.mk 58 endif 59 60 ####################################################################### 61 # [6.0] Master "Core Components" source and release <component> tags # 62 # NOTE: A component is also called a module or a subsystem. # 63 # (dependent upon $(MODULE) being defined on the # 64 # command line, as an environment variable, or in individual # 65 # makefiles, or more appropriately, manifest.mn) # 66 ####################################################################### 67 ifndef MK_MODULE 68 include $(CORE_DEPTH)/coreconf/module.mk 69 endif 70 71 ####################################################################### 72 # [7.0] Master "Core Components" release <version> tags # 73 # (dependent upon $(MODULE) being defined on the # 74 # command line, as an environment variable, or in individual # 75 # makefiles, or more appropriately, manifest.mn) # 76 ####################################################################### 77 ifndef MK_VERSION 78 include $(CORE_DEPTH)/coreconf/version.mk 79 endif 80 81 ####################################################################### 82 # [8.0] Master "Core Components" macros to figure out # 83 # binary code location # 84 # (dependent upon <platform> tags) # 85 ####################################################################### 86 ifndef MK_LOCATION 87 include $(CORE_DEPTH)/coreconf/location.mk 88 endif 89 90 ####################################################################### 91 # [9.0] Master "Core Components" <component>-specific source path # 92 # (dependent upon <user_source_tree>, <source_component>, # 93 # <version>, and <platform> tags) # 94 ####################################################################### 95 ifndef MK_SOURCE 96 include $(CORE_DEPTH)/coreconf/source.mk 97 endif 98 99 ####################################################################### 100 # [10.0] Master "Core Components" include switch for support header # 101 # files # 102 # (dependent upon <tree>, <component>, <version>, # 103 # and <platform> tags) # 104 ####################################################################### 105 ifndef MK_HEADERS 106 include $(CORE_DEPTH)/coreconf/headers.mk 107 endif 108 109 ####################################################################### 110 # [11.0] Master "Core Components" for computing program prefixes # 111 ####################################################################### 112 ifndef MK_PREFIX 113 include $(CORE_DEPTH)/coreconf/prefix.mk 114 endif 115 116 ####################################################################### 117 # [12.0] Master "Core Components" for computing program suffixes # 118 # (dependent upon <architecture> tags) # 119 ####################################################################### 120 ifndef MK_SUFFIX 121 include $(CORE_DEPTH)/coreconf/suffix.mk 122 endif 123 124 ####################################################################### 125 # [14.0] Master "Core Components" rule set # 126 ####################################################################### 127 ifndef MK_RULESET 128 include $(CORE_DEPTH)/coreconf/ruleset.mk 129 endif 130 131 ####################################################################### 132 # Master "Core Components" macros for Hardware features # 133 ####################################################################### 134 135 ifndef NSS_DISABLE_SSE3 136 NSS_DISABLE_SSE3 = 0 137 ifndef CC_IS_CLANG 138 ifeq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION)))) 139 NSS_DISABLE_SSE3 = 1 140 endif 141 endif 142 ifeq (1,$(NSS_DISABLE_SSE3)) 143 export NSS_DISABLE_SSE3 144 endif 145 endif #ndef NSS_DISABLE_SSE3 146 147 ifndef NSS_DISABLE_AVX2 148 ifneq ($(CPU_ARCH),x86_64) 149 # Disable AVX2 entirely on non-Intel platforms 150 NSS_DISABLE_AVX2 = 1 151 else 152 # Clang reports its version as an older gcc, but it's OK 153 ifndef CC_IS_CLANG 154 ifneq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION)))) 155 NSS_DISABLE_AVX2 = 1 156 endif 157 endif 158 ifeq (1,$(NSS_DISABLE_AVX2)) 159 $(warning Unable to find gcc 4.8 or greater, disabling -mavx2) 160 export NSS_DISABLE_AVX2 161 endif 162 endif 163 endif #ndef NSS_DISABLE_AVX2 164 165 ####################################################################### 166 # [16.0] Global environ ment defines 167 ####################################################################### 168 169 ifdef NSS_ALLOW_UNSUPPORTED_CRITICAL 170 DEFINES += -DNSS_ALLOW_UNSUPPORTED_CRITICAL 171 endif 172 173 ifdef BUILD_LIBPKIX_TESTS 174 DEFINES += -DBUILD_LIBPKIX_TESTS 175 endif 176 177 ifdef NSS_DISABLE_LIBPKIX 178 DEFINES += -DNSS_DISABLE_LIBPKIX 179 endif 180 181 ifdef NSS_DISABLE_DBM 182 DEFINES += -DNSS_DISABLE_DBM 183 endif 184 185 ifdef NSS_DISABLE_DSA 186 DEFINES += -DNSS_DISABLE_DSA 187 endif 188 189 ifdef NSS_DISABLE_AVX2 190 DEFINES += -DNSS_DISABLE_AVX2 191 endif 192 193 ifdef NSS_DISABLE_SSE3 194 DEFINES += -DNSS_DISABLE_SSE3 195 endif 196 197 ifdef NSS_DISABLE_CHACHAPOLY 198 DEFINES += -DNSS_DISABLE_CHACHAPOLY 199 endif 200 201 ifdef NSS_DISABLE_DEPRECATED_SEED 202 DEFINES += -DNSS_DISABLE_DEPRECATED_SEED 203 endif 204 205 ifdef NSS_DISABLE_DEPRECATED_RC2 206 DEFINES += -DNSS_DISABLE_DEPRECATED_RC2 207 endif 208 209 ifdef NSS_PKIX_NO_LDAP 210 DEFINES += -DNSS_PKIX_NO_LDAP 211 endif 212 213 # FIPS support requires startup tests to be executed at load time of shared modules. 214 # For performance reasons, these tests are disabled by default. 215 # When compiling binaries that must support FIPS mode, 216 # you should define NSS_FORCE_FIPS 217 # 218 # NSS_NO_INIT_SUPPORT is always defined on platforms that don't support 219 # executing the startup tests at library load time. 220 ifndef NSS_FORCE_FIPS 221 DEFINES += -DNSS_NO_INIT_SUPPORT 222 endif 223 224 ifdef NSS_SEED_ONLY_DEV_URANDOM 225 DEFINES += -DSEED_ONLY_DEV_URANDOM 226 endif 227 228 ifdef NSS_PKCS1_AllowMissingParameters 229 DEFINES += -DNSS_PKCS1_AllowMissingParameters 230 endif 231 232 # Avoid building object leak test code for optimized library 233 ifndef BUILD_OPT 234 ifdef PKIX_OBJECT_LEAK_TEST 235 DEFINES += -DPKIX_OBJECT_LEAK_TEST 236 endif 237 endif 238 239 # Avoid building with Neon acceleration on Arm32 240 ifdef NSS_DISABLE_ARM32_NEON 241 DEFINES += -DNSS_DISABLE_ARM32_NEON 242 endif 243 244 ifdef NSS_DISABLE_KYBER 245 DEFINES += -DNSS_DISABLE_KYBER 246 endif 247 248 # Avoid building with PowerPC's Altivec acceleration 249 ifeq ($(NSS_DISABLE_ALTIVEC),1) 250 DEFINES += -DNSS_DISABLE_ALTIVEC 251 endif 252 253 # Avoid building with PowerPC's Crypto and VSX instructions 254 ifeq ($(NSS_DISABLE_CRYPTO_VSX),1) 255 DEFINES += -DNSS_DISABLE_CRYPTO_VSX 256 endif 257 258 # This allows all library and tools code to use the util function 259 # implementations directly from libnssutil3, rather than the wrappers 260 # in libnss3 which are present for binary compatibility only 261 DEFINES += -DUSE_UTIL_DIRECTLY 262 USE_UTIL_DIRECTLY = 1 263 264 # Build with NO_NSPR_10_SUPPORT to avoid using obsolete NSPR features 265 DEFINES += -DNO_NSPR_10_SUPPORT 266 267 # Hide old, deprecated, TLS cipher suite names when building NSS 268 DEFINES += -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES 269 270 271 # By default the PKCS5_PBKD2_PARAMS(structure) version is determined based on the 272 # cryptokiVersion of the token, PKCS5_PBKD2_PARAMS2 structure is used for version 273 # 2.40 or later, PKCS5_PBKD2_PARAMS structure is used otherwise. 274 # This define allows to force the use of PKCS5_PBKD2_PARAMS2 structure only. 275 ifdef NSS_USE_PKCS5_PBKD2_PARAMS2_ONLY 276 DEFINES += -DNSS_USE_PKCS5_PBKD2_PARAMS2_ONLY 277 endif 278 279 # By default the PKCS5_PBKD2_PARAMS(structure) version is auto-detected based on 280 # the difference between the two structures,by default this limits 281 # the password length to 8192 bytes. 282 # Using this define, only PKCS5_PBKD2_PARAMS2 structure is expected, this can cause 283 # segmentation fault if PKCS5_PBKD2_PARAMS structure is provided!). 284 # Additional the password length is not limited with this option. 285 ifdef SOFTOKEN_USE_PKCS5_PBKD2_PARAMS2_ONLY 286 DEFINES += -DSOFTOKEN_USE_PKCS5_PBKD2_PARAMS2_ONLY 287 endif