xref: /aoo42x/main/solenv/inc/unxsolu4.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
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
112STDOBJVCL=$(L)/salmain.o
113
114THREADLIB=
115LINK=$(CXX)
116LINKC=$(CC)
117
118# link against set of baseline libraries
119.IF "$(SYSBASE)"!=""
120C_RESTRICTIONFLAGS*=-xc99=none
121LD_OPTIONS+=-L$(SYSBASE)/usr/lib
122CDEFS+=-DSYSBASE="$(SYSBASE)"
123CFLAGSCC+=$(C_RESTRICTIONFLAGS)
124.EXPORT : LD_OPTIONS
125.ENDIF          # "$(SYSBASE)"!=""
126
127# -z combreloc combines multiple relocation sections. Reduces overhead on startup
128# -norunpath prevents the compiler from recording his own libs in the runpath
129LINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
130LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN'\'
131#LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
132    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
133LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN'\'
134LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN'\'
135#LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
136#LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
137LINKFLAGSRUNPATH_OXT=
138LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN'\'
139#LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
140LINKFLAGSRUNPATH_NONE=
141LINKFLAGS=-m64 -w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=stlport4
142LINKCFLAGS=-m64 -w -mt -z combreloc -norunpath
143
144# -z text force fatal error if non PIC code is linked into shared library. Such code
145#    would be expensive on startup
146CHECKFORPIC =-z text
147LINKFLAGSSHLGUI=$(CHECKFORPIC) -G
148LINKFLAGSSHLCUI=$(CHECKFORPIC) -G
149
150# switches for dynamic and static linking
151LINKFLAGSDEFS*= -z defs
152STATIC		= -Bstatic
153DIRECT		= -Bdirect $(LINKFLAGSDEFS)
154DYNAMIC		= -Bdynamic
155
156LINKFLAGSAPPGUI+=$(DIRECT)
157LINKFLAGSAPPCUI+=$(DIRECT)
158LINKFLAGSSHLGUI+=$(DIRECT)
159LINKFLAGSSHLCUI+=$(DIRECT)
160
161LINKFLAGSTACK=
162LINKFLAGSPROF=
163LINKFLAGSDEBUG=
164LINKFLAGSOPT=
165LINKVERSIONMAPFLAG=-M
166
167# mapfile for non-executable stack
168LINKFLAGSNOEXSTK*=$(LINKVERSIONMAPFLAG) $(SOLARENV)/src/solaris_noexstk.map
169LINKFLAGSAPPGUI+=$(LINKFLAGSNOEXSTK)
170LINKFLAGSAPPCUI+=$(LINKFLAGSNOEXSTK)
171
172APPLINKSTATIC=$(STATIC)
173APPLINKSHARED=$(DIRECT)
174APP_LINKTYPE=
175
176STDLIBCPP=-lCrun
177
178# reihenfolge der libs NICHT egal!
179STDOBJGUI=
180.IF "DBG_UTIL" != ""
181STDSLOGUI=#-lpthread
182.ELSE
183STDSLOGUI=
184.ENDIF
185STDOBJCUI=
186STDSLOCUI=
187
188# CPPRUNTIME - define where to place C++ runtime if required
189STDLIBGUIMT=$(DYNAMIC) -lpthread -lm
190STDLIBCUIMT=$(DYNAMIC) -lpthread -lm
191STDSHLGUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
192STDSHLCUIMT=$(DYNAMIC) -lpthread CPPRUNTIME -lm -lc
193
194# libdl.so - no really an GUI library but required in this context
195STDLIBGUIMT+=-lX11 -ldl
196STDSHLGUIMT+=-lX11 -ldl
197
198# @@@ interposer needed for -Bdirect @@@
199# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
200LIBSALCPPRT=
201
202.IF "$(USE_STLP_DEBUG)" != ""
203LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
204LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
205.ELSE
206LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
207LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
208.ENDIF # "$(USE_STLP_DEBUG)" != ""
209
210LIBMGR=CC
211LIBFLAGS=-xar -o
212
213IMPLIB=
214IMPLIBFLAGS=
215
216MAPSYM=
217MAPSYMFLAGS=
218IGNORE_SYMBOLS=S-ILP32
219
220RC=irc
221RCFLAGS=-fo$@ $(RCFILES)
222RCLINK=
223RCLINKFLAGS=
224RCSETVERSION=
225
226DLLPOSTFIX=
227
228DLLPRE=lib
229DLLPOST=.so
230
231LDUMP=cppfilt /b /n /o /p
232
233CFLAGSCXXSLO +=
234CFLAGSCXXOBJ +=
235
236LINKFLAGSAPPGUI+=
237LINKFLAGSSHLGUI+=
238LINKFLAGSAPPCUI+=
239LINKFLAGSSHLCUI+=
240
241BUILD64=1
242