Kaydet (Commit) 56d6d17b authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

consolidated compiler optimizations flags, updated some docs

üst 53b59ac2
......@@ -28,12 +28,48 @@ static const Bool DEBUG;
static const Bool PRODUCT;
// gbuild global variables derived from the configure/environment
// some of these are defined per platform
namespace gb
{
static const Integer PRODUCT;
static const Integer DEBUGLEVEL;
/// building with generated dependencies
static const Bool FULLDEPS;
/// product build or non-product build with additional assertions and tests
static const Bool PRODUCT;
/// command to run awk scripts
static const Command AWK;
/// command to compile c source files
static const Command CC;
/// command to compile c++ source files
static const Command CXX;
/// command to process input with a gcc compatible preprocessor
static const Command GCCP;
/// command to link objects on the microsoft toolchain
static const Command LINK;
/// command to create a unique temporary file
static const Command MKTEMP;
/// debuglevel:
/// 0=no debugging,
/// 1=non-product build,
/// 2=debugging build (either product or nonproduct)
static const Integer DEBUGLEVEL;
/// compiler specific optimization flags
static const List<String> COMPILEROPTFLAGS;
/// default c compilation compiler flags
static const List<String> CFLAGS;
/// compiler specific defines
static const List<String> COMPILERDEFS;
/// cpu-specific default defines
static const List<String> CPUDEFS;
/// default c++ compilation compiler flags
static const List<String> CXXFLAGS;
/// platform- and compilerindependent default defines
static const List<String> GLOBALDEFS;
/// default objective c++ compilation compiler flags
static const List<String> OBJCXXFLAGS;
/// platfomspecific default defines
static const List<String> OSDEFS;
/// ?
static const Path SDKDIR;
};
// GXX_INCLUDE_PATH (Linux)
......
......@@ -104,9 +104,9 @@ gb_LinkTarget_LDFLAGS := \
$(subst -L../lib , ,$(SOLARLIB)) \
ifeq ($(gb_DEBUGLEVEL),2)
gb_GCCOPTFLAGS := -O0
gb_COMPILEROPTFLAGS := -O0
else
gb_GCCOPTFLAGS := -Os
gb_COMPILEROPTFLAGS := -Os
endif
......@@ -188,8 +188,8 @@ gb_LinkTarget_LAYER := \
$(foreach lib,$(gb_Library_UNOLIBS),$(lib):URELIB) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_GCCOPTFLAGS)
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_GCCOPTFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_COMPILEROPTFLAGS)
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS)
ifeq ($(gb_DEBUGLEVEL),2)
gb_LinkTarget_CXXFLAGS += -ggdb3 -finline-limit=0 -fno-inline -fno-default-inline
......
......@@ -124,9 +124,9 @@ gb_LinkTarget_LDFLAGS := \
#man ld says: obsolete -Wl,-multiply_defined,suppress \
ifeq ($(gb_DEBUGLEVEL),2)
gb_GCCOPTFLAGS := -O0
gb_COMPILEROPTFLAGS := -O0
else
gb_GCCOPTFLAGS := -O2
gb_COMPILEROPTFLAGS := -O2
endif
......@@ -228,9 +228,9 @@ gb_LinkTarget_LAYER := \
$(foreach lib,$(gb_Library_UNOLIBS),$(lib):URELIB) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_GCCOPTFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_GCCOPTFLAGS)
gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) $(gb_GCCOPTFLAGS)
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_COMPILEROPTFLAGS)
gb_LinkTarget_OBJCXXFLAGS := $(gb_CXXFLAGS) $(gb_OBJCXXFLAGS) $(gb_COMPILEROPTFLAGS)
ifeq ($(gb_DEBUGLEVEL),2)
gb_LinkTarget_CFLAGS += -g
......
......@@ -97,16 +97,16 @@ gb_LinkTarget_LDFLAGS := \
-library=no%Cstd \
ifeq ($(gb_DEBUGLEVEL),2)
gb_CCOPTFLAGS :=
gb_COMPILEROPTFLAGS :=
else
ifeq ($(CPUNAME),INTEL)
gb_CCOPTFLAGS := -xarch=generic -xO3
gb_COMPILEROPTFLAGS := -xarch=generic -xO3
else # ifeq ($(CPUNAME),SPARC)
# -m32 -xarch=sparc restrict target to 32 bit sparc
# -xO3 optimization level 3
# -xspace don't do optimizations which do increase binary size
# -xprefetch=yes do prefetching (helps on UltraSparc III)
gb_CCOPTFLAGS := -m32 -xarch=sparc -xO3 -xspace -xprefetch=yes
gb_COMPILEROPTFLAGS := -m32 -xarch=sparc -xO3 -xspace -xprefetch=yes
endif
endif
......@@ -189,8 +189,8 @@ gb_LinkTarget_LAYER := \
$(foreach lib,$(gb_Library_UNOLIBS),$(lib):URELIB) \
$(foreach lib,$(gb_Library_UNOVERLIBS),$(lib):URELIB) \
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CCOPTFLAGS)
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CCOPTFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_COMPILEROPTFLAGS)
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS)
ifeq ($(gb_DEBUGLEVEL),2)
gb_LinkTarget_CXXFLAGS += -g
......
......@@ -35,14 +35,14 @@ gb_CXX := cl
gb_LINK := link
gb_AWK := awk
gb_OSDEFS :=\
gb_OSDEFS := \
-DWINVER=0x0500 \
-D_WIN32_IE=0x0500 \
-DNT351 \
-DWIN32 \
-DWNT \
gb_COMPILERDEFS :=\
gb_COMPILERDEFS := \
-DMSC \
-D_CRT_NON_CONFORMING_SWPRINTFS \
-D_CRT_NONSTDC_NO_DEPRECATE \
......@@ -55,7 +55,7 @@ gb_COMPILERDEFS :=\
gb_CPUDEFS := -DINTEL -D_X86_=1
gb_CFLAGS :=\
gb_CFLAGS := \
-Gd \
-GR \
-Gs \
......@@ -102,7 +102,7 @@ gb_CFLAGS :=\
-Zc:forScope,wchar_t- \
-Zm500 \
gb_CXXFLAGS :=\
gb_CXXFLAGS := \
-Gd \
-GR \
-Gs \
......@@ -148,24 +148,24 @@ gb_CXXFLAGS :=\
-Zc:forScope,wchar_t- \
-Zm500 \
gb_LinkTarget_EXCEPTIONFLAGS :=\
gb_LinkTarget_EXCEPTIONFLAGS := \
-DEXCEPTIONS_ON \
-EHa \
gb_LinkTarget_NOEXCEPTIONFLAGS :=\
gb_LinkTarget_NOEXCEPTIONFLAGS := \
-DEXCEPTIONS_OFF \
gb_LinkTarget_LDFLAGS :=\
gb_LinkTarget_LDFLAGS := \
-MACHINE:IX86 \
-NODEFAULTLIB \
-SUBSYSTEM:CONSOLE \
ifeq ($(gb_DEBUGLEVEL),2)
gb_MSCOPTFLAGS :=
gb_COMPILEROPTFLAGS :=
gb_LinkTarget_LDFLAGS += -DEBUG
else
gb_MSCOPTFLAGS := -Ob1 -Oxs -Oy-
gb_COMPILEROPTFLAGS := -Ob1 -Oxs -Oy-
endif
......@@ -261,8 +261,8 @@ endef
gb_LinkTarget_get_rpath :=
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_MSCOPTFLAGS)
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_MSCOPTFLAGS)
gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_COMPILEROPTFLAGS)
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_COMPILEROPTFLAGS)
ifeq ($(gb_DEBUGLEVEL),2)
gb_LinkTarget_CXXFLAGS +=
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment