Remove C++ compiler flags and parameters

This commit is contained in:
Ali Mashtizadeh 2023-08-30 13:06:07 -04:00
parent cbf5643974
commit d4839182f9

View File

@ -10,7 +10,6 @@ opts = Variables('Local.sc')
opts.AddVariables( opts.AddVariables(
("CC", "C Compiler"), ("CC", "C Compiler"),
("CXX", "C++ Compiler"),
("AS", "Assembler"), ("AS", "Assembler"),
("LINK", "Linker"), ("LINK", "Linker"),
("AR", "Archiver"), ("AR", "Archiver"),
@ -34,8 +33,6 @@ Help(opts.GenerateHelpText(env))
# Copy environment variables # Copy environment variables
if 'CC' in os.environ: if 'CC' in os.environ:
env["CC"] = os.getenv('CC') env["CC"] = os.getenv('CC')
if 'CXX' in os.environ:
env["CXX"] = os.getenv('CXX')
if 'AS' in os.environ: if 'AS' in os.environ:
env["AS"] = os.getenv('AS') env["AS"] = os.getenv('AS')
if 'LD' in os.environ: if 'LD' in os.environ:
@ -48,18 +45,10 @@ if 'CFLAGS' in os.environ:
env.Append(CCFLAGS = SCons.Util.CLVar(os.environ['CFLAGS'])) env.Append(CCFLAGS = SCons.Util.CLVar(os.environ['CFLAGS']))
if 'CPPFLAGS' in os.environ: if 'CPPFLAGS' in os.environ:
env.Append(CPPFLAGS = SCons.Util.CLVar(os.environ['CPPFLAGS'])) env.Append(CPPFLAGS = SCons.Util.CLVar(os.environ['CPPFLAGS']))
if 'CXXFLAGS' in os.environ:
env.Append(CXXFLAGS = SCons.Util.CLVar(os.environ['CXXFLAGS']))
if 'LDFLAGS' in os.environ: if 'LDFLAGS' in os.environ:
env.Append(LINKFLAGS = SCons.Util.CLVar(os.environ['LDFLAGS'])) env.Append(LINKFLAGS = SCons.Util.CLVar(os.environ['LDFLAGS']))
#env.Append(CPPFLAGS = [ "-Wall", "-Wformat=2", "-Wextra", "-Wwrite-strings",
# "-Wno-unused-parameter", "-Wmissing-format-attribute",
# "-Werror" ])
env.Append(CFLAGS = [ "-Wshadow", "-Wno-typedef-redefinition" ]) env.Append(CFLAGS = [ "-Wshadow", "-Wno-typedef-redefinition" ])
#env.Append(CXXFLAGS = [ "-Wno-non-template-friend", "-Woverloaded-virtual",
# "-Wcast-qual", "-Wcast-align", "-Wconversion",
# "-Weffc++", "-std=c++0x", "-Werror" ])
env.Append(CPPFLAGS = [ "-fno-builtin", "-fno-stack-protector" ]) env.Append(CPPFLAGS = [ "-fno-builtin", "-fno-stack-protector" ])
if (env["STRICT"] == "1"): if (env["STRICT"] == "1"):
@ -104,9 +93,7 @@ except IOError:
if env["VERBOSE"] == "0": if env["VERBOSE"] == "0":
env["CCCOMSTR"] = "Compiling $SOURCE" env["CCCOMSTR"] = "Compiling $SOURCE"
env["CXXCOMSTR"] = "Compiling $SOURCE"
env["SHCCCOMSTR"] = "Compiling $SOURCE" env["SHCCCOMSTR"] = "Compiling $SOURCE"
env["SHCXXCOMSTR"] = "Compiling $SOURCE"
env["ARCOMSTR"] = "Creating library $TARGET" env["ARCOMSTR"] = "Creating library $TARGET"
env["RANLIBCOMSTR"] = "Indexing library $TARGET" env["RANLIBCOMSTR"] = "Indexing library $TARGET"
env["LINKCOMSTR"] = "Linking $TARGET" env["LINKCOMSTR"] = "Linking $TARGET"
@ -153,10 +140,6 @@ if not conf.CheckCC():
print('Your C compiler and/or environment is incorrectly configured.') print('Your C compiler and/or environment is incorrectly configured.')
CheckFailed() CheckFailed()
if not conf.CheckCXX():
print('Your C++ compiler and/or environment is incorrectly configured.')
CheckFailed()
if not env["CCVERSION"].startswith("15."): if not env["CCVERSION"].startswith("15."):
print('Only Clang 15 is supported') print('Only Clang 15 is supported')
print('You are running: ' + env["CCVERSION"]) print('You are running: ' + env["CCVERSION"])
@ -198,7 +181,6 @@ SConscript('tests/SConscript', variant_dir='build/tests')
# Build Tools # Build Tools
env["TOOLCHAINBUILD"] = "TRUE" env["TOOLCHAINBUILD"] = "TRUE"
env["CC"] = "cc" env["CC"] = "cc"
env["CXX"] = "c++"
env["LINK"] = "cc" env["LINK"] = "cc"
SConscript('sbin/newfs_o2fs/SConscript', variant_dir='build/tools/newfs_o2fs') SConscript('sbin/newfs_o2fs/SConscript', variant_dir='build/tools/newfs_o2fs')