merge the formfield patch from ooo-build
[ooovba.git] / solenv / inc / unxlng.mk
blob1404ccd7e683e19c9fcf6ee1a53f4b0e8f133c37
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: unxlngi6.mk,v $
11 # $Revision: 1.48 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 # generic mk file for unxlng (unix linux glibc)
33 ASM*=
34 AFLAGS*=
35 SOLAR_JAVA*=
36 # default optimization level for product code
37 CDEFAULTOPT*=-O2
38 # architecture dependent flags for the C and C++ compiler that can be changed by
39 # exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
40 ARCH_FLAGS*=
41 # position independent code switch
42 PICSWITCH*:=-fpic
43 JAVAFLAGSDEBUG=-g
45 # filter for supressing verbose messages from linker
46 #not needed at the moment
47 #LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
49 # _PTHREADS is needed for the stl
50 CDEFS+=$(PTHREAD_CFLAGS) -DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER)
52 # enable visibility define in "sal/types.h"
53 .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
54 CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
55 .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
57 # this is a platform with JAVA support
58 .IF "$(SOLAR_JAVA)"!=""
59 JAVADEF=-DSOLAR_JAVA
60 .IF "$(debug)"==""
61 JAVA_RUNTIME=-ljava
62 .ELSE
63 JAVA_RUNTIME=-ljava_g
64 .ENDIF
65 .ENDIF
67 # name of C++ Compiler
68 CXX*=g++
69 # name of C Compiler
70 CC*=gcc
71 .IF "$(SYSBASE)"!=""
72 CFLAGS_SYSBASE:=-isystem $(SYSBASE)$/usr$/include
73 CXX+:=$(CFLAGS_SYSBASE)
74 CC+:=$(CFLAGS_SYSBASE)
75 .ENDIF # "$(SYSBASE)"!=""
76 CFLAGS+=-fmessage-length=0 -c
78 # flags to enable build with symbols; required for crashdump feature
79 .IF "$(ENABLE_SYMBOLS)"=="SMALL"
80 CFLAGSENABLESYMBOLS=-g1
81 .ELSE
82 CFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta
84 .ENDIF
86 # flags for the C++ Compiler
87 CFLAGSCC= -pipe $(ARCH_FLAGS)
88 # Flags for enabling exception handling
89 CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
90 # Flags for disabling exception handling
91 CFLAGS_NO_EXCEPTIONS=-fno-exceptions
93 # -fpermissive should be removed as soon as possible
94 CFLAGSCXX= -pipe $(ARCH_FLAGS)
95 .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" && "$(HAVE_GCC_VISIBILITY_BROKEN)" != "TRUE"
96 CFLAGSCXX += -fvisibility-inlines-hidden
97 .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
99 CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
100 CFLAGS_USE_PCH=-I$(SLO)$/pch -DPRECOMPILED_HEADERS -Winvalid-pch
101 CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)$/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
103 # Compiler flags for compiling static object in multi threaded environment with graphical user interface
104 CFLAGSOBJGUIMT=
105 # Compiler flags for compiling static object in multi threaded environment with character user interface
106 CFLAGSOBJCUIMT=
107 # Compiler flags for compiling shared object in multi threaded environment with graphical user interface
108 CFLAGSSLOGUIMT=$(PICSWITCH)
109 # Compiler flags for compiling shared object in multi threaded environment with character user interface
110 CFLAGSSLOCUIMT=$(PICSWITCH)
111 # Compiler flags for profiling
112 CFLAGSPROF=
113 # Compiler flags for debugging
114 CFLAGSDEBUG=-g
115 CFLAGSDBGUTIL=
116 # Compiler flags for enabling optimizations
117 .IF "$(PRODUCT)"!=""
118 CFLAGSOPT=$(CDEFAULTOPT) -fno-strict-aliasing # optimizing for products
119 .ELSE # "$(PRODUCT)"!=""
120 CFLAGSOPT= # no optimizing for non products
121 .ENDIF # "$(PRODUCT)"!=""
122 # Compiler flags for disabling optimizations
123 CFLAGSNOOPT=-O0
124 # Compiler flags for describing the output path
125 CFLAGSOUTOBJ=-o
127 # -Wshadow does not work for C with nested uses of pthread_cleanup_push:
128 CFLAGSWARNCC=-Wall -Wextra -Wendif-labels
129 CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \
130 -Wno-non-virtual-dtor
131 CFLAGSWALLCC=$(CFLAGSWARNCC)
132 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
133 CFLAGSWERRCC=-Werror
135 # Once all modules on this platform compile without warnings, set
136 # COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see
137 # settings.mk):
138 MODULES_WITH_WARNINGS := \
139 soldep
141 # switches for dynamic and static linking
142 STATIC = -Wl,-Bstatic
143 DYNAMIC = -Wl,-Bdynamic
145 # name of linker
146 LINK*=$(CXX)
147 LINKC*=$(CC)
149 # default linker flags
150 LINKFLAGSDEFS*=-Wl,-z,defs
151 LINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\'
152 LINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\'
153 #TODO: drop $ORIGIN once no URE executable is also shipped in OOo
154 LINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\'
155 LINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\'
156 LINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\'
157 LINKFLAGSRUNPATH_OXT=
158 LINKFLAGSRUNPATH_NONE=
159 # flag -Wl,-z,noexecstack sets the NX bit on the stack
160 LINKFLAGS=-Wl,-z,noexecstack -Wl,-z,combreloc $(LINKFLAGSDEFS)
161 .IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE"
162 LINKFLAGS += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo
163 .ENDIF
164 .IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
165 LINKFLAGS += -Wl,--as-needed
166 .ENDIF
168 # linker flags for linking applications
169 LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
170 -Wl,-rpath-link,$(LB):$(SOLARLIBDIR)
171 LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \
172 -Wl,-rpath-link,$(LB):$(SOLARLIBDIR)
174 # linker flags for linking shared libraries
175 LINKFLAGSSHLGUI= -shared
176 LINKFLAGSSHLCUI= -shared
178 LINKFLAGSTACK=
179 LINKFLAGSPROF=
180 LINKFLAGSDEBUG=-g
181 LINKFLAGSOPT=
183 # linker flags for optimization (symbol hashtable)
184 # for now, applied to symbol scoped libraries, only
185 LINKFLAGSOPTIMIZE*=-Wl,-O1
186 LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script
188 SONAME_SWITCH=-Wl,-h
190 # Sequence of libs does matter !
192 STDLIBCPP=-lstdc++
194 # default objectfilenames to link
195 STDOBJVCL=$(L)$/salmain.o
196 STDOBJGUI=
197 STDSLOGUI=
198 STDOBJCUI=
199 STDSLOCUI=
201 .IF "$(ALLOC)" == "TCMALLOC"
202 STDLIBGUIMT+=-ltcmalloc
203 STDLIBCUIMT+=-ltcmalloc
204 STDSHLGUIMT+=-ltcmalloc
205 STDSHLCUIMT+=-ltcmalloc
206 .ENDIF
207 .IF "$(HAVE_LD_HASH_STYLE)" == "TRUE"
208 LINKFLAGS += -Wl,--hash-style=$(WITH_LINKER_HASH_STYLE)
209 .ELSE
210 LINKFLAGS += -Wl,-zdynsort
211 .ENDIF
213 # libraries for linking applications
214 STDLIBGUIMT+=-Wl,--as-needed -lX11 -ldl -lpthread -lm -Wl,--no-as-needed
215 STDLIBCUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed
216 # libraries for linking shared libraries
217 STDSHLGUIMT+=-Wl,--as-needed -lX11 -lXext -ldl -lpthread -lm -Wl,--no-as-needed
218 STDSHLCUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed
220 LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive
222 .IF "$(USE_STLP_DEBUG)" != ""
223 .IF "$(STLPORT_VER)" >= "500"
224 LIBSTLPORT=$(DYNAMIC) -lstlportstlg
225 LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC)
226 .ELSE
227 LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug
228 LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC)
229 .ENDIF
230 .ELSE # "$(USE_STLP_DEBUG)" != ""
231 .IF "$(STLPORT_VER)" >= "500"
232 LIBSTLPORT=$(DYNAMIC) -lstlport
233 LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC)
234 .ELSE
235 LIBSTLPORT=$(DYNAMIC) -lstlport_gcc
236 LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC)
237 .ENDIF
238 .ENDIF # "$(USE_STLP_DEBUG)" != ""
240 #FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC)
242 # name of library manager
243 LIBMGR*=ar
244 LIBFLAGS=-r
246 # tool for generating import libraries
247 IMPLIB=
248 IMPLIBFLAGS=
250 MAPSYM=
251 MAPSYMFLAGS=
253 RC=irc
254 RCFLAGS=-fo$@ $(RCFILES)
255 RCLINK=
256 RCLINKFLAGS=
257 RCSETVERSION=
259 # platform specific identifier for shared libs
260 DLLPRE=lib
261 DLLPOST=.so
262 PCHPOST=.gch