1*0bc66fd0SHerbert Dürr#************************************************************** 2*0bc66fd0SHerbert Dürr# 3*0bc66fd0SHerbert Dürr# Licensed to the Apache Software Foundation (ASF) under one 4*0bc66fd0SHerbert Dürr# or more contributor license agreements. See the NOTICE file 5*0bc66fd0SHerbert Dürr# distributed with this work for additional information 6*0bc66fd0SHerbert Dürr# regarding copyright ownership. The ASF licenses this file 7*0bc66fd0SHerbert Dürr# to you under the Apache License, Version 2.0 (the 8*0bc66fd0SHerbert Dürr# "License"); you may not use this file except in compliance 9*0bc66fd0SHerbert Dürr# with the License. You may obtain a copy of the License at 10*0bc66fd0SHerbert Dürr# 11*0bc66fd0SHerbert Dürr# http://www.apache.org/licenses/LICENSE-2.0 12*0bc66fd0SHerbert Dürr# 13*0bc66fd0SHerbert Dürr# Unless required by applicable law or agreed to in writing, 14*0bc66fd0SHerbert Dürr# software distributed under the License is distributed on an 15*0bc66fd0SHerbert Dürr# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*0bc66fd0SHerbert Dürr# KIND, either express or implied. See the License for the 17*0bc66fd0SHerbert Dürr# specific language governing permissions and limitations 18*0bc66fd0SHerbert Dürr# under the License. 19*0bc66fd0SHerbert Dürr# 20*0bc66fd0SHerbert Dürr#************************************************************** 21*0bc66fd0SHerbert Dürr 22*0bc66fd0SHerbert Dürr 23*0bc66fd0SHerbert Dürr 24*0bc66fd0SHerbert Dürr########################################################################## 25*0bc66fd0SHerbert Dürr# Platform MAKEFILE for Mac OS X and Darwin on both PowerPC and Intel 26*0bc66fd0SHerbert Dürr########################################################################## 27*0bc66fd0SHerbert Dürr 28*0bc66fd0SHerbert Dürr# PROCESSOR_DEFINES and DLLPOSTFIX are defined in the particular platform file 29*0bc66fd0SHerbert Dürr 30*0bc66fd0SHerbert DürrASM= 31*0bc66fd0SHerbert DürrAFLAGS= 32*0bc66fd0SHerbert DürrLINKOUTPUT_FILTER= 33*0bc66fd0SHerbert Dürr 34*0bc66fd0SHerbert Dürr# Definitions that we may need on the compile line. 35*0bc66fd0SHerbert Dürr# -D_PTHREADS and -D_REENTRANT are needed for STLport, and must be specified when 36*0bc66fd0SHerbert Dürr# compiling STLport sources too, either internally or externally. 37*0bc66fd0SHerbert DürrCDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -D_USE_NAMESPACE=1 38*0bc66fd0SHerbert Dürr 39*0bc66fd0SHerbert Dürr# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build result 40*0bc66fd0SHerbert Dürr# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro) 41*0bc66fd0SHerbert Dürr# http://developer.apple.com/technotes/tn2002/tn2064.html 42*0bc66fd0SHerbert Dürr# done in setsolar/configure now. left here for documentation 43*0bc66fd0SHerbert Dürr#MACOSX_DEPLOYMENT_TARGET=10.7 44*0bc66fd0SHerbert Dürr#.EXPORT: MACOSX_DEPLOYMENT_TARGET 45*0bc66fd0SHerbert DürrCDEFS+=-DQUARTZ 46*0bc66fd0SHerbert DürrEXTRA_CDEFS*=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk 47*0bc66fd0SHerbert Dürr 48*0bc66fd0SHerbert Dürr# Name of library where static data members are initialized 49*0bc66fd0SHerbert Dürr# STATICLIBNAME=static$(DLLPOSTFIX) 50*0bc66fd0SHerbert Dürr# STATICLIB=-l$(STATICLIBNAME) 51*0bc66fd0SHerbert Dürr 52*0bc66fd0SHerbert Dürr# enable visibility define in "sal/types.h" 53*0bc66fd0SHerbert Dürr.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 54*0bc66fd0SHerbert Dürr CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE 55*0bc66fd0SHerbert Dürr.ENDIF 56*0bc66fd0SHerbert Dürr 57*0bc66fd0SHerbert Dürr# MacOS X specific Java compilation/link flags 58*0bc66fd0SHerbert DürrSOLAR_JAVA*=TRUE 59*0bc66fd0SHerbert Dürr.IF "$(SOLAR_JAVA)"!="" 60*0bc66fd0SHerbert Dürr JAVADEF=-DSOLAR_JAVA 61*0bc66fd0SHerbert Dürr JAVAFLAGSDEBUG=-g 62*0bc66fd0SHerbert Dürr JAVA_RUNTIME=-framework JavaVM 63*0bc66fd0SHerbert Dürr.ENDIF 64*0bc66fd0SHerbert Dürr 65*0bc66fd0SHerbert Dürr# architecture dependent flags for the C and C++ compiler that can be changed by 66*0bc66fd0SHerbert Dürr# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build 67*0bc66fd0SHerbert DürrARCH_FLAGS*= 68*0bc66fd0SHerbert Dürr 69*0bc66fd0SHerbert Dürr# Specify the compiler to use. NOTE: MacOS X should always specify 70*0bc66fd0SHerbert Dürr# c++ for C++ compilation as it does certain C++ specific things 71*0bc66fd0SHerbert Dürr# behind the scenes for us. 72*0bc66fd0SHerbert Dürr# CC = C++ compiler to use 73*0bc66fd0SHerbert Dürr# cc = C compiler to use 74*0bc66fd0SHerbert Dürr# objc = Objective C compiler to use 75*0bc66fd0SHerbert Dürr# objcpp = Objective C++ compiler to use 76*0bc66fd0SHerbert DürrCXX*=clang++ 77*0bc66fd0SHerbert DürrCC*=clang 78*0bc66fd0SHerbert Dürrobjc*=$(CC) 79*0bc66fd0SHerbert Dürrobjcpp*=$(CXX) 80*0bc66fd0SHerbert Dürr 81*0bc66fd0SHerbert DürrEXTRA_CFLAGS= 82*0bc66fd0SHerbert Dürr 83*0bc66fd0SHerbert DürrCFLAGS=-fsigned-char -fmessage-length=0 -c $(EXTRA_CFLAGS) 84*0bc66fd0SHerbert Dürr 85*0bc66fd0SHerbert Dürr.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE" 86*0bc66fd0SHerbert DürrCFLAGS+=-Wno-deprecated-declarations 87*0bc66fd0SHerbert Dürr.ENDIF 88*0bc66fd0SHerbert Dürr# --------------------------------- 89*0bc66fd0SHerbert Dürr# Compilation flags 90*0bc66fd0SHerbert Dürr# --------------------------------- 91*0bc66fd0SHerbert Dürr# Normal C compilation flags 92*0bc66fd0SHerbert DürrCFLAGSCC=-pipe -fsigned-char 93*0bc66fd0SHerbert Dürr 94*0bc66fd0SHerbert Dürr# Normal Objective C compilation flags 95*0bc66fd0SHerbert Dürr#OBJCFLAGS=-no-precomp 96*0bc66fd0SHerbert DürrOBJCFLAGS=-fobjc-exceptions 97*0bc66fd0SHerbert Dürr# -x options generally ignored by ccache, tell it that it can cache 98*0bc66fd0SHerbert Dürr# the result nevertheless 99*0bc66fd0SHerbert DürrCCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL)) 100*0bc66fd0SHerbert DürrOBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions 101*0bc66fd0SHerbert Dürr 102*0bc66fd0SHerbert Dürr# Comp Flags for files that need exceptions enabled (C and C++) 103*0bc66fd0SHerbert DürrCFLAGSEXCEPTIONS=-fexceptions 104*0bc66fd0SHerbert Dürr 105*0bc66fd0SHerbert Dürr# Comp Flags for files that do not need exceptions enabled (C and C++) 106*0bc66fd0SHerbert DürrCFLAGS_NO_EXCEPTIONS=-fno-exceptions 107*0bc66fd0SHerbert Dürr 108*0bc66fd0SHerbert Dürr# Normal C++ compilation flags 109*0bc66fd0SHerbert DürrCFLAGSCXX=-pipe -fsigned-char 110*0bc66fd0SHerbert Dürr 111*0bc66fd0SHerbert DürrCFLAGSCXX+= -Wno-ctor-dtor-privacy 112*0bc66fd0SHerbert Dürr 113*0bc66fd0SHerbert DürrPICSWITCH:=-fPIC 114*0bc66fd0SHerbert Dürr# Other flags 115*0bc66fd0SHerbert DürrCFLAGSOBJGUIMT=$(PICSWITCH) -fno-common 116*0bc66fd0SHerbert DürrCFLAGSOBJCUIMT=$(PICSWITCH) -fno-common 117*0bc66fd0SHerbert DürrCFLAGSSLOGUIMT=$(PICSWITCH) -fno-common 118*0bc66fd0SHerbert DürrCFLAGSSLOCUIMT=$(PICSWITCH) -fno-common 119*0bc66fd0SHerbert DürrCFLAGSPROF= 120*0bc66fd0SHerbert Dürr 121*0bc66fd0SHerbert Dürr# Flag for including debugging information in object files 122*0bc66fd0SHerbert DürrCFLAGSDEBUG=-g 123*0bc66fd0SHerbert DürrCFLAGSDBGUTIL= 124*0bc66fd0SHerbert Dürr 125*0bc66fd0SHerbert Dürr# Flag to specify output file to compiler/linker 126*0bc66fd0SHerbert DürrCFLAGSOUTOBJ=-o 127*0bc66fd0SHerbert Dürr 128*0bc66fd0SHerbert Dürr# Flags to enable precompiled headers 129*0bc66fd0SHerbert DürrCFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS 130*0bc66fd0SHerbert DürrCFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch 131*0bc66fd0SHerbert DürrCFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch 132*0bc66fd0SHerbert Dürr 133*0bc66fd0SHerbert Dürr# --------------------------------- 134*0bc66fd0SHerbert Dürr# Optimization flags 135*0bc66fd0SHerbert Dürr# --------------------------------- 136*0bc66fd0SHerbert DürrCFLAGSOPT=-O2 -fno-strict-aliasing 137*0bc66fd0SHerbert DürrCFLAGSNOOPT=-O0 138*0bc66fd0SHerbert Dürr 139*0bc66fd0SHerbert Dürr# -Wshadow does not work for C with nested uses of pthread_cleanup_push: 140*0bc66fd0SHerbert Dürr# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h 141*0bc66fd0SHerbert Dürr# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705, 142*0bc66fd0SHerbert Dürr# in template code for which a #pragma gcc system_header would not work: 143*0bc66fd0SHerbert DürrCFLAGSWARNCC=-Wall -Wendif-labels 144*0bc66fd0SHerbert DürrCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor 145*0bc66fd0SHerbert DürrCFLAGSWALLCC=$(CFLAGSWARNCC) 146*0bc66fd0SHerbert DürrCFLAGSWALLCXX=$(CFLAGSWARNCXX) 147*0bc66fd0SHerbert DürrCFLAGSWERRCC=-Werror 148*0bc66fd0SHerbert Dürr 149*0bc66fd0SHerbert Dürr# All modules on this platform compile without warnings. 150*0bc66fd0SHerbert Dürr# If you need to set MODULES_WITH_WARNINGS here, comment 151*0bc66fd0SHerbert Dürr# COMPILER_WARN_ERRORS=TRUE here (see settings.mk): 152*0bc66fd0SHerbert DürrCOMPILER_WARN_ERRORS=TRUE 153*0bc66fd0SHerbert Dürr 154*0bc66fd0SHerbert Dürr#special settings from environment 155*0bc66fd0SHerbert DürrCDEFS+=$(EXTRA_CDEFS) 156*0bc66fd0SHerbert Dürr 157*0bc66fd0SHerbert Dürr# --------------------------------- 158*0bc66fd0SHerbert Dürr# STL library names 159*0bc66fd0SHerbert Dürr# --------------------------------- 160*0bc66fd0SHerbert Dürr 161*0bc66fd0SHerbert DürrCDEFS+=-DHAVE_STL_INCLUDE_PATH -I../v1/ 162*0bc66fd0SHerbert DürrSTDLIBCPP=-lc++ 163*0bc66fd0SHerbert Dürr 164*0bc66fd0SHerbert Dürr# --------------------------------- 165*0bc66fd0SHerbert Dürr# Link stage flags 166*0bc66fd0SHerbert Dürr# --------------------------------- 167*0bc66fd0SHerbert Dürr 168*0bc66fd0SHerbert DürrLINK*=$(CXX) 169*0bc66fd0SHerbert DürrLINKC*=$(CC) 170*0bc66fd0SHerbert Dürr 171*0bc66fd0SHerbert Dürr###LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress 172*0bc66fd0SHerbert Dürr# assure backwards-compatibility 173*0bc66fd0SHerbert Dürr###EXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk 174*0bc66fd0SHerbert DürrEXTRA_LINKFLAGS*=-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk 175*0bc66fd0SHerbert Dürr# Very long install_names are needed so that install_name_tool -change later on 176*0bc66fd0SHerbert Dürr# does not complain that "larger updated load commands do not fit:" 177*0bc66fd0SHerbert DürrLINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)' 178*0bc66fd0SHerbert DürrLINKFLAGSRUNPATH_UREBIN= 179*0bc66fd0SHerbert DürrLINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)' 180*0bc66fd0SHerbert DürrLINKFLAGSRUNPATH_SDK= 181*0bc66fd0SHerbert DürrLINKFLAGSRUNPATH_BRAND= 182*0bc66fd0SHerbert DürrLINKFLAGSRUNPATH_OXT= 183*0bc66fd0SHerbert DürrLINKFLAGSRUNPATH_BOXT= 184*0bc66fd0SHerbert DürrLINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)' 185*0bc66fd0SHerbert DürrLINKFLAGS=$(LINKFLAGSDEFS) 186*0bc66fd0SHerbert Dürr 187*0bc66fd0SHerbert Dürr# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line 188*0bc66fd0SHerbert Dürr.IF "$(GUIBASE)" == "aqua" 189*0bc66fd0SHerbert Dürr LINKFLAGS+=-lobjc 190*0bc66fd0SHerbert Dürr # Sometimes we still use files that would be in a GUIBASE="unx" specific directory 191*0bc66fd0SHerbert Dürr # because they really aren't GUIBASE specific, so we've got to account for that here. 192*0bc66fd0SHerbert Dürr INCGUI+= -I$(PRJ)/unx/inc 193*0bc66fd0SHerbert Dürr.ENDIF 194*0bc66fd0SHerbert Dürr 195*0bc66fd0SHerbert Dürr#special settings form environment 196*0bc66fd0SHerbert DürrLINKFLAGS+=$(EXTRA_LINKFLAGS) 197*0bc66fd0SHerbert Dürr 198*0bc66fd0SHerbert Dürr# Random link flags dealing with different cases of linking 199*0bc66fd0SHerbert Dürr 200*0bc66fd0SHerbert DürrLINKFLAGSAPPGUI=-bind_at_load 201*0bc66fd0SHerbert DürrLINKFLAGSSHLGUI=-dynamiclib -single_module 202*0bc66fd0SHerbert DürrLINKFLAGSAPPCUI=-bind_at_load 203*0bc66fd0SHerbert DürrLINKFLAGSSHLCUI=-dynamiclib -single_module 204*0bc66fd0SHerbert DürrLINKFLAGSTACK= 205*0bc66fd0SHerbert DürrLINKFLAGSPROF= 206*0bc66fd0SHerbert Dürr 207*0bc66fd0SHerbert Dürr# Flag to add debugging information to final products 208*0bc66fd0SHerbert DürrLINKFLAGSDEBUG=-g 209*0bc66fd0SHerbert DürrLINKFLAGSOPT= 210*0bc66fd0SHerbert Dürr 211*0bc66fd0SHerbert Dürr# --------------------------------- 212*0bc66fd0SHerbert Dürr# MacOS X shared library specifics 213*0bc66fd0SHerbert Dürr# --------------------------------- 214*0bc66fd0SHerbert Dürr 215*0bc66fd0SHerbert Dürr# Tag to identify an output file as a library 216*0bc66fd0SHerbert DürrDLLPRE=lib 217*0bc66fd0SHerbert Dürr# File extension to identify dynamic shared libraries on MacOS X 218*0bc66fd0SHerbert DürrDLLPOST=.dylib 219*0bc66fd0SHerbert Dürr# Precompiled header file extension 220*0bc66fd0SHerbert DürrPCHPOST=.gch 221*0bc66fd0SHerbert Dürr 222*0bc66fd0SHerbert Dürr#LINKVERSIONMAPFLAG=-Xlinker -map -Xlinker 223*0bc66fd0SHerbert DürrLINKVERSIONMAPFLAG=-Wl,-map -Wl, 224*0bc66fd0SHerbert Dürr 225*0bc66fd0SHerbert DürrSONAME_SWITCH=-Wl,-h 226*0bc66fd0SHerbert Dürr 227*0bc66fd0SHerbert Dürr### STDLIBCPP=-stdlib=libc++ 228*0bc66fd0SHerbert DürrSTDLIBCPP=-lc++ 229*0bc66fd0SHerbert Dürr 230*0bc66fd0SHerbert DürrSTDOBJVCL=$(L)/salmain.o 231*0bc66fd0SHerbert DürrSTDOBJGUI= 232*0bc66fd0SHerbert DürrSTDSLOGUI= 233*0bc66fd0SHerbert DürrSTDOBJCUI= 234*0bc66fd0SHerbert DürrSTDSLOCUI= 235*0bc66fd0SHerbert Dürr 236*0bc66fd0SHerbert Dürr.IF "$(GUIBASE)" == "aqua" 237*0bc66fd0SHerbert Dürr STDLIBCUIMT=CPPRUNTIME -lm 238*0bc66fd0SHerbert Dürr STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm 239*0bc66fd0SHerbert Dürr STDSHLCUIMT=-lpthread CPPRUNTIME -lm 240*0bc66fd0SHerbert Dürr STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm 241*0bc66fd0SHerbert Dürr.ELSE 242*0bc66fd0SHerbert Dürr STDLIBCUIMT= CPPRUNTIME -lm 243*0bc66fd0SHerbert Dürr STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm 244*0bc66fd0SHerbert Dürr STDSHLCUIMT=-lpthread CPPRUNTIME -lm 245*0bc66fd0SHerbert Dürr STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation 246*0bc66fd0SHerbert Dürr.ENDIF 247*0bc66fd0SHerbert Dürr 248*0bc66fd0SHerbert DürrLIBMGR=ar 249*0bc66fd0SHerbert DürrLIBFLAGS=-r 250*0bc66fd0SHerbert Dürr 251*0bc66fd0SHerbert DürrIMPLIB= 252*0bc66fd0SHerbert DürrIMPLIBFLAGS= 253*0bc66fd0SHerbert Dürr 254*0bc66fd0SHerbert DürrMAPSYM= 255*0bc66fd0SHerbert DürrMAPSYMFLAGS= 256*0bc66fd0SHerbert Dürr 257*0bc66fd0SHerbert DürrRC=irc 258*0bc66fd0SHerbert DürrRCFLAGS=-fo$@ $(RCFILES) 259*0bc66fd0SHerbert DürrRCLINK= 260*0bc66fd0SHerbert DürrRCLINKFLAGS= 261*0bc66fd0SHerbert DürrRCSETVERSION= 262*0bc66fd0SHerbert Dürr 263*0bc66fd0SHerbert DürrOOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH 264