1#************************************************************** 2# 3# Licensed to the Apache Software Foundation (ASF) under one 4# or more contributor license agreements. See the NOTICE file 5# distributed with this work for additional information 6# regarding copyright ownership. The ASF licenses this file 7# to you under the Apache License, Version 2.0 (the 8# "License"); you may not use this file except in compliance 9# with the License. You may obtain a copy of the License at 10# 11# http://www.apache.org/licenses/LICENSE-2.0 12# 13# Unless required by applicable law or agreed to in writing, 14# software distributed under the License is distributed on an 15# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16# KIND, either express or implied. See the License for the 17# specific language governing permissions and limitations 18# under the License. 19# 20#************************************************************** 21 22 23 24# Makefile for FreeBSD. 25 26ASM= 27AFLAGS= 28 29SOLAR_JAVA*= 30PICSWITCH*:=-fPIC 31JAVAFLAGSDEBUG=-g 32 33# Include arch specific makefile. 34.IF "$(CPUNAME)" == "INTEL" 35.INCLUDE : unxfbsdi.mk 36.ENDIF 37.IF "$(CPUNAME)" == "X86_64" 38.INCLUDE : unxfbsdx.mk 39.ENDIF 40.IF "$(CPUNAME)" == "POWERPC64" 41.INCLUDE : unxfbsdp.mk 42.ENDIF 43.IF "$(CPUNAME)" == "POWERPC" 44.INCLUDE : unxfbsdppc.mk 45.ENDIF 46.IF "$(CPUNAME)" == "POWERPC64" 47.INCLUDE : unxfbsdppc64.mk 48.ENDIF 49.IF "$(CPUNAME)" == "ARM" 50.INCLUDE : unxfbsdr.mk 51.ENDIF 52 53# filter for suppressing verbose messages from linker 54#not needed at the moment 55#LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter" 56 57# _PTHREADS is needed for the stl 58CDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450 59.IF "$(COM)"=="CLANG" 60CDEFS+=-DHAVE_STL_INCLUDE_PATH 61.ELSE 62CDEFS+=-DBOOST_TR1_DISABLE_INCLUDE_NEXT -DBOOST_TR1_GCC_INCLUDE_PATH=c++ 63.ENDIF 64 65# enable visibility define in "sal/types.h" 66.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 67CDEFS += -DHAVE_GCC_VISIBILITY_FEATURE 68.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 69 70# this is a platform with JAVA support 71.IF "$(SOLAR_JAVA)"!="" 72JAVADEF=-DSOLAR_JAVA 73.IF "$(debug)"=="" 74JAVA_RUNTIME=-ljava 75.ELSE 76JAVA_RUNTIME=-ljava_g 77.ENDIF 78.ENDIF 79 80# name of C++ Compiler 81CXX*=c++ 82# name of C Compiler 83CC*=cc 84.IF "$(SYSBASE)"!="" 85CFLAGS_SYSBASE:=--sysroot=$(SYSBASE) 86CXX+:=$(CFLAGS_SYSBASE) 87CC+:=$(CFLAGS_SYSBASE) 88.ENDIF # "$(SYSBASE)"!="" 89CFLAGS+=-fmessage-length=0 -c 90 91# flags to enable build with symbols; required for crashdump feature 92.IF "$(ENABLE_SYMBOLS)"=="SMALL" 93CFLAGSENABLESYMBOLS=-g1 94.ELSE 95CFLAGSENABLESYMBOLS=-g # was temporarily commented out, reenabled before Beta 96 97.ENDIF 98 99# flags for the C++ Compiler 100CFLAGSCC= -pipe $(ARCH_FLAGS) 101# Flags for enabling exception handling 102.IF "$(COM)"=="CLANG" 103CFLAGSEXCEPTIONS=-fexceptions 104.ELSE 105CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs 106.ENDIF 107# Flags for disabling exception handling 108CFLAGS_NO_EXCEPTIONS=-fno-exceptions 109 110# -fpermissive should be removed as soon as possible 111CFLAGSCXX= -pipe $(ARCH_FLAGS) 112.IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 113CFLAGSCXX += -fvisibility-inlines-hidden 114.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE" 115 116# Compiler flags for compiling static object in multi threaded environment with graphical user interface 117CFLAGSOBJGUIMT= 118# Compiler flags for compiling static object in multi threaded environment with character user interface 119CFLAGSOBJCUIMT= 120# Compiler flags for compiling shared object in multi threaded environment with graphical user interface 121CFLAGSSLOGUIMT=$(PICSWITCH) 122# Compiler flags for compiling shared object in multi threaded environment with character user interface 123CFLAGSSLOCUIMT=$(PICSWITCH) 124# Compiler flags for profiling 125CFLAGSPROF= 126# Compiler flags for debugging 127CFLAGSDEBUG=-g 128CFLAGSDBGUTIL= 129# Compiler flags for disabling optimizations 130CFLAGSNOOPT=-O0 131# Compiler flags for describing the output path 132CFLAGSOUTOBJ=-o 133 134# -Wshadow does not work for C with nested uses of pthread_cleanup_push: 135CFLAGSWARNCC=-Wall -Wextra -Wendif-labels 136CFLAGSWARNCXX=$(CFLAGSWARNCC) -Wshadow -Wno-ctor-dtor-privacy \ 137 -Wno-non-virtual-dtor 138CFLAGSWALLCC=$(CFLAGSWARNCC) 139CFLAGSWALLCXX=$(CFLAGSWARNCXX) 140CFLAGSWERRCC=-Werror 141 142# Once all modules on this platform compile without warnings, set 143# COMPILER_WARN_ERRORS=TRUE here instead of setting MODULES_WITH_WARNINGS (see 144# settings.mk): Currently this is not tested on FreeBSD 145#MODULES_WITH_WARNINGS := 146 147# switches for dynamic and static linking 148STATIC = -Wl,-Bstatic 149DYNAMIC = -Wl,-Bdynamic 150 151# name of linker 152LINK*=$(CXX) 153LINKC*=$(CC) 154 155# default linker flags 156.IF "$(SYSBASE)"!="" 157LINKFLAGS_SYSBASE:=-Wl,--sysroot=$(SYSBASE) 158.ENDIF # "$(SYSBASE)"!="" 159LINKFLAGSDEFS*=-Wl,-z,defs 160LINKFLAGSRUNPATH_URELIB=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 161LINKFLAGSRUNPATH_UREBIN=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 162#LINKFLAGSRUNPATH_UREBIN=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../lib:$$ORIGIN'\' 163 #TODO: drop $ORIGIN once no URE executable is also shipped in OOo 164LINKFLAGSRUNPATH_OOO=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 165LINKFLAGSRUNPATH_SDK=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 166LINKFLAGSRUNPATH_BRAND=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 167#LINKFLAGSRUNPATH_OOO=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../ure-link/lib'\' 168#LINKFLAGSRUNPATH_SDK=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../ure-link/lib'\' 169#LINKFLAGSRUNPATH_BRAND=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN:$$ORIGIN/../basis-link/program:$$ORIGIN/../basis-link/ure-link/lib'\' 170LINKFLAGSRUNPATH_OXT= 171LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN'\' 172#LINKFLAGSRUNPATH_BOXT=-Wl,-z,origin -Wl,-rpath,\''$$ORIGIN/../../../basis-link/program'\' 173LINKFLAGSRUNPATH_NONE= 174LINKFLAGS=-Wl,-z,combreloc $(LDFLAGS) $(LINKFLAGSDEFS) $(LINKFLAGS_SYSBASE) 175 176# linker flags for linking applications 177LINKFLAGSAPPGUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \ 178 -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib 179LINKFLAGSAPPCUI= -Wl,-export-dynamic -Wl,--noinhibit-exec \ 180 -Wl,-rpath-link,$(LB):$(SOLARLIBDIR):$(SYSBASE)/lib:$(SYSBASE)/usr/lib 181 182# linker flags for linking shared libraries 183LINKFLAGSSHLGUI= -shared 184LINKFLAGSSHLCUI= -shared 185 186LINKFLAGSTACK= 187LINKFLAGSPROF= 188LINKFLAGSDEBUG=-g 189LINKFLAGSOPT= 190 191# linker flags for optimization (symbol hashtable) 192# for now, applied to symbol scoped libraries, only 193LINKFLAGSOPTIMIZE*=-Wl,-O1 194LINKVERSIONMAPFLAG=$(LINKFLAGSOPTIMIZE) -Wl,--version-script 195 196SONAME_SWITCH=-Wl,-h 197 198# Sequence of libs does matter ! 199 200STDLIBCPP=-lstdc++ 201 202# default objectfilenames to link 203STDOBJVCL=$(L)$/salmain.o 204STDOBJGUI= 205STDSLOGUI= 206STDOBJCUI= 207STDSLOCUI= 208 209.IF "$(ALLOC)" == "TCMALLOC" 210STDLIBGUIMT+=-ltcmalloc 211STDLIBCUIMT+=-ltcmalloc 212STDSHLGUIMT+=-ltcmalloc 213STDSHLCUIMT+=-ltcmalloc 214.ENDIF 215 216# libraries for linking applications 217STDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH} 218STDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH} 219# libraries for linking shared libraries 220STDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH} 221STDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH} 222 223X11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed 224 225LIBSALCPPRT*=-Wl,--whole-archive -lsalcpprt -Wl,--no-whole-archive 226 227.IF "$(USE_STLP_DEBUG)" != "" 228.IF "$(STLPORT_VER)" >= "500" 229LIBSTLPORT=$(DYNAMIC) -lstlportstlg 230LIBSTLPORTST=$(STATIC) -lstlportstlg $(DYNAMIC) 231.ELSE 232LIBSTLPORT=$(DYNAMIC) -lstlport_gcc_stldebug 233LIBSTLPORTST=$(STATIC) -lstlport_gcc_stldebug $(DYNAMIC) 234.ENDIF 235.ELSE # "$(USE_STLP_DEBUG)" != "" 236.IF "$(STLPORT_VER)" >= "500" 237LIBSTLPORT=$(DYNAMIC) -lstlport 238LIBSTLPORTST=$(STATIC) -lstlport $(DYNAMIC) 239.ELSE 240LIBSTLPORT=$(DYNAMIC) -lstlport_gcc 241LIBSTLPORTST=$(STATIC) -lstlport_gcc $(DYNAMIC) 242.ENDIF 243.ENDIF # "$(USE_STLP_DEBUG)" != "" 244 245#FILLUPARC=$(STATIC) -lsupc++ $(DYNAMIC) 246 247# name of library manager 248LIBMGR=ar 249LIBFLAGS=-r 250 251# tool for generating import libraries 252IMPLIB= 253IMPLIBFLAGS= 254 255MAPSYM= 256MAPSYMFLAGS= 257 258RC=irc 259RCFLAGS=-fo$@ $(RCFILES) 260RCLINK= 261RCLINKFLAGS= 262RCSETVERSION= 263 264# platform specific identifier for shared libs 265DLLPRE=lib 266DLLPOST=.so 267PCHPOST=.gch 268