# This script manages external libraries
#
# Some methods are added to manage external packages:
-# 'PrepareLib': Checks the existence of an external library, if it
+# 'PrepareLib': Checks the existence of an external library, if it
# doesn't exist, calls the script user provided to download(if required)
# and build the source code of the external library or notify user to
# install the library.
# 'InstallLib': Install library binaries(.so, .a etc)
#
# By default, assume the script for an exteranl library is:
-# <src_dir>/extlibs/<libname>/SConscript
+# <src_dir>/extlibs/<libname>/SConscript
#
# Note: After the external library is built:
# Head files should be installed to <src_dir>/deps/<target_os>/include
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 <src_dir>/deps/<target_os>/include
# the library binaries are in <src_dir>/deps/<target_os>/lib/<arch>
if target_os not in ['windows']:
# download the source code and build it
# @param libname - the name of the library try to prepare
# @param lib - the lib(.so, .a etc) to check (a library may include more then
-# one lib, e.g. boost, includes boost_thread, boost_system ...
+# one lib, e.g. boost, includes boost_thread, boost_system ...
# @param path - the directory of the library building script, if it's not set,
# by default, it's <src_dir>/extlibs/<libname>/
# @param script - the building script, by default, it's 'SConscript'
env.AddMethod(__install_head_file, "InstallHeadFile")
env.AddMethod(__install_lib, "InstallLib")
-if env.get('SECURED') == '1' and target_os != 'tizen':
- SConscript(os.path.join(env.get('SRC_DIR'), 'extlibs', 'sqlite3', 'SConscript'))
-
-if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
- if target_os not in ['tizen']:
- 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')