xref: /aoo41x/main/solenv/inc/unxsolu4.mk (revision 910823ae)
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
25# 64 bit (LP64) platform
26IS_LP64=TRUE
27
28ASM=/usr/ccs/bin/as
29AFLAGS=-P -xarch=v9
30
31
32CDEFS+=-D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DIS_LP64
33
34SOLAR_JAVA*=TRUE
35.IF "$(SOLAR_JAVA)"!=""
36JAVADEF=-DSOLAR_JAVA
37JAVAFLAGSDEBUG=-g
38.IF "$(debug)"==""
39JAVA_RUNTIME=-ljava
40.ELSE
41JAVA_RUNTIME=-ljava_g
42.ENDIF
43.ENDIF
44
45# architecture dependent flags for the C and C++ compiler that can be changed by
46# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
47ARCH_FLAGS*=-m64
48
49CXX*=CC
50CC*=cc
51
52CFLAGS=$(PREENVCFLAGS) -c -temp=/tmp
53CFLAGSCC=-xCC $(ARCH_FLAGS)
54CFLAGSCXX= -features=no%altspell -library=stlport4 $(ARCH_FLAGS)
55
56# flags to enable build with symbols; required for crashdump feature
57CFLAGSENABLESYMBOLS=-g0 -xs # was temporarily commented out, reenabled before Beta
58CFLAGSENABLESYMBOLS_CC_ONLY=-g -xs # was temporarily commented out, reenabled before Beta
59
60CFLAGSEXCEPTIONS=
61CFLAGS_NO_EXCEPTIONS=-noex
62
63CFLAGSOBJGUIMT=-KPIC -mt
64CFLAGSOBJCUIMT=-KPIC -mt
65CFLAGSSLOGUIMT=-KPIC -mt
66CFLAGSSLOCUIMT=-KPIC -mt
67CFLAGSPROF=-xpg
68CFLAGSDEBUG=-g
69CFLAGSDBGUTIL=
70#  -xO3                     optimization level 3
71CFLAGSOPT= -xO3 -xalias_level=compatible
72CFLAGSNOOPT=
73CFLAGSOUTOBJ=-o
74
75# Warnings switched off for CXX:
76# - doubunder: we have many identifiers containing double underscores, some of
77#   them in the stable UDK API we cannot change
78# - identexpected: Identifier expected instead of "}"
79#   if an enum ends with a comma before the '}'
80#   this warning does not seem to heed #pragma disable_warn, and is not helpful
81# - inllargeuse: "function is too large and will not be expanded inline" is
82#   merely a hint
83# - inllargeint: "function is too large to generate inline, consider writing
84#   it yourself" is merely a hint
85# - notemsource: "could not find source for function" appears to be spurious
86# - reftotemp: warns about calling non-const functions on temporary objects,
87#   something legally done by boost::scoped_array<T>::reset, for example
88#   (this_type(p).swap(*this))
89# - truncwarn: "conversion of 64 bit type value to smaller type causes
90#   truncation" at least with CC 5.8 is reported only at the end of a
91#   compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
92#   sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
93#   disabled globally
94# - wnoretvalue: "The last statement should return a value."
95#   CC 5.9: the compiler does often not notice that there is no way
96#   to reach the closing brace of a function without either returning a proper
97#   value or throwing an exception.
98# - hidef:  "d::foo() hides the function b::foo()." We got still some cases of mixed
99#   sal_uInt32 and ULONG usages which needs to be fixed. We can then remove this one
100CFLAGSWARNCC=
101CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,hidef,anonnotype,unassigned,badargtype2w
102CFLAGSWALLCC=$(CFLAGSWARNCC)
103CFLAGSWALLCXX=$(CFLAGSWARNCXX)
104CFLAGSWERRCC=-errwarn=%all
105CFLAGSWERRCXX=-xwe
106
107# Once all modules on this platform compile without warnings, set
108# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
109# settings.mk):
110MODULES_WITH_WARNINGS := \
111    soldep
112
113STDOBJVCL=$(L)/salmain.o
114
115THREADLIB=
116LINK=$(CXX)
117LINKC=$(CC)
118
119# link against set of baseline libraries
120.IF "$(SYSBASE)"!=""
121C_RESTRICTIONFLAGS*=-xc99=none
122LD_OPTIONS+=-L$(SYSBASE)/usr/lib
123CDEFS+=-DSYSBASE="$(SYSBASE)"
124CFLAGSCC+=$(C_RESTRICTIONFLAGS)
125.EXPORT : LD_OPTIONS
126.ENDIF          # "$(SYSBASE)"!=""
127
128# -z combreloc combines multiple relocation sections. Reduces overhead on startup
129# -norunpath prevents the compiler from recording his own libs in the runpath
130LINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
131LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN'\'
132#LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
133    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
134LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN'\'
135LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN'\'
136#LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
137#LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
138LINKFLAGSRUNPATH_OXT=
139LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN'\'
140#LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
141LINKFLAGSRUNPATH_NONE=
142LINKFLAGS=-m64 -w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=stlport4
143LINKCFLAGS=-m64 -w -mt -z combreloc -norunpath
144
145# -z text force fatal error if non PIC code is linked into shared library. Such code
146#    would be expensive on startup
147CHECKFORPIC =-z text
148LINKFLAGSSHLGUI=$(CHECKFORPIC) -G
149LINKFLAGSSHLCUI=$(CHECKFORPIC) -G
150
151# switches for dynamic and static linking
152LINKFLAGSDEFS*= -z defs
153STATIC		= -Bstatic
154DIRECT		= -Bdirect $(LINKFLAGSDEFS)
155DYNAMIC		= -Bdynamic
156
157LINKFLAGSAPPGUI+=$(DIRECT)
158LINKFLAGSAPPCUI+=$(DIRECT)
159LINKFLAGSSHLGUI+=$(DIRECT)
160LINKFLAGSSHLCUI+=$(DIRECT)
161
162LINKFLAGSTACK=
163LINKFLAGSPROF=
164LINKFLAGSDEBUG=
165LINKFLAGSOPT=
166LINKVERSIONMAPFLAG=-M
167
168# mapfile for non-executable stack
169LINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
170LINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
171LINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
172
173APPLINKSTATIC=$(STATIC)
174APPLINKSHARED=$(DIRECT)
175APP_LINKTYPE=
176
177STDLIBCPP=-lCrun
178
179# reihenfolge der libs NICHT egal!
180STDOBJGUI=
181.IF "DBG_UTIL" != ""
182STDSLOGUI=#-lpthread
183.ELSE
184STDSLOGUI=
185.ENDIF
186STDOBJCUI=
187STDSLOCUI=
188
189# CPPRUNTIME - define where to place C++ runtime if required
190STDLIBGUIMT=$(DYNAMIC) -lpthread -lm
191STDLIBCUIMT=$(DYNAMIC) -lpthread -lm
192STDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
193STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
194
195# libdl.so - no really an GUI library but required in this context
196STDLIBGUIMT+=-lX11 -ldl
197STDSHLGUIMT+=-lX11 -ldl
198
199# @@@ interposer needed for -Bdirect @@@
200# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
201LIBSALCPPRT=
202
203.IF "$(USE_STLP_DEBUG)" != ""
204LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
205LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
206.ELSE
207LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
208LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
209.ENDIF # "$(USE_STLP_DEBUG)" != ""
210
211LIBMGR=CC
212LIBFLAGS=-xar -o
213
214IMPLIB=
215IMPLIBFLAGS=
216
217MAPSYM=
218MAPSYMFLAGS=
219IGNORE_SYMBOLS=S-ILP32
220
221RC=irc
222RCFLAGS=-fo$@ $(RCFILES)
223RCLINK=
224RCLINKFLAGS=
225RCSETVERSION=
226
227DLLPOSTFIX=
228
229DLLPRE=lib
230DLLPOST=.so
231
232LDUMP=cppfilt /b /n /o /p
233
234CFLAGSCXXSLO +=
235CFLAGSCXXOBJ +=
236
237LINKFLAGSAPPGUI+=
238LINKFLAGSSHLGUI+=
239LINKFLAGSAPPCUI+=
240LINKFLAGSSHLCUI+=
241
242BUILD64=1
243