xref: /aoo42x/main/solenv/inc/unxmacx.mk (revision a4523a2b)
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.
37b597708bSHerbert DürrCDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -D_USE_NAMESPACE=1
38b597708bSHerbert Dürr
39b597708bSHerbert 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
48cdf0e10cSrcweir# Name of library where static data members are initialized
49cdf0e10cSrcweir# STATICLIBNAME=static$(DLLPOSTFIX)
50cdf0e10cSrcweir# STATICLIB=-l$(STATICLIBNAME)
51cdf0e10cSrcweir
52cdf0e10cSrcweir# enable visibility define in "sal/types.h"
53cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
54cdf0e10cSrcweirCDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
55cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
56cdf0e10cSrcweir
57cdf0e10cSrcweir
58cdf0e10cSrcweir# MacOS X specific Java compilation/link flags
59cdf0e10cSrcweirSOLAR_JAVA*=TRUE
60cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"!=""
61cdf0e10cSrcweir	JAVADEF=-DSOLAR_JAVA
62cdf0e10cSrcweir	JAVAFLAGSDEBUG=-g
63cdf0e10cSrcweir	JAVA_RUNTIME=-framework JavaVM
64cdf0e10cSrcweir.ENDIF
65cdf0e10cSrcweir
66cdf0e10cSrcweir# architecture dependent flags for the C and C++ compiler that can be changed by
67cdf0e10cSrcweir# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
68cdf0e10cSrcweirARCH_FLAGS*=
69cdf0e10cSrcweir
70cdf0e10cSrcweir# Specify the compiler to use.  NOTE:  MacOS X should always specify
71cdf0e10cSrcweir# c++ for C++ compilation as it does certain C++ specific things
72cdf0e10cSrcweir# behind the scenes for us.
73cdf0e10cSrcweir# CC = C++ compiler to use
74cdf0e10cSrcweir# cc = C compiler to use
75cdf0e10cSrcweir# objc = Objective C compiler to use
76cdf0e10cSrcweir# objcpp = Objective C++ compiler to use
77cdf0e10cSrcweirCXX*=g++
78cdf0e10cSrcweirCC*=gcc
79cdf0e10cSrcweirobjc*=$(CC)
80cdf0e10cSrcweirobjcpp*=$(CXX)
81cdf0e10cSrcweir
82cdf0e10cSrcweirCFLAGS=-fsigned-char -fmessage-length=0 -malign-natural -c $(EXTRA_CFLAGS)
83cdf0e10cSrcweir
84cdf0e10cSrcweir.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
85cdf0e10cSrcweirCFLAGS+=-Wno-deprecated-declarations
86cdf0e10cSrcweir.ENDIF
87cdf0e10cSrcweir# ---------------------------------
88cdf0e10cSrcweir#  Compilation flags
89cdf0e10cSrcweir# ---------------------------------
90cdf0e10cSrcweir# Normal C compilation flags
91cdf0e10cSrcweirCFLAGSCC=-pipe -fsigned-char -malign-natural $(ARCH_FLAGS)
92cdf0e10cSrcweir
93cdf0e10cSrcweir# Normal Objective C compilation flags
94cdf0e10cSrcweir#OBJCFLAGS=-no-precomp
95cdf0e10cSrcweirOBJCFLAGS=-fobjc-exceptions
96cdf0e10cSrcweir# -x options generally ignored by ccache, tell it that it can cache
97cdf0e10cSrcweir# the result nevertheless
98cdf0e10cSrcweirCCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL))
99cdf0e10cSrcweirOBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions
100cdf0e10cSrcweir
101cdf0e10cSrcweir# Comp Flags for files that need exceptions enabled (C and C++)
102cdf0e10cSrcweirCFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
103cdf0e10cSrcweir
104cdf0e10cSrcweir# Comp Flags for files that do not need exceptions enabled (C and C++)
105cdf0e10cSrcweirCFLAGS_NO_EXCEPTIONS=-fno-exceptions
106cdf0e10cSrcweir
107cdf0e10cSrcweir# Normal C++ compilation flags
1089964c96fSHerbert DürrCFLAGSCXX=-pipe -malign-natural -fsigned-char $(ARCH_FLAGS)
109cdf0e10cSrcweirCFLAGSCXX+= -Wno-ctor-dtor-privacy
110cdf0e10cSrcweir
111cdf0e10cSrcweirPICSWITCH:=-fPIC
112cdf0e10cSrcweir# Other flags
113cdf0e10cSrcweirCFLAGSOBJGUIMT=$(PICSWITCH) -fno-common
114cdf0e10cSrcweirCFLAGSOBJCUIMT=$(PICSWITCH) -fno-common
115cdf0e10cSrcweirCFLAGSSLOGUIMT=$(PICSWITCH) -fno-common
116cdf0e10cSrcweirCFLAGSSLOCUIMT=$(PICSWITCH) -fno-common
117cdf0e10cSrcweirCFLAGSPROF=
118cdf0e10cSrcweir
119cdf0e10cSrcweir# Flag for including debugging information in object files
120cdf0e10cSrcweirCFLAGSDEBUG=-g
121cdf0e10cSrcweirCFLAGSDBGUTIL=
122cdf0e10cSrcweir
123cdf0e10cSrcweir# Flag to specify output file to compiler/linker
124cdf0e10cSrcweirCFLAGSOUTOBJ=-o
125cdf0e10cSrcweir
126cdf0e10cSrcweir# Flags to enable precompiled headers
127cdf0e10cSrcweirCFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
128cdf0e10cSrcweirCFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch
129cdf0e10cSrcweirCFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch
130cdf0e10cSrcweir
131cdf0e10cSrcweir# ---------------------------------
132cdf0e10cSrcweir#  Optimization flags
133cdf0e10cSrcweir# ---------------------------------
134cdf0e10cSrcweirCFLAGSOPT=-O2 -fno-strict-aliasing
135cdf0e10cSrcweirCFLAGSNOOPT=-O0
136cdf0e10cSrcweir
137cdf0e10cSrcweir# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
138cdf0e10cSrcweir# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h
139cdf0e10cSrcweir# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705,
140cdf0e10cSrcweir# in template code for which a #pragma gcc system_header would not work:
141cdf0e10cSrcweir# -Wextra doesn not work for gcc-3.3
142cdf0e10cSrcweirCFLAGSWARNCC=-Wall -Wendif-labels
143cdf0e10cSrcweirCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
144cdf0e10cSrcweirCFLAGSWALLCC=$(CFLAGSWARNCC)
145cdf0e10cSrcweirCFLAGSWALLCXX=$(CFLAGSWARNCXX)
1469e1bc291SJim JagielskiCFLAGSWERRCC=-Werror -Wno-error=deprecated
147cdf0e10cSrcweir
148cdf0e10cSrcweir# All modules on this platform compile without warnings.
149cdf0e10cSrcweir# If you need to set MODULES_WITH_WARNINGS here, comment
150cdf0e10cSrcweir# COMPILER_WARN_ERRORS=TRUE here (see settings.mk):
151cdf0e10cSrcweirCOMPILER_WARN_ERRORS=TRUE
152cdf0e10cSrcweir
153cdf0e10cSrcweir#special settings form environment
154cdf0e10cSrcweirCDEFS+=$(EXTRA_CDEFS)
155cdf0e10cSrcweir
156cdf0e10cSrcweirSTDLIBCPP=-lstdc++
157cdf0e10cSrcweir
158cdf0e10cSrcweir# ---------------------------------
159cdf0e10cSrcweir#  STLport library names
160cdf0e10cSrcweir# ---------------------------------
161cdf0e10cSrcweir.IF "$(USE_STLP_DEBUG)" != ""
162cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
163cdf0e10cSrcweirLIBSTLPORT=-lstlportstlg
164cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlportstlg
165cdf0e10cSrcweir.ELSE
166cdf0e10cSrcweirLIBSTLPORT=-lstlport_gcc_stldebug
167cdf0e10cSrcweirLIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc_stldebug.a
168cdf0e10cSrcweir.ENDIF
169cdf0e10cSrcweir.ELSE # "$(USE_STLP_DEBUG" != ""
170cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500"
171cdf0e10cSrcweirLIBSTLPORT=-lstlport
172cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport
173cdf0e10cSrcweir.ELSE
174cdf0e10cSrcweirLIBSTLPORT=-lstlport_gcc
175cdf0e10cSrcweirLIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc.a
176cdf0e10cSrcweir.ENDIF
177cdf0e10cSrcweir.ENDIF # "$(USE_STLP_DEBUG" != ""
178cdf0e10cSrcweir
179cdf0e10cSrcweir# ---------------------------------
180cdf0e10cSrcweir#  Link stage flags
181cdf0e10cSrcweir# ---------------------------------
182cdf0e10cSrcweir# always link with gcc since you may be linking c code and don't want -lstdc++ linked in!
183cdf0e10cSrcweir
184cdf0e10cSrcweir##  ericb 04 mars 2005
185cdf0e10cSrcweir
186cdf0e10cSrcweirLINK*=$(CXX)
187cdf0e10cSrcweirLINKC*=$(CC)
188cdf0e10cSrcweir
189*a4523a2bSJim JagielskiLINKFLAGSDEFS*=-Wl,-headerpad,ff,-multiply_defined,suppress
190cdf0e10cSrcweir# assure backwards-compatibility
191cdf0e10cSrcweirEXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
192*a4523a2bSJim JagielskiLINKFLAGSRUNPATH_URELIB=-install_name '@_______URELIB/$(@:f)'
193cdf0e10cSrcweirLINKFLAGSRUNPATH_UREBIN=
194*a4523a2bSJim JagielskiLINKFLAGSRUNPATH_OOO=-install_name '@_______OOO/$(@:f)'
195cdf0e10cSrcweirLINKFLAGSRUNPATH_SDK=
196cdf0e10cSrcweirLINKFLAGSRUNPATH_BRAND=
197cdf0e10cSrcweirLINKFLAGSRUNPATH_OXT=
198cdf0e10cSrcweirLINKFLAGSRUNPATH_BOXT=
199*a4523a2bSJim JagielskiLINKFLAGSRUNPATH_NONE=-install_name '@_______NONE/$(@:f)'
200cdf0e10cSrcweirLINKFLAGS=$(LINKFLAGSDEFS)
201cdf0e10cSrcweir
202cdf0e10cSrcweir# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line
203cdf0e10cSrcweir.IF "$(GUIBASE)" == "aqua"
204cdf0e10cSrcweir	LINKFLAGS+=-lobjc
205cdf0e10cSrcweir	# Sometimes we still use files that would be in a GUIBASE="unx" specific directory
206cdf0e10cSrcweir	# because they really aren't GUIBASE specific, so we've got to account for that here.
207cdf0e10cSrcweir	INCGUI+= -I$(PRJ)/unx/inc
208cdf0e10cSrcweir.ENDIF
209cdf0e10cSrcweir
210cdf0e10cSrcweir#special settings form environment
211cdf0e10cSrcweirLINKFLAGS+=$(EXTRA_LINKFLAGS)
212cdf0e10cSrcweir
213cdf0e10cSrcweir# Random link flags dealing with different cases of linking
214cdf0e10cSrcweir
215cdf0e10cSrcweirLINKFLAGSAPPGUI=-bind_at_load
216cdf0e10cSrcweirLINKFLAGSSHLGUI=-dynamiclib -single_module
217cdf0e10cSrcweirLINKFLAGSAPPCUI=-bind_at_load
218cdf0e10cSrcweirLINKFLAGSSHLCUI=-dynamiclib -single_module
219cdf0e10cSrcweirLINKFLAGSTACK=
220cdf0e10cSrcweirLINKFLAGSPROF=
221cdf0e10cSrcweir
222cdf0e10cSrcweir# Flag to add debugging information to final products
223cdf0e10cSrcweirLINKFLAGSDEBUG=-g
224cdf0e10cSrcweirLINKFLAGSOPT=
225cdf0e10cSrcweir
226cdf0e10cSrcweir# ---------------------------------
227cdf0e10cSrcweir#  MacOS X shared library specifics
228cdf0e10cSrcweir# ---------------------------------
229cdf0e10cSrcweir
230cdf0e10cSrcweir# Tag to identify an output file as a library
231cdf0e10cSrcweirDLLPRE=lib
232cdf0e10cSrcweir# File extension to identify dynamic shared libraries on MacOS X
233cdf0e10cSrcweirDLLPOST=.dylib
234cdf0e10cSrcweir# Precompiled header file extension
235cdf0e10cSrcweirPCHPOST=.gch
236cdf0e10cSrcweir
237cdf0e10cSrcweir# We don't use mapping on MacOS X
238cdf0e10cSrcweir#LINKVERSIONMAPFLAG=-Wl,--version-script
239cdf0e10cSrcweirLINKVERSIONMAPFLAG=-Wl,-exported_symbols_list
240cdf0e10cSrcweir
241cdf0e10cSrcweirSONAME_SWITCH=-Wl,-h
242cdf0e10cSrcweir
243cdf0e10cSrcweirSTDLIBCPP=-lstdc++
244cdf0e10cSrcweir
245cdf0e10cSrcweirSTDOBJVCL=$(L)/salmain.o
246cdf0e10cSrcweirSTDOBJGUI=
247cdf0e10cSrcweirSTDSLOGUI=
248cdf0e10cSrcweirSTDOBJCUI=
249cdf0e10cSrcweirSTDSLOCUI=
250cdf0e10cSrcweir
251cdf0e10cSrcweir.IF "$(GUIBASE)" == "aqua"
252cdf0e10cSrcweir	STDLIBCUIMT=CPPRUNTIME -lm
253cdf0e10cSrcweir	STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
254cdf0e10cSrcweir	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
255cdf0e10cSrcweir	STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
256cdf0e10cSrcweir.ELSE
257cdf0e10cSrcweir	STDLIBCUIMT= CPPRUNTIME -lm
258cdf0e10cSrcweir	STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm
259cdf0e10cSrcweir	STDSHLCUIMT=-lpthread CPPRUNTIME -lm
260cdf0e10cSrcweir	STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation
261cdf0e10cSrcweir.ENDIF
262cdf0e10cSrcweir
263cdf0e10cSrcweirLIBMGR=ar
264cdf0e10cSrcweirLIBFLAGS=-r
265cdf0e10cSrcweir
266cdf0e10cSrcweirIMPLIB=
267cdf0e10cSrcweirIMPLIBFLAGS=
268cdf0e10cSrcweir
269cdf0e10cSrcweirMAPSYM=
270cdf0e10cSrcweirMAPSYMFLAGS=
271cdf0e10cSrcweir
272cdf0e10cSrcweirRC=irc
273cdf0e10cSrcweirRCFLAGS=-fo$@ $(RCFILES)
274cdf0e10cSrcweirRCLINK=
275cdf0e10cSrcweirRCLINKFLAGS=
276cdf0e10cSrcweirRCSETVERSION=
277cdf0e10cSrcweir
278cdf0e10cSrcweirOOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
279