1#************************************************************************* 2# 3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4# 5# Copyright 2000, 2010 Oracle and/or its affiliates. 6# 7# OpenOffice.org - a multi-platform office productivity suite 8# 9# This file is part of OpenOffice.org. 10# 11# OpenOffice.org is free software: you can redistribute it and/or modify 12# it under the terms of the GNU Lesser General Public License version 3 13# only, as published by the Free Software Foundation. 14# 15# OpenOffice.org is distributed in the hope that it will be useful, 16# but WITHOUT ANY WARRANTY; without even the implied warranty of 17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18# GNU Lesser General Public License version 3 for more details 19# (a copy is included in the LICENSE file that accompanied this code). 20# 21# You should have received a copy of the GNU Lesser General Public License 22# version 3 along with OpenOffice.org. If not, see 23# <http://www.openoffice.org/license.html> 24# for a copy of the LGPLv3 License. 25# 26#************************************************************************* 27 28########################################################################## 29# Platform MAKEFILE for Mac OS X and Darwin on both PowerPC and Intel 30########################################################################## 31 32# PROCESSOR_DEFINES and DLLPOSTFIX are defined in the particular platform file 33 34ASM= 35AFLAGS= 36LINKOUTPUT_FILTER= 37 38# Definitions that we may need on the compile line. 39# -D_PTHREADS and -D_REENTRANT are needed for STLport, and must be specified when 40# compiling STLport sources too, either internally or externally. 41CDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNO_PTHREAD_PRIORITY $(PROCESSOR_DEFINES) -DSTLPORT_VERSION=$(STLPORT_VER) -D_USE_NAMESPACE=1 42.IF "$(GUIBASE)"=="unx" && "$(USE_SYSTEM_STL)"!="YES" 43CDEFS+=-DX_LOCALE 44.ENDIF 45.IF "$(GUIBASE)"=="aqua" 46# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build, 47# build can assume functions/libraries of that version to be available 48# unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk 49# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro) 50# http://developer.apple.com/technotes/tn2002/tn2064.html 51# done in setsolar/configure now. left here for documentation 52#MACOSX_DEPLOYMENT_TARGET=10.4 53#.EXPORT: MACOSX_DEPLOYMENT_TARGET 54CDEFS+=-DQUARTZ 55EXTRA_CDEFS*=-isysroot /Developer/SDKs/MacOSX10.4u.sdk 56.ENDIF 57 58# Name of library where static data members are initialized 59# STATICLIBNAME=static$(DLLPOSTFIX) 60# STATICLIB=-l$(STATICLIBNAME) 61 62# enable visibility define in "sal/types.h" 63.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 64CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE 65.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 66 67 68# MacOS X specific Java compilation/link flags 69SOLAR_JAVA*=TRUE 70.IF "$(SOLAR_JAVA)"!="" 71 JAVADEF=-DSOLAR_JAVA 72 JAVAFLAGSDEBUG=-g 73 JAVA_RUNTIME=-framework JavaVM 74.ENDIF 75 76# architecture dependent flags for the C and C++ compiler that can be changed by 77# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build 78ARCH_FLAGS*= 79 80# Specify the compiler to use. NOTE: MacOS X should always specify 81# c++ for C++ compilation as it does certain C++ specific things 82# behind the scenes for us. 83# CC = C++ compiler to use 84# cc = C compiler to use 85# objc = Objective C compiler to use 86# objcpp = Objective C++ compiler to use 87CXX*=g++ 88CC*=gcc 89objc*=$(CC) 90objcpp*=$(CXX) 91 92CFLAGS=-fsigned-char -fmessage-length=0 -malign-natural -c $(EXTRA_CFLAGS) 93 94.IF "$(DISABLE_DEPRECATION_WARNING)" == "TRUE" 95CFLAGS+=-Wno-deprecated-declarations 96.ENDIF 97# --------------------------------- 98# Compilation flags 99# --------------------------------- 100# Normal C compilation flags 101CFLAGSCC=-pipe -fsigned-char -malign-natural $(ARCH_FLAGS) 102 103# Normal Objective C compilation flags 104#OBJCFLAGS=-no-precomp 105OBJCFLAGS=-fobjc-exceptions 106# -x options generally ignored by ccache, tell it that it can cache 107# the result nevertheless 108CCACHE_SKIP:=$(eq,$(USE_CCACHE),YES --ccache-skip $(NULL)) 109OBJCXXFLAGS:=$(CCACHE_SKIP) -x $(CCACHE_SKIP) objective-c++ -fobjc-exceptions 110 111# Comp Flags for files that need exceptions enabled (C and C++) 112CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs 113 114# Comp Flags for files that do not need exceptions enabled (C and C++) 115CFLAGS_NO_EXCEPTIONS=-fno-exceptions 116 117# Normal C++ compilation flags 118CFLAGSCXX=-pipe -malign-natural -fsigned-char -Wno-long-double $(ARCH_FLAGS) 119CFLAGSCXX+= -Wno-ctor-dtor-privacy 120 121PICSWITCH:=-fPIC 122# Other flags 123CFLAGSOBJGUIMT=$(PICSWITCH) -fno-common 124CFLAGSOBJCUIMT=$(PICSWITCH) -fno-common 125CFLAGSSLOGUIMT=$(PICSWITCH) -fno-common 126CFLAGSSLOCUIMT=$(PICSWITCH) -fno-common 127CFLAGSPROF= 128 129# Flag for including debugging information in object files 130CFLAGSDEBUG=-g 131CFLAGSDBGUTIL= 132 133# Flag to specify output file to compiler/linker 134CFLAGSOUTOBJ=-o 135 136# Flags to enable precompiled headers 137CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS 138CFLAGS_USE_PCH=-I$(SLO)/pch -DPRECOMPILED_HEADERS -Winvalid-pch 139CFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch 140 141# --------------------------------- 142# Optimization flags 143# --------------------------------- 144CFLAGSOPT=-O2 -fno-strict-aliasing 145CFLAGSNOOPT=-O0 146 147# -Wshadow does not work for C with nested uses of pthread_cleanup_push: 148# -Wshadow does not work for C++ as /usr/include/c++/4.0.0/ext/hashtable.h 149# l. 717 contains a declaration of __cur2 shadowing the declaration at l. 705, 150# in template code for which a #pragma gcc system_header would not work: 151# -Wextra doesn not work for gcc-3.3 152CFLAGSWARNCC=-Wall -Wendif-labels 153CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor 154CFLAGSWALLCC=$(CFLAGSWARNCC) 155CFLAGSWALLCXX=$(CFLAGSWARNCXX) 156CFLAGSWERRCC=-Werror 157 158# All modules on this platform compile without warnings. 159# If you need to set MODULES_WITH_WARNINGS here, comment 160# COMPILER_WARN_ERRORS=TRUE here (see settings.mk): 161COMPILER_WARN_ERRORS=TRUE 162 163#special settings form environment 164CDEFS+=$(EXTRA_CDEFS) 165 166STDLIBCPP=-lstdc++ 167 168# --------------------------------- 169# STLport library names 170# --------------------------------- 171.IF "$(USE_STLP_DEBUG)" != "" 172.IF "$(STLPORT_VER)" >= "500" 173LIBSTLPORT=-lstlportstlg 174LIBSTLPORTST=$(STATIC) -lstlportstlg 175.ELSE 176LIBSTLPORT=-lstlport_gcc_stldebug 177LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc_stldebug.a 178.ENDIF 179.ELSE # "$(USE_STLP_DEBUG" != "" 180.IF "$(STLPORT_VER)" >= "500" 181LIBSTLPORT=-lstlport 182LIBSTLPORTST=$(STATIC) -lstlport 183.ELSE 184LIBSTLPORT=-lstlport_gcc 185LIBSTLPORTST=$(SOLARVERSION)/$(INPATH)/lib/libstlport_gcc.a 186.ENDIF 187.ENDIF # "$(USE_STLP_DEBUG" != "" 188 189# --------------------------------- 190# Link stage flags 191# --------------------------------- 192# always link with gcc since you may be linking c code and don't want -lstdc++ linked in! 193 194## ericb 04 mars 2005 195 196LINK*=$(CXX) 197LINKC*=$(CC) 198 199LINKFLAGSDEFS*=-Wl,-multiply_defined,suppress 200# assure backwards-compatibility 201EXTRA_LINKFLAGS*=-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk 202# Very long install_names are needed so that install_name_tool -change later on 203# does not complain that "larger updated load commands do not fit:" 204LINKFLAGSRUNPATH_URELIB=-install_name '@__________________________________________________URELIB/$(@:f)' 205LINKFLAGSRUNPATH_UREBIN= 206LINKFLAGSRUNPATH_OOO=-install_name '@__________________________________________________OOO/$(@:f)' 207LINKFLAGSRUNPATH_SDK= 208LINKFLAGSRUNPATH_BRAND= 209LINKFLAGSRUNPATH_OXT= 210LINKFLAGSRUNPATH_BOXT= 211LINKFLAGSRUNPATH_NONE=-install_name '@__________________________________________________NONE/$(@:f)' 212LINKFLAGS=$(LINKFLAGSDEFS) 213 214# [ed] 5/14/02 If we're building for aqua, add in the objc runtime library into our link line 215.IF "$(GUIBASE)" == "aqua" 216 LINKFLAGS+=-lobjc 217 # Sometimes we still use files that would be in a GUIBASE="unx" specific directory 218 # because they really aren't GUIBASE specific, so we've got to account for that here. 219 INCGUI+= -I$(PRJ)/unx/inc 220.ENDIF 221 222#special settings form environment 223LINKFLAGS+=$(EXTRA_LINKFLAGS) 224 225# Random link flags dealing with different cases of linking 226 227LINKFLAGSAPPGUI=-bind_at_load 228LINKFLAGSSHLGUI=-dynamiclib -single_module 229LINKFLAGSAPPCUI=-bind_at_load 230LINKFLAGSSHLCUI=-dynamiclib -single_module 231LINKFLAGSTACK= 232LINKFLAGSPROF= 233 234# Flag to add debugging information to final products 235LINKFLAGSDEBUG=-g 236LINKFLAGSOPT= 237 238# --------------------------------- 239# MacOS X shared library specifics 240# --------------------------------- 241 242# Tag to identify an output file as a library 243DLLPRE=lib 244# File extension to identify dynamic shared libraries on MacOS X 245DLLPOST=.dylib 246# Precompiled header file extension 247PCHPOST=.gch 248 249# We don't use mapping on MacOS X 250#LINKVERSIONMAPFLAG=-Wl,--version-script 251LINKVERSIONMAPFLAG=-Wl,-exported_symbols_list 252 253SONAME_SWITCH=-Wl,-h 254 255STDLIBCPP=-lstdc++ 256 257STDOBJVCL=$(L)/salmain.o 258STDOBJGUI= 259STDSLOGUI= 260STDOBJCUI= 261STDSLOCUI= 262 263.IF "$(GUIBASE)" == "aqua" 264 STDLIBCUIMT=CPPRUNTIME -lm 265 STDLIBGUIMT=-framework Carbon -framework Cocoa -lpthread CPPRUNTIME -lm 266 STDSHLCUIMT=-lpthread CPPRUNTIME -lm 267 STDSHLGUIMT=-framework Carbon -framework CoreFoundation -framework Cocoa -lpthread CPPRUNTIME -lm 268.ELSE 269 STDLIBCUIMT= CPPRUNTIME -lm 270 STDLIBGUIMT=-lX11 -lpthread CPPRUNTIME -lm 271 STDSHLCUIMT=-lpthread CPPRUNTIME -lm 272 STDSHLGUIMT=-lX11 -lXext -lpthread CPPRUNTIME -lm -framework CoreFoundation 273.ENDIF 274 275LIBMGR=ar 276LIBFLAGS=-r 277 278IMPLIB= 279IMPLIBFLAGS= 280 281MAPSYM= 282MAPSYMFLAGS= 283 284RC=irc 285RCFLAGS=-fo$@ $(RCFILES) 286RCLINK= 287RCLINKFLAGS= 288RCSETVERSION= 289 290OOO_LIBRARY_PATH_VAR = DYLD_LIBRARY_PATH 291