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.7 44#.EXPORT: MACOSX_DEPLOYMENT_TARGET 45CDEFS+=-DQUARTZ 46EXTRA_CDEFS*=-isysroot $(SDK_PATH) 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" 54 CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE 55.ENDIF 56 57# MacOS X specific Java compilation/link flags 58SOLAR_JAVA*=TRUE 59.IF "$(SOLAR_JAVA)"!="" 60 JAVADEF=-DSOLAR_JAVA 61 JAVAFLAGSDEBUG=-g 62 JAVA_RUNTIME=-framework JavaVM 63.ENDIF 64 65# architecture dependent flags for the C and C++ compiler that can be changed by 66# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build 67ARCH_FLAGS*= 68 69# Specify the compiler to use. NOTE: MacOS X should always specify 70# c++ for C++ compilation as it does certain C++ specific things 71# behind the scenes for us. 72# CC = C++ compiler to use 73# cc = C compiler to use 74# objc = Objective C compiler to use 75# objcpp = Objective C++ compiler to use 76CXX*=clang++ 77CC*=clang 78objc*=$(CC) 79objcpp*=$(CXX) 80 81EXTRA_CFLAGS= 82 83CFLAGS=-fsigned-char -fmessage-length=0 -c $(EXTRA_CFLAGS) 84 85.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE" 86CFLAGS+=-Wno-deprecated-declarations 87.ENDIF 88# --------------------------------- 89# Compilation flags 90# --------------------------------- 91# Normal C compilation flags 92CFLAGSCC=-pipe -fsigned-char 93 94# Normal Objective C compilation flags 95#OBJCFLAGS=-no-precomp 96OBJCFLAGS=-fobjc-exceptions 97# -x options generally ignored by ccache, tell it that it can cache 98# the result nevertheless 99CCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL)) 100OBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions 101 102# Comp Flags for files that need exceptions enabled (C and C++) 103CFLAGSEXCEPTIONS=-fexceptions 104 105# Comp Flags for files that do not need exceptions enabled (C and C++) 106CFLAGS_NO_EXCEPTIONS=-fno-exceptions 107 108# Normal C++ compilation flags 109CFLAGSCXX=-pipe -fsigned-char 110 111CFLAGSCXX+= -Wno-ctor-dtor-privacy 112 113PICSWITCH:=-fPIC 114# Other flags 115CFLAGSOBJGUIMT=$(PICSWITCH) -fno-common 116CFLAGSOBJCUIMT=$(PICSWITCH) -fno-common 117CFLAGSSLOGUIMT=$(PICSWITCH) -fno-common 118CFLAGSSLOCUIMT=$(PICSWITCH) -fno-common 119CFLAGSPROF= 120 121# Flag for including debugging information in object files 122CFLAGSDEBUG=-g 123CFLAGSDBGUTIL= 124 125# Flag to specify output file to compiler/linker 126CFLAGSOUTOBJ=-o 127 128# Flags to enable precompiled headers 129CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS 130CFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch 131CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch 132 133# --------------------------------- 134# Optimization flags 135# --------------------------------- 136CFLAGSOPT=-O2 -fno-strict-aliasing 137CFLAGSNOOPT=-O0 138 139# -Wshadow does not work for C with nested uses of pthread_cleanup_push: 140# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h 141# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705, 142# in template code for which a #pragma gcc system_header would not work: 143CFLAGSWARNCC=-Wall -Wendif-labels 144CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor 145CFLAGSWALLCC=$(CFLAGSWARNCC) 146CFLAGSWALLCXX=$(CFLAGSWARNCXX) 147CFLAGSWERRCC=-Werror 148 149# All modules on this platform compile without warnings. 150# If you need to set MODULES_WITH_WARNINGS here, comment 151# COMPILER_WARN_ERRORS=TRUE here (see settings.mk): 152COMPILER_WARN_ERRORS=TRUE 153 154#special settings from environment 155CDEFS+=$(EXTRA_CDEFS) 156 157# --------------------------------- 158# STL library names 159# --------------------------------- 160 161CDEFS+=-DHAVE_STL_INCLUDE_PATH -I../v1/ 162STDLIBCPP=-lc++ 163 164# --------------------------------- 165# Link stage flags 166# --------------------------------- 167 168LINK*=$(CXX) 169LINKC*=$(CC) 170 171###LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress 172EXTRA_LINKFLAGS*=-L$(SDK_PATH) 173# Very long install_names are needed so that install_name_tool -change later on 174# does not complain that "larger updated load commands do not fit:" 175LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)' 176LINKFLAGSRUNPATH_UREBIN= 177LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)' 178LINKFLAGSRUNPATH_SDK= 179LINKFLAGSRUNPATH_BRAND= 180LINKFLAGSRUNPATH_OXT= 181LINKFLAGSRUNPATH_BOXT= 182LINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)' 183LINKFLAGS=$(LINKFLAGSDEFS) 184 185LINKFLAGS+=-lobjc 186LINKFLAGS+=-lc++ 187 188#special settings form environment 189LINKFLAGS+=$(EXTRA_LINKFLAGS) 190 191# Random link flags dealing with different cases of linking 192 193LINKFLAGSAPPGUI=-bind_at_load 194LINKFLAGSSHLGUI=-dynamiclib -single_module 195LINKFLAGSAPPCUI=-bind_at_load 196LINKFLAGSSHLCUI=-dynamiclib -single_module 197LINKFLAGSTACK= 198LINKFLAGSPROF= 199 200# Flag to add debugging information to final products 201LINKFLAGSDEBUG=-g 202LINKFLAGSOPT= 203 204# --------------------------------- 205# MacOS X shared library specifics 206# --------------------------------- 207 208# Tag to identify an output file as a library 209DLLPRE=lib 210# File extension to identify dynamic shared libraries on MacOS X 211DLLPOST=.dylib 212# Precompiled header file extension 213PCHPOST=.gch 214 215#LINKVERSIONMAPFLAG=-Xlinker -map -Xlinker 216LINKVERSIONMAPFLAG=-Wl,-map -Wl, 217 218SONAME_SWITCH=-Wl,-h 219 220 221STDOBJVCL=$(L)/salmain.o 222STDOBJGUI= 223STDSLOGUI= 224STDOBJCUI= 225STDSLOCUI= 226 227#STDLIBCUIMT=CPPRUNTIME -lm 228#STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm 229STDSHLCUIMT=-lpthread CPPRUNTIME -lm 230STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm 231 232LIBMGR=ar 233LIBFLAGS=-r 234 235IMPLIB= 236IMPLIBFLAGS= 237 238MAPSYM= 239MAPSYMFLAGS= 240 241RC=irc 242RCFLAGS=-fo$@ $(RCFILES) 243RCLINK= 244RCLINKFLAGS= 245RCSETVERSION= 246 247OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH 248