# # Compiler settings for Solaris with Sun Studio 12, CC # Works for all hosts that SS Pro supports (e.g. sparc, amd64, i386) # Works for 32/64 bit builds, depends on CFLAGS/CXXFLAGS # Before attempting the Solaris build, you must export necessary # CFLAGS and CXXFLAGS to be picked up by the configure process and # subsequent build. Make sure CC is in the path! # # for typical 64-bit build # export CC=cc # export CXX=CC # export CFLAGS="-m64" # export CXXFLAGS=$CFLAGS # History # 30-Dec-2002 nmcc FB2 initial working build on Solaris8 with gcc 3.2.1 # 07-Apr-2005 kkuznetsov starting moving to sparc 64 # 20-Mar-2009 wbo refresh for Sun Studio C++ 5.9, Solaris 9+ # Useful predefined macros from Sun Studio # __SUNPRO_CC, indicates the release number of the compiler, e.g. 0x590 # These macros are predefined by both Sun Studio and g++ when appropriate. # No need to define again. # __amd64 # __i386 # __sparc # __sun # __unix # set Instruction Set Architecture, and add any processor specific flags ISA=$(shell isainfo -k) ifeq ($(ISA),sparcv9) # -xcheck=%all, SPARC only, add run time check for stack overflow ISA_DEV_FLAGS=-xcheck=%all ISA_COMMON_FLAGS=-xarch=sparcvis2 endif ifeq ($(ISA),amd64) ISA_COMMON_FLAGS=-xarch=sse2 endif # Flags shared by production and debug build # -m32 | -m64, specify memory model. -m64 means LP64, -m32 means ILP32 # -m64 is default on Intel/AMD architecture, -m32 default on sparc # -m64 is sufficient to create 64-bit targets on most(?) platforms # -KPIC, use to compile source files when building a shared library # -bBinding, specify library binding for linking. Can be symbolic, dynamic, or static # -features=extensions, allow non-standard C++ commonly accepted by other compilers # -D_POSIX_C_SOURCE, we are conformant to this posix version # -D__EXTENSIONS__, access all interfaces and headers not in conflict with posix version # -D_POSIX_THREAD_SEMANTICS, enable threading extensions # -erroff=nothrowneww, suppress warning for redefined new with different # exception specification # -D_REENTRANT is added by -mt switch, explicit definition not needed COMMON_FLAGS= -DSOLARIS -DBSD_COMP -D__EXTENSIONS__ \ -D_POSIX_THREAD_SEMANTICS -D_POSIX_THREAD_PRIO_INHERIT -D_POSIX_C_SOURCE=199506L -mt -KPIC \ -erroff=nothrowneww,wvarhidemem $(ISA_COMMON_FLAGS) # if we keep sfio this needs to be set by configure (or move in to extern directory) # must use full sfio not stdio emulation to get file handle number fix #SFIO_DIR=$(SRC_ROOT)/../../../sfio/sfio_2002 #SFIO_DIR=/data01/fb-dev/sfio/sfio_2002 #SFIO_FLAGS= -DSFIO -I$(SFIO_DIR)/include #SFIO_LDFLAGS= -L$(SFIO)/lib #these come from configure --with-sfio=/path/to/sfio SFIO_DIR=@SFIO_DIR@ SFIO_FLAGS=@SFIO_FLAGS@ SFIO_LDFLAGS=@SFIO_LDFLAGS@ # Production flags # -fast, provides near-maximum performance. **includes** -O5, -libmil, and more! # -fast must come first, and must be present in compile and link! # -libmil, use the intrinsic library functions like strlen # -O, optimize, implies -O3 in Sun Studio 12 PROD_FLAGS= -fast -O -DNDEBUG \ $(COMMON_FLAGS) $(SFIO_FLAGS) # Debug flags # -xport64, warn about 32-bit to 64-bit funny stuff, like sign extension # -w, warn about code that may have "unintended consequences." How nice! DEV_FLAGS= -g -xs \ $(COMMON_FLAGS) $(SFIO_FLAGS) $(ISA_DEV_FLAGS) OS_ServerFiles=inet_server.cpp Server_main_dummy= os/sun/server_main_dummy.cpp LIB_LINK_OPTIONS= -G LIB_PLATFORM_RPATH= -R $(1) LIB_LINK_SONAME= -h $(1) LIB_LINK_MAPFILE= -M # link options for Solaris linker, /usr/ccs/bin/ld #LINK_OPTS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) #LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared EMBED_UTIL_TARGETS=gstat gsec fbguard nbackup fb_lock_print CLIENT_UTIL_TARGETS=gstat gsec fbguard fbmgr_bin nbackup fb_lock_print Physical_IO_Module=os/posix/unix.cpp #LD=CC LDFLAGS=-library=no%Cstd -mt UNDEF_PLATFORM=