security/nss/coreconf/WIN32.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/coreconf/WIN32.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,368 @@
     1.4 +#
     1.5 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 +
     1.9 +#
    1.10 +# Configuration common to all versions of Windows NT
    1.11 +# and Windows 95
    1.12 +#
    1.13 +
    1.14 +DEFAULT_COMPILER = cl
    1.15 +
    1.16 +ifdef NS_USE_GCC
    1.17 +	CC           = gcc
    1.18 +	CCC          = g++
    1.19 +	LINK         = ld
    1.20 +	AR           = ar
    1.21 +	AR          += cr $@
    1.22 +	RANLIB       = ranlib
    1.23 +	BSDECHO      = echo
    1.24 +	RC           = windres.exe -O coff --use-temp-file
    1.25 +	LINK_DLL      = $(CC) $(OS_DLLFLAGS) $(DLLFLAGS)
    1.26 +else
    1.27 +	CC           = cl
    1.28 +	CCC          = cl
    1.29 +	LINK         = link
    1.30 +	AR           = lib
    1.31 +	AR          += -NOLOGO -OUT:$@
    1.32 +	RANLIB       = echo
    1.33 +	BSDECHO      = echo
    1.34 +	RC           = rc.exe
    1.35 +	MT           = mt.exe
    1.36 +	# Determine compiler version
    1.37 +	CC_VERSION  := $(shell $(CC) 2>&1 | sed -ne \
    1.38 +		's|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p')
    1.39 +	# Change the dots to spaces.
    1.40 +	_CC_VERSION_WORDS := $(subst ., ,$(CC_VERSION))
    1.41 +	_CC_VMAJOR  := $(word 1,$(_CC_VERSION_WORDS))
    1.42 +	_CC_VMINOR  := $(word 2,$(_CC_VERSION_WORDS))
    1.43 +	_CC_RELEASE := $(word 3,$(_CC_VERSION_WORDS))
    1.44 +	_CC_BUILD   := $(word 4,$(_CC_VERSION_WORDS))
    1.45 +	_MSC_VER     = $(_CC_VMAJOR)$(_CC_VMINOR)
    1.46 +	_MSC_VER_6   = 1200
    1.47 +	# VC10 (2010) is 16.00.30319.01, VC10SP1 is 16.00.40219.01.
    1.48 +	_MSC_VER_GE_10SP1 := $(shell expr $(_MSC_VER) \> 1600 \| \
    1.49 +		$(_MSC_VER) = 1600 \& $(_CC_RELEASE) \>= 40219)
    1.50 +	# VC12 (2013).
    1.51 +	_MSC_VER_GE_12 := $(shell expr $(_MSC_VER) \>= 1800)
    1.52 +	ifeq ($(_CC_VMAJOR),14)
    1.53 +	    # -DYNAMICBASE is only supported on VC8SP1 or newer,
    1.54 +	    # so be very specific here!
    1.55 +	    # VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
    1.56 +	    ifeq ($(_CC_RELEASE).$(_CC_BUILD),50727.42)
    1.57 +		USE_DYNAMICBASE =
    1.58 +	    else
    1.59 +	    ifeq ($(_CC_RELEASE).$(_CC_BUILD),50727.762)
    1.60 +		USE_DYNAMICBASE = 1
    1.61 +	    else
    1.62 +		_LOSER := $(error Unknown compiler version $(CC_VERSION))
    1.63 +	    endif
    1.64 +	    endif
    1.65 +	endif
    1.66 +	# if $(_CC_VMAJOR) >= 15
    1.67 +	# NOTE: 'sort' sorts the words in lexical order, so this test works
    1.68 +	# only if $(_CC_VMAJOR) is two digits.
    1.69 +	ifeq ($(firstword $(sort $(_CC_VMAJOR) 15)),15)
    1.70 +	    USE_DYNAMICBASE = 1
    1.71 +	endif
    1.72 +endif
    1.73 +
    1.74 +ifdef BUILD_TREE
    1.75 +NSINSTALL_DIR  = $(BUILD_TREE)/nss
    1.76 +else
    1.77 +NSINSTALL_DIR  = $(CORE_DEPTH)/coreconf/nsinstall
    1.78 +endif
    1.79 +NSINSTALL      = nsinstall
    1.80 +
    1.81 +MKDEPEND_DIR    = $(CORE_DEPTH)/coreconf/mkdepend
    1.82 +MKDEPEND        = $(MKDEPEND_DIR)/$(OBJDIR_NAME)/mkdepend.exe
    1.83 +# Note: MKDEPENDENCIES __MUST__ be a relative pathname, not absolute.
    1.84 +# If it is absolute, gmake will crash unless the named file exists.
    1.85 +MKDEPENDENCIES  = $(OBJDIR_NAME)/depend.mk
    1.86 +
    1.87 +INSTALL      = $(NSINSTALL)
    1.88 +MAKE_OBJDIR  = mkdir
    1.89 +MAKE_OBJDIR += $(OBJDIR)
    1.90 +GARBAGE     += $(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb
    1.91 +XP_DEFINE   += -DXP_PC
    1.92 +ifdef NS_USE_GCC
    1.93 +LIB_SUFFIX   = a
    1.94 +else
    1.95 +LIB_SUFFIX   = lib
    1.96 +endif
    1.97 +DLL_SUFFIX   = dll
    1.98 +
    1.99 +ifdef NS_USE_GCC
   1.100 +    # The -mnop-fun-dllimport flag allows us to avoid a drawback of
   1.101 +    # the dllimport attribute that a pointer to a function marked as
   1.102 +    # dllimport cannot be used as as a constant address.
   1.103 +    OS_CFLAGS += -mwindows -mms-bitfields -mnop-fun-dllimport
   1.104 +    _GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
   1.105 +    DLLFLAGS  += -mwindows -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
   1.106 +    ifdef BUILD_OPT
   1.107 +	ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
   1.108 +		OPTIMIZER += -Os
   1.109 +	else
   1.110 +		OPTIMIZER += -O2
   1.111 +	endif
   1.112 +	DEFINES    += -UDEBUG -U_DEBUG -DNDEBUG
   1.113 +    else
   1.114 +	OPTIMIZER  += -g
   1.115 +	NULLSTRING :=
   1.116 +	SPACE      := $(NULLSTRING) # end of the line
   1.117 +	USERNAME   := $(subst $(SPACE),_,$(USERNAME))
   1.118 +	USERNAME   := $(subst -,_,$(USERNAME))
   1.119 +	DEFINES    += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME)
   1.120 +    endif
   1.121 +else # !NS_USE_GCC
   1.122 +    OS_CFLAGS += -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \
   1.123 +		 -D_CRT_NONSTDC_NO_WARNINGS
   1.124 +    OS_DLLFLAGS += -nologo -DLL -SUBSYSTEM:WINDOWS
   1.125 +    ifeq ($(_MSC_VER),$(_MSC_VER_6))
   1.126 +    ifndef MOZ_DEBUG_SYMBOLS
   1.127 +	OS_DLLFLAGS += -PDB:NONE
   1.128 +    endif
   1.129 +    endif
   1.130 +    ifdef USE_DYNAMICBASE
   1.131 +	OS_DLLFLAGS += -DYNAMICBASE
   1.132 +    endif
   1.133 +    ifdef BUILD_OPT
   1.134 +	OS_CFLAGS  += -MD
   1.135 +	ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
   1.136 +		OPTIMIZER += -O1
   1.137 +	else
   1.138 +		OPTIMIZER += -O2
   1.139 +	endif
   1.140 +	DEFINES    += -UDEBUG -U_DEBUG -DNDEBUG
   1.141 +	DLLFLAGS   += -OUT:$@
   1.142 +	ifdef MOZ_DEBUG_SYMBOLS
   1.143 +		ifdef MOZ_DEBUG_FLAGS
   1.144 +			OPTIMIZER += $(MOZ_DEBUG_FLAGS) -Fd$(OBJDIR)/
   1.145 +		else
   1.146 +			OPTIMIZER += -Zi -Fd$(OBJDIR)/
   1.147 +		endif
   1.148 +		DLLFLAGS += -DEBUG -OPT:REF
   1.149 +		LDFLAGS += -DEBUG -OPT:REF
   1.150 +	endif
   1.151 +    else
   1.152 +	#
   1.153 +	# Define USE_DEBUG_RTL if you want to use the debug runtime library
   1.154 +	# (RTL) in the debug build
   1.155 +	#
   1.156 +	ifdef USE_DEBUG_RTL
   1.157 +		OS_CFLAGS += -MDd -D_CRTDBG_MAP_ALLOC
   1.158 +	else
   1.159 +		OS_CFLAGS += -MD
   1.160 +	endif
   1.161 +	OPTIMIZER += -Zi -Fd$(OBJDIR)/ -Od
   1.162 +	NULLSTRING :=
   1.163 +	SPACE      := $(NULLSTRING) # end of the line
   1.164 +	USERNAME   := $(subst $(SPACE),_,$(USERNAME))
   1.165 +	USERNAME   := $(subst -,_,$(USERNAME))
   1.166 +	DEFINES    += -DDEBUG -D_DEBUG -UNDEBUG -DDEBUG_$(USERNAME)
   1.167 +	DLLFLAGS   += -DEBUG -OUT:$@
   1.168 +	LDFLAGS    += -DEBUG 
   1.169 +ifeq ($(_MSC_VER),$(_MSC_VER_6))
   1.170 +ifndef MOZ_DEBUG_SYMBOLS
   1.171 +	LDFLAGS    += -PDB:NONE 
   1.172 +endif
   1.173 +endif
   1.174 +	# Purify requires /FIXED:NO when linking EXEs.
   1.175 +	LDFLAGS    += /FIXED:NO
   1.176 +    endif
   1.177 +ifneq ($(_MSC_VER),$(_MSC_VER_6))
   1.178 +    # Convert certain deadly warnings to errors (see list at end of file)
   1.179 +    OS_CFLAGS += -we4002 -we4003 -we4004 -we4006 -we4009 -we4013 \
   1.180 +     -we4015 -we4028 -we4033 -we4035 -we4045 -we4047 -we4053 -we4054 -we4063 \
   1.181 +     -we4064 -we4078 -we4087 -we4090 -we4098 -we4390 -we4551 -we4553 -we4715
   1.182 +
   1.183 +    ifeq ($(_MSC_VER_GE_12),1)
   1.184 +	OS_CFLAGS += -FS
   1.185 +    endif
   1.186 +endif # !MSVC6
   1.187 +endif # NS_USE_GCC
   1.188 +
   1.189 +ifdef USE_64
   1.190 +DEFINES += -DWIN64
   1.191 +else
   1.192 +DEFINES += -DWIN32
   1.193 +endif
   1.194 +
   1.195 +ifeq (,$(filter-out x386 x86_64,$(CPU_ARCH)))
   1.196 +ifdef USE_64
   1.197 +	DEFINES += -D_AMD64_
   1.198 +else
   1.199 +	DEFINES += -D_X86_
   1.200 +endif
   1.201 +endif
   1.202 +ifeq ($(CPU_ARCH), ALPHA)
   1.203 +	DEFINES += -D_ALPHA_=1
   1.204 +endif
   1.205 +
   1.206 +ifdef MAPFILE
   1.207 +ifndef NS_USE_GCC
   1.208 +DLLFLAGS += -DEF:$(MAPFILE)
   1.209 +endif
   1.210 +endif
   1.211 +# Change PROCESS to put the mapfile in the correct format for this platform
   1.212 +PROCESS_MAP_FILE = cp $< $@
   1.213 +
   1.214 +
   1.215 +#
   1.216 +#  The following is NOT needed for the NSPR 2.0 library.
   1.217 +#
   1.218 +
   1.219 +DEFINES += -D_WINDOWS
   1.220 +
   1.221 +# override default, which is ASFLAGS = CFLAGS
   1.222 +ifdef NS_USE_GCC
   1.223 +	AS	= $(CC)
   1.224 +	ASFLAGS = $(INCLUDES)
   1.225 +else
   1.226 +ifdef USE_64
   1.227 +	AS	= ml64.exe
   1.228 +	ASFLAGS = -nologo -Cp -Sn -Zi $(INCLUDES)
   1.229 +else
   1.230 +	AS	= ml.exe
   1.231 +	ASFLAGS = -nologo -Cp -Sn -Zi -coff $(INCLUDES)
   1.232 +endif
   1.233 +endif
   1.234 +
   1.235 +#
   1.236 +# override the definitions of RELEASE_TREE found in tree.mk
   1.237 +#
   1.238 +ifndef RELEASE_TREE
   1.239 +    ifdef BUILD_SHIP
   1.240 +	ifdef USE_SHIPS
   1.241 +	    RELEASE_TREE = $(NTBUILD_SHIP)
   1.242 +	else
   1.243 +	    RELEASE_TREE = //redbuild/components
   1.244 +	endif
   1.245 +    else
   1.246 +	RELEASE_TREE = //redbuild/components
   1.247 +    endif
   1.248 +endif
   1.249 +
   1.250 +#
   1.251 +# override the definitions of IMPORT_LIB_PREFIX, LIB_PREFIX, and
   1.252 +# DLL_PREFIX in prefix.mk
   1.253 +#
   1.254 +
   1.255 +ifndef IMPORT_LIB_PREFIX
   1.256 +    ifdef NS_USE_GCC
   1.257 +	IMPORT_LIB_PREFIX = lib
   1.258 +    else
   1.259 +	IMPORT_LIB_PREFIX = $(NULL)
   1.260 +    endif
   1.261 +endif
   1.262 +
   1.263 +ifndef LIB_PREFIX
   1.264 +    ifdef NS_USE_GCC
   1.265 +	LIB_PREFIX = lib
   1.266 +    else
   1.267 +	LIB_PREFIX = $(NULL)
   1.268 +    endif
   1.269 +endif
   1.270 +
   1.271 +ifndef DLL_PREFIX
   1.272 +    DLL_PREFIX =  $(NULL)
   1.273 +endif
   1.274 +
   1.275 +#
   1.276 +# override the definitions of various _SUFFIX symbols in suffix.mk
   1.277 +#
   1.278 +
   1.279 +#
   1.280 +# Object suffixes
   1.281 +#
   1.282 +ifndef OBJ_SUFFIX
   1.283 +    ifdef NS_USE_GCC
   1.284 +	OBJ_SUFFIX = .o
   1.285 +    else
   1.286 +	OBJ_SUFFIX = .obj
   1.287 +    endif
   1.288 +endif
   1.289 +
   1.290 +#
   1.291 +# Assembler source suffixes
   1.292 +#
   1.293 +ifndef ASM_SUFFIX
   1.294 +    ifdef NS_USE_GCC
   1.295 +	ASM_SUFFIX = .s
   1.296 +    else
   1.297 +	ASM_SUFFIX = .asm
   1.298 +    endif
   1.299 +endif
   1.300 +
   1.301 +#
   1.302 +# Library suffixes
   1.303 +#
   1.304 +
   1.305 +ifndef IMPORT_LIB_SUFFIX
   1.306 +    IMPORT_LIB_SUFFIX = .$(LIB_SUFFIX)
   1.307 +endif
   1.308 +
   1.309 +ifndef DYNAMIC_LIB_SUFFIX_FOR_LINKING
   1.310 +    DYNAMIC_LIB_SUFFIX_FOR_LINKING = $(IMPORT_LIB_SUFFIX)
   1.311 +endif
   1.312 +
   1.313 +#
   1.314 +# Program suffixes
   1.315 +#
   1.316 +ifndef PROG_SUFFIX
   1.317 +    PROG_SUFFIX = .exe
   1.318 +endif
   1.319 +
   1.320 +#
   1.321 +# When the processor is NOT 386-based on Windows NT, override the
   1.322 +# value of $(CPU_TAG).  For WinNT, 95, 16, not CE.
   1.323 +#
   1.324 +ifneq ($(CPU_ARCH),x386)
   1.325 +    CPU_TAG = _$(CPU_ARCH)
   1.326 +endif
   1.327 +
   1.328 +#
   1.329 +# override ruleset.mk, removing the "lib" prefix for library names, and
   1.330 +# adding the "32" after the LIBRARY_VERSION.
   1.331 +#
   1.332 +ifdef LIBRARY_NAME
   1.333 +    SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).dll
   1.334 +    IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)32$(JDK_DEBUG_SUFFIX).lib
   1.335 +endif
   1.336 +
   1.337 +#
   1.338 +# override the TARGETS defined in ruleset.mk, adding IMPORT_LIBRARY
   1.339 +#
   1.340 +ifndef TARGETS
   1.341 +    TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(PROGRAM)
   1.342 +endif
   1.343 +
   1.344 +# list of MSVC warnings converted to errors above:
   1.345 +# 4002: too many actual parameters for macro 'identifier'
   1.346 +# 4003: not enough actual parameters for macro 'identifier'
   1.347 +# 4004: incorrect construction after 'defined'
   1.348 +# 4006: #undef expected an identifier
   1.349 +# 4009: string too big; trailing characters truncated
   1.350 +# 4015: 'identifier' : type of bit field must be integral
   1.351 +# 4028: formal parameter different from declaration
   1.352 +# 4033: 'function' must return a value
   1.353 +# 4035: 'function' : no return value
   1.354 +# 4045: 'identifier' : array bounds overflow
   1.355 +# 4047: 'function' : 'type 1' differs in levels of indirection from 'type 2'
   1.356 +# 4053: one void operand for '?:'
   1.357 +# 4054: 'conversion' : from function pointer 'type1' to data pointer 'type2'
   1.358 +# 4059: pascal string too big, length byte is length % 256
   1.359 +# 4063: case 'identifier' is not a valid value for switch of enum 'identifier'
   1.360 +# 4064: switch of incomplete enum 'identifier'
   1.361 +# 4078: case constant 'value' too big for the type of the switch expression
   1.362 +# 4087: 'function' : declared with 'void' parameter list
   1.363 +# 4090: 'function' : different 'const' qualifiers
   1.364 +# 4098: 'function' : void function returning a value
   1.365 +# 4390: ';' : empty controlled statement found; is this the intent?
   1.366 +# 4541: RTTI train wreck
   1.367 +# 4715: not all control paths return a value
   1.368 +# 4013: function undefined; assuming extern returning int
   1.369 +# 4553: '==' : operator has no effect; did you intend '='?
   1.370 +# 4551: function call missing argument list
   1.371 +

mercurial