From c9038f2ab1936162717beb212541063abfaffed9 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Fri, 20 Mar 2015 17:20:14 +0100 Subject: [PATCH] If clang detected, the user can select clang or g++, if not, default system compiler is used. --- SConstruct | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/SConstruct b/SConstruct index fd6ba85..f5cde93 100644 --- a/SConstruct +++ b/SConstruct @@ -18,14 +18,20 @@ target_opt_bin = os.path.join (opt_bin, "anna") release = ARGUMENTS.get ('release', 0) # Environment - -# Using clang, uncomment following: -env = Environment(CXX = 'clang++') -env.Append (CCFLAGS = '-DIS_CLANG') -env.Append (CXXFLAGS = '-Wno-parentheses-equality') - -# Using c++, uncomment following: -#env = Environment () +env = None +rc = os.system("clang++ --version >/dev/null 2>/dev/null") +if rc == 0: + print "\nDetected clang++ installed in the system" + print "\nSelect compiler:\n 1. g++\n 2. clang++" + option = raw_input("\nInput option [1]: ") or "1" + if option == "2": + env = Environment(CXX = 'clang++') + env.Append (CCFLAGS = '-DIS_CLANG') + env.Append (CXXFLAGS = '-Wno-parentheses-equality') + else: + env = Environment() +else: + env = Environment() #oracle_includes = os.environ["ORACLE_HOME"] + "/include" oracle_includes = "/usr/lib/oracle/12.1/client64/include" -- 2.20.1