xref: /trunk/main/solenv/inc/unxmacc.mk (revision 8c12a8ba)
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) -Wl,-headerpad_max_install_names
171LINKFLAGSRUNPATH_URELIB=-install_name '@_______URELIB/$(@:f)'
172LINKFLAGSRUNPATH_UREBIN=
173LINKFLAGSRUNPATH_OOO=-install_name '@_______OOO/$(@:f)'
174LINKFLAGSRUNPATH_SDK=
175LINKFLAGSRUNPATH_BRAND=
176LINKFLAGSRUNPATH_OXT=
177LINKFLAGSRUNPATH_BOXT=
178LINKFLAGSRUNPATH_NONE=-install_name '@_______NONE/$(@:f)'
179LINKFLAGS=$(LINKFLAGSDEFS)
180
181LINKFLAGS+=-lobjc
182LINKFLAGS+=-lc++
183
184#special settings form environment
185LINKFLAGS+=$(EXTRA_LINKFLAGS)
186
187# Random link flags dealing with different cases of linking
188
189LINKFLAGSAPPGUI=-bind_at_load
190LINKFLAGSSHLGUI=-dynamiclib -single_module
191LINKFLAGSAPPCUI=-bind_at_load
192LINKFLAGSSHLCUI=-dynamiclib -single_module
193LINKFLAGSTACK=
194LINKFLAGSPROF=
195
196# Flag to add debugging information to final products
197LINKFLAGSDEBUG=-g
198LINKFLAGSOPT=
199
200# ---------------------------------
201#  MacOS X shared library specifics
202# ---------------------------------
203
204# Tag to identify an output file as a library
205DLLPRE=lib
206# File extension to identify dynamic shared libraries on MacOS X
207DLLPOST=.dylib
208# Precompiled header file extension
209PCHPOST=.gch
210
211#LINKVERSIONMAPFLAG=-Xlinker -map -Xlinker
212LINKVERSIONMAPFLAG=-Wl,-map -Wl,
213
214SONAME_SWITCH=-Wl,-h
215
216
217STDOBJVCL=$(L)/salmain.o
218STDOBJGUI=
219STDSLOGUI=
220STDOBJCUI=
221STDSLOCUI=
222
223#STDLIBCUIMT=CPPRUNTIME -lm
224#STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm
225STDSHLCUIMT=-lpthread CPPRUNTIME -lm
226STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm
227
228LIBMGR=ar
229LIBFLAGS=-r
230
231IMPLIB=
232IMPLIBFLAGS=
233
234MAPSYM=
235MAPSYMFLAGS=
236
237RC=irc
238RCFLAGS=-fo$@ $(RCFILES)
239RCLINK=
240RCLINKFLAGS=
241RCSETVERSION=
242
243OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH
244