1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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
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
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
69 .IF
"$(SOLAR_JAVA)"!=""
72 JAVA_RUNTIME
=-framework JavaVM
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
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
91 CFLAGS
=-fsigned-char
-fmessage-length
=0 -c
$(EXTRA_CFLAGS
)
93 .IF
"$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
94 CFLAGS
+=-Wno-deprecated-declarations
96 # ---------------------------------
98 # ---------------------------------
99 # Normal C compilation flags
100 CFLAGSCC
=-pipe
-fsigned-char
$(ARCH_FLAGS
)
101 .IF
"$(COM_GCC_IS_CLANG)" != "TRUE"
102 CFLAGSCC
+=-malign-natural
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
114 .IF
"$(COM_GCC_IS_CLANG)" != "TRUE"
115 CFLAGSEXCEPTIONS
+=-fno-enforce-eh-specs
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
127 .IF
"$(HAVE_GCC_NO_LONG-DOUBLE)" == "TRUE"
128 CFLAGSCXX
+= -Wno-long-double
130 .IF
"$(HAVE_THREADSAFE_STATICS)" != "TRUE"
131 CFLAGSCXX
+= -fno-threadsafe-statics
136 CFLAGSOBJGUIMT
=$(PICSWITCH
) -fno-common
137 CFLAGSOBJCUIMT
=$(PICSWITCH
) -fno-common
138 CFLAGSSLOGUIMT
=$(PICSWITCH
) -fno-common
139 CFLAGSSLOCUIMT
=$(PICSWITCH
) -fno-common
142 # Flag for including debugging information in object files
146 # Flag to specify output file to compiler/linker
149 # ---------------------------------
151 # ---------------------------------
152 CFLAGSOPT
=-O2
-fno-strict-aliasing
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
)
176 # ---------------------------------
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
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
)
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
)
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
220 # Flag to add debugging information to final products
224 # ---------------------------------
225 # MacOS X shared library specifics
226 # ---------------------------------
228 # Tag to identify an output file as a library
230 # File extension to identify dynamic shared libraries on MacOS X
233 # We don't use mapping on MacOS X
234 #LINKVERSIONMAPFLAG=-Wl,--version-script
235 LINKVERSIONMAPFLAG
=-Wl
,-exported_symbols_list
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
261 RCFLAGS
=-fo
$@
$(RCFILES
)
266 OOO_LIBRARY_PATH_VAR
= DYLD_LIBRARY_PATH