xref: /aoo42x/main/solenv/inc/unxmacx.mk (revision b597708b)
17871dc3eSAndrew Rist#**************************************************************
27871dc3eSAndrew Rist#
37871dc3eSAndrew Rist#  Licensed to the Apache Software Foundation (ASF) under one
47871dc3eSAndrew Rist#  or more contributor license agreements.  See the NOTICE file
57871dc3eSAndrew Rist#  distributed with this work for additional information
67871dc3eSAndrew Rist#  regarding copyright ownership.  The ASF licenses this file
77871dc3eSAndrew Rist#  to you under the Apache License, Version 2.0 (the
87871dc3eSAndrew Rist#  "License"); you may not use this file except in compliance
97871dc3eSAndrew Rist#  with the License.  You may obtain a copy of the License at
107871dc3eSAndrew Rist#
117871dc3eSAndrew Rist#    http://www.apache.org/licenses/LICENSE-2.0
127871dc3eSAndrew Rist#
137871dc3eSAndrew Rist#  Unless required by applicable law or agreed to in writing,
147871dc3eSAndrew Rist#  software distributed under the License is distributed on an
157871dc3eSAndrew Rist#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
167871dc3eSAndrew Rist#  KIND, either express or implied.  See the License for the
177871dc3eSAndrew Rist#  specific language governing permissions and limitations
187871dc3eSAndrew Rist#  under the License.
197871dc3eSAndrew Rist#
207871dc3eSAndrew Rist#**************************************************************
217871dc3eSAndrew Rist
227871dc3eSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir##########################################################################
25cdf0e10cSrcweir# Platform MAKEFILE for Mac OS X and Darwin on both PowerPC and Intel
26cdf0e10cSrcweir##########################################################################
27cdf0e10cSrcweir
28cdf0e10cSrcweir# PROCESSOR_DEFINES and DLLPOSTFIX are defined in the particular platform file
29cdf0e10cSrcweir
30cdf0e10cSrcweirASM=
31cdf0e10cSrcweirAFLAGS=
32cdf0e10cSrcweirLINKOUTPUT_FILTER=
33cdf0e10cSrcweir
34cdf0e10cSrcweir# Definitions that we may need on the compile line.
35cdf0e10cSrcweir# -D_PTHREADS and -D_REENTRANT are needed for STLport, and must be specified when
36cdf0e10cSrcweir#  compiling STLport sources too, either internally or externally.
37*b597708bSHerbert DürrCDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -D_USE_NAMESPACE=1
38*b597708bSHerbert Dürr
39*b597708bSHerbert Dürr# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build result
40cdf0e10cSrcweir# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
41cdf0e10cSrcweir# http://developer.apple.com/technotes/tn2002/tn2064.html
42cdf0e10cSrcweir# done in setsolar/configure now. left here for documentation
43cdf0e10cSrcweir#MACOSX_DEPLOYMENT_TARGET=10.4
44cdf0e10cSrcweir#.EXPORT: MACOSX_DEPLOYMENT_TARGET
45cdf0e10cSrcweirCDEFS+=-DQUARTZ
46cdf0e10cSrcweirEXTRA_CDEFS*=-isysroot /Developer/SDKs/MacOSX10.4u.sdk
47cdf0e10cSrcweir.ENDIF
48cdf0e10cSrcweir
49cdf0e10cSrcweir# Name of library where static data members are initialized
50cdf0e10cSrcweir# STATICLIBNAME=static$(DLLPOSTFIX)
51cdf0e10cSrcweir# STATICLIB=-l$(STATICLIBNAME)
52cdf0e10cSrcweir
53cdf0e10cSrcweir# enable visibility define in "sal/types.h"
54cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
55cdf0e10cSrcweirCDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
56cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
57cdf0e10cSrcweir
58cdf0e10cSrcweir
59cdf0e10cSrcweir# MacOS X specific Java compilation/link flags
60cdf0e10cSrcweirSOLAR_JAVA*=TRUE
61cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"!=""
62cdf0e10cSrcweir	JAVADEF=-DSOLAR_JAVA
63cdf0e10cSrcweir	JAVAFLAGSDEBUG=-g
64cdf0e10cSrcweir	JAVA_RUNTIME=-framework JavaVM
65cdf0e10cSrcweir.ENDIF
66cdf0e10cSrcweir
67cdf0e10cSrcweir# architecture dependent flags for the C and C++ compiler that can be changed by
68cdf0e10cSrcweir# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
69cdf0e10cSrcweirARCH_FLAGS*=
70cdf0e10cSrcweir
71cdf0e10cSrcweir# Specify the compiler to use.  NOTE:  MacOS X should always specify
72cdf0e10cSrcweir# c++ for C++ compilation as it does certain C++ specific things
73cdf0e10cSrcweir# behind the scenes for us.
74cdf0e10cSrcweir# CC = C++ compiler to use
75cdf0e10cSrcweir# cc = C compiler to use
76cdf0e10cSrcweir# objc = Objective C compiler to use
77cdf0e10cSrcweir# objcpp = Objective C++ compiler to use
78cdf0e10cSrcweirCXX*=g++
79cdf0e10cSrcweirCC*=gcc
80cdf0e10cSrcweirobjc*=$(CC)
81cdf0e10cSrcweirobjcpp*=$(CXX)
82cdf0e10cSrcweir
83cdf0e10cSrcweirCFLAGS=-fsigned-char -fmessage-length=0 -malign-natural -c $(EXTRA_CFLAGS)
84cdf0e10cSrcweir
85cdf0e10cSrcweir.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
86cdf0e10cSrcweirCFLAGS+=-Wno-deprecated-declarations
87cdf0e10cSrcweir.ENDIF
88cdf0e10cSrcweir# ---------------------------------
89cdf0e10cSrcweir#  Compilation flags
90cdf0e10cSrcweir# ---------------------------------
91cdf0e10cSrcweir# Normal C compilation flags
92cdf0e10cSrcweirCFLAGSCC=-pipe -fsigned-char -malign-natural $(ARCH_FLAGS)
93cdf0e10cSrcweir
94cdf0e10cSrcweir# Normal Objective C compilation flags
95cdf0e10cSrcweir#OBJCFLAGS=-no-precomp
96cdf0e10cSrcweirOBJCFLAGS=-fobjc-exceptions
97cdf0e10cSrcweir# -x options generally ignored by ccache, tell it that it can cache
98cdf0e10cSrcweir# the result nevertheless
99cdf0e10cSrcweirCCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL))
100cdf0e10cSrcweirOBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions
101cdf0e10cSrcweir
102cdf0e10cSrcweir# Comp Flags for files that need exceptions enabled (C and C++)
103cdf0e10cSrcweirCFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
104cdf0e10cSrcweir
105cdf0e10cSrcweir# Comp Flags for files that do not need exceptions enabled (C and C++)
106cdf0e10cSrcweirCFLAGS_NO_EXCEPTIONS=-fno-exceptions
107cdf0e10cSrcweir
108cdf0e10cSrcweir# Normal C++ compilation flags
1099964c96fSHerbert DürrCFLAGSCXX=-pipe -malign-natural -fsigned-char $(ARCH_FLAGS)
110cdf0e10cSrcweirCFLAGSCXX+= -Wno-ctor-dtor-privacy
111cdf0e10cSrcweir
112cdf0e10cSrcweirPICSWITCH:=-fPIC
113cdf0e10cSrcweir# Other flags
114cdf0e10cSrcweirCFLAGSOBJGUIMT=$(PICSWITCH) -fno-common
115cdf0e10cSrcweirCFLAGSOBJCUIMT=$(PICSWITCH) -fno-common
116cdf0e10cSrcweirCFLAGSSLOGUIMT=$(PICSWITCH) -fno-common
117cdf0e10cSrcweirCFLAGSSLOCUIMT=$(PICSWITCH) -fno-common
118cdf0e10cSrcweirCFLAGSPROF=
119cdf0e10cSrcweir
120cdf0e10cSrcweir# Flag for including debugging information in object files
121cdf0e10cSrcweirCFLAGSDEBUG=-g
122cdf0e10cSrcweirCFLAGSDBGUTIL=
123cdf0e10cSrcweir
124cdf0e10cSrcweir# Flag to specify output file to compiler/linker
125cdf0e10cSrcweirCFLAGSOUTOBJ=-o
126cdf0e10cSrcweir
127cdf0e10cSrcweir# Flags to enable precompiled headers
128cdf0e10cSrcweirCFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
129cdf0e10cSrcweirCFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch
130cdf0e10cSrcweirCFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
131cdf0e10cSrcweir
132cdf0e10cSrcweir# ---------------------------------
133cdf0e10cSrcweir#  Optimization flags
134cdf0e10cSrcweir# ---------------------------------
135cdf0e10cSrcweirCFLAGSOPT=-O2 -fno-strict-aliasing
136cdf0e10cSrcweirCFLAGSNOOPT=-O0
137cdf0e10cSrcweir
138cdf0e10cSrcweir# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
139cdf0e10cSrcweir# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h
140cdf0e10cSrcweir# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705,
141cdf0e10cSrcweir# in template code for which a #pragma gcc system_header would not work:
142cdf0e10cSrcweir# -Wextra doesn not work for gcc-3.3
143cdf0e10cSrcweirCFLAGSWARNCC=-Wall -Wendif-labels
144cdf0e10cSrcweirCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
145cdf0e10cSrcweirCFLAGSWALLCC=$(CFLAGSWARNCC)
146cdf0e10cSrcweirCFLAGSWALLCXX=$(CFLAGSWARNCXX)
147cdf0e10cSrcweirCFLAGSWERRCC=-Werror
148cdf0e10cSrcweir
149cdf0e10cSrcweir# All modules on this platform compile without warnings.
150cdf0e10cSrcweir# If you need to set MODULES_WITH_WARNINGS here, comment
151cdf0e10cSrcweir# COMPILER_WARN_ERRORS=TRUE here (see settings.mk):
152cdf0e10cSrcweirCOMPILER_WARN_ERRORS=TRUE
153cdf0e10cSrcweir
154cdf0e10cSrcweir#special settings form environment
155cdf0e10cSrcweirCDEFS+=$(EXTRA_CDEFS)
156cdf0e10cSrcweir
157cdf0e10cSrcweirSTDLIBCPP=-lstdc++
158cdf0e10cSrcweir
159cdf0e10cSrcweir# ---------------------------------
160cdf0e10cSrcweir#  STLport library names
161cdf0e10cSrcweir# ---------------------------------
162cdf0e10cSrcweir.IF "$(USE_STLP_DEBUG)" != ""
163cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
164cdf0e10cSrcweirLIBSTLPORT=-lstlportstlg
165cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlportstlg
166cdf0e10cSrcweir.ELSE
167cdf0e10cSrcweirLIBSTLPORT=-lstlport_gcc_stldebug
168cdf0e10cSrcweirLIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc_stldebug.a
169cdf0e10cSrcweir.ENDIF
170cdf0e10cSrcweir.ELSE # "$(USE_STLP_DEBUG" != ""
171cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
172cdf0e10cSrcweirLIBSTLPORT=-lstlport
173cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport
174cdf0e10cSrcweir.ELSE
175cdf0e10cSrcweirLIBSTLPORT=-lstlport_gcc
176cdf0e10cSrcweirLIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc.a
177cdf0e10cSrcweir.ENDIF
178cdf0e10cSrcweir.ENDIF # "$(USE_STLP_DEBUG" != ""
179cdf0e10cSrcweir
180cdf0e10cSrcweir# ---------------------------------
181cdf0e10cSrcweir#  Link stage flags
182cdf0e10cSrcweir# ---------------------------------
183cdf0e10cSrcweir# always link with gcc since you may be linking c code and don't want -lstdc++ linked in!
184cdf0e10cSrcweir
185cdf0e10cSrcweir##  ericb 04 mars 2005
186cdf0e10cSrcweir
187cdf0e10cSrcweirLINK*=$(CXX)
188cdf0e10cSrcweirLINKC*=$(CC)
189cdf0e10cSrcweir
190cdf0e10cSrcweirLINKFLAGSDEFS*=-Wl,-multiply_defined,suppress
191cdf0e10cSrcweir# assure backwards-compatibility
192cdf0e10cSrcweirEXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
193cdf0e10cSrcweir# Very long install_names are needed so that install_name_tool -change later on
194cdf0e10cSrcweir# does not complain that "larger updated load commands do not fit:"
195cdf0e10cSrcweirLINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)'
196cdf0e10cSrcweirLINKFLAGSRUNPATH_UREBIN=
197cdf0e10cSrcweirLINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)'
198cdf0e10cSrcweirLINKFLAGSRUNPATH_SDK=
199cdf0e10cSrcweirLINKFLAGSRUNPATH_BRAND=
200cdf0e10cSrcweirLINKFLAGSRUNPATH_OXT=
201cdf0e10cSrcweirLINKFLAGSRUNPATH_BOXT=
202cdf0e10cSrcweirLINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)'
203cdf0e10cSrcweirLINKFLAGS=$(LINKFLAGSDEFS)
204cdf0e10cSrcweir
205cdf0e10cSrcweir# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
206cdf0e10cSrcweir.IF "$(GUIBASE)" == "aqua"
207cdf0e10cSrcweir	LINKFLAGS+=-lobjc
208cdf0e10cSrcweir	# Sometimes we still use files that would be in a GUIBASE="unx" specific directory
209cdf0e10cSrcweir	# because they really aren't GUIBASE specific, so we've got to account for that here.
210cdf0e10cSrcweir	INCGUI+= -I$(PRJ)/unx/inc
211cdf0e10cSrcweir.ENDIF
212cdf0e10cSrcweir
213cdf0e10cSrcweir#special settings form environment
214cdf0e10cSrcweirLINKFLAGS+=$(EXTRA_LINKFLAGS)
215cdf0e10cSrcweir
216cdf0e10cSrcweir# Random link flags dealing with different cases of linking
217cdf0e10cSrcweir
218cdf0e10cSrcweirLINKFLAGSAPPGUI=-bind_at_load
219cdf0e10cSrcweirLINKFLAGSSHLGUI=-dynamiclib -single_module
220cdf0e10cSrcweirLINKFLAGSAPPCUI=-bind_at_load
221cdf0e10cSrcweirLINKFLAGSSHLCUI=-dynamiclib -single_module
222cdf0e10cSrcweirLINKFLAGSTACK=
223cdf0e10cSrcweirLINKFLAGSPROF=
224cdf0e10cSrcweir
225cdf0e10cSrcweir# Flag to add debugging information to final products
226cdf0e10cSrcweirLINKFLAGSDEBUG=-g
227cdf0e10cSrcweirLINKFLAGSOPT=
228cdf0e10cSrcweir
229cdf0e10cSrcweir# ---------------------------------
230cdf0e10cSrcweir#  MacOS X shared library specifics
231cdf0e10cSrcweir# ---------------------------------
232cdf0e10cSrcweir
233cdf0e10cSrcweir# Tag to identify an output file as a library
234cdf0e10cSrcweirDLLPRE=lib
235cdf0e10cSrcweir# File extension to identify dynamic shared libraries on MacOS X
236cdf0e10cSrcweirDLLPOST=.dylib
237cdf0e10cSrcweir# Precompiled header file extension
238cdf0e10cSrcweirPCHPOST=.gch
239cdf0e10cSrcweir
240cdf0e10cSrcweir# We don't use mapping on MacOS X
241cdf0e10cSrcweir#LINKVERSIONMAPFLAG=-Wl,--version-script
242cdf0e10cSrcweirLINKVERSIONMAPFLAG=-Wl,-exported_symbols_list
243cdf0e10cSrcweir
244cdf0e10cSrcweirSONAME_SWITCH=-Wl,-h
245cdf0e10cSrcweir
246cdf0e10cSrcweirSTDLIBCPP=-lstdc++
247cdf0e10cSrcweir
248cdf0e10cSrcweirSTDOBJVCL=$(L)/salmain.o
249cdf0e10cSrcweirSTDOBJGUI=
250cdf0e10cSrcweirSTDSLOGUI=
251cdf0e10cSrcweirSTDOBJCUI=
252cdf0e10cSrcweirSTDSLOCUI=
253cdf0e10cSrcweir
254cdf0e10cSrcweir.IF "$(GUIBASE)" == "aqua"
255cdf0e10cSrcweir	STDLIBCUIMT=CPPRUNTIME -lm
256cdf0e10cSrcweir	STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
257cdf0e10cSrcweir	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
258cdf0e10cSrcweir	STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
259cdf0e10cSrcweir.ELSE
260cdf0e10cSrcweir	STDLIBCUIMT= CPPRUNTIME -lm
261cdf0e10cSrcweir	STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm
262cdf0e10cSrcweir	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
263cdf0e10cSrcweir	STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation
264cdf0e10cSrcweir.ENDIF
265cdf0e10cSrcweir
266cdf0e10cSrcweirLIBMGR=ar
267cdf0e10cSrcweirLIBFLAGS=-r
268cdf0e10cSrcweir
269cdf0e10cSrcweirIMPLIB=
270cdf0e10cSrcweirIMPLIBFLAGS=
271cdf0e10cSrcweir
272cdf0e10cSrcweirMAPSYM=
273cdf0e10cSrcweirMAPSYMFLAGS=
274cdf0e10cSrcweir
275cdf0e10cSrcweirRC=irc
276cdf0e10cSrcweirRCFLAGS=-fo$@ $(RCFILES)
277cdf0e10cSrcweirRCLINK=
278cdf0e10cSrcweirRCLINKFLAGS=
279cdf0e10cSrcweirRCSETVERSION=
280cdf0e10cSrcweir
281cdf0e10cSrcweirOOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
282