xref: /aoo41x/main/solenv/inc/unxmacx.mk (revision 7871dc3e)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24##########################################################################
25# Platform MAKEFILE for Mac OS X and Darwin on both PowerPC and Intel
26##########################################################################
27
28# PROCESSOR_DEFINES and DLLPOSTFIX are defined in the particular platform file
29
30ASM=
31AFLAGS=
32LINKOUTPUT_FILTER=
33
34# Definitions that we may need on the compile line.
35# -D_PTHREADS and -D_REENTRANT are needed for STLport, and must be specified when
36#  compiling STLport sources too, either internally or externally.
37CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -DSTLPORT_VERSION=$(STLPORT_VER) -D_USE_NAMESPACE=1
38.IF "$(GUIBASE)"=="unx" && "$(USE_SYSTEM_STL)"!="YES"
39CDEFS+=-DX_LOCALE
40.ENDIF
41.IF "$(GUIBASE)"=="aqua"
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
50CDEFS+=-DQUARTZ
51EXTRA_CDEFS*=-isysroot /Developer/SDKs/MacOSX10.4u.sdk
52.ENDIF
53
54# Name of library where static data members are initialized
55# STATICLIBNAME=static$(DLLPOSTFIX)
56# STATICLIB=-l$(STATICLIBNAME)
57
58# enable visibility define in "sal/types.h"
59.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
60CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
61.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
62
63
64# MacOS X specific Java compilation/link flags
65SOLAR_JAVA*=TRUE
66.IF "$(SOLAR_JAVA)"!=""
67	JAVADEF=-DSOLAR_JAVA
68	JAVAFLAGSDEBUG=-g
69	JAVA_RUNTIME=-framework JavaVM
70.ENDIF
71
72# architecture dependent flags for the C and C++ compiler that can be changed by
73# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
74ARCH_FLAGS*=
75
76# Specify the compiler to use.  NOTE:  MacOS X should always specify
77# c++ for C++ compilation as it does certain C++ specific things
78# behind the scenes for us.
79# CC = C++ compiler to use
80# cc = C compiler to use
81# objc = Objective C compiler to use
82# objcpp = Objective C++ compiler to use
83CXX*=g++
84CC*=gcc
85objc*=$(CC)
86objcpp*=$(CXX)
87
88CFLAGS=-fsigned-char -fmessage-length=0 -malign-natural -c $(EXTRA_CFLAGS)
89
90.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
91CFLAGS+=-Wno-deprecated-declarations
92.ENDIF
93# ---------------------------------
94#  Compilation flags
95# ---------------------------------
96# Normal C compilation flags
97CFLAGSCC=-pipe -fsigned-char -malign-natural $(ARCH_FLAGS)
98
99# Normal Objective C compilation flags
100#OBJCFLAGS=-no-precomp
101OBJCFLAGS=-fobjc-exceptions
102# -x options generally ignored by ccache, tell it that it can cache
103# the result nevertheless
104CCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL))
105OBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions
106
107# Comp Flags for files that need exceptions enabled (C and C++)
108CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
109
110# Comp Flags for files that do not need exceptions enabled (C and C++)
111CFLAGS_NO_EXCEPTIONS=-fno-exceptions
112
113# Normal C++ compilation flags
114CFLAGSCXX=-pipe -malign-natural -fsigned-char -Wno-long-double $(ARCH_FLAGS)
115CFLAGSCXX+= -Wno-ctor-dtor-privacy
116
117PICSWITCH:=-fPIC
118# Other flags
119CFLAGSOBJGUIMT=$(PICSWITCH) -fno-common
120CFLAGSOBJCUIMT=$(PICSWITCH) -fno-common
121CFLAGSSLOGUIMT=$(PICSWITCH) -fno-common
122CFLAGSSLOCUIMT=$(PICSWITCH) -fno-common
123CFLAGSPROF=
124
125# Flag for including debugging information in object files
126CFLAGSDEBUG=-g
127CFLAGSDBGUTIL=
128
129# Flag to specify output file to compiler/linker
130CFLAGSOUTOBJ=-o
131
132# Flags to enable precompiled headers
133CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
134CFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch
135CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
136
137# ---------------------------------
138#  Optimization flags
139# ---------------------------------
140CFLAGSOPT=-O2 -fno-strict-aliasing
141CFLAGSNOOPT=-O0
142
143# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
144# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h
145# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705,
146# in template code for which a #pragma gcc system_header would not work:
147# -Wextra doesn not work for gcc-3.3
148CFLAGSWARNCC=-Wall -Wendif-labels
149CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
150CFLAGSWALLCC=$(CFLAGSWARNCC)
151CFLAGSWALLCXX=$(CFLAGSWARNCXX)
152CFLAGSWERRCC=-Werror
153
154# All modules on this platform compile without warnings.
155# If you need to set MODULES_WITH_WARNINGS here, comment
156# COMPILER_WARN_ERRORS=TRUE here (see settings.mk):
157COMPILER_WARN_ERRORS=TRUE
158
159#special settings form environment
160CDEFS+=$(EXTRA_CDEFS)
161
162STDLIBCPP=-lstdc++
163
164# ---------------------------------
165#  STLport library names
166# ---------------------------------
167.IF "$(USE_STLP_DEBUG)" != ""
168.IF "$(STLPORT_VER)" >= "500"
169LIBSTLPORT=-lstlportstlg
170LIBSTLPORTST=$(STATIC) -lstlportstlg
171.ELSE
172LIBSTLPORT=-lstlport_gcc_stldebug
173LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc_stldebug.a
174.ENDIF
175.ELSE # "$(USE_STLP_DEBUG" != ""
176.IF "$(STLPORT_VER)" >= "500"
177LIBSTLPORT=-lstlport
178LIBSTLPORTST=$(STATIC) -lstlport
179.ELSE
180LIBSTLPORT=-lstlport_gcc
181LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc.a
182.ENDIF
183.ENDIF # "$(USE_STLP_DEBUG" != ""
184
185# ---------------------------------
186#  Link stage flags
187# ---------------------------------
188# always link with gcc since you may be linking c code and don't want -lstdc++ linked in!
189
190##  ericb 04 mars 2005
191
192LINK*=$(CXX)
193LINKC*=$(CC)
194
195LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress
196# assure backwards-compatibility
197EXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
198# Very long install_names are needed so that install_name_tool -change later on
199# does not complain that "larger updated load commands do not fit:"
200LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)'
201LINKFLAGSRUNPATH_UREBIN=
202LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)'
203LINKFLAGSRUNPATH_SDK=
204LINKFLAGSRUNPATH_BRAND=
205LINKFLAGSRUNPATH_OXT=
206LINKFLAGSRUNPATH_BOXT=
207LINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)'
208LINKFLAGS=$(LINKFLAGSDEFS)
209
210# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
211.IF "$(GUIBASE)" == "aqua"
212	LINKFLAGS+=-lobjc
213	# Sometimes we still use files that would be in a GUIBASE="unx" specific directory
214	# because they really aren't GUIBASE specific, so we've got to account for that here.
215	INCGUI+= -I$(PRJ)/unx/inc
216.ENDIF
217
218#special settings form environment
219LINKFLAGS+=$(EXTRA_LINKFLAGS)
220
221# Random link flags dealing with different cases of linking
222
223LINKFLAGSAPPGUI=-bind_at_load
224LINKFLAGSSHLGUI=-dynamiclib -single_module
225LINKFLAGSAPPCUI=-bind_at_load
226LINKFLAGSSHLCUI=-dynamiclib -single_module
227LINKFLAGSTACK=
228LINKFLAGSPROF=
229
230# Flag to add debugging information to final products
231LINKFLAGSDEBUG=-g
232LINKFLAGSOPT=
233
234# ---------------------------------
235#  MacOS X shared library specifics
236# ---------------------------------
237
238# Tag to identify an output file as a library
239DLLPRE=lib
240# File extension to identify dynamic shared libraries on MacOS X
241DLLPOST=.dylib
242# Precompiled header file extension
243PCHPOST=.gch
244
245# We don't use mapping on MacOS X
246#LINKVERSIONMAPFLAG=-Wl,--version-script
247LINKVERSIONMAPFLAG=-Wl,-exported_symbols_list
248
249SONAME_SWITCH=-Wl,-h
250
251STDLIBCPP=-lstdc++
252
253STDOBJVCL=$(L)/salmain.o
254STDOBJGUI=
255STDSLOGUI=
256STDOBJCUI=
257STDSLOCUI=
258
259.IF "$(GUIBASE)" == "aqua"
260	STDLIBCUIMT=CPPRUNTIME -lm
261	STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
262	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
263	STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
264.ELSE
265	STDLIBCUIMT= CPPRUNTIME -lm
266	STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm
267	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
268	STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation
269.ENDIF
270
271LIBMGR=ar
272LIBFLAGS=-r
273
274IMPLIB=
275IMPLIBFLAGS=
276
277MAPSYM=
278MAPSYMFLAGS=
279
280RC=irc
281RCFLAGS=-fo$@ $(RCFILES)
282RCLINK=
283RCLINKFLAGS=
284RCSETVERSION=
285
286OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
287