# ---------------------------------------------------------------------- # # zoom.symbols.mk - define FPCL symbols required for compilation # # Intended to be used as a postprocessing step after all others' # GNUmakefiles have been read and processed # # History: # 21-Oct-1997 WEB Initial draft # 25-Oct-1997 WEB Added FixedTypes' req's and debugging opt # 10-Nov-1997 WEB Revised approach to adding to CPPFLAGS # 11-Nov-1997 WEB Fixed syntax error # 13-Nov-1997 WEB Improved exception-processing logic and comments; # added new logic for compiler control options; resequenced # 14-Nov-1997 WEB Corrected NOTHROW symbol name; revised # optimization logic (including matching debugging option) # 17-Nov-1997 WEB Added __KAI_STRICT (per KAI's advice) # 18-Nov-1997 WEB Added debugging option and a bit of narrative # 18-Dec-1997 WEB Separated zoom.mk into this and zoom.build.mk # and moved from SoftRelTools to ZMutility package # 05-Jan-1997 WEB Incorporated updated DEFECT_STANDARD_CPLUSPLUS # and FIXED_TYPES_ENV symbols; keep both predecessor symbols # __STANDARD_CPLUSPLUS and _FIXED_TYPES_ENV for now # 03-Jun-1998 WEB Added MSVC++ compliance # # ---------------------------------------------------------------------- # ---------- # [5] Determine whether we're using a standards-compliant compiler # (in order to provide proper code for such compilers): # ---------- #compliant__ := no # assume the worst # #ifeq (KCC, $(CXX)) # KCC is standards-compliant # compliant__ := yes #endif # #ifeq (srt_ntcc, $(CXX)) # MSVC++ is standards-compliant # compliant__ := yes #endif # ## Define appropriate symbols if compiler is sufficiently standards-compliant #ifeq (yes, $(compliant__)) # ifeq (, $(filter -D__STANDARD_CPLUSPLUS, $(CPPFLAGS))) # override CPPFLAGS += -D__STANDARD_CPLUSPLUS # endif # ifeq (, $(filter -DDEFECT_STANDARD_CPLUSPLUS, $(CPPFLAGS))) # override CPPFLAGS += -DDEFECT_STANDARD_CPLUSPLUS # endif #endif # $(compliant__) == yes # ---------- # [6] Note whether exception-handling is disabled (in order to force # an exit() call instead of a throw in packages that employ FPCL's # Exceptions package): # ---------- exceptions__ := yes # assume the best ifeq (g++, $(CXX)) # g++ requires "-fhandle-exceptions" and "-frtti" ifeq (, $(filter -fhandle-exceptions, $(CXXFLAGS))) exceptions__ := no endif ifeq (, $(filter -frtti, $(CXXFLAGS))) exceptions__ := no endif endif # g++ ifeq (KCC, $(CXX)) # KCC requires "--exceptions" but not "--no_rtti" ifeq (, $(filter --exceptions, $(CXXFLAGS))) ifeq (, $(filter -x, $(CXXFLAGS))) # "-x" is synonym for "--exceptions" exceptions__ := no endif endif ifeq (--no_rtti, $(filter --no_rtti, $(CXXFLAGS))) exceptions__ := no endif endif # KCC # Define NOTHROW if exceptions are unsupported ifeq (no, $(exceptions__)) ifeq (, $(filter -DNOTHROW, $(CPPFLAGS))) override CPPFLAGS += -DNOTHROW endif endif # $(exceptions__) == no # ---------- # [7] Ensure that FixedTypes' symbol is defined: # ---------- #ifeq (, $(filter -D_FIXED_TYPES_ENV, $(CPPFLAGS))) # override CPPFLAGS += -D_FIXED_TYPES_ENV=1 #endif #ifeq (, $(filter -DFIXED_TYPES_ENV, $(CPPFLAGS))) # override CPPFLAGS += -DFIXED_TYPES_ENV=1 #endif