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/.
6 include $(CORE_DEPTH
)/coreconf
/UNIX.mk
8 # Sun's WorkShop defines v8, v8plus and v9 architectures.
9 # gcc on Solaris defines v8 and v9 "cpus".
10 # gcc's v9 is equivalent to Workshop's v8plus.
11 # gcc's -m64 is equivalent to Workshop's v9
17 ifeq ($(OS_TEST
),i86pc
)
24 ifneq ($(OS_TEST
),i86pc
)
28 ARCHFLAG
=-xarch
=v8plus
37 OS_CFLAGS
+= -Wall
-Wno-format
-Werror-implicit-function-declaration
-Wno-switch
38 OS_CFLAGS
+= -D__EXTENSIONS__
40 CCC
+= -Wall
-Wno-format
41 ASFLAGS
+= -x assembler-with-cpp
42 OS_CFLAGS
+= $(NOMD_OS_CFLAGS
) $(ARCHFLAG
)
45 # Enable this for accurate dtrace profiling
46 # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
52 OS_CFLAGS
+= $(NOMD_OS_CFLAGS
) $(ARCHFLAG
)
66 OS_DEFINES
+= -DSVR4
-DSYSV
-D__svr4
-D__svr4__
-DSOLARIS
-D_REENTRANT
68 ifeq ($(OS_TEST
),i86pc
)
77 # Purify doesn't like -MDupdate
78 NOMD_OS_CFLAGS
+= $(DSO_CFLAGS
) $(OS_DEFINES
) $(SOL_CFLAGS
)
80 MKSHLIB
= $(CC
) $(DSO_LDOPTS
) $(RPATH
)
82 ifeq (GNU
,$(findstring GNU
,$(shell `$(CC) -print-prog-name=ld` -v
2>&1)))
89 MKSHLIB
+= -Wl
,--version-script
,$(MAPFILE
)
91 MKSHLIB
+= -Wl
,-M
,$(MAPFILE
)
94 MKSHLIB
+= -M
$(MAPFILE
)
97 PROCESS_MAP_FILE
= grep
-v
';-' $< | \
98 sed
-e
's,;+,,' -e
's; DATA ;;' -e
's,;;,,' -e
's,;.*,;,' > $@
101 # -G: produce a shared object
102 # -z defs: no unresolved symbols allowed
107 DSO_LDOPTS
+= -shared
-h
$(notdir $@
)
110 ifeq ($(OS_TEST
),i86pc
)
111 DSO_LDOPTS
+=-xarch
=amd64
113 DSO_LDOPTS
+=-xarch
=v9
116 DSO_LDOPTS
+= -G
-h
$(notdir $@
)
118 DSO_LDOPTS
+= -z combreloc
-z defs
-z ignore
120 # -KPIC generates position independent code for use in shared libraries.
121 # (Similarly for -fPIC in case of gcc.)
128 NOSUCHFILE
= /solaris-rm-f-sucks
130 ifeq ($(BUILD_SUN_PKG
), 1)
131 # The -R '$ORIGIN' linker option instructs this library to search for its
132 # dependencies in the same directory where it resides.
134 RPATH
= -R
'$$ORIGIN:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
136 RPATH
= -R
'$$ORIGIN:/usr/lib/mps/secv1:/usr/lib/mps'
139 RPATH
= -R
'$$ORIGIN'
142 OS_LIBS
+= -lthread
-lnsl
-lsocket
-lposix4
-ldl
-lc