security/nss/coreconf/arch.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/coreconf/arch.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,297 @@
     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 +# Master "Core Components" macros for getting the OS architecture     #
    1.11 +# defines these symbols:
    1.12 +# 64BIT_TAG
    1.13 +# OS_ARCH	(from uname -r)
    1.14 +# OS_TEST	(from uname -m)
    1.15 +# OS_RELEASE	(from uname -v and/or -r)
    1.16 +# OS_TARGET	User defined, or set to OS_ARCH
    1.17 +# CPU_ARCH  	(from unmame -m or -p, ONLY on WINNT)
    1.18 +# OS_CONFIG	OS_TARGET + OS_RELEASE
    1.19 +# OBJDIR_TAG
    1.20 +# OBJDIR_NAME
    1.21 +#######################################################################
    1.22 +
    1.23 +#
    1.24 +# Macros for getting the OS architecture
    1.25 +#
    1.26 +
    1.27 +ifeq ($(USE_64), 1)
    1.28 +	64BIT_TAG=_64
    1.29 +else
    1.30 +	64BIT_TAG=
    1.31 +endif
    1.32 +
    1.33 +OS_ARCH := $(subst /,_,$(shell uname -s))
    1.34 +
    1.35 +#
    1.36 +# Attempt to differentiate between sparc and x86 Solaris
    1.37 +#
    1.38 +
    1.39 +OS_TEST := $(shell uname -m)
    1.40 +ifeq ($(OS_TEST),i86pc)
    1.41 +    OS_RELEASE := $(shell uname -r)_$(OS_TEST)
    1.42 +else
    1.43 +    OS_RELEASE := $(shell uname -r)
    1.44 +endif
    1.45 +
    1.46 +#
    1.47 +# Force the IRIX64 machines to use IRIX.
    1.48 +#
    1.49 +
    1.50 +ifeq ($(OS_ARCH),IRIX64)
    1.51 +    OS_ARCH = IRIX
    1.52 +endif
    1.53 +
    1.54 +#
    1.55 +# Force the older BSD/OS versions to use the new arch name.
    1.56 +#
    1.57 +
    1.58 +ifeq ($(OS_ARCH),BSD_386)
    1.59 +    OS_ARCH = BSD_OS
    1.60 +endif
    1.61 +
    1.62 +#
    1.63 +# Catch Deterim if SVR4 is NCR or UNIXWARE
    1.64 +#
    1.65 +
    1.66 +ifeq ($(OS_ARCH),UNIX_SV)
    1.67 +    ifneq ($(findstring NCR, $(shell grep NCR /etc/bcheckrc | head -1 )),)
    1.68 +	OS_ARCH = NCR
    1.69 +    else
    1.70 +	# Make UnixWare something human readable
    1.71 +	OS_ARCH = UNIXWARE
    1.72 +    endif
    1.73 +
    1.74 +    # Get the OS release number, not 4.2
    1.75 +    OS_RELEASE := $(shell uname -v)
    1.76 +endif
    1.77 +
    1.78 +ifeq ($(OS_ARCH),UNIX_System_V)
    1.79 +    OS_ARCH	= NEC
    1.80 +endif
    1.81 +
    1.82 +ifeq ($(OS_ARCH),AIX)
    1.83 +    OS_RELEASE := $(shell uname -v).$(shell uname -r)
    1.84 +endif
    1.85 +
    1.86 +#
    1.87 +# Distinguish between OSF1 V4.0B and V4.0D
    1.88 +#
    1.89 +
    1.90 +ifeq ($(OS_ARCH)$(OS_RELEASE),OSF1V4.0)
    1.91 +    OS_VERSION := $(shell uname -v)
    1.92 +    ifeq ($(OS_VERSION),564)
    1.93 +	OS_RELEASE := V4.0B
    1.94 +    endif
    1.95 +    ifeq ($(OS_VERSION),878)
    1.96 +	OS_RELEASE := V4.0D
    1.97 +    endif
    1.98 +endif
    1.99 +
   1.100 +#
   1.101 +# SINIX changes name to ReliantUNIX with 5.43
   1.102 +#
   1.103 +
   1.104 +ifeq ($(OS_ARCH),ReliantUNIX-N)
   1.105 +    OS_ARCH    = ReliantUNIX
   1.106 +    OS_RELEASE = 5.4
   1.107 +endif
   1.108 +
   1.109 +ifeq ($(OS_ARCH),SINIX-N)
   1.110 +    OS_ARCH    = ReliantUNIX
   1.111 +    OS_RELEASE = 5.4
   1.112 +endif
   1.113 +
   1.114 +#
   1.115 +# Handle FreeBSD 2.2-STABLE, Linux 2.0.30-osfmach3, and
   1.116 +# IRIX 6.5-ALPHA-1289139620.
   1.117 +#
   1.118 +
   1.119 +ifeq (,$(filter-out Linux FreeBSD IRIX,$(OS_ARCH)))
   1.120 +    OS_RELEASE := $(shell echo $(OS_RELEASE) | sed 's/-.*//')
   1.121 +endif
   1.122 +
   1.123 +ifeq ($(OS_ARCH),Linux)
   1.124 +    OS_RELEASE := $(subst ., ,$(OS_RELEASE))
   1.125 +    ifneq ($(words $(OS_RELEASE)),1)
   1.126 +	OS_RELEASE := $(word 1,$(OS_RELEASE)).$(word 2,$(OS_RELEASE))
   1.127 +    endif
   1.128 +endif
   1.129 +
   1.130 +#
   1.131 +# For OS/2
   1.132 +#
   1.133 +ifeq ($(OS_ARCH),OS_2)
   1.134 +    OS_ARCH = OS2
   1.135 +    OS_RELEASE := $(shell uname -v)
   1.136 +endif
   1.137 +
   1.138 +#######################################################################
   1.139 +# Master "Core Components" macros for getting the OS target           #
   1.140 +#######################################################################
   1.141 +
   1.142 +#
   1.143 +# Note: OS_TARGET should be specified on the command line for gmake.
   1.144 +# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
   1.145 +# The difference between the Win95 target and the WinNT target is that
   1.146 +# the WinNT target uses Windows NT specific features not available
   1.147 +# in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
   1.148 +# at lesser performance (the Win95 target uses threads; the WinNT target
   1.149 +# uses fibers).
   1.150 +#
   1.151 +# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
   1.152 +# cross-compilation, except on Windows, where it defaults to WIN95.
   1.153 +#
   1.154 +
   1.155 +#
   1.156 +# On WIN32, we also define the variable CPU_ARCH, if it isn't already.
   1.157 +#
   1.158 +ifndef CPU_ARCH
   1.159 +    ifeq ($(OS_ARCH), WINNT)
   1.160 +	CPU_ARCH := $(shell uname -p)
   1.161 +	ifeq ($(CPU_ARCH),I386)
   1.162 +	    CPU_ARCH = x386
   1.163 +	endif
   1.164 +    endif
   1.165 +endif
   1.166 +
   1.167 +# If uname -s returns "Windows_NT", we assume that we are using
   1.168 +# the uname.exe in MKS toolkit.
   1.169 +#
   1.170 +# The -r option of MKS uname only returns the major version number.
   1.171 +# So we need to use its -v option to get the minor version number.
   1.172 +# Moreover, it doesn't have the -p option, so we need to use uname -m.
   1.173 +#
   1.174 +ifeq ($(OS_ARCH), Windows_NT)
   1.175 +    OS_ARCH = WINNT
   1.176 +    OS_MINOR_RELEASE := $(shell uname -v)
   1.177 +    # strip leading 0
   1.178 +    OS_MINOR_RELEASE := $(patsubst 0%,%,$(OS_MINOR_RELEASE))
   1.179 +    OS_RELEASE := $(OS_RELEASE).$(OS_MINOR_RELEASE)
   1.180 +    ifndef CPU_ARCH
   1.181 +	CPU_ARCH := $(shell uname -m)
   1.182 +	#
   1.183 +	# MKS's uname -m returns "586" on a Pentium machine.
   1.184 +	#
   1.185 +	ifneq (,$(findstring 86,$(CPU_ARCH)))
   1.186 +	    CPU_ARCH = x386
   1.187 +	endif
   1.188 +    endif
   1.189 +endif
   1.190 +#
   1.191 +# If uname -s returns "CYGWIN_NT-*", we assume that we are using
   1.192 +# the uname.exe in the Cygwin tools.
   1.193 +#
   1.194 +ifeq (CYGWIN_NT,$(findstring CYGWIN_NT,$(OS_ARCH)))
   1.195 +    OS_RELEASE := $(patsubst CYGWIN_NT-%,%,$(OS_ARCH))
   1.196 +    OS_ARCH = WINNT
   1.197 +    ifndef CPU_ARCH
   1.198 +    ifeq (WOW64,$(findstring WOW64,$(OS_RELEASE)))
   1.199 +        OS_RELEASE := $(patsubst %-WOW64,%,$(OS_RELEASE))
   1.200 +    endif    
   1.201 +	CPU_ARCH := $(shell uname -m)
   1.202 +	#
   1.203 +	# Cygwin's uname -m returns "i686" on a Pentium Pro machine.
   1.204 +	#
   1.205 +	ifneq (,$(findstring 86,$(CPU_ARCH)))
   1.206 +	    CPU_ARCH = x386
   1.207 +	endif
   1.208 +    endif
   1.209 +endif
   1.210 +#
   1.211 +# If uname -s returns "MINGW32_NT-*", we assume that we are using
   1.212 +# the uname.exe in the MSYS toolkit.
   1.213 +#
   1.214 +ifeq (MINGW32_NT,$(findstring MINGW32_NT,$(OS_ARCH)))
   1.215 +    OS_RELEASE := $(patsubst MINGW32_NT-%,%,$(OS_ARCH))
   1.216 +    OS_ARCH = WINNT
   1.217 +    USE_MSYS = 1
   1.218 +    ifndef CPU_ARCH
   1.219 +	CPU_ARCH := $(shell uname -m)
   1.220 +	#
   1.221 +	# MSYS's uname -m returns "i686" on a Pentium Pro machine.
   1.222 +	#
   1.223 +	ifneq (,$(findstring 86,$(CPU_ARCH)))
   1.224 +	    CPU_ARCH = x386
   1.225 +	endif
   1.226 +    endif
   1.227 +endif
   1.228 +
   1.229 +ifeq ($(OS_TARGET),Android)
   1.230 +#
   1.231 +# this should be  configurable from the user
   1.232 +#
   1.233 +   OS_TEST := arm
   1.234 +   OS_ARCH = Android
   1.235 +   ifndef OS_TARGET_RELEASE
   1.236 +	OS_TARGET_RELEASE := 8
   1.237 +   endif
   1.238 +endif
   1.239 +
   1.240 +ifndef OS_TARGET
   1.241 +ifeq ($(OS_ARCH), WINNT)
   1.242 +    OS_TARGET = WIN95
   1.243 +else
   1.244 +    OS_TARGET = $(OS_ARCH)
   1.245 +endif
   1.246 +endif
   1.247 +
   1.248 +ifeq ($(OS_TARGET), WIN95)
   1.249 +    OS_RELEASE = 4.0
   1.250 +endif
   1.251 +
   1.252 +ifdef OS_TARGET_RELEASE
   1.253 +    OS_RELEASE = $(OS_TARGET_RELEASE)
   1.254 +endif
   1.255 +
   1.256 +#
   1.257 +# This variable is used to get OS_CONFIG.mk.
   1.258 +#
   1.259 +
   1.260 +OS_CONFIG = $(OS_TARGET)$(OS_RELEASE)
   1.261 +
   1.262 +#
   1.263 +# OBJDIR_TAG depends on the predefined variable BUILD_OPT,
   1.264 +# to distinguish between debug and release builds.
   1.265 +#
   1.266 +
   1.267 +ifdef BUILD_OPT
   1.268 +    OBJDIR_TAG = $(64BIT_TAG)_OPT
   1.269 +else
   1.270 +    ifdef BUILD_IDG
   1.271 +	OBJDIR_TAG = $(64BIT_TAG)_IDG
   1.272 +    else
   1.273 +	OBJDIR_TAG = $(64BIT_TAG)_DBG
   1.274 +    endif
   1.275 +endif
   1.276 +
   1.277 +#
   1.278 +# The following flags are defined in the individual $(OS_CONFIG).mk
   1.279 +# files.
   1.280 +#
   1.281 +# CPU_TAG is defined if the CPU is not the most common CPU.
   1.282 +# COMPILER_TAG is defined if the compiler is not the default compiler.
   1.283 +# IMPL_STRATEGY may be defined too.
   1.284 +#
   1.285 +
   1.286 +OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
   1.287 +
   1.288 +ifeq (,$(filter-out WIN%,$(OS_TARGET)))
   1.289 +ifndef BUILD_OPT
   1.290 +#
   1.291 +# Define USE_DEBUG_RTL if you want to use the debug runtime library
   1.292 +# (RTL) in the debug build
   1.293 +#
   1.294 +ifdef USE_DEBUG_RTL
   1.295 +    OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJD
   1.296 +endif
   1.297 +endif
   1.298 +endif
   1.299 +
   1.300 +MK_ARCH = included

mercurial