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