xref: /aoo41x/main/solenv/inc/unxmacx.mk (revision b597708b)
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) -D_USE_NAMESPACE=1
38
39# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build result
40# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
41# http://developer.apple.com/technotes/tn2002/tn2064.html
42# done in setsolar/configure now. left here for documentation
43#MACOSX_DEPLOYMENT_TARGET=10.4
44#.EXPORT: MACOSX_DEPLOYMENT_TARGET
45CDEFS+=-DQUARTZ
46EXTRA_CDEFS*=-isysroot /Developer/SDKs/MacOSX10.4u.sdk
47.ENDIF
48
49# Name of library where static data members are initialized
50# STATICLIBNAME=static$(DLLPOSTFIX)
51# STATICLIB=-l$(STATICLIBNAME)
52
53# enable visibility define in "sal/types.h"
54.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
55CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
56.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
57
58
59# MacOS X specific Java compilation/link flags
60SOLAR_JAVA*=TRUE
61.IF "$(SOLAR_JAVA)"!=""
62	JAVADEF=-DSOLAR_JAVA
63	JAVAFLAGSDEBUG=-g
64	JAVA_RUNTIME=-framework JavaVM
65.ENDIF
66
67# architecture dependent flags for the C and C++ compiler that can be changed by
68# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
69ARCH_FLAGS*=
70
71# Specify the compiler to use.  NOTE:  MacOS X should always specify
72# c++ for C++ compilation as it does certain C++ specific things
73# behind the scenes for us.
74# CC = C++ compiler to use
75# cc = C compiler to use
76# objc = Objective C compiler to use
77# objcpp = Objective C++ compiler to use
78CXX*=g++
79CC*=gcc
80objc*=$(CC)
81objcpp*=$(CXX)
82
83CFLAGS=-fsigned-char -fmessage-length=0 -malign-natural -c $(EXTRA_CFLAGS)
84
85.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
86CFLAGS+=-Wno-deprecated-declarations
87.ENDIF
88# ---------------------------------
89#  Compilation flags
90# ---------------------------------
91# Normal C compilation flags
92CFLAGSCC=-pipe -fsigned-char -malign-natural $(ARCH_FLAGS)
93
94# Normal Objective C compilation flags
95#OBJCFLAGS=-no-precomp
96OBJCFLAGS=-fobjc-exceptions
97# -x options generally ignored by ccache, tell it that it can cache
98# the result nevertheless
99CCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL))
100OBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions
101
102# Comp Flags for files that need exceptions enabled (C and C++)
103CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
104
105# Comp Flags for files that do not need exceptions enabled (C and C++)
106CFLAGS_NO_EXCEPTIONS=-fno-exceptions
107
108# Normal C++ compilation flags
109CFLAGSCXX=-pipe -malign-natural -fsigned-char $(ARCH_FLAGS)
110CFLAGSCXX+= -Wno-ctor-dtor-privacy
111
112PICSWITCH:=-fPIC
113# Other flags
114CFLAGSOBJGUIMT=$(PICSWITCH) -fno-common
115CFLAGSOBJCUIMT=$(PICSWITCH) -fno-common
116CFLAGSSLOGUIMT=$(PICSWITCH) -fno-common
117CFLAGSSLOCUIMT=$(PICSWITCH) -fno-common
118CFLAGSPROF=
119
120# Flag for including debugging information in object files
121CFLAGSDEBUG=-g
122CFLAGSDBGUTIL=
123
124# Flag to specify output file to compiler/linker
125CFLAGSOUTOBJ=-o
126
127# Flags to enable precompiled headers
128CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
129CFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch
130CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
131
132# ---------------------------------
133#  Optimization flags
134# ---------------------------------
135CFLAGSOPT=-O2 -fno-strict-aliasing
136CFLAGSNOOPT=-O0
137
138# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
139# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h
140# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705,
141# in template code for which a #pragma gcc system_header would not work:
142# -Wextra doesn not work for gcc-3.3
143CFLAGSWARNCC=-Wall -Wendif-labels
144CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
145CFLAGSWALLCC=$(CFLAGSWARNCC)
146CFLAGSWALLCXX=$(CFLAGSWARNCXX)
147CFLAGSWERRCC=-Werror
148
149# All modules on this platform compile without warnings.
150# If you need to set MODULES_WITH_WARNINGS here, comment
151# COMPILER_WARN_ERRORS=TRUE here (see settings.mk):
152COMPILER_WARN_ERRORS=TRUE
153
154#special settings form environment
155CDEFS+=$(EXTRA_CDEFS)
156
157STDLIBCPP=-lstdc++
158
159# ---------------------------------
160#  STLport library names
161# ---------------------------------
162.IF "$(USE_STLP_DEBUG)" != ""
163.IF "$(STLPORT_VER)" >= "500"
164LIBSTLPORT=-lstlportstlg
165LIBSTLPORTST=$(STATIC) -lstlportstlg
166.ELSE
167LIBSTLPORT=-lstlport_gcc_stldebug
168LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc_stldebug.a
169.ENDIF
170.ELSE # "$(USE_STLP_DEBUG" != ""
171.IF "$(STLPORT_VER)" >= "500"
172LIBSTLPORT=-lstlport
173LIBSTLPORTST=$(STATIC) -lstlport
174.ELSE
175LIBSTLPORT=-lstlport_gcc
176LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc.a
177.ENDIF
178.ENDIF # "$(USE_STLP_DEBUG" != ""
179
180# ---------------------------------
181#  Link stage flags
182# ---------------------------------
183# always link with gcc since you may be linking c code and don't want -lstdc++ linked in!
184
185##  ericb 04 mars 2005
186
187LINK*=$(CXX)
188LINKC*=$(CC)
189
190LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress
191# assure backwards-compatibility
192EXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
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:"
195LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)'
196LINKFLAGSRUNPATH_UREBIN=
197LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)'
198LINKFLAGSRUNPATH_SDK=
199LINKFLAGSRUNPATH_BRAND=
200LINKFLAGSRUNPATH_OXT=
201LINKFLAGSRUNPATH_BOXT=
202LINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)'
203LINKFLAGS=$(LINKFLAGSDEFS)
204
205# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
206.IF "$(GUIBASE)" == "aqua"
207	LINKFLAGS+=-lobjc
208	# Sometimes we still use files that would be in a GUIBASE="unx" specific directory
209	# because they really aren't GUIBASE specific, so we've got to account for that here.
210	INCGUI+= -I$(PRJ)/unx/inc
211.ENDIF
212
213#special settings form environment
214LINKFLAGS+=$(EXTRA_LINKFLAGS)
215
216# Random link flags dealing with different cases of linking
217
218LINKFLAGSAPPGUI=-bind_at_load
219LINKFLAGSSHLGUI=-dynamiclib -single_module
220LINKFLAGSAPPCUI=-bind_at_load
221LINKFLAGSSHLCUI=-dynamiclib -single_module
222LINKFLAGSTACK=
223LINKFLAGSPROF=
224
225# Flag to add debugging information to final products
226LINKFLAGSDEBUG=-g
227LINKFLAGSOPT=
228
229# ---------------------------------
230#  MacOS X shared library specifics
231# ---------------------------------
232
233# Tag to identify an output file as a library
234DLLPRE=lib
235# File extension to identify dynamic shared libraries on MacOS X
236DLLPOST=.dylib
237# Precompiled header file extension
238PCHPOST=.gch
239
240# We don't use mapping on MacOS X
241#LINKVERSIONMAPFLAG=-Wl,--version-script
242LINKVERSIONMAPFLAG=-Wl,-exported_symbols_list
243
244SONAME_SWITCH=-Wl,-h
245
246STDLIBCPP=-lstdc++
247
248STDOBJVCL=$(L)/salmain.o
249STDOBJGUI=
250STDSLOGUI=
251STDOBJCUI=
252STDSLOCUI=
253
254.IF "$(GUIBASE)" == "aqua"
255	STDLIBCUIMT=CPPRUNTIME -lm
256	STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
257	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
258	STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
259.ELSE
260	STDLIBCUIMT= CPPRUNTIME -lm
261	STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm
262	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
263	STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation
264.ENDIF
265
266LIBMGR=ar
267LIBFLAGS=-r
268
269IMPLIB=
270IMPLIBFLAGS=
271
272MAPSYM=
273MAPSYMFLAGS=
274
275RC=irc
276RCFLAGS=-fo$@ $(RCFILES)
277RCLINK=
278RCLINKFLAGS=
279RCSETVERSION=
280
281OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
282