xref: /aoo42x/main/solenv/inc/unxsoli4.mk (revision cdf0e10c)
1#*************************************************************************
2#
3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4#
5# Copyright 2000, 2010 Oracle and/or its affiliates.
6#
7# OpenOffice.org - a multi-platform office productivity suite
8#
9# This file is part of OpenOffice.org.
10#
11# OpenOffice.org is free software: you can redistribute it and/or modify
12# it under the terms of the GNU Lesser General Public License version 3
13# only, as published by the Free Software Foundation.
14#
15# OpenOffice.org is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18# GNU Lesser General Public License version 3 for more details
19# (a copy is included in the LICENSE file that accompanied this code).
20#
21# You should have received a copy of the GNU Lesser General Public License
22# version 3 along with OpenOffice.org.  If not, see
23# <http://www.openoffice.org/license.html>
24# for a copy of the LGPLv3 License.
25#
26#*************************************************************************
27
28
29ASM=/usr/ccs/bin/as
30AFLAGS=-P
31
32CDEFS+=-D_PTHREADS -DSYSV -DSUN -DSUN4 -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DSTLPORT_VERSION=$(STLPORT_VER)
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*=
48
49CXX*=CC
50CC*=cc
51
52CFLAGS=$(PREENVCFLAGS) -c -temp=/tmp
53CFLAGSCC=-xCC $(ARCH_FLAGS)
54CFLAGSCXX=-features=no%altspell -library=no%Cstd $(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=
70CFLAGSOPT=-xarch=generic -xO3
71CFLAGSNOOPT=
72CFLAGSOUTOBJ=-o
73
74# Warnings switched off for CXX:
75# - doubunder: we have many identifiers containing double underscores, some of
76#   them in the stable UDK API we cannot change
77# - identexpected: Identifier expected instead of "}"
78#   if an enum ends with a comma before the '}'
79#   this warning does not seem to heed #pragma disable_warn, and is not helpful
80# - inllargeuse: "function is too large and will not be expanded inline" is
81#   merely a hint
82# - inllargeint: "function is too large to generate inline, consider writing
83#   it yourself" is merely a hint
84# - notemsource: "could not find source for function" appears to be spurious
85# - reftotemp: warns about calling non-const functions on temporary objects,
86#   something legally done by boost::scoped_array<T>::reset, for example
87#   (this_type(p).swap(*this))
88# - truncwarn: "conversion of 64 bit type value to smaller type causes
89#   truncation" at least with CC 5.8 is reported only at the end of a
90#   compilation unit that uses std::hash_map<sal_Int64, sal_Int64> (see
91#   sfx2/source/toolbox/imgmgr.cxx:1.27) and thus unfortunately needs to be
92#   disabled globally
93# - wnoretvalue: warning about the last statement of a function not
94#   returning a value. Unfortunately triggers on perfectly acceptable
95#   code, for example if the last statement in is a throw statement
96# - anonnotype: Warns if a type is declared in an anonymous union. Temporary
97#   disabled until issue i97325 is fixed. Note: The compiler is actually
98#   right about this warning, the C++ standard is explicit about this.
99CFLAGSWARNCC=
100CFLAGSWARNCXX=+w2 -erroff=doubunder,identexpected,inllargeuse,inllargeint,notemsource,reftotemp,truncwarn,wnoretvalue,anonnotype
101CFLAGSWALLCC=$(CFLAGSWARNCC)
102CFLAGSWALLCXX=$(CFLAGSWARNCXX)
103CFLAGSWERRCC=-errwarn=%all
104CFLAGSWERRCXX=-xwe
105
106# Once all modules on this platform compile without warnings, set
107# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
108# settings.mk):
109MODULES_WITH_WARNINGS := \
110    soldep
111
112STDOBJVCL=$(L)/salmain.o
113
114THREADLIB=
115.IF "$(PURIFY)"!=""
116LINK=/usr/local/purify-4.2-solaris2/purify CC
117.ELSE
118LINK=$(CXX)
119.ENDIF
120LINKC=$(CC)
121
122# link against set of baseline libraries
123.IF "$(SYSBASE)"!=""
124C_RESTRICTIONFLAGS*=-xc99=none
125#LD_OPTIONS+:=-L$(SYSBASE)/usr/lib
126CDEFS+=-DSYSBASE="$(SYSBASE)"
127CFLAGSCC+=$(C_RESTRICTIONFLAGS)
128#.EXPORT : LD_OPTIONS
129.ENDIF          # "$(SYSBASE)"!=""
130
131# -z combreloc combines multiple relocation sections. Reduces overhead on startup
132# -norunpath prevents the compiler from recording his own libs in the runpath
133LINKFLAGSRUNPATH_URELIB=-R\''$$ORIGIN'\'
134LINKFLAGSRUNPATH_UREBIN=-R\''$$ORIGIN/../lib:$$ORIGIN'\'
135    #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
136LINKFLAGSRUNPATH_OOO=-R\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
137LINKFLAGSRUNPATH_SDK=-R\''$$ORIGIN/../../ure-link/lib'\'
138LINKFLAGSRUNPATH_BRAND=-R\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
139LINKFLAGSRUNPATH_OXT=
140LINKFLAGSRUNPATH_BOXT=-R\''$$ORIGIN/../../../basis-link/program'\'
141LINKFLAGSRUNPATH_NONE=
142LINKFLAGS=-w -mt -z combreloc -PIC -temp=/tmp -norunpath -library=no%Cstd
143LINKCFLAGS=-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=-L$(COMPATH)/WS6U1/lib/libp -xpg -z allextract
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+=-ldl
197STDSHLGUIMT+=-ldl
198X11LINK_DYNAMIC = -lXext -lX11
199
200# @@@ interposer needed for -Bdirect @@@
201# LIBSALCPPRT*=-z allextract -lsalcpprt -z defaultextract
202LIBSALCPPRT=
203
204.IF "$(USE_STLP_DEBUG)" != ""
205LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro_debug
206LIBSTLPORTST=$(STATIC) -lstlport_sunpro_debug $(DYNAMIC)
207.ELSE
208LIBSTLPORT=$(DYNAMIC) -lstlport_sunpro
209LIBSTLPORTST=$(STATIC) -lstlport_sunpro $(DYNAMIC)
210.ENDIF # "$(USE_STLP_DEBUG)" != ""
211
212LIBMGR=CC
213LIBFLAGS=-xar -o
214
215IMPLIB=
216IMPLIBFLAGS=
217
218MAPSYM=
219MAPSYMFLAGS=
220IGNORE_SYMBOLS=S-LP64
221
222RC=irc
223RCFLAGS=-fo$@ $(RCFILES)
224RCLINK=
225RCLINKFLAGS=
226RCSETVERSION=
227
228DLLPOSTFIX=si
229
230DLLPRE=lib
231DLLPOST=.so
232
233LDUMP=cppfilt /b /n /o /p
234
235CFLAGSCXXSLO +=
236CFLAGSCXXOBJ +=
237
238LINKFLAGSAPPGUI+=
239LINKFLAGSSHLGUI+=
240LINKFLAGSAPPCUI+=
241LINKFLAGSSHLCUI+=
242