Update ooo320-m1
[ooovba.git] / solenv / inc / unxmacx.mk
blobe9eec7cb09ef25f164a7953d5d7cb1b9fd285b25
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: unxmacx.mk,v $
11 # $Revision: 1.34.56.1 $
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 ##########################################################################
33 # Platform MAKEFILE for Mac OS X and Darwin on both PowerPC and Intel
34 ##########################################################################
36 # PROCESSOR_DEFINES and DLLPOSTFIX are defined in the particular platform file
38 ASM=
39 AFLAGS=
40 LINKOUTPUT_FILTER=
42 # Definitions that we may need on the compile line.
43 # -D_PTHREADS and -D_REENTRANT are needed for STLport, and must be specified when
44 # compiling STLport sources too, either internally or externally.
45 CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -DSTLPORT_VERSION=$(STLPORT_VER) -D_USE_NAMESPACE=1
46 .IF "$(GUIBASE)"=="unx" && "$(USE_SYSTEM_STL)"!="YES"
47 CDEFS+=-DX_LOCALE
48 .ENDIF
49 .IF "$(GUIBASE)"=="aqua"
50 # MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build,
51 # build can assume functions/libraries of that version to be available
52 # unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk
53 # (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
54 # http://developer.apple.com/technotes/tn2002/tn2064.html
55 MACOSX_DEPLOYMENT_TARGET=10.4
56 .EXPORT: MACOSX_DEPLOYMENT_TARGET
57 CDEFS+=-DQUARTZ
58 EXTRA_CDEFS*=-isysroot /Developer/SDKs/MacOSX10.4u.sdk
59 .ENDIF
61 # Name of library where static data members are initialized
62 # STATICLIBNAME=static$(DLLPOSTFIX)
63 # STATICLIB=-l$(STATICLIBNAME)
65 # enable visibility define in "sal/types.h"
66 .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
67 CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
68 .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
71 # MacOS X specific Java compilation/link flags
72 SOLAR_JAVA*=TRUE
73 .IF "$(SOLAR_JAVA)"!=""
74 JAVADEF=-DSOLAR_JAVA
75 JAVAFLAGSDEBUG=-g
76 JAVA_RUNTIME=-framework JavaVM
77 .ENDIF
79 # architecture dependent flags for the C and C++ compiler that can be changed by
80 # exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
81 ARCH_FLAGS*=
83 # Specify the compiler to use. NOTE: MacOS X should always specify
84 # c++ for C++ compilation as it does certain C++ specific things
85 # behind the scenes for us.
86 # CC = C++ compiler to use
87 # cc = C compiler to use
88 # objc = Objective C compiler to use
89 # objcpp = Objective C++ compiler to use
90 CXX*=g++
91 CC*=gcc
92 objc*=gcc
93 objcpp*=g++
95 CFLAGS=-fsigned-char -fmessage-length=0 -malign-natural -c $(EXTRA_CFLAGS)
97 .IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
98 CFLAGS+=-Wno-deprecated-declarations
99 .ENDIF
100 # ---------------------------------
101 # Compilation flags
102 # ---------------------------------
103 # Normal C compilation flags
104 CFLAGSCC=-pipe -fsigned-char -malign-natural $(ARCH_FLAGS)
106 # Normal Objective C compilation flags
107 #OBJCFLAGS=-no-precomp
108 OBJCFLAGS=-fobjc-exceptions
109 # -x options generally ignored by ccache, tell it that it can cache
110 # the result nevertheless
111 CCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL))
112 OBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions
114 # Comp Flags for files that need exceptions enabled (C and C++)
115 CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
117 # Comp Flags for files that do not need exceptions enabled (C and C++)
118 CFLAGS_NO_EXCEPTIONS=-fno-exceptions
120 # Normal C++ compilation flags
121 CFLAGSCXX=-pipe -malign-natural -fsigned-char -Wno-long-double $(ARCH_FLAGS)
122 CFLAGSCXX+= -Wno-ctor-dtor-privacy
124 PICSWITCH:=-fPIC
125 # Other flags
126 CFLAGSOBJGUIMT=$(PICSWITCH) -fno-common
127 CFLAGSOBJCUIMT=$(PICSWITCH) -fno-common
128 CFLAGSSLOGUIMT=$(PICSWITCH) -fno-common
129 CFLAGSSLOCUIMT=$(PICSWITCH) -fno-common
130 CFLAGSPROF=
132 # Flag for including debugging information in object files
133 CFLAGSDEBUG=-g
134 CFLAGSDBGUTIL=
136 # Flag to specify output file to compiler/linker
137 CFLAGSOUTOBJ=-o
139 # Flags to enable precompiled headers
140 CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
141 CFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch
142 CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
144 # ---------------------------------
145 # Optimization flags
146 # ---------------------------------
147 CFLAGSOPT=-O2 -fno-strict-aliasing
148 CFLAGSNOOPT=-O0
150 # -Wshadow does not work for C with nested uses of pthread_cleanup_push:
151 # -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h
152 # l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705,
153 # in template code for which a #pragma gcc system_header would not work:
154 # -Wextra doesn not work for gcc-3.3
155 CFLAGSWARNCC=-Wall -Wendif-labels
156 CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
157 CFLAGSWALLCC=$(CFLAGSWARNCC)
158 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
159 CFLAGSWERRCC=-Werror
161 # All modules on this platform compile without warnings.
162 # If you need to set MODULES_WITH_WARNINGS here, comment
163 # COMPILER_WARN_ERRORS=TRUE here (see settings.mk):
164 COMPILER_WARN_ERRORS=TRUE
166 #special settings form environment
167 CDEFS+=$(EXTRA_CDEFS)
169 STDLIBCPP=-lstdc++
171 # ---------------------------------
172 # STLport library names
173 # ---------------------------------
174 .IF "$(USE_STLP_DEBUG)" != ""
175 .IF "$(STLPORT_VER)" >= "500"
176 LIBSTLPORT=-lstlportstlg
177 LIBSTLPORTST=$(STATIC) -lstlportstlg
178 .ELSE
179 LIBSTLPORT=-lstlport_gcc_stldebug
180 LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc_stldebug.a
181 .ENDIF
182 .ELSE # "$(USE_STLP_DEBUG" != ""
183 .IF "$(STLPORT_VER)" >= "500"
184 LIBSTLPORT=-lstlport
185 LIBSTLPORTST=$(STATIC) -lstlport
186 .ELSE
187 LIBSTLPORT=-lstlport_gcc
188 LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc.a
189 .ENDIF
190 .ENDIF # "$(USE_STLP_DEBUG" != ""
192 # ---------------------------------
193 # Link stage flags
194 # ---------------------------------
195 # always link with gcc since you may be linking c code and don't want -lstdc++ linked in!
197 ## ericb 04 mars 2005
199 LINK*=$(CXX)
200 LINKC*=$(CC)
202 LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress
203 # assure backwards-compatibility
204 EXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
205 # Very long install_names are needed so that install_name_tool -change later on
206 # does not complain that "larger updated load commands do not fit:"
207 LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)'
208 LINKFLAGSRUNPATH_UREBIN=
209 LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)'
210 LINKFLAGSRUNPATH_SDK=
211 LINKFLAGSRUNPATH_BRAND=
212 LINKFLAGSRUNPATH_OXT=
213 LINKFLAGSRUNPATH_NONE=
214 LINKFLAGS=$(LINKFLAGSDEFS)
216 .IF "$(HAVE_WORKING_LD_AS_NEEDED)" == "TRUE"
217 LINKFLAGS += -Wl,--as-needed
218 .ENDIF
220 # [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
221 .IF "$(GUIBASE)" == "aqua"
222 LINKFLAGS+=-lobjc
223 # Sometimes we still use files that would be in a GUIBASE="unx" specific directory
224 # because they really aren't GUIBASE specific, so we've got to account for that here.
225 INCGUI+= -I$(PRJ)/unx/inc
226 .ENDIF
228 #special settings form environment
229 LINKFLAGS+=$(EXTRA_LINKFLAGS)
231 # Random link flags dealing with different cases of linking
233 LINKFLAGSAPPGUI=-bind_at_load
234 LINKFLAGSSHLGUI=-dynamiclib -single_module
235 LINKFLAGSAPPCUI=-bind_at_load
236 LINKFLAGSSHLCUI=-dynamiclib -single_module
237 LINKFLAGSTACK=
238 LINKFLAGSPROF=
240 # Flag to add debugging information to final products
241 LINKFLAGSDEBUG=-g
242 LINKFLAGSOPT=
244 # ---------------------------------
245 # MacOS X shared library specifics
246 # ---------------------------------
248 # Tag to identify an output file as a library
249 DLLPRE=lib
250 # File extension to identify dynamic shared libraries on MacOS X
251 DLLPOST=.dylib
252 # Precompiled header file extension
253 PCHPOST=.gch
255 # We don't use mapping on MacOS X
256 #LINKVERSIONMAPFLAG=-Wl,--version-script
257 LINKVERSIONMAPFLAG=-Wl,-exported_symbols_list
259 SONAME_SWITCH=-Wl,-h
261 STDLIBCPP=-lstdc++
263 STDOBJVCL=$(L)/salmain.o
264 STDOBJGUI=
265 STDSLOGUI=
266 STDOBJCUI=
267 STDSLOCUI=
269 .IF "$(GUIBASE)" == "aqua"
270 STDLIBCUIMT=CPPRUNTIME -lm
271 STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
272 STDSHLCUIMT=-lpthread CPPRUNTIME -lm
273 STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
274 .ELSE
275 STDLIBCUIMT= CPPRUNTIME -lm
276 STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm
277 STDSHLCUIMT=-lpthread CPPRUNTIME -lm
278 STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation
279 .ENDIF
281 LIBMGR=ar
282 LIBFLAGS=-r
284 IMPLIB=
285 IMPLIBFLAGS=
287 MAPSYM=
288 MAPSYMFLAGS=
290 RC=irc
291 RCFLAGS=-fo$@ $(RCFILES)
292 RCLINK=
293 RCLINKFLAGS=
294 RCSETVERSION=
296 # Add SOLARLIBDIR to the end of a (potentially previously undefined)
297 # DYLD_LIBRARY_PATH (there is no real reason to prefer adding at the end over
298 # adding at the start); the ": &&" in the bash case enables this to work at the
299 # start of a recipe line that is not prefixed by "+" as well as in the middle of
300 # an existing && chain; the tcsh case is somewhat imprecise in that it
301 # potentially affects multiple commands following on the recipe line:
302 .IF "$(USE_SHELL)" == "bash"
303 AUGMENT_LIBRARY_PATH = : && \
304 DYLD_LIBRARY_PATH=$${{DYLD_LIBRARY_PATH+$${{DYLD_LIBRARY_PATH}}:}}$(SOLARLIBDIR)
305 .ELSE
306 AUGMENT_LIBRARY_PATH = if ($$?DYLD_LIBRARY_PATH == 1) \
307 eval 'setenv DYLD_LIBRARY_PATH "$${{DYLD_LIBRARY_PATH}}:$(SOLARLIBDIR)"' \
308 && if ($$?DYLD_LIBRARY_PATH == 0) \
309 setenv DYLD_LIBRARY_PATH "$(SOLARLIBDIR)" &&
310 .ENDIF