xref: /trunk/main/solenv/inc/unxmacx.mk (revision d92161c4)
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 -Wno-error=deprecated
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,-headerpad,ff,-multiply_defined,suppress
190# assure backwards-compatibility
191EXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
192LINKFLAGSRUNPATH_URELIB=-install_name '@_______URELIB/$(@:f)'
193LINKFLAGSRUNPATH_UREBIN=
194LINKFLAGSRUNPATH_OOO=-install_name '@_______OOO/$(@:f)'
195LINKFLAGSRUNPATH_SDK=
196LINKFLAGSRUNPATH_BRAND=
197LINKFLAGSRUNPATH_OXT=
198LINKFLAGSRUNPATH_BOXT=
199LINKFLAGSRUNPATH_NONE=-install_name '@_______NONE/$(@:f)'
200LINKFLAGS=$(LINKFLAGSDEFS)
201
202# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
203.IF "$(GUIBASE)" == "aqua"
204	LINKFLAGS+=-lobjc
205	# Sometimes we still use files that would be in a GUIBASE="unx" specific directory
206	# because they really aren't GUIBASE specific, so we've got to account for that here.
207	INCGUI+= -I$(PRJ)/unx/inc
208.ENDIF
209
210#special settings form environment
211LINKFLAGS+=$(EXTRA_LINKFLAGS)
212
213# Random link flags dealing with different cases of linking
214
215LINKFLAGSAPPGUI=-bind_at_load
216LINKFLAGSSHLGUI=-dynamiclib -single_module
217LINKFLAGSAPPCUI=-bind_at_load
218LINKFLAGSSHLCUI=-dynamiclib -single_module
219LINKFLAGSTACK=
220LINKFLAGSPROF=
221
222# Flag to add debugging information to final products
223LINKFLAGSDEBUG=-g
224LINKFLAGSOPT=
225
226# ---------------------------------
227#  MacOS X shared library specifics
228# ---------------------------------
229
230# Tag to identify an output file as a library
231DLLPRE=lib
232# File extension to identify dynamic shared libraries on MacOS X
233DLLPOST=.dylib
234# Precompiled header file extension
235PCHPOST=.gch
236
237# We don't use mapping on MacOS X
238#LINKVERSIONMAPFLAG=-Wl,--version-script
239LINKVERSIONMAPFLAG=-Wl,-exported_symbols_list
240
241SONAME_SWITCH=-Wl,-h
242
243STDLIBCPP=-lstdc++
244
245STDOBJVCL=$(L)/salmain.o
246STDOBJGUI=
247STDSLOGUI=
248STDOBJCUI=
249STDSLOCUI=
250
251.IF "$(GUIBASE)" == "aqua"
252	STDLIBCUIMT=CPPRUNTIME -lm
253	STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
254	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
255	STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
256.ELSE
257	STDLIBCUIMT= CPPRUNTIME -lm
258	STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm
259	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
260	STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation
261.ENDIF
262
263LIBMGR=ar
264LIBFLAGS=-r
265
266IMPLIB=
267IMPLIBFLAGS=
268
269MAPSYM=
270MAPSYMFLAGS=
271
272RC=irc
273RCFLAGS=-fo$@ $(RCFILES)
274RCLINK=
275RCLINKFLAGS=
276RCSETVERSION=
277
278OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
279