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 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk 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 172# assure backwards-compatibility 173###EXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk 174EXTRA_LINKFLAGS*=-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk 175# Very long install_names are needed so that install_name_tool -change later on 176# does not complain that "larger updated load commands do not fit:" 177LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)' 178LINKFLAGSRUNPATH_UREBIN= 179LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)' 180LINKFLAGSRUNPATH_SDK= 181LINKFLAGSRUNPATH_BRAND= 182LINKFLAGSRUNPATH_OXT= 183LINKFLAGSRUNPATH_BOXT= 184LINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)' 185LINKFLAGS=$(LINKFLAGSDEFS) 186 187# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line 188.IF "$(GUIBASE)" == "aqua" 189 LINKFLAGS+=-lobjc 190 # Sometimes we still use files that would be in a GUIBASE="unx" specific directory 191 # because they really aren't GUIBASE specific, so we've got to account for that here. 192 INCGUI+= -I$(PRJ)/unx/inc 193.ENDIF 194 195#special settings form environment 196LINKFLAGS+=$(EXTRA_LINKFLAGS) 197 198# Random link flags dealing with different cases of linking 199 200LINKFLAGSAPPGUI=-bind_at_load 201LINKFLAGSSHLGUI=-dynamiclib -single_module 202LINKFLAGSAPPCUI=-bind_at_load 203LINKFLAGSSHLCUI=-dynamiclib -single_module 204LINKFLAGSTACK= 205LINKFLAGSPROF= 206 207# Flag to add debugging information to final products 208LINKFLAGSDEBUG=-g 209LINKFLAGSOPT= 210 211# --------------------------------- 212# MacOS X shared library specifics 213# --------------------------------- 214 215# Tag to identify an output file as a library 216DLLPRE=lib 217# File extension to identify dynamic shared libraries on MacOS X 218DLLPOST=.dylib 219# Precompiled header file extension 220PCHPOST=.gch 221 222#LINKVERSIONMAPFLAG=-Xlinker -map -Xlinker 223LINKVERSIONMAPFLAG=-Wl,-map -Wl, 224 225SONAME_SWITCH=-Wl,-h 226 227### STDLIBCPP=-stdlib=libc++ 228STDLIBCPP=-lc++ 229 230STDOBJVCL=$(L)/salmain.o 231STDOBJGUI= 232STDSLOGUI= 233STDOBJCUI= 234STDSLOCUI= 235 236.IF "$(GUIBASE)" == "aqua" 237 STDLIBCUIMT=CPPRUNTIME -lm 238 STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm 239 STDSHLCUIMT=-lpthread CPPRUNTIME -lm 240 STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm 241.ELSE 242 STDLIBCUIMT= CPPRUNTIME -lm 243 STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm 244 STDSHLCUIMT=-lpthread CPPRUNTIME -lm 245 STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation 246.ENDIF 247 248LIBMGR=ar 249LIBFLAGS=-r 250 251IMPLIB= 252IMPLIBFLAGS= 253 254MAPSYM= 255MAPSYMFLAGS= 256 257RC=irc 258RCFLAGS=-fo$@ $(RCFILES) 259RCLINK= 260RCLINKFLAGS= 261RCSETVERSION= 262 263OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH 264