[IOT-1436] fix scons build issue related sqlite3 with unsecured mode
authorjihwan.seo <jihwan.seo@samsung.com>
Tue, 11 Oct 2016 05:09:40 +0000 (14:09 +0900)
committerAshok Babu Channa <ashok.channa@samsung.com>
Thu, 20 Oct 2016 07:07:48 +0000 (07:07 +0000)
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 <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13071
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
(cherry picked from commit 651887dd94864cf0f8eda52f5a8d7ec93dc27d0e)
Reviewed-on: https://gerrit.iotivity.org/gerrit/13381

extlibs/sqlite3/SConscript

index a7e033b..348ede3 100755 (executable)
@@ -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.