security/nss/coreconf/SunOS5.mk

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/security/nss/coreconf/SunOS5.mk	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,144 @@
     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 +include $(CORE_DEPTH)/coreconf/UNIX.mk
    1.10 +
    1.11 +# Sun's WorkShop defines v8, v8plus and v9 architectures.
    1.12 +# gcc on Solaris defines v8 and v9 "cpus".  
    1.13 +# gcc's v9 is equivalent to Workshop's v8plus.
    1.14 +# gcc's -m64 is equivalent to Workshop's v9
    1.15 +
    1.16 +ifeq ($(USE_64), 1)
    1.17 +  ifdef NS_USE_GCC
    1.18 +      ARCHFLAG=-m64
    1.19 +  else
    1.20 +      ifeq ($(OS_TEST),i86pc)
    1.21 +        ARCHFLAG=-xarch=amd64
    1.22 +      else
    1.23 +        ARCHFLAG=-xarch=v9
    1.24 +      endif
    1.25 +  endif
    1.26 +else
    1.27 +  ifneq ($(OS_TEST),i86pc)
    1.28 +    ifdef NS_USE_GCC
    1.29 +      ARCHFLAG=-mcpu=v9
    1.30 +    else
    1.31 +      ARCHFLAG=-xarch=v8plus
    1.32 +    endif
    1.33 +  endif
    1.34 +endif
    1.35 +
    1.36 +DEFAULT_COMPILER = cc
    1.37 +
    1.38 +ifdef NS_USE_GCC
    1.39 +	CC         = gcc
    1.40 +	OS_CFLAGS += -Wall -Wno-format -Werror-implicit-function-declaration -Wno-switch
    1.41 +	CCC        = g++
    1.42 +	CCC       += -Wall -Wno-format
    1.43 +	ASFLAGS	  += -x assembler-with-cpp
    1.44 +	OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
    1.45 +	ifdef USE_MDUPDATE
    1.46 +		OS_CFLAGS += -MDupdate $(DEPENDENCIES)
    1.47 +	endif
    1.48 +	ifdef BUILD_OPT
    1.49 +	    OPTIMIZER = -O2
    1.50 +	    # Enable this for accurate dtrace profiling
    1.51 +	    # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
    1.52 +	endif
    1.53 +else
    1.54 +	CC         = cc
    1.55 +	CCC        = CC
    1.56 +	ASFLAGS   += -Wa,-P
    1.57 +	OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
    1.58 +	ifndef BUILD_OPT
    1.59 +		OS_CFLAGS  += -xs
    1.60 +	else
    1.61 +		OPTIMIZER = -xO4
    1.62 +	endif
    1.63 +	ifdef USE_TCOV
    1.64 +		CC += -xprofile=tcov
    1.65 +		CCC += -xprofile=tcov
    1.66 +	endif
    1.67 +endif
    1.68 +
    1.69 +RANLIB      = echo
    1.70 +CPU_ARCH    = sparc
    1.71 +OS_DEFINES += -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT
    1.72 +
    1.73 +ifeq ($(OS_TEST),i86pc)
    1.74 +ifeq ($(USE_64),1)
    1.75 +    CPU_ARCH		= x86_64
    1.76 +else
    1.77 +    CPU_ARCH		= x86
    1.78 +    OS_DEFINES		+= -Di386
    1.79 +endif
    1.80 +endif
    1.81 +
    1.82 +# Purify doesn't like -MDupdate
    1.83 +NOMD_OS_CFLAGS += $(DSO_CFLAGS) $(OS_DEFINES) $(SOL_CFLAGS)
    1.84 +
    1.85 +MKSHLIB  = $(CC) $(DSO_LDOPTS) $(RPATH)
    1.86 +ifdef NS_USE_GCC
    1.87 +ifeq (GNU,$(findstring GNU,$(shell `$(CC) -print-prog-name=ld` -v 2>&1)))
    1.88 +	GCC_USE_GNU_LD = 1
    1.89 +endif
    1.90 +endif
    1.91 +ifdef MAPFILE
    1.92 +ifdef NS_USE_GCC
    1.93 +ifdef GCC_USE_GNU_LD
    1.94 +    MKSHLIB += -Wl,--version-script,$(MAPFILE)
    1.95 +else
    1.96 +    MKSHLIB += -Wl,-M,$(MAPFILE)
    1.97 +endif
    1.98 +else
    1.99 +    MKSHLIB += -M $(MAPFILE)
   1.100 +endif
   1.101 +endif
   1.102 +PROCESS_MAP_FILE = grep -v ';-' $< | \
   1.103 +         sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
   1.104 +
   1.105 +# ld options:
   1.106 +# -G: produce a shared object
   1.107 +# -z defs: no unresolved symbols allowed
   1.108 +ifdef NS_USE_GCC
   1.109 +ifeq ($(USE_64), 1)
   1.110 +	DSO_LDOPTS += -m64
   1.111 +endif
   1.112 +	DSO_LDOPTS += -shared -h $(notdir $@)
   1.113 +else
   1.114 +ifeq ($(USE_64), 1)
   1.115 +	ifeq ($(OS_TEST),i86pc)
   1.116 +	    DSO_LDOPTS +=-xarch=amd64
   1.117 +	else
   1.118 +	    DSO_LDOPTS +=-xarch=v9
   1.119 +	endif
   1.120 +endif
   1.121 +	DSO_LDOPTS += -G -h $(notdir $@)
   1.122 +endif
   1.123 +DSO_LDOPTS += -z combreloc -z defs -z ignore
   1.124 +
   1.125 +# -KPIC generates position independent code for use in shared libraries.
   1.126 +# (Similarly for -fPIC in case of gcc.)
   1.127 +ifdef NS_USE_GCC
   1.128 +	DSO_CFLAGS += -fPIC
   1.129 +else
   1.130 +	DSO_CFLAGS += -KPIC
   1.131 +endif
   1.132 +
   1.133 +NOSUCHFILE   = /solaris-rm-f-sucks
   1.134 +
   1.135 +ifeq ($(BUILD_SUN_PKG), 1)
   1.136 +# The -R '$ORIGIN' linker option instructs this library to search for its
   1.137 +# dependencies in the same directory where it resides.
   1.138 +ifeq ($(USE_64), 1)
   1.139 +RPATH = -R '$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
   1.140 +else
   1.141 +RPATH = -R '$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
   1.142 +endif
   1.143 +else
   1.144 +RPATH = -R '$$ORIGIN'
   1.145 +endif
   1.146 +
   1.147 +OS_LIBS += -lthread -lnsl -lsocket -lposix4 -ldl -lc

mercurial