17871dc3eSAndrew Rist#************************************************************** 2cdf0e10cSrcweir# 37871dc3eSAndrew Rist# Licensed to the Apache Software Foundation (ASF) under one 47871dc3eSAndrew Rist# or more contributor license agreements. See the NOTICE file 57871dc3eSAndrew Rist# distributed with this work for additional information 67871dc3eSAndrew Rist# regarding copyright ownership. The ASF licenses this file 77871dc3eSAndrew Rist# to you under the Apache License, Version 2.0 (the 87871dc3eSAndrew Rist# "License"); you may not use this file except in compliance 97871dc3eSAndrew Rist# with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir# 117871dc3eSAndrew Rist# http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir# 137871dc3eSAndrew Rist# Unless required by applicable law or agreed to in writing, 147871dc3eSAndrew Rist# software distributed under the License is distributed on an 157871dc3eSAndrew Rist# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 167871dc3eSAndrew Rist# KIND, either express or implied. See the License for the 177871dc3eSAndrew Rist# specific language governing permissions and limitations 187871dc3eSAndrew Rist# under the License. 19cdf0e10cSrcweir# 207871dc3eSAndrew Rist#************************************************************** 217871dc3eSAndrew Rist 227871dc3eSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir# Makefile for FreeBSD. 25cdf0e10cSrcweir 26cdf0e10cSrcweirASM= 27cdf0e10cSrcweirAFLAGS= 28cdf0e10cSrcweir 29cdf0e10cSrcweirSOLAR_JAVA*= 30de2c434cSPedro GiffuniPICSWITCH*:=-fPIC 31cdf0e10cSrcweirJAVAFLAGSDEBUG=-g 32cdf0e10cSrcweir 33cdf0e10cSrcweir# Include arch specific makefile. 34cdf0e10cSrcweir.IF "$(CPUNAME)" == "INTEL" 35cdf0e10cSrcweir.INCLUDE : unxfbsdi.mk 36cdf0e10cSrcweir.ENDIF 37cdf0e10cSrcweir.IF "$(CPUNAME)" == "X86_64" 38cdf0e10cSrcweir.INCLUDE : unxfbsdx.mk 39cdf0e10cSrcweir.ENDIF 40941ddfd7Spfg.IF "$(CPUNAME)" == "POWERPC64" 41941ddfd7Spfg.INCLUDE : unxfbsdp.mk 42941ddfd7Spfg.ENDIF 43af84ad07SPedro Giffuni.IF "$(CPUNAME)" == "POWERPC" 44af84ad07SPedro Giffuni.INCLUDE : unxfbsdppc.mk 45af84ad07SPedro Giffuni.ENDIF 46af84ad07SPedro Giffuni.IF "$(CPUNAME)" == "POWERPC64" 47af84ad07SPedro Giffuni.INCLUDE : unxfbsdppc64.mk 48af84ad07SPedro Giffuni.ENDIF 49*0bd9e244Spfg.IF "$(CPUNAME)" == "ARM" 50*0bd9e244Spfg.INCLUDE : unxfbsdr.mk 51*0bd9e244Spfg.ENDIF 52cdf0e10cSrcweir 53cdf0e10cSrcweir# filter for supressing verbose messages from linker 54cdf0e10cSrcweir#not needed at the moment 55cdf0e10cSrcweir#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter" 56cdf0e10cSrcweir 57cdf0e10cSrcweir# _PTHREADS is needed for the stl 58cdf0e10cSrcweirCDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450 59de2c434cSPedro Giffuni.IF "$(COM)"=="CLANG" 60de2c434cSPedro GiffuniCDEFS+=-DHAVE_STL_INCLUDE_PATH 61de2c434cSPedro Giffuni.ELSE 62de2c434cSPedro GiffuniCDEFS+=-DBOOST_TR1_DISABLE_INCLUDE_NEXT -DBOOST_TR1_GCC_INCLUDE_PATH=c++ 63de2c434cSPedro Giffuni.ENDIF 64cdf0e10cSrcweir 65cdf0e10cSrcweir# enable visibility define in "sal/types.h" 66cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 67cdf0e10cSrcweirCDEFS += -DHAVE_GCC_VISIBILITY_FEATURE 68cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 69cdf0e10cSrcweir 70cdf0e10cSrcweir# this is a platform with JAVA support 71cdf0e10cSrcweir.IF "$(SOLAR_JAVA)"!="" 72cdf0e10cSrcweirJAVADEF=-DSOLAR_JAVA 73cdf0e10cSrcweir.IF "$(debug)"=="" 74cdf0e10cSrcweirJAVA_RUNTIME=-ljava 75cdf0e10cSrcweir.ELSE 76cdf0e10cSrcweirJAVA_RUNTIME=-ljava_g 77cdf0e10cSrcweir.ENDIF 78cdf0e10cSrcweir.ENDIF 79cdf0e10cSrcweir 80cdf0e10cSrcweir# name of C++ Compiler 817fcdd55bSPedro GiffuniCXX*=c++ 82cdf0e10cSrcweir# name of C Compiler 837fcdd55bSPedro GiffuniCC*=cc 84cdf0e10cSrcweir.IF "$(SYSBASE)"!="" 8525da6cb0SPedro GiffuniCFLAGS_SYSBASE:=--sysroot=$(SYSBASE) 86cdf0e10cSrcweirCXX+:=$(CFLAGS_SYSBASE) 87cdf0e10cSrcweirCC+:=$(CFLAGS_SYSBASE) 88cdf0e10cSrcweir.ENDIF # "$(SYSBASE)"!="" 89cdf0e10cSrcweirCFLAGS+=-fmessage-length=0 -c 90cdf0e10cSrcweir 91cdf0e10cSrcweir# flags to enable build with symbols; required for crashdump feature 92cdf0e10cSrcweir.IF "$(ENABLE_SYMBOLS)"=="SMALL" 93cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g1 94cdf0e10cSrcweir.ELSE 95cdf0e10cSrcweirCFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta 96cdf0e10cSrcweir 97cdf0e10cSrcweir.ENDIF 98cdf0e10cSrcweir 99cdf0e10cSrcweir# flags for the C++ Compiler 100cdf0e10cSrcweirCFLAGSCC= -pipe $(ARCH_FLAGS) 101cdf0e10cSrcweir# Flags for enabling exception handling 102de2c434cSPedro Giffuni.IF "$(COM)"=="CLANG" 103de2c434cSPedro GiffuniCFLAGSEXCEPTIONS=-fexceptions 104de2c434cSPedro Giffuni.ELSE 105cdf0e10cSrcweirCFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs 106de2c434cSPedro Giffuni.ENDIF 107cdf0e10cSrcweir# Flags for disabling exception handling 108cdf0e10cSrcweirCFLAGS_NO_EXCEPTIONS=-fno-exceptions 109cdf0e10cSrcweir 110cdf0e10cSrcweir# -fpermissive should be removed as soon as possible 111ad2d53dbSDon LewisCFLAGSCXX= -pipe $(ARCH_FLAGS) -std=gnu++98 112cdf0e10cSrcweir.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 113cdf0e10cSrcweirCFLAGSCXX += -fvisibility-inlines-hidden 114cdf0e10cSrcweir.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 115cdf0e10cSrcweir 116ad2d53dbSDon Lewis.IF "$(CPUNAME)" == "INTEL" || "$(CPUNAME)" == "X86_64" 117ad2d53dbSDon LewisCFLAGSCC += -fstack-protector 118ad2d53dbSDon LewisCFLAGSCXX += -fstack-protector 119ad2d53dbSDon Lewis.ENDIF 120ad2d53dbSDon Lewis 121cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with graphical user interface 122cdf0e10cSrcweirCFLAGSOBJGUIMT= 123cdf0e10cSrcweir# Compiler flags for compiling static object in multi threaded environment with character user interface 124cdf0e10cSrcweirCFLAGSOBJCUIMT= 125cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with graphical user interface 126cdf0e10cSrcweirCFLAGSSLOGUIMT=$(PICSWITCH) 127cdf0e10cSrcweir# Compiler flags for compiling shared object in multi threaded environment with character user interface 128cdf0e10cSrcweirCFLAGSSLOCUIMT=$(PICSWITCH) 129cdf0e10cSrcweir# Compiler flags for profiling 130cdf0e10cSrcweirCFLAGSPROF= 131cdf0e10cSrcweir# Compiler flags for debugging 132cdf0e10cSrcweirCFLAGSDEBUG=-g 133cdf0e10cSrcweirCFLAGSDBGUTIL= 134cdf0e10cSrcweir# Compiler flags for disabling optimizations 135cdf0e10cSrcweirCFLAGSNOOPT=-O0 136cdf0e10cSrcweir# Compiler flags for describing the output path 137cdf0e10cSrcweirCFLAGSOUTOBJ=-o 138cdf0e10cSrcweir 139cdf0e10cSrcweir# -Wshadow does not work for C with nested uses of pthread_cleanup_push: 140cdf0e10cSrcweirCFLAGSWARNCC=-Wall -Wextra -Wendif-labels 141cdf0e10cSrcweirCFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \ 142cdf0e10cSrcweir -Wno-non-virtual-dtor 143cdf0e10cSrcweirCFLAGSWALLCC=$(CFLAGSWARNCC) 144cdf0e10cSrcweirCFLAGSWALLCXX=$(CFLAGSWARNCXX) 145cdf0e10cSrcweirCFLAGSWERRCC=-Werror 146cdf0e10cSrcweir 147cdf0e10cSrcweir# Once all modules on this platform compile without warnings, set 148cdf0e10cSrcweir# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see 149cdf0e10cSrcweir# settings.mk): Currently this is not tested on FreeBSD 150cdf0e10cSrcweir#MODULES_WITH_WARNINGS := 151cdf0e10cSrcweir 152cdf0e10cSrcweir# switches for dynamic and static linking 153cdf0e10cSrcweirSTATIC = -Wl,-Bstatic 154cdf0e10cSrcweirDYNAMIC = -Wl,-Bdynamic 155cdf0e10cSrcweir 156cdf0e10cSrcweir# name of linker 157cdf0e10cSrcweirLINK*=$(CXX) 158cdf0e10cSrcweirLINKC*=$(CC) 159cdf0e10cSrcweir 160cdf0e10cSrcweir# default linker flags 16125da6cb0SPedro Giffuni.IF "$(SYSBASE)"!="" 16225da6cb0SPedro GiffuniLINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE) 16325da6cb0SPedro Giffuni.ENDIF # "$(SYSBASE)"!="" 16425da6cb0SPedro GiffuniLINKFLAGSDEFS*=-Wl,-z,defs 165a8e4828dSPedro GiffuniLINKFLAGSRUNPATH_URELIB=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 166910823aeSJürgen SchmidtLINKFLAGSRUNPATH_UREBIN=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 167910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_UREBIN=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\' 168cdf0e10cSrcweir #TODO: drop $ORIGIN once no URE executable is also shipped in OOo 169910823aeSJürgen SchmidtLINKFLAGSRUNPATH_OOO=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 170910823aeSJürgen SchmidtLINKFLAGSRUNPATH_SDK=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 171910823aeSJürgen SchmidtLINKFLAGSRUNPATH_BRAND=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 172910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_OOO=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\' 173910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_SDK=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\' 174910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_BRAND=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\' 175cdf0e10cSrcweirLINKFLAGSRUNPATH_OXT= 176910823aeSJürgen SchmidtLINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 177910823aeSJürgen Schmidt#LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\' 178cdf0e10cSrcweirLINKFLAGSRUNPATH_NONE= 179de2c434cSPedro GiffuniLINKFLAGS=-Wl,-z,combreloc $(LDFLAGS) $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE) 180cdf0e10cSrcweir 181cdf0e10cSrcweir# linker flags for linking applications 18225da6cb0SPedro GiffuniLINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \ 18325da6cb0SPedro Giffuni -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib 18425da6cb0SPedro GiffuniLINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \ 18525da6cb0SPedro Giffuni -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib 186cdf0e10cSrcweir 187cdf0e10cSrcweir# linker flags for linking shared libraries 188cdf0e10cSrcweirLINKFLAGSSHLGUI= -shared 189cdf0e10cSrcweirLINKFLAGSSHLCUI= -shared 190cdf0e10cSrcweir 191cdf0e10cSrcweirLINKFLAGSTACK= 192cdf0e10cSrcweirLINKFLAGSPROF= 193cdf0e10cSrcweirLINKFLAGSDEBUG=-g 194cdf0e10cSrcweirLINKFLAGSOPT= 195cdf0e10cSrcweir 196cdf0e10cSrcweir# linker flags for optimization (symbol hashtable) 197cdf0e10cSrcweir# for now, applied to symbol scoped libraries, only 198cdf0e10cSrcweirLINKFLAGSOPTIMIZE*=-Wl,-O1 199cdf0e10cSrcweirLINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script 200cdf0e10cSrcweir 201cdf0e10cSrcweirSONAME_SWITCH=-Wl,-h 202cdf0e10cSrcweir 203cdf0e10cSrcweir# Sequence of libs does matter ! 204cdf0e10cSrcweir 205cdf0e10cSrcweirSTDLIBCPP=-lstdc++ 206cdf0e10cSrcweir 207cdf0e10cSrcweir# default objectfilenames to link 20825da6cb0SPedro GiffuniSTDOBJVCL=$(L)$/salmain.o 209cdf0e10cSrcweirSTDOBJGUI= 210cdf0e10cSrcweirSTDSLOGUI= 211cdf0e10cSrcweirSTDOBJCUI= 212cdf0e10cSrcweirSTDSLOCUI= 213cdf0e10cSrcweir 21486686c1aSPedro Giffuni.IF "$(ALLOC)" == "TCMALLOC" 21525da6cb0SPedro GiffuniSTDLIBGUIMT+=-ltcmalloc 21625da6cb0SPedro GiffuniSTDLIBCUIMT+=-ltcmalloc 21725da6cb0SPedro GiffuniSTDSHLGUIMT+=-ltcmalloc 21825da6cb0SPedro GiffuniSTDSHLCUIMT+=-ltcmalloc 21925da6cb0SPedro Giffuni.ENDIF 22025da6cb0SPedro Giffuni 221cdf0e10cSrcweir# libraries for linking applications 222de2c434cSPedro GiffuniSTDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH} 223de2c434cSPedro GiffuniSTDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH} 224cdf0e10cSrcweir# libraries for linking shared libraries 225de2c434cSPedro GiffuniSTDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH} 226de2c434cSPedro GiffuniSTDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH} 22725da6cb0SPedro Giffuni 22825da6cb0SPedro GiffuniX11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed 229cdf0e10cSrcweir 230cdf0e10cSrcweirLIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive 231cdf0e10cSrcweir 232cdf0e10cSrcweir.IF "$(USE_STLP_DEBUG)" != "" 233cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500" 234cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlportstlg 235cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC) 236cdf0e10cSrcweir.ELSE 237cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug 238cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC) 239cdf0e10cSrcweir.ENDIF 240cdf0e10cSrcweir.ELSE # "$(USE_STLP_DEBUG)" != "" 241cdf0e10cSrcweir.IF "$(STLPORT_VER)" >= "500" 242cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport 243cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC) 244cdf0e10cSrcweir.ELSE 245cdf0e10cSrcweirLIBSTLPORT=$(DYNAMIC) -lstlport_gcc 246cdf0e10cSrcweirLIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC) 247cdf0e10cSrcweir.ENDIF 248cdf0e10cSrcweir.ENDIF # "$(USE_STLP_DEBUG)" != "" 249cdf0e10cSrcweir 250cdf0e10cSrcweir#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC) 251cdf0e10cSrcweir 252cdf0e10cSrcweir# name of library manager 253cdf0e10cSrcweirLIBMGR=ar 254cdf0e10cSrcweirLIBFLAGS=-r 255cdf0e10cSrcweir 256cdf0e10cSrcweir# tool for generating import libraries 257cdf0e10cSrcweirIMPLIB= 258cdf0e10cSrcweirIMPLIBFLAGS= 259cdf0e10cSrcweir 260cdf0e10cSrcweirMAPSYM= 261cdf0e10cSrcweirMAPSYMFLAGS= 262cdf0e10cSrcweir 263cdf0e10cSrcweirRC=irc 264cdf0e10cSrcweirRCFLAGS=-fo$@ $(RCFILES) 265cdf0e10cSrcweirRCLINK= 266cdf0e10cSrcweirRCLINKFLAGS= 267cdf0e10cSrcweirRCSETVERSION= 268cdf0e10cSrcweir 269cdf0e10cSrcweir# platform specific identifier for shared libs 270cdf0e10cSrcweirDLLPRE=lib 271cdf0e10cSrcweirDLLPOST=.so 27225da6cb0SPedro GiffuniPCHPOST=.gch 273