Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / solenv / inc / unxmacx.mk
blob0a58f4cc10b8c617483d1091544bf5fb68540df5
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2000, 2010 Oracle and/or its affiliates.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # This file is part of OpenOffice.org.
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.
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).
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.
26 #*************************************************************************
28 ##########################################################################
29 # Platform MAKEFILE for Mac OS X and Darwin on both PowerPC and Intel
30 ##########################################################################
32 # PROCESSOR_DEFINES is defined in the particular platform file
34 ASM=
35 AFLAGS=
36 LINKOUTPUT_FILTER=
38 # Definitions that we may need on the compile line.
39 # -D_PTHREADS and -D_REENTRANT are needed for STLport, and must be specified when
40 # compiling STLport sources too, either internally or externally.
41 CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -D_USE_NAMESPACE=1
42 # MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build,
43 # build can assume functions/libraries of that version to be available
44 # unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk
45 # (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
46 # http://developer.apple.com/technotes/tn2002/tn2064.html
47 # done in setsolar/configure now. left here for documentation
48 #MACOSX_DEPLOYMENT_TARGET=10.4
49 #.EXPORT: MACOSX_DEPLOYMENT_TARGET
50 CDEFS+:=-DQUARTZ
52 EXTRA_CDEFS+:=-DMAC_OS_X_VERSION_MIN_REQUIRED=$(MAC_OS_X_VERSION_MIN_REQUIRED) -DMAC_OS_X_VERSION_MAX_ALLOWED=$(MAC_OS_X_VERSION_MAX_ALLOWED) -DMACOSX_SDK_VERSION=$(MACOSX_SDK_VERSION)
54 # Name of library where static data members are initialized
55 # STATICLIBNAME=static$(DLLPOSTFIX)
56 # STATICLIB=-l$(STATICLIBNAME)
58 # enable visibility define in "sal/types.h"
59 .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
60 CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
61 .ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
63 .IF "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE"
64 CDEFS += -DHAVE_SFINAE_ANONYMOUS_BROKEN
65 .ENDIF # "$(HAVE_SFINAE_ANONYMOUS_BROKEN)" == "TRUE"
67 # MacOS X specific Java compilation/link flags
68 SOLAR_JAVA*=TRUE
69 .IF "$(SOLAR_JAVA)"!=""
70 JAVADEF=-DSOLAR_JAVA
71 JAVAFLAGSDEBUG=-g
72 JAVA_RUNTIME=-framework JavaVM
73 .ENDIF
75 # architecture dependent flags for the C and C++ compiler that can be changed by
76 # exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
77 ARCH_FLAGS*=
79 # Specify the compiler to use. NOTE: MacOS X should always specify
80 # c++ for C++ compilation as it does certain C++ specific things
81 # behind the scenes for us.
82 # CC = C++ compiler to use
83 # cc = C compiler to use
84 # objc = Objective C compiler to use
85 # objcpp = Objective C++ compiler to use
86 CXX*=g++
87 CC*=gcc
88 objc*=$(CC)
89 objcpp*=$(CXX)
91 CFLAGS=-fsigned-char -fmessage-length=0 -c $(EXTRA_CFLAGS)
93 .IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
94 CFLAGS+=-Wno-deprecated-declarations
95 .ENDIF
96 # ---------------------------------
97 # Compilation flags
98 # ---------------------------------
99 # Normal C compilation flags
100 CFLAGSCC=-pipe -fsigned-char $(ARCH_FLAGS)
101 .IF "$(COM_GCC_IS_CLANG)" != "TRUE"
102 CFLAGSCC+=-malign-natural
103 .ENDIF
105 # Normal Objective C compilation flags
106 #OBJCFLAGS=-no-precomp
107 OBJCFLAGS=-fobjc-exceptions
109 OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions
111 # Comp Flags for files that need exceptions enabled (C and C++)
112 CFLAGSEXCEPTIONS=-fexceptions
113 .IF "$(dbgutil)"==""
114 .IF "$(COM_GCC_IS_CLANG)" != "TRUE"
115 CFLAGSEXCEPTIONS+=-fno-enforce-eh-specs
116 .ENDIF
117 .ENDIF
119 # Comp Flags for files that do not need exceptions enabled (C and C++)
120 CFLAGS_NO_EXCEPTIONS=-fno-exceptions
122 # Normal C++ compilation flags
123 CFLAGSCXX=-pipe -fsigned-char $(ARCH_FLAGS) -Wno-ctor-dtor-privacy
124 .IF "$(COM_GCC_IS_CLANG)" != "TRUE"
125 CFLAGSCXX+=-malign-natural
126 .ENDIF
127 .IF "$(HAVE_GCC_NO_LONG-DOUBLE)" == "TRUE"
128 CFLAGSCXX+= -Wno-long-double
129 .ENDIF
130 .IF "$(HAVE_THREADSAFE_STATICS)" != "TRUE"
131 CFLAGSCXX += -fno-threadsafe-statics
132 .ENDIF
134 PICSWITCH:=-fPIC
135 # Other flags
136 CFLAGSOBJGUIMT=$(PICSWITCH) -fno-common
137 CFLAGSOBJCUIMT=$(PICSWITCH) -fno-common
138 CFLAGSSLOGUIMT=$(PICSWITCH) -fno-common
139 CFLAGSSLOCUIMT=$(PICSWITCH) -fno-common
140 CFLAGSPROF=
142 # Flag for including debugging information in object files
143 CFLAGSDEBUG=-g
144 CFLAGSDBGUTIL=
146 # Flag to specify output file to compiler/linker
147 CFLAGSOUTOBJ=-o
149 # ---------------------------------
150 # Optimization flags
151 # ---------------------------------
152 CFLAGSOPT=-O2 -fno-strict-aliasing
153 CFLAGSNOOPT=-O0
155 # -Wshadow does not work for C with nested uses of pthread_cleanup_push:
156 # -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h
157 # l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705,
158 # in template code for which a #pragma gcc system_header would not work:
159 # -Wextra doesn not work for gcc-3.3
160 CFLAGSWARNCC=-Wall -Wendif-labels
161 CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
162 CFLAGSWALLCC=$(CFLAGSWARNCC)
163 CFLAGSWALLCXX=$(CFLAGSWARNCXX)
164 CFLAGSWERRCC=-Werror -DLIBO_WERROR
166 # All modules on this platform compile without warnings.
167 # If you need to set MODULES_WITH_WARNINGS here, comment
168 # COMPILER_WARN_ERRORS=TRUE here (see settings.mk):
169 COMPILER_WARN_ERRORS=TRUE
171 #special settings form environment
172 CDEFS+=$(EXTRA_CDEFS)
174 STDLIBCPP=-lstdc++
176 # ---------------------------------
177 # Link stage flags
178 # ---------------------------------
179 # always link with gcc since you may be linking c code and don't want -lstdc++ linked in!
181 ## ericb 04 mars 2005
183 LINK*=$(CXX)
184 LINKC*=$(CC)
186 LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress
188 .IF "$(MAC_OS_X_VERSION_MIN_REQUIRED)" <= "1050"
189 # assure backwards-compatibility
190 EXTRA_LINKFLAGS*:=-Wl,-syslibroot,$(MACOSX_SDK_PATH)
191 .ENDIF
193 # Very long install_names are needed so that install_name_tool -change later on
194 # does not complain that "larger updated load commands do not fit:"
195 LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)'
196 LINKFLAGSRUNPATH_UREBIN=
197 LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)'
198 LINKFLAGSRUNPATH_SDKBIN=
199 LINKFLAGSRUNPATH_OXT=
200 LINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)'
201 LINKFLAGS=$(LINKFLAGSDEFS)
203 LINKFLAGS+=-lobjc
204 # Sometimes we still use files that would be in a GUIBASE="unx" specific directory
205 # because they really aren't GUIBASE specific, so we've got to account for that here.
206 INCGUI+= -I$(PRJ)/unx/inc
208 #special settings form environment
209 LINKFLAGS+=$(EXTRA_LINKFLAGS)
211 # Random link flags dealing with different cases of linking
213 LINKFLAGSAPPGUI=-bind_at_load
214 LINKFLAGSSHLGUI=-dynamiclib -single_module
215 LINKFLAGSAPPCUI=-bind_at_load
216 LINKFLAGSSHLCUI=-dynamiclib -single_module
217 LINKFLAGSTACK=
218 LINKFLAGSPROF=
220 # Flag to add debugging information to final products
221 LINKFLAGSDEBUG=-g
222 LINKFLAGSOPT=
224 # ---------------------------------
225 # MacOS X shared library specifics
226 # ---------------------------------
228 # Tag to identify an output file as a library
229 DLLPRE=lib
230 # File extension to identify dynamic shared libraries on MacOS X
231 DLLPOST=.dylib
233 # We don't use mapping on MacOS X
234 #LINKVERSIONMAPFLAG=-Wl,--version-script
235 LINKVERSIONMAPFLAG=-Wl,-exported_symbols_list
237 SONAME_SWITCH=-Wl,-h
239 STDLIBCPP=-lstdc++
241 STDOBJGUI=
242 STDSLOGUI=
243 STDOBJCUI=
244 STDSLOCUI=
246 STDLIBCUIMT=CPPRUNTIME -lm
247 STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
248 STDSHLCUIMT=-lpthread CPPRUNTIME -lm
249 STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
251 LIBMGR=ar
252 LIBFLAGS=-r
254 IMPLIB=
255 IMPLIBFLAGS=
257 MAPSYM=
258 MAPSYMFLAGS=
260 RC=irc
261 RCFLAGS=-fo$@ $(RCFILES)
262 RCLINK=
263 RCLINKFLAGS=
264 RCSETVERSION=
266 OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH