#
##
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':
# External library include files are in <src_dir>/deps/<target_os>/include
# the library binaries are in <src_dir>/deps/<target_os>/lib/<arch>
-env.AppendUnique(CPPPATH = [os.path.join(env.get('SRC_DIR'), 'deps', target_os, 'include')])
-env.AppendUnique(LIBPATH = [os.path.join(env.get('SRC_DIR'), 'deps', target_os, 'lib', target_arch)])
+if target_os not in ['windows']:
+ env.AppendUnique(CPPPATH = [os.path.join(env.get('SRC_DIR'), 'deps', target_os, 'include')])
+ env.AppendUnique(LIBPATH = [os.path.join(env.get('SRC_DIR'), 'deps', target_os, 'lib', target_arch)])
# Check whether a library exists, if not, notify user to install it or try to
# download the source code and build it
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
if with_ra:
SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'raxmpp', 'SConscript'))
+with_ra_ibb = env.get('WITH_RA_IBB')
+if with_ra_ibb:
+ SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'wksxmppxep', 'SConscript'))
+
env.AddMethod(__prepare_lib, "PrepareLib")
env.AddMethod(__configure, "Configure")
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'))
\ No newline at end of file
+if env.get('SECURED') == '1' or 'SERVER' in rd_mode:
+ if target_os not in ['linux', 'tizen']:
+ SConscript('#extlibs/sqlite3/SConscript')