xref: /aoo42x/main/solenv/inc/unxsols4.mk (revision f3ecff4e)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24
25ASM=/usr/ccs/bin/as
26# needs -D__sparcv8plus because it's not defined by the assembler with -xarch=v8plus
27AFLAGS=-P -xarch=v8plus -D__sparcv8plus
28
29CDEFS+=-D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=$(STLPORT_VER)
30
31SOLAR_JAVA*=TRUE
32.IF "$(SOLAR_JAVA)"!=""
33JAVADEF=-DSOLAR_JAVA
34JAVAFLAGSDEBUG=-g
35.IF "$(debug)"==""
36JAVA_RUNTIME=-ljava
37.ELSE
38JAVA_RUNTIME=-ljava_g
39.ENDIF
40.ENDIF
41
42# architecture dependent flags for the C and C++ compiler that can be changed by
43# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
44ARCH_FLAGS*=
45
46CXX*=CC
47CC*=cc
48
49CFLAGS=$(PREENVCFLAGS) -c -temp=/tmp
50# CC defines __sparcv8plus with -xarch=v8plus, cc does not (sigh)
51CFLAGSCC=-xCC -D__sparcv8plus $(ARCH_FLAGS)
52CFLAGSCXX=-features=no%altspell -library=no%Cstd $(ARCH_FLAGS)
53
54# flags to enable build with symbols; required for crashdump feature
55CFLAGSENABLESYMBOLS=-g0 -xs # was temporarily commented out, reenabled before Beta
56CFLAGSENABLESYMBOLS_CC_ONLY=-g -xs # was temporarily commented out, reenabled before Beta
57
58CFLAGSEXCEPTIONS=
59CFLAGS_NO_EXCEPTIONS=-noex
60
61CFLAGSOBJGUIMT=-KPIC -mt
62CFLAGSOBJCUIMT=-KPIC -mt
63CFLAGSSLOGUIMT=-KPIC -mt
64CFLAGSSLOCUIMT=-KPIC -mt
65CFLAGSPROF=-xpg
66CFLAGSDEBUG=-g
67CFLAGSDBGUTIL=
68#  -m32 -xarch=sparc        restrict target to 32 bit sparc
69#  -xO3                     optimization level 3
70#  -xspace                  don't do optimizations which do increase binary size
71#  -xprefetch=yes           do prefetching (helps on UltraSparc III)
72CFLAGSOPT=-m32 -xarch=sparc -xO3 -xspace -xprefetch=yes
73CFLAGSNOOPT=
74CFLAGSOUTOBJ=-o
75
76# Warnings switched off for CXX:
77# - doubunder: we have many identifiers containing double underscores, some of
78#   them in the stable UDK API we cannot change
79# - identexpected: Identifier expected instead of "}"
80#   if an enum ends with a comma before the '}'
81#   this warning does not seem to heed #pragma disable_warn, and is not helpful
82# - inllargeuse: "function is too large and will not be expanded inline" is
83#   merely a hint
84# - inllargeint: "function is too large to generate inline, consider writing
85#   it yourself" is merely a hint
86# - notemsource: "could not find source for function" appears to be spurious
87# - reftotemp: warns about calling non-const functions on temporary objects,
88#   something legally done by boost::scoped_array<T>::reset, for example
89#   (this_type(p).swap(*this))
90# - truncwarn: "conversion of 64 bit type value to smaller type causes
91#   truncation" at least with CC 5.8 is reported only at the end of a
92#   compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
93#   sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
94#   disabled globally
95# - wnoretvalue: warning about the last statement of a function not
96#   returning a value. Unfortunately triggers on perfectly acceptable
97#   code, for example if the last statement in is a throw statement
98# - anonnotype: Warns if a type is declared in an anonymous union. Temporary
99#   disabled until issue i97325 is fixed. Note: The compiler is actually
100#   right about this warning, the C++ standard is explicit about this.
101CFLAGSWARNCC=
102CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype
103CFLAGSWALLCC=$(CFLAGSWARNCC)
104CFLAGSWALLCXX=$(CFLAGSWARNCXX)
105CFLAGSWERRCC=-errwarn=%all
106CFLAGSWERRCXX=-xwe
107
108# Once all modules on this platform compile without warnings, set
109# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
110# settings.mk):
111MODULES_WITH_WARNINGS :=
112
113STDOBJVCL=$(L)/salmain.o
114
115THREADLIB=
116.IF "$(PURIFY)"!=""
117LINK=/usr/local/purify-4.2-solaris2/purify CC
118.ELSE
119LINK=$(CXX)
120.ENDIF
121LINKC=$(CC)
122
123# link against set of baseline libraries
124.IF "$(SYSBASE)"!=""
125C_RESTRICTIONFLAGS*=-xc99=none
126#LD_OPTIONS+:=-L$(SYSBASE)/usr/lib
127CDEFS+=-DSYSBASE="$(SYSBASE)"
128CFLAGSCC+=$(C_RESTRICTIONFLAGS)
129#.EXPORT : LD_OPTIONS
130.ENDIF          # "$(SYSBASE)"!=""
131
132# -z combreloc combines multiple relocation sections. Reduces overhead on startup
133# -norunpath prevents the compiler from recording his own libs in the runpath
134LINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
135LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN'\'
136#LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
137    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
138LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN'\'
139LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN'\'
140LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN'\'
141#LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
142#LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN/../../ure-link/lib'\'
143#LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
144LINKFLAGSRUNPATH_OXT=
145LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN'\'
146#LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
147LINKFLAGSRUNPATH_NONE=
148LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
149LINKCFLAGS=-w -mt -z combreloc -norunpath
150
151# -z text force fatal error if non PIC code is linked into shared library. Such code
152#    would be expensive on startup
153CHECKFORPIC =-z text
154LINKFLAGSSHLGUI=$(CHECKFORPIC) -G
155LINKFLAGSSHLCUI=$(CHECKFORPIC) -G
156
157# switches for dynamic and static linking
158LINKFLAGSDEFS*= -z defs
159STATIC		= -Bstatic
160DIRECT		= -Bdirect $(LINKFLAGSDEFS)
161DYNAMIC		= -Bdynamic
162
163LINKFLAGSAPPGUI+=$(DIRECT)
164LINKFLAGSAPPCUI+=$(DIRECT)
165LINKFLAGSSHLGUI+=$(DIRECT)
166LINKFLAGSSHLCUI+=$(DIRECT)
167
168LINKFLAGSTACK=
169LINKFLAGSPROF=-L$(COMPATH)/WS6U1/lib/libp -xpg -z allextract
170LINKFLAGSDEBUG=
171LINKFLAGSOPT=
172LINKVERSIONMAPFLAG=-M
173
174# mapfile for non-executable stack
175LINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
176LINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
177LINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
178
179APPLINKSTATIC=$(STATIC)
180APPLINKSHARED=$(DIRECT)
181APP_LINKTYPE=
182
183STDLIBCPP=-lCrun
184
185# reihenfolge der libs NICHT egal!
186STDOBJGUI=
187.IF "DBG_UTIL" != ""
188STDSLOGUI=#-lpthread
189.ELSE
190STDSLOGUI=
191.ENDIF
192STDOBJCUI=
193STDSLOCUI=
194
195# CPPRUNTIME - define where to place C++ runtime if required
196STDLIBGUIMT=$(DYNAMIC) -lpthread -lm
197STDLIBCUIMT=$(DYNAMIC) -lpthread -lm
198STDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
199STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
200
201# libdl.so - no really an GUI library but required in this context
202STDLIBGUIMT+=-ldl
203STDSHLGUIMT+=-ldl
204X11LINK_DYNAMIC = -lXext -lX11
205
206# @@@ interposer needed for -Bdirect @@@
207# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
208LIBSALCPPRT=
209
210.IF "$(USE_STLP_DEBUG)" != ""
211LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
212LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
213.ELSE
214LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
215LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
216.ENDIF # "$(USE_STLP_DEBUG)" != ""
217
218LIBMGR=CC
219LIBFLAGS=-xar -o
220
221IMPLIB=
222IMPLIBFLAGS=
223
224MAPSYM=
225MAPSYMFLAGS=
226IGNORE_SYMBOLS=S-LP64
227
228RC=irc
229RCFLAGS=-fo$@ $(RCFILES)
230RCLINK=
231RCLINKFLAGS=
232RCSETVERSION=
233
234DLLPOSTFIX=
235
236DLLPRE=lib
237DLLPOST=.so
238
239LDUMP=cppfilt /b /n /o /p
240
241CFLAGSCXXSLO +=
242CFLAGSCXXOBJ +=
243
244LINKFLAGSAPPGUI+=
245LINKFLAGSSHLGUI+=
246LINKFLAGSAPPCUI+=
247LINKFLAGSSHLCUI+=
248