From: Caiwen Zhang Date: Tue, 10 Feb 2015 09:10:27 +0000 (+0800) Subject: Check if C/C++ compiler is installed X-Git-Tag: Plugfest-1~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ab500ba1179c0430be577d2f431825727d2a77a;p=contrib%2Fiotivity.git Check if C/C++ compiler is installed If C/C++ compiler isn't installed, notify user to install it. Change-Id: I58ad124139a2b454dcd8100b14d5ed23a8065144 Signed-off-by: Caiwen Zhang Reviewed-on: https://gerrit.iotivity.org/gerrit/322 Tested-by: jenkins-iotivity Reviewed-by: Erich Keane Reviewed-by: Patrick Lankswert --- diff --git a/build_common/SConscript b/build_common/SConscript index 37a7b50..2670070 100644 --- a/build_common/SConscript +++ b/build_common/SConscript @@ -264,4 +264,28 @@ if env.GetOption('clean'): Execute(Delete(dir + '/.sconsign.dblite')) Execute(Delete(dir + '/.sconf_temp')) +# Check if C/C++ compiler is installed +cc = env.get('CC', '') +cxx = env.get('CXX', '') + +if not cc: + print ''' +*************************************** Error ********************************* +* * +* Didn't find C compiler, please install C compiler (e.g. gcc >= 4.6). * +* * +******************************************************************************* +''' + Exit(1) + +if not cxx: + print ''' +*************************************** Error ********************************* +* * +* Didn't find C++ compiler, please install C++ compiler (e.g. g++ >= 4.6) * +* * +******************************************************************************* +''' + Exit(1) + Return('env')