1*cdf0e10cSrcweir#************************************************************************* 2*cdf0e10cSrcweir# 3*cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir# 5*cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir# 7*cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir# 9*cdf0e10cSrcweir# This file is part of OpenOffice.org. 10*cdf0e10cSrcweir# 11*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir# only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir# 15*cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir# 21*cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir# version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir# <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir# for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir# 26*cdf0e10cSrcweir#************************************************************************* 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir# generic mk file for unxlng (unix linux glibc) 29*cdf0e10cSrcweirASM*= 30*cdf0e10cSrcweirAFLAGS*= 31*cdf0e10cSrcweirSOLAR_JAVA*= 32*cdf0e10cSrcweir# default optimization level for product code 33*cdf0e10cSrcweirCDEFAULTOPT*=-O2 34*cdf0e10cSrcweir# architecture dependent flags for the C and C++ compiler that can be changed by 35*cdf0e10cSrcweir# exporting the variable ARCH_FLAGS="..." in the shell, which is used to start build 36*cdf0e10cSrcweirARCH_FLAGS*= 37*cdf0e10cSrcweir# position independent code switch 38*cdf0e10cSrcweirPICSWITCH*:=-fpic 39*cdf0e10cSrcweirJAVAFLAGSDEBUG=-g 40*cdf0e10cSrcweir 41*cdf0e10cSrcweir# filter for supressing verbose messages from linker 42*cdf0e10cSrcweir#not needed at the moment 43*cdf0e10cSrcweir#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter" 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir# _PTHREADS is needed for the stl 46*cdf0e10cSrcweirCDEFS+=-DGLIBC=2 -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=$(STLPORT_VER) 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir# enable visibility define in "sal/types.h" 49*cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 50*cdf0e10cSrcweirCDEFS += -DHAVE_GCC_VISIBILITY_FEATURE 51*cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir# this is a platform with JAVA support 54*cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"!="" 55*cdf0e10cSrcweirJAVADEF=-DSOLAR_JAVA 56*cdf0e10cSrcweir.IF "$(debug)"=="" 57*cdf0e10cSrcweirJAVA_RUNTIME=-ljava 58*cdf0e10cSrcweir.ELSE 59*cdf0e10cSrcweirJAVA_RUNTIME=-ljava_g 60*cdf0e10cSrcweir.ENDIF 61*cdf0e10cSrcweir.ENDIF 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir# name of C++ Compiler 64*cdf0e10cSrcweirCXX*=g++ 65*cdf0e10cSrcweir# name of C Compiler 66*cdf0e10cSrcweirCC*=gcc 67*cdf0e10cSrcweir.IF "$(SYSBASE)"!="" 68*cdf0e10cSrcweirCFLAGS_SYSBASE:=--sysroot=$(SYSBASE) 69*cdf0e10cSrcweirCXX+:=$(CFLAGS_SYSBASE) 70*cdf0e10cSrcweirCC+:=$(CFLAGS_SYSBASE) 71*cdf0e10cSrcweir.ENDIF # "$(SYSBASE)"!="" 72*cdf0e10cSrcweirCFLAGS+=-fmessage-length=0 -c 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir# flags to enable build with symbols; required for crashdump feature 75*cdf0e10cSrcweir.IF "$(ENABLE_SYMBOLS)"=="SMALL" 76*cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g1 77*cdf0e10cSrcweir.ELSE 78*cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir.ENDIF 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir# flags for the C++ Compiler 83*cdf0e10cSrcweirCFLAGSCC= -pipe $(ARCH_FLAGS) 84*cdf0e10cSrcweir# Flags for enabling exception handling 85*cdf0e10cSrcweirCFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs 86*cdf0e10cSrcweir# Flags for disabling exception handling 87*cdf0e10cSrcweirCFLAGS_NO_EXCEPTIONS=-fno-exceptions 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir# -fpermissive should be removed as soon as possible 90*cdf0e10cSrcweirCFLAGSCXX= -pipe $(ARCH_FLAGS) 91*cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 92*cdf0e10cSrcweirCFLAGSCXX += -fvisibility-inlines-hidden 93*cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 94*cdf0e10cSrcweir 95*cdf0e10cSrcweirCFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS 96*cdf0e10cSrcweirCFLAGS_USE_PCH=-I$(SLO)$/pch -DPRECOMPILED_HEADERS -Winvalid-pch 97*cdf0e10cSrcweirCFLAGS_USE_EXCEPTIONS_PCH=-I$(SLO)$/pch_ex -DPRECOMPILED_HEADERS -Winvalid-pch 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with graphical user interface 100*cdf0e10cSrcweirCFLAGSOBJGUIMT= 101*cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with character user interface 102*cdf0e10cSrcweirCFLAGSOBJCUIMT= 103*cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with graphical user interface 104*cdf0e10cSrcweirCFLAGSSLOGUIMT=$(PICSWITCH) 105*cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with character user interface 106*cdf0e10cSrcweirCFLAGSSLOCUIMT=$(PICSWITCH) 107*cdf0e10cSrcweir# Compiler flags for profiling 108*cdf0e10cSrcweirCFLAGSPROF= 109*cdf0e10cSrcweir# Compiler flags for debugging 110*cdf0e10cSrcweirCFLAGSDEBUG=-g 111*cdf0e10cSrcweirCFLAGSDBGUTIL= 112*cdf0e10cSrcweir# Compiler flags for enabling optimizations 113*cdf0e10cSrcweir.IF "$(PRODUCT)"!="" 114*cdf0e10cSrcweirCFLAGSOPT=$(CDEFAULTOPT) -fno-strict-aliasing # optimizing for products 115*cdf0e10cSrcweir.ELSE # "$(PRODUCT)"!="" 116*cdf0e10cSrcweirCFLAGSOPT= # no optimizing for non products 117*cdf0e10cSrcweir.ENDIF # "$(PRODUCT)"!="" 118*cdf0e10cSrcweir# Compiler flags for disabling optimizations 119*cdf0e10cSrcweirCFLAGSNOOPT=-O0 120*cdf0e10cSrcweir# Compiler flags for describing the output path 121*cdf0e10cSrcweirCFLAGSOUTOBJ=-o 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir# -Wshadow does not work for C with nested uses of pthread_cleanup_push: 124*cdf0e10cSrcweirCFLAGSWARNCC=-Wall -Wextra -Wendif-labels 125*cdf0e10cSrcweirCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \ 126*cdf0e10cSrcweir -Wno-non-virtual-dtor 127*cdf0e10cSrcweirCFLAGSWALLCC=$(CFLAGSWARNCC) 128*cdf0e10cSrcweirCFLAGSWALLCXX=$(CFLAGSWARNCXX) 129*cdf0e10cSrcweirCFLAGSWERRCC=-Werror 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir# Once all modules on this platform compile without warnings, set 132*cdf0e10cSrcweir# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see 133*cdf0e10cSrcweir# settings.mk): 134*cdf0e10cSrcweirMODULES_WITH_WARNINGS := \ 135*cdf0e10cSrcweir soldep 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir# switches for dynamic and static linking 138*cdf0e10cSrcweirSTATIC = -Wl,-Bstatic 139*cdf0e10cSrcweirDYNAMIC = -Wl,-Bdynamic 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir# name of linker 142*cdf0e10cSrcweirLINK*=$(CXX) 143*cdf0e10cSrcweirLINKC*=$(CC) 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir# default linker flags 146*cdf0e10cSrcweir.IF "$(SYSBASE)"!="" 147*cdf0e10cSrcweirLINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE) 148*cdf0e10cSrcweir.ENDIF # "$(SYSBASE)"!="" 149*cdf0e10cSrcweirLINKFLAGSDEFS*=-Wl,-z,defs 150*cdf0e10cSrcweirLINKFLAGSRUNPATH_URELIB=-Wl,-rpath,\''$$ORIGIN'\' 151*cdf0e10cSrcweirLINKFLAGSRUNPATH_UREBIN=-Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\' 152*cdf0e10cSrcweir #TODO: drop $ORIGIN once no URE executable is also shipped in OOo 153*cdf0e10cSrcweirLINKFLAGSRUNPATH_OOO=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\' 154*cdf0e10cSrcweirLINKFLAGSRUNPATH_SDK=-Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\' 155*cdf0e10cSrcweirLINKFLAGSRUNPATH_BRAND=-Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\' 156*cdf0e10cSrcweirLINKFLAGSRUNPATH_OXT= 157*cdf0e10cSrcweirLINKFLAGSRUNPATH_BOXT=-Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\' 158*cdf0e10cSrcweirLINKFLAGSRUNPATH_NONE= 159*cdf0e10cSrcweirLINKFLAGS=-Wl,-z,combreloc $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE) 160*cdf0e10cSrcweir.IF "$(HAVE_LD_BSYMBOLIC_FUNCTIONS)" == "TRUE" 161*cdf0e10cSrcweirLINKFLAGS += -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo 162*cdf0e10cSrcweir.ENDIF 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir# linker flags for linking applications 165*cdf0e10cSrcweirLINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \ 166*cdf0e10cSrcweir -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib 167*cdf0e10cSrcweirLINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \ 168*cdf0e10cSrcweir -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib 169*cdf0e10cSrcweir 170*cdf0e10cSrcweir# linker flags for linking shared libraries 171*cdf0e10cSrcweirLINKFLAGSSHLGUI= -shared 172*cdf0e10cSrcweirLINKFLAGSSHLCUI= -shared 173*cdf0e10cSrcweir 174*cdf0e10cSrcweirLINKFLAGSTACK= 175*cdf0e10cSrcweirLINKFLAGSPROF= 176*cdf0e10cSrcweirLINKFLAGSDEBUG=-g 177*cdf0e10cSrcweirLINKFLAGSOPT= 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir# linker flags for optimization (symbol hashtable) 180*cdf0e10cSrcweir# for now, applied to symbol scoped libraries, only 181*cdf0e10cSrcweirLINKFLAGSOPTIMIZE*=-Wl,-O1 182*cdf0e10cSrcweirLINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script 183*cdf0e10cSrcweir 184*cdf0e10cSrcweirSONAME_SWITCH=-Wl,-h 185*cdf0e10cSrcweir 186*cdf0e10cSrcweir# Sequence of libs does matter ! 187*cdf0e10cSrcweir 188*cdf0e10cSrcweirSTDLIBCPP=-lstdc++ 189*cdf0e10cSrcweir 190*cdf0e10cSrcweir# default objectfilenames to link 191*cdf0e10cSrcweirSTDOBJVCL=$(L)$/salmain.o 192*cdf0e10cSrcweirSTDOBJGUI= 193*cdf0e10cSrcweirSTDSLOGUI= 194*cdf0e10cSrcweirSTDOBJCUI= 195*cdf0e10cSrcweirSTDSLOCUI= 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir.IF "$(ALLOC)" == "TCMALLOC" 198*cdf0e10cSrcweirSTDLIBGUIMT+=-ltcmalloc 199*cdf0e10cSrcweirSTDLIBCUIMT+=-ltcmalloc 200*cdf0e10cSrcweirSTDSHLGUIMT+=-ltcmalloc 201*cdf0e10cSrcweirSTDSHLCUIMT+=-ltcmalloc 202*cdf0e10cSrcweir.ENDIF 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir.IF "$(ALLOC)" == "JEMALLOC" 205*cdf0e10cSrcweirSTDLIBGUIMT+=-ljemalloc 206*cdf0e10cSrcweirSTDLIBCUIMT+=-ljemalloc 207*cdf0e10cSrcweirSTDSHLGUIMT+=-ljemalloc 208*cdf0e10cSrcweirSTDSHLCUIMT+=-ljemalloc 209*cdf0e10cSrcweir.ENDIF 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir.IF "$(HAVE_LD_HASH_STYLE)" == "TRUE" 212*cdf0e10cSrcweirLINKFLAGS += -Wl,--hash-style=both 213*cdf0e10cSrcweir.ELSE 214*cdf0e10cSrcweirLINKFLAGS += -Wl,-zdynsort 215*cdf0e10cSrcweir.ENDIF 216*cdf0e10cSrcweir 217*cdf0e10cSrcweir# libraries for linking applications 218*cdf0e10cSrcweirSTDLIBGUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed 219*cdf0e10cSrcweirSTDLIBCUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed 220*cdf0e10cSrcweir# libraries for linking shared libraries 221*cdf0e10cSrcweirSTDSHLGUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed 222*cdf0e10cSrcweirSTDSHLCUIMT+=-Wl,--as-needed -ldl -lpthread -lm -Wl,--no-as-needed 223*cdf0e10cSrcweir 224*cdf0e10cSrcweirX11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed 225*cdf0e10cSrcweir 226*cdf0e10cSrcweirLIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir.IF "$(USE_STLP_DEBUG)" != "" 229*cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500" 230*cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlportstlg 231*cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC) 232*cdf0e10cSrcweir.ELSE 233*cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug 234*cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC) 235*cdf0e10cSrcweir.ENDIF 236*cdf0e10cSrcweir.ELSE # "$(USE_STLP_DEBUG)" != "" 237*cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500" 238*cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport 239*cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC) 240*cdf0e10cSrcweir.ELSE 241*cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc 242*cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC) 243*cdf0e10cSrcweir.ENDIF 244*cdf0e10cSrcweir.ENDIF # "$(USE_STLP_DEBUG)" != "" 245*cdf0e10cSrcweir 246*cdf0e10cSrcweir#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC) 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir# name of library manager 249*cdf0e10cSrcweirLIBMGR*=ar 250*cdf0e10cSrcweirLIBFLAGS=-r 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir# tool for generating import libraries 253*cdf0e10cSrcweirIMPLIB= 254*cdf0e10cSrcweirIMPLIBFLAGS= 255*cdf0e10cSrcweir 256*cdf0e10cSrcweirMAPSYM= 257*cdf0e10cSrcweirMAPSYMFLAGS= 258*cdf0e10cSrcweir 259*cdf0e10cSrcweirRC=irc 260*cdf0e10cSrcweirRCFLAGS=-fo$@ $(RCFILES) 261*cdf0e10cSrcweirRCLINK= 262*cdf0e10cSrcweirRCLINKFLAGS= 263*cdf0e10cSrcweirRCSETVERSION= 264*cdf0e10cSrcweir 265*cdf0e10cSrcweir# platform specific identifier for shared libs 266*cdf0e10cSrcweirDLLPRE=lib 267*cdf0e10cSrcweirDLLPOST=.so 268*cdf0e10cSrcweirPCHPOST=.gch 269