From 651887dd94864cf0f8eda52f5a8d7ec93dc27d0e Mon Sep 17 00:00:00 2001 From: "jihwan.seo" Date: Tue, 11 Oct 2016 14:09:40 +0900 Subject: [PATCH] [IOT-1436] fix scons build issue related sqlite3 with unsecured mode sqlite3 is triggering to download by default. it causes a storage memory waste in user side. scons build script should check any option for download that lib Change-Id: I701752bb450dc79d3604304fc7130375586e5356 Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/13071 Tested-by: jenkins-iotivity Reviewed-by: Ashok Babu Channa --- extlibs/sqlite3/SConscript | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/extlibs/sqlite3/SConscript b/extlibs/sqlite3/SConscript index a7e033b..348ede3 100755 --- a/extlibs/sqlite3/SConscript +++ b/extlibs/sqlite3/SConscript @@ -19,24 +19,25 @@ sqlite_url = 'https://www.sqlite.org/2015/sqlite-amalgamation-3081101.zip' # Download if target_os in targets_need_sqlite: - print '*** Checking for installation of SQLite 3.8.11.1 ***' - if not os.path.exists(sqlite_dir + 'sqlite3.c') or not os.path.exists(sqlite_dir + 'sqlite3.h'): - - # If the zip file is not already present, download it - if not os.path.exists(sqlite_zip_file): - sqlite_zip = sqlite_env.Download(sqlite_zip_file, sqlite_url) - else: - sqlite_zip = sqlite_zip_file - - # Unzip the lib - print 'Unzipping SQLite amalgamation src...' - sqlite_env.UnpackAll(sqlite_build_dir, sqlite_zip) - print 'Unzipping SQLite amalgamation src complete' - - # Move requried src and header - os.rename(sqlite_build_dir + 'sqlite3.c', sqlite_dir + 'sqlite3.c') - os.rename(sqlite_build_dir + 'sqlite3.h', sqlite_dir + 'sqlite3.h') - os.remove(sqlite_zip_file) - shutil.rmtree(sqlite_build_dir) + if sqlite_env.get('SECURED') == '1': + print '*** Checking for installation of SQLite 3.8.11.1 (extlib/sqlite3) ***' + if not os.path.exists(sqlite_dir + 'sqlite3.c') or not os.path.exists(sqlite_dir + 'sqlite3.h'): + + # If the zip file is not already present, download it + if not os.path.exists(sqlite_zip_file): + sqlite_zip = sqlite_env.Download(sqlite_zip_file, sqlite_url) + else: + sqlite_zip = sqlite_zip_file + + # Unzip the lib + print 'Unzipping SQLite amalgamation src...' + sqlite_env.UnpackAll(sqlite_build_dir, sqlite_zip) + print 'Unzipping SQLite amalgamation src complete' + + # Move requried src and header + os.rename(sqlite_build_dir + 'sqlite3.c', sqlite_dir + 'sqlite3.c') + os.rename(sqlite_build_dir + 'sqlite3.h', sqlite_dir + 'sqlite3.h') + os.remove(sqlite_zip_file) + shutil.rmtree(sqlite_build_dir) # Build will be done with provisioning manager module. -- 2.7.4