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