## # This script manages external libraries # # By default, assume the script for an exteranl library is: # /extlibs//SConscript # # Note: After the external library is built: # Head files should be installed to /deps//include # lib(e.g .so, .a) should be installed to /deps//lib/ # ## import os 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': if target_arch == 'armeabi-v7a-hard': target_arch = 'armeabi-v7a' env.AppendUnique(CCFLAGS = ['-D__JAVA__']) if target_os == 'darwin': env.AppendUnique(CPPPATH = ['/usr/local/include']) env.AppendUnique(LIBPATH = ['/usr/local/lib']) if env.get('BUILD_JAVA') == True and target_os != 'android': if env.get('JAVA_HOME') != None: env.AppendUnique(CCFLAGS = ['-D__JAVA__']) env.AppendUnique(CPPPATH = [ env.get('JAVA_HOME') + '/include', env.get('JAVA_HOME') + '/include/' + target_os ]) else: raise SCons.Errors.StopError( 'BUILD_JAVA is specified, but JAVA_HOME is not set.') # External library include files are in /deps//include # the library binaries are in /deps//lib/ 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)]) # tinycbor build/fetch SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'tinycbor', 'SConscript')) #cJSON lib SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'cjson', 'SConscript')) with_ra = env.get('WITH_RA') 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')) if env.get('SECURED') == '1' or 'SERVER' in rd_mode: if target_os not in ['linux', 'tizen']: SConscript('#extlibs/sqlite3/SConscript')