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