10bc66fd0SHerbert Dürr#************************************************************** 20bc66fd0SHerbert Dürr# 30bc66fd0SHerbert Dürr# Licensed to the Apache Software Foundation (ASF) under one 40bc66fd0SHerbert Dürr# or more contributor license agreements. See the NOTICE file 50bc66fd0SHerbert Dürr# distributed with this work for additional information 60bc66fd0SHerbert Dürr# regarding copyright ownership. The ASF licenses this file 70bc66fd0SHerbert Dürr# to you under the Apache License, Version 2.0 (the 80bc66fd0SHerbert Dürr# "License"); you may not use this file except in compliance 90bc66fd0SHerbert Dürr# with the License. You may obtain a copy of the License at 100bc66fd0SHerbert Dürr# 110bc66fd0SHerbert Dürr# http://www.apache.org/licenses/LICENSE-2.0 120bc66fd0SHerbert Dürr# 130bc66fd0SHerbert Dürr# Unless required by applicable law or agreed to in writing, 140bc66fd0SHerbert Dürr# software distributed under the License is distributed on an 150bc66fd0SHerbert Dürr# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 160bc66fd0SHerbert Dürr# KIND, either express or implied. See the License for the 170bc66fd0SHerbert Dürr# specific language governing permissions and limitations 180bc66fd0SHerbert Dürr# under the License. 190bc66fd0SHerbert Dürr# 200bc66fd0SHerbert Dürr#************************************************************** 210bc66fd0SHerbert Dürr 220bc66fd0SHerbert Dürr 230bc66fd0SHerbert Dürr 240bc66fd0SHerbert Dürr########################################################################## 250bc66fd0SHerbert Dürr# Platform MAKEFILE for Mac OS X and Darwin on both PowerPC and Intel 260bc66fd0SHerbert Dürr########################################################################## 270bc66fd0SHerbert Dürr 280bc66fd0SHerbert Dürr# PROCESSOR_DEFINES and DLLPOSTFIX are defined in the particular platform file 290bc66fd0SHerbert Dürr 300bc66fd0SHerbert DürrASM= 310bc66fd0SHerbert DürrAFLAGS= 320bc66fd0SHerbert DürrLINKOUTPUT_FILTER= 330bc66fd0SHerbert Dürr 340bc66fd0SHerbert Dürr# Definitions that we may need on the compile line. 350bc66fd0SHerbert Dürr# -D_PTHREADS and -D_REENTRANT are needed for STLport, and must be specified when 360bc66fd0SHerbert Dürr# compiling STLport sources too, either internally or externally. 370bc66fd0SHerbert DürrCDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -D_USE_NAMESPACE=1 380bc66fd0SHerbert Dürr 390bc66fd0SHerbert Dürr# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build result 400bc66fd0SHerbert Dürr# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro) 410bc66fd0SHerbert Dürr# http://developer.apple.com/technotes/tn2002/tn2064.html 420bc66fd0SHerbert Dürr# done in setsolar/configure now. left here for documentation 430bc66fd0SHerbert DürrCDEFS+=-DQUARTZ 44*61a3a0ffSHerbert DürrEXTRA_CDEFS*=-isysroot $(MACOSX_SDK_PATH) 450bc66fd0SHerbert Dürr 460bc66fd0SHerbert Dürr# Name of library where static data members are initialized 470bc66fd0SHerbert Dürr# STATICLIBNAME=static$(DLLPOSTFIX) 480bc66fd0SHerbert Dürr# STATICLIB=-l$(STATICLIBNAME) 490bc66fd0SHerbert Dürr 500bc66fd0SHerbert Dürr# enable visibility define in "sal/types.h" 510bc66fd0SHerbert Dürr.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 520bc66fd0SHerbert Dürr CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE 530bc66fd0SHerbert Dürr.ENDIF 540bc66fd0SHerbert Dürr 550bc66fd0SHerbert Dürr# MacOS X specific Java compilation/link flags 560bc66fd0SHerbert DürrSOLAR_JAVA*=TRUE 570bc66fd0SHerbert Dürr.IF "$(SOLAR_JAVA)"!="" 580bc66fd0SHerbert Dürr JAVADEF=-DSOLAR_JAVA 590bc66fd0SHerbert Dürr JAVAFLAGSDEBUG=-g 600bc66fd0SHerbert Dürr JAVA_RUNTIME=-framework JavaVM 610bc66fd0SHerbert Dürr.ENDIF 620bc66fd0SHerbert Dürr 630bc66fd0SHerbert Dürr# architecture dependent flags for the C and C++ compiler that can be changed by 640bc66fd0SHerbert Dürr# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build 650bc66fd0SHerbert DürrARCH_FLAGS*= 660bc66fd0SHerbert Dürr 670bc66fd0SHerbert Dürr# Specify the compiler to use. NOTE: MacOS X should always specify 680bc66fd0SHerbert Dürr# c++ for C++ compilation as it does certain C++ specific things 690bc66fd0SHerbert Dürr# behind the scenes for us. 700bc66fd0SHerbert Dürr# CC = C++ compiler to use 710bc66fd0SHerbert Dürr# cc = C compiler to use 720bc66fd0SHerbert Dürr# objc = Objective C compiler to use 730bc66fd0SHerbert Dürr# objcpp = Objective C++ compiler to use 740bc66fd0SHerbert DürrCXX*=clang++ 750bc66fd0SHerbert DürrCC*=clang 760bc66fd0SHerbert Dürrobjc*=$(CC) 770bc66fd0SHerbert Dürrobjcpp*=$(CXX) 780bc66fd0SHerbert Dürr 790bc66fd0SHerbert DürrEXTRA_CFLAGS= 800bc66fd0SHerbert Dürr 810bc66fd0SHerbert DürrCFLAGS=-fsigned-char -fmessage-length=0 -c $(EXTRA_CFLAGS) 820bc66fd0SHerbert Dürr 830bc66fd0SHerbert Dürr.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE" 840bc66fd0SHerbert DürrCFLAGS+=-Wno-deprecated-declarations 850bc66fd0SHerbert Dürr.ENDIF 860bc66fd0SHerbert Dürr# --------------------------------- 870bc66fd0SHerbert Dürr# Compilation flags 880bc66fd0SHerbert Dürr# --------------------------------- 890bc66fd0SHerbert Dürr# Normal C compilation flags 900bc66fd0SHerbert DürrCFLAGSCC=-pipe -fsigned-char 910bc66fd0SHerbert Dürr 920bc66fd0SHerbert Dürr# Normal Objective C compilation flags 930bc66fd0SHerbert Dürr#OBJCFLAGS=-no-precomp 940bc66fd0SHerbert DürrOBJCFLAGS=-fobjc-exceptions 950bc66fd0SHerbert Dürr# -x options generally ignored by ccache, tell it that it can cache 960bc66fd0SHerbert Dürr# the result nevertheless 970bc66fd0SHerbert DürrCCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL)) 980bc66fd0SHerbert DürrOBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions 990bc66fd0SHerbert Dürr 1000bc66fd0SHerbert Dürr# Comp Flags for files that need exceptions enabled (C and C++) 1010bc66fd0SHerbert DürrCFLAGSEXCEPTIONS=-fexceptions 1020bc66fd0SHerbert Dürr 1030bc66fd0SHerbert Dürr# Comp Flags for files that do not need exceptions enabled (C and C++) 1040bc66fd0SHerbert DürrCFLAGS_NO_EXCEPTIONS=-fno-exceptions 1050bc66fd0SHerbert Dürr 1060bc66fd0SHerbert Dürr# Normal C++ compilation flags 1070bc66fd0SHerbert DürrCFLAGSCXX=-pipe -fsigned-char 1080bc66fd0SHerbert Dürr 1090bc66fd0SHerbert DürrCFLAGSCXX+= -Wno-ctor-dtor-privacy 1100bc66fd0SHerbert Dürr 1110bc66fd0SHerbert DürrPICSWITCH:=-fPIC 1120bc66fd0SHerbert Dürr# Other flags 1130bc66fd0SHerbert DürrCFLAGSOBJGUIMT=$(PICSWITCH) -fno-common 1140bc66fd0SHerbert DürrCFLAGSOBJCUIMT=$(PICSWITCH) -fno-common 1150bc66fd0SHerbert DürrCFLAGSSLOGUIMT=$(PICSWITCH) -fno-common 1160bc66fd0SHerbert DürrCFLAGSSLOCUIMT=$(PICSWITCH) -fno-common 1170bc66fd0SHerbert DürrCFLAGSPROF= 1180bc66fd0SHerbert Dürr 1190bc66fd0SHerbert Dürr# Flag for including debugging information in object files 1200bc66fd0SHerbert DürrCFLAGSDEBUG=-g 1210bc66fd0SHerbert DürrCFLAGSDBGUTIL= 1220bc66fd0SHerbert Dürr 1230bc66fd0SHerbert Dürr# Flag to specify output file to compiler/linker 1240bc66fd0SHerbert DürrCFLAGSOUTOBJ=-o 1250bc66fd0SHerbert Dürr 1260bc66fd0SHerbert Dürr# Flags to enable precompiled headers 1270bc66fd0SHerbert DürrCFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS 1280bc66fd0SHerbert DürrCFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch 1290bc66fd0SHerbert DürrCFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch 1300bc66fd0SHerbert Dürr 1310bc66fd0SHerbert Dürr# --------------------------------- 1320bc66fd0SHerbert Dürr# Optimization flags 1330bc66fd0SHerbert Dürr# --------------------------------- 1340bc66fd0SHerbert DürrCFLAGSOPT=-O2 -fno-strict-aliasing 1350bc66fd0SHerbert DürrCFLAGSNOOPT=-O0 1360bc66fd0SHerbert Dürr 1370bc66fd0SHerbert Dürr# -Wshadow does not work for C with nested uses of pthread_cleanup_push: 1380bc66fd0SHerbert Dürr# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h 1390bc66fd0SHerbert Dürr# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705, 1400bc66fd0SHerbert Dürr# in template code for which a #pragma gcc system_header would not work: 1410bc66fd0SHerbert DürrCFLAGSWARNCC=-Wall -Wendif-labels 1420bc66fd0SHerbert DürrCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor 1430bc66fd0SHerbert DürrCFLAGSWALLCC=$(CFLAGSWARNCC) 1440bc66fd0SHerbert DürrCFLAGSWALLCXX=$(CFLAGSWARNCXX) 1450bc66fd0SHerbert DürrCFLAGSWERRCC=-Werror 1460bc66fd0SHerbert Dürr 1470bc66fd0SHerbert Dürr# All modules on this platform compile without warnings. 1480bc66fd0SHerbert Dürr# If you need to set MODULES_WITH_WARNINGS here, comment 1490bc66fd0SHerbert Dürr# COMPILER_WARN_ERRORS=TRUE here (see settings.mk): 1500bc66fd0SHerbert DürrCOMPILER_WARN_ERRORS=TRUE 1510bc66fd0SHerbert Dürr 1520bc66fd0SHerbert Dürr#special settings from environment 1530bc66fd0SHerbert DürrCDEFS+=$(EXTRA_CDEFS) 1540bc66fd0SHerbert Dürr 1550bc66fd0SHerbert Dürr# --------------------------------- 1560bc66fd0SHerbert Dürr# STL library names 1570bc66fd0SHerbert Dürr# --------------------------------- 1580bc66fd0SHerbert Dürr 1590bc66fd0SHerbert DürrCDEFS+=-DHAVE_STL_INCLUDE_PATH -I../v1/ 1600bc66fd0SHerbert DürrSTDLIBCPP=-lc++ 1610bc66fd0SHerbert Dürr 1620bc66fd0SHerbert Dürr# --------------------------------- 1630bc66fd0SHerbert Dürr# Link stage flags 1640bc66fd0SHerbert Dürr# --------------------------------- 1650bc66fd0SHerbert Dürr 1660bc66fd0SHerbert DürrLINK*=$(CXX) 1670bc66fd0SHerbert DürrLINKC*=$(CC) 1680bc66fd0SHerbert Dürr 1690bc66fd0SHerbert Dürr###LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress 170*61a3a0ffSHerbert DürrEXTRA_LINKFLAGS*=-L$(MACOSX_SDK_PATH) 1710bc66fd0SHerbert Dürr# Very long install_names are needed so that install_name_tool -change later on 1720bc66fd0SHerbert Dürr# does not complain that "larger updated load commands do not fit:" 1730bc66fd0SHerbert DürrLINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)' 1740bc66fd0SHerbert DürrLINKFLAGSRUNPATH_UREBIN= 1750bc66fd0SHerbert DürrLINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)' 1760bc66fd0SHerbert DürrLINKFLAGSRUNPATH_SDK= 1770bc66fd0SHerbert DürrLINKFLAGSRUNPATH_BRAND= 1780bc66fd0SHerbert DürrLINKFLAGSRUNPATH_OXT= 1790bc66fd0SHerbert DürrLINKFLAGSRUNPATH_BOXT= 1800bc66fd0SHerbert DürrLINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)' 1810bc66fd0SHerbert DürrLINKFLAGS=$(LINKFLAGSDEFS) 1820bc66fd0SHerbert Dürr 1831e1ac450SHerbert DürrLINKFLAGS+=-lobjc 1841e1ac450SHerbert DürrLINKFLAGS+=-lc++ 1850bc66fd0SHerbert Dürr 1860bc66fd0SHerbert Dürr#special settings form environment 1870bc66fd0SHerbert DürrLINKFLAGS+=$(EXTRA_LINKFLAGS) 1880bc66fd0SHerbert Dürr 1890bc66fd0SHerbert Dürr# Random link flags dealing with different cases of linking 1900bc66fd0SHerbert Dürr 1910bc66fd0SHerbert DürrLINKFLAGSAPPGUI=-bind_at_load 1920bc66fd0SHerbert DürrLINKFLAGSSHLGUI=-dynamiclib -single_module 1930bc66fd0SHerbert DürrLINKFLAGSAPPCUI=-bind_at_load 1940bc66fd0SHerbert DürrLINKFLAGSSHLCUI=-dynamiclib -single_module 1950bc66fd0SHerbert DürrLINKFLAGSTACK= 1960bc66fd0SHerbert DürrLINKFLAGSPROF= 1970bc66fd0SHerbert Dürr 1980bc66fd0SHerbert Dürr# Flag to add debugging information to final products 1990bc66fd0SHerbert DürrLINKFLAGSDEBUG=-g 2000bc66fd0SHerbert DürrLINKFLAGSOPT= 2010bc66fd0SHerbert Dürr 2020bc66fd0SHerbert Dürr# --------------------------------- 2030bc66fd0SHerbert Dürr# MacOS X shared library specifics 2040bc66fd0SHerbert Dürr# --------------------------------- 2050bc66fd0SHerbert Dürr 2060bc66fd0SHerbert Dürr# Tag to identify an output file as a library 2070bc66fd0SHerbert DürrDLLPRE=lib 2080bc66fd0SHerbert Dürr# File extension to identify dynamic shared libraries on MacOS X 2090bc66fd0SHerbert DürrDLLPOST=.dylib 2100bc66fd0SHerbert Dürr# Precompiled header file extension 2110bc66fd0SHerbert DürrPCHPOST=.gch 2120bc66fd0SHerbert Dürr 2130bc66fd0SHerbert Dürr#LINKVERSIONMAPFLAG=-Xlinker -map -Xlinker 2140bc66fd0SHerbert DürrLINKVERSIONMAPFLAG=-Wl,-map -Wl, 2150bc66fd0SHerbert Dürr 2160bc66fd0SHerbert DürrSONAME_SWITCH=-Wl,-h 2170bc66fd0SHerbert Dürr 2180bc66fd0SHerbert Dürr 2190bc66fd0SHerbert DürrSTDOBJVCL=$(L)/salmain.o 2200bc66fd0SHerbert DürrSTDOBJGUI= 2210bc66fd0SHerbert DürrSTDSLOGUI= 2220bc66fd0SHerbert DürrSTDOBJCUI= 2230bc66fd0SHerbert DürrSTDSLOCUI= 2240bc66fd0SHerbert Dürr 2251e1ac450SHerbert Dürr#STDLIBCUIMT=CPPRUNTIME -lm 2261e1ac450SHerbert Dürr#STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm 2271e1ac450SHerbert DürrSTDSHLCUIMT=-lpthread CPPRUNTIME -lm 2281e1ac450SHerbert DürrSTDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm 2290bc66fd0SHerbert Dürr 2300bc66fd0SHerbert DürrLIBMGR=ar 2310bc66fd0SHerbert DürrLIBFLAGS=-r 2320bc66fd0SHerbert Dürr 2330bc66fd0SHerbert DürrIMPLIB= 2340bc66fd0SHerbert DürrIMPLIBFLAGS= 2350bc66fd0SHerbert Dürr 2360bc66fd0SHerbert DürrMAPSYM= 2370bc66fd0SHerbert DürrMAPSYMFLAGS= 2380bc66fd0SHerbert Dürr 2390bc66fd0SHerbert DürrRC=irc 2400bc66fd0SHerbert DürrRCFLAGS=-fo$@ $(RCFILES) 2410bc66fd0SHerbert DürrRCLINK= 2420bc66fd0SHerbert DürrRCLINKFLAGS= 2430bc66fd0SHerbert DürrRCSETVERSION= 2440bc66fd0SHerbert Dürr 2450bc66fd0SHerbert DürrOOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH 246