#
##
import os, subprocess
-import urllib2, urlparse
+import urllib.request, urllib.error, urllib.parse, urllib.parse
import SCons.Errors
Import('env')
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'
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 <src_dir>/deps/<target_os>/include