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