xref: /trunk/main/solenv/inc/unxmacc.mk (revision 9e1bc291)
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.IF "$(MACOSX_DEPLOYMENT_TARGET)" != ""
40	CDEFS += -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_$(subst,.,_ $(MACOSX_DEPLOYMENT_TARGET))
41.ENDIF
42
43CDEFS+=-DQUARTZ
44EXTRA_CDEFS*=-isysroot $(MACOSX_SDK_PATH)
45
46# Name of library where static data members are initialized
47# STATICLIBNAME=static$(DLLPOSTFIX)
48# STATICLIB=-l$(STATICLIBNAME)
49
50# enable visibility define in "sal/types.h"
51.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
52	CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE
53.ENDIF
54
55# MacOS X specific Java compilation/link flags
56SOLAR_JAVA*=TRUE
57.IF "$(SOLAR_JAVA)"!=""
58	JAVADEF=-DSOLAR_JAVA
59	JAVAFLAGSDEBUG=-g
60	JAVA_RUNTIME=-framework JavaVM
61.ENDIF
62
63# architecture dependent flags for the C and C++ compiler that can be changed by
64# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build
65ARCH_FLAGS*=
66
67# Specify the compiler to use.  NOTE:  MacOS X should always specify
68# c++ for C++ compilation as it does certain C++ specific things
69# behind the scenes for us.
70# CC = C++ compiler to use
71# cc = C compiler to use
72# objc = Objective C compiler to use
73# objcpp = Objective C++ compiler to use
74CXX*=clang++
75CC*=clang
76objc*=$(CC)
77objcpp*=$(CXX)
78
79EXTRA_CFLAGS=
80
81CFLAGS=-fsigned-char -fmessage-length=0 -c $(EXTRA_CFLAGS)
82
83.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE"
84CFLAGS+=-Wno-deprecated-declarations
85.ENDIF
86# ---------------------------------
87#  Compilation flags
88# ---------------------------------
89# Normal C compilation flags
90CFLAGSCC=-pipe -fsigned-char
91
92# Normal Objective C compilation flags
93#OBJCFLAGS=-no-precomp
94OBJCFLAGS=-fobjc-exceptions
95# -x options generally ignored by ccache, tell it that it can cache
96# the result nevertheless
97CCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL))
98OBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions
99
100# Comp Flags for files that need exceptions enabled (C and C++)
101CFLAGSEXCEPTIONS=-fexceptions
102
103# Comp Flags for files that do not need exceptions enabled (C and C++)
104CFLAGS_NO_EXCEPTIONS=-fno-exceptions
105
106# Normal C++ compilation flags
107CFLAGSCXX=-pipe -fsigned-char
108
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:
141CFLAGSWARNCC=-Wall -Wendif-labels
142CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor
143CFLAGSWALLCC=$(CFLAGSWARNCC)
144CFLAGSWALLCXX=$(CFLAGSWARNCXX)
145CFLAGSWERRCC=-Werror -Wno-error=deprecated
146
147# All modules on this platform compile without warnings.
148# If you need to set MODULES_WITH_WARNINGS here, comment
149# COMPILER_WARN_ERRORS=TRUE here (see settings.mk):
150COMPILER_WARN_ERRORS=TRUE
151
152#special settings from environment
153CDEFS+=$(EXTRA_CDEFS)
154
155# ---------------------------------
156#  STL library names
157# ---------------------------------
158
159CDEFS+=-DHAVE_STL_INCLUDE_PATH -I../v1/
160STDLIBCPP=-lc++
161
162# ---------------------------------
163#  Link stage flags
164# ---------------------------------
165
166LINK*=$(CXX)
167LINKC*=$(CC)
168
169###LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress
170EXTRA_LINKFLAGS*=-L$(MACOSX_SDK_PATH)
171# Very long install_names are needed so that install_name_tool -change later on
172# does not complain that "larger updated load commands do not fit:"
173LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)'
174LINKFLAGSRUNPATH_UREBIN=
175LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)'
176LINKFLAGSRUNPATH_SDK=
177LINKFLAGSRUNPATH_BRAND=
178LINKFLAGSRUNPATH_OXT=
179LINKFLAGSRUNPATH_BOXT=
180LINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)'
181LINKFLAGS=$(LINKFLAGSDEFS)
182
183LINKFLAGS+=-lobjc
184LINKFLAGS+=-lc++
185
186#special settings form environment
187LINKFLAGS+=$(EXTRA_LINKFLAGS)
188
189# Random link flags dealing with different cases of linking
190
191LINKFLAGSAPPGUI=-bind_at_load
192LINKFLAGSSHLGUI=-dynamiclib -single_module
193LINKFLAGSAPPCUI=-bind_at_load
194LINKFLAGSSHLCUI=-dynamiclib -single_module
195LINKFLAGSTACK=
196LINKFLAGSPROF=
197
198# Flag to add debugging information to final products
199LINKFLAGSDEBUG=-g
200LINKFLAGSOPT=
201
202# ---------------------------------
203#  MacOS X shared library specifics
204# ---------------------------------
205
206# Tag to identify an output file as a library
207DLLPRE=lib
208# File extension to identify dynamic shared libraries on MacOS X
209DLLPOST=.dylib
210# Precompiled header file extension
211PCHPOST=.gch
212
213#LINKVERSIONMAPFLAG=-Xlinker -map -Xlinker
214LINKVERSIONMAPFLAG=-Wl,-map -Wl,
215
216SONAME_SWITCH=-Wl,-h
217
218
219STDOBJVCL=$(L)/salmain.o
220STDOBJGUI=
221STDSLOGUI=
222STDOBJCUI=
223STDSLOCUI=
224
225#STDLIBCUIMT=CPPRUNTIME -lm
226#STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
227STDSHLCUIMT=-lpthread CPPRUNTIME -lm
228STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
229
230LIBMGR=ar
231LIBFLAGS=-r
232
233IMPLIB=
234IMPLIBFLAGS=
235
236MAPSYM=
237MAPSYMFLAGS=
238
239RC=irc
240RCFLAGS=-fo$@ $(RCFILES)
241RCLINK=
242RCLINKFLAGS=
243RCSETVERSION=
244
245OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
246