# -*- Makefile -*- # # $Id$ # # configuration file for SunPro CC on SunOS # ############################################################################## CXX = CC # extract the "C++ m.n" substring from version string (whcih changes # from one release of the compiler to another) CCVER := $(shell $(CXX) -V 2>&1 | head -n1 | sed 's/.*C\+\+ *\([^ ]*\).*/\1/') WARNFLAGS = +w DEPENDFLAGS = -xM PICFLAGS = -KPIC LDSOFLAGS = CXXFLAGS = -library=%none CXXPRELINK = CPPFLAGS = LDFLAGS = -library=%none LDSOFLAGS = -G # use CC to invoke the compiler (needed to pick up template # instantiations from SunWS_cache) AR = CC ARFLAGS = -xar -o # The flag(s) to use to embed a library search path into generated executables. RPATH = -R # debug/optimization options DEBUG_CXXFLAGS = -g DEBUG_CPPFLAGS = OPTMZ_CXXFLAGS = -O OPTMZ_CPPFLAGS = # shared/static library options SHARED_CXXFLAGS = SHARED_CPPFLAGS = SHARED_LDFLAGS = STATIC_CXXFLAGS = STATIC_CPPFLAGS = STATIC_LDFLAGS = # multi/single thread options; -mt defines _REENTRANT MULTI_CPPFLAGS_POSIX = -mt MULTI_CPPFLAGS_SOLARIS = -mt -D_RWSTD_SOLARIS_THREADS MULTI_CPPFLAGS_DCE = # avoid linking with the redundant libpthread and libthread # on Solaris 10 and beyond to prevent error 543 ifeq ($(OSNAME),SunOS) OSVER = $(shell uname -r) OSMAJOR = $(shell echo $(OSVER) | sed "s/\([0-9][0-9]*\)\..*/\1/") OSMINOR = $(shell echo $(OSVER) | sed "s/[^.]*\.\([0-9][0-9]*\)/\1/") ifneq ($(shell expr $(OSMAJOR) \> 5 \| $(OSMINOR) = 10),1) LIBPTHREAD = -lpthread LIBTHREAD = -lthread endif else LIBPTHREAD = -lpthread LIBTHREAD = -lthread endif MULTI_LDFLAGS_POSIX = -mt $(LIBPTHREAD) MULTI_LDFLAGS_SOLARIS = -mt $(LIBTHREAD) MULTI_LDFLAGS_DCE = # POSIX MULTI_CPPFLAGS = $(MULTI_CPPFLAGS_POSIX) MULTI_LDFLAGS = $(MULTI_LDFLAGS_POSIX) SINGL_CPPFLAGS = SINGL_LDFLAGS = # (try to) determine the architecture via the (non-standard) -p option # recognized on (at least) Linux and Solaris arch=$(shell uname -p 2>/dev/null) ifeq ($(arch),sparc) # wide (64-bit) flags -- must be set explicitly # narrow (32-bit) flags are implicit on SPARC wide_flags = -xarch=v9 narrow_flags = -xarch=v8 else # wide (64-bit) flags -- must be set explicitly # narrow (32-bit) flags are implicit on AMD64 ifeq ($(arch),amd64) wide_flags = -xarch=amd64 narrow_flags = endif endif CXXFLAGS.wide = $(wide_flags) LDFLAGS.wide = $(wide_flags) LDSOFLAGS.wide = $(wide_flags) ARFLAGS.wide = CXXFLAGS.narrow = $(narrow_flags) LDFLAGS.narrow = $(narrow_flags) LDSOFLAGS.narrow = $(narrow_flags) ARFLAGS.narrow =