0

This is my build environment

  • OS:OS X El Capitan 10.11.5
  • Android SDK build-tool : 24.0.1
  • Android NDK : 12
  • Scons version : 2.5.0

This is build command

  • SCons TARGET_OS=android TARGET_ARCH=armeabi-v7a TARGET_TRANSPORT=ALL RELEASE=1 SECURED=0 ANDROID_HOME=/Users/KangSengGil/Library/Android/sdk ANDROID_NDK=/Users/KangSengGil/Library/Android/sdk/ndk-bundle ANDROID_GRADLE=/Library/gradle-2.14.1/bin/gradle scons: Reading SConscript files ...

To obtain .aar file, I have to build Iotivity project. but Scons build is showing me some error. I don`t know How i solve this problem. Please Answer This problem!! Thank you

Below shows the error

NameError: name 'SCons' is not defined:
File "/Users/KangSengGil/Documents/iotivity-1.1.0/SConstruct", line 28:
SConscript('build_common/SConscript')
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 604:
return method(*args, **kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "/Users/KangSengGil/Documents/iotivity-1.1.0/build_common/SConscript", line 386:
env.SConscript(target_os + '/SConscript')
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "/Users/KangSengGil/Documents/iotivity-1.1.0/build_common/android/SConscript", line 241:
SConscript(env.get('SRC_DIR') + '/extlibs/boost/SConscript')
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 604:
return method(*args, **kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 541:
return _SConscript(self.fs, *files, **subst_kw)
File "/usr/local/lib/scons-2.5.0/SCons/Script/SConscript.py", line 250:
exec _file_ in call_stack[-1].globals
File "/Users/KangSengGil/Documents/iotivity-1.1.0/extlibs/boost/SConscript", line 35:
raise SCons.Errors.EnvironmentError(msg)

2 Answers2

0

Looks like a typo - please confirm. SCons command is not found. Maybe use 'scons' ?

Sanjeev BA
  • 307
  • 1
  • 6
0

Try it

edit <iotivity_root>/extlibs/boost/SConscript

befor

if host_os == 'linux2' :
    boost_bootstrap = boost_base_name+os.sep+'bootstrap.sh'
else :
    msg="Host platform (%s) is currently not supported for boost builds" % host_os
    raise SCons.Errors.EnvironmentError(msg)

after

if host_os == 'linux2' :
    boost_bootstrap = boost_base_name+os.sep+'bootstrap.sh'
else :
    if host_os == 'darwin' :
        boost_bootstrap = ''
    else :
        msg="Host platform (%s) is currently not supported for boost builds" % host_os
        raise SCons.Errors.EnvironmentError(msg)
Gecko
  • 1
  • Hi @Gecko , I tried something like this but still found same error like above , really appreaciate for any kind suggestion : if host_os.startswith("linux"): boost_bootstrap = boost_base_name + os.sep + 'bootstrap.sh' else: if host_os.startswith("darwin"): boost_bootstrap = '' else : msg = "Host platform (%s) is currently not supported for boost builds" % host_os raise SCons.Errors.EnvironmentError(msg) – Vierda Mila Nartila Apr 09 '18 at 02:26