Trying to unravel some stuff, I come across this.
external_libs.scons makes this claim at the top:
# Note: After the external library is built:
# Head files should be installed to <src_dir>/deps/<target_os>/include
# lib(e.g .so, .a) should be installed to
<src_dir>/deps/<target_os>/lib/<arch>
and later follows it up with adding those paths to the build environment:
# 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']:
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)])
However, it seems the claim is not true: nothing is ever put in
<src_dir>/deps in a Linux build, apparently the extlibs scripts have
moved on from there. (and on an experimental Mac build, I even saw in
the log file a complaint about deps not being found)
Is it okay to remove this chunk?
===
To continue the fun, external_builders.scons defines methods used for
installation that would seem to support the above claim, but then
doesn't do what it claims:
# Install header file(s) to <src_dir>/deps/<target_os>/include
def __install_head_file(ienv, file):
return ienv.Install(
os.path.join(
env.get('SRC_DIR'), 'dep', target_os, target_arch, 'usr',
'include'), file)
# Install library binaries to <src_dir>/deps/<target_os>/lib/<arch>
def __install_lib(ienv, lib):
return ienv.Install(
os.path.join( env.get('SRC_DIR'), 'dep', target_os, target_arch,
'usr', 'lib'), lib)
Notice that while the comments (matching those in external_libs.scons)
say "deps" the code actually uses "dep".
That script sets those two functions as scons methods InstallHeadFile
and InstallLib, but those two methods are never used in the entire
iotivity code base.
So it seems like the material in these two scripts is just dead code.
===
Finally, the android build DOES do something with this stuff, the
build_common android script contains this:
# Determine dependency faux SYS_ROOT
dep_sys_root = os.path.join(env.get('SRC_DIR'), 'dep', 'android',
target_arch, 'usr')
dep_src_dir = os.path.join(dep_sys_root, 'include')
dep_lib_dir = os.path.join(dep_sys_root, 'lib')
env['DEP_SYS_ROOT'] = dep_sys_root
# Add external libraries including boost
env.AppendUnique(CPPPATH=[dep_src_dir])
env.AppendUnique(LIBPATH=[dep_lib_dir])
and indeed on a build targeting Android, boost (libraries and headers)
is indeed is put in a tree beginning with the name "dep". That's because
extlibs/boost/SConscript fetches DEP_SYS_ROOT and uses it; it does not
use the install functions that were described in the previous chunk.
====
Suggestions for best way to clean this up?
_______________________________________________
iotivity-dev mailing list
[email protected]
https://lists.iotivity.org/mailman/listinfo/iotivity-dev