X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=build_common%2Fexternal_libs.scons;h=b9c6947d2a655910fb7c2b30414ace24b3625d15;hb=refs%2Ftags%2Faccepted%2Ftizen%2Funified%2F20230214.171546;hp=f1e8295b354c8944b2f0c9e75a9d459e7142a2f9;hpb=945944cb3ff5efaccd03e8efa23199e58bd59ded;p=platform%2Fupstream%2Fiotivity.git diff --git a/build_common/external_libs.scons b/build_common/external_libs.scons index f1e8295..b9c6947 100644 --- a/build_common/external_libs.scons +++ b/build_common/external_libs.scons @@ -21,13 +21,14 @@ # ## import os, subprocess -import urllib2, urlparse +import urllib.request, urllib.error, urllib.parse, urllib.parse import SCons.Errors Import('env') target_os = env.get('TARGET_OS') target_arch = env.get('TARGET_ARCH') +rd_mode = env.get('RD_MODE') # for android, doesn't distinguish 'armeabi-v7a-hard' and 'armeabi-v7a' library if target_os == 'android': @@ -78,21 +79,21 @@ def __prepare_lib(ienv, libname, lib = None, path = None, script = None): SConscript(st) else: if target_os in ['linux', 'darwin', 'tizen']: - print 'Don\'t find library(%s), please intall it, exit ...' % libname + print(('Don\'t find library(%s), please intall it, exit ...' % libname)) else: - print 'Don\'t find library(%s) and don\'t find the process script (%s), exit ...' % (libname, st) + print(('Don\'t find library(%s) and don\'t find the process script (%s), exit ...' % (libname, st))) Exit(1) conf.Finish() # Run configure command (usually it's done before build a library) def __configure(env, cwd, cmd) : - print "Configuring using [%s/%s] ..." % (cwd, cmd) + print(("Configuring using [%s/%s] ..." % (cwd, cmd))) # build it now (we need the shell, because some programs need it) devnull = open(os.devnull, "wb") handle = subprocess.Popen(cmd, shell=True, cwd=cwd, stdout=devnull) - if handle.wait() <> 0 : + if handle.wait() != 0 : raise SCons.Errors.BuildError( "Run configuring script [%s]" % (cmd) ) # Download from URL 'url', will save as 'target' @@ -101,15 +102,15 @@ def __download(ienv, target, url) : return target try : - print "Download %s from %s" % (target, url) - print "Downloading ..." - stream = urllib2.urlopen(url) + print(("Download %s from %s" % (target, url))) + print("Downloading ...") + stream = urllib.request.urlopen(url) file = open(target, 'wb') file.write(stream.read()) file.close() - print "Download %s from %s complete" % (target, url) + print(("Download %s from %s complete" % (target, url))) return target - except Exception, e : + except Exception as e : raise SCons.Errors.StopError( '%s [%s]' % (e, url) ) # Install header file(s) to /deps//include @@ -140,5 +141,6 @@ env.AddMethod(__download, "Download") env.AddMethod(__install_head_file, "InstallHeadFile") env.AddMethod(__install_lib, "InstallLib") -if env.get('SECURED') == '1': - SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'sqlite3', 'SConscript')) +if env.get('SECURED') == '1' or 'SERVER' in rd_mode: + if target_os not in ['linux', 'tizen']: + SConscript('#extlibs/sqlite3/SConscript')