From 67212bbf2fdeaa702e607337c6277ddd03d7de61 Mon Sep 17 00:00:00 2001 From: Eduardo Ramos Testillano Date: Fri, 20 Mar 2015 17:29:09 +0100 Subject: [PATCH] Protection for non-interactive procedures --- SConstruct | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index f5cde93..517b1a6 100644 --- a/SConstruct +++ b/SConstruct @@ -1,4 +1,5 @@ import os +import sys, select # Basic paths prefix = ARGUMENTS.get ('prefix', "/usr/local") @@ -23,7 +24,13 @@ 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" + #option = raw_input("\nInput option [1]: ") or "1" + # Read with timeout: + print "\nInput option [1]: " + option = 1 + i, o, e = select.select( [sys.stdin], [], [], 60 ) + if (i): option = sys.stdin.readline().strip() + else: print "expired! using default ..." if option == "2": env = Environment(CXX = 'clang++') env.Append (CCFLAGS = '-DIS_CLANG') -- 2.20.1