[IOT-1294] Fixed build failure for WITH_RA_IBB flags
authorGeorge Nash <george.nash@intel.com>
Mon, 12 Sep 2016 22:42:20 +0000 (15:42 -0700)
committerDave Thaler <dthaler@microsoft.com>
Thu, 15 Sep 2016 00:56:07 +0000 (00:56 +0000)
When building code with the WITH_RA_IBB=1 the build
would fail with undefined references to code found in the external
code found in extlibs/libstrophe and extlibs/wksxmppxep.

The code was already being built but was not properly linked by the
linker. This commit adds the library paths and libraries needed to
pass the build.

Change-Id: Ia9a1a6c40f6eeed174caaeb428224b97ffb6b59d
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11715
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Rick Bell <richard.s.bell@intel.com>
Tested-by: Rick Bell <richard.s.bell@intel.com>
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
extlibs/libstrophe/SConscript
extlibs/wksxmppxep/SConscript
resource/csdk/connectivity/src/SConscript

index f774ecd..24177bf 100644 (file)
@@ -21,6 +21,7 @@ EXT_PATH = EXT_BASE + '/' + SRC_NAME
 SRC_PATH = base_dir + '/' + EXT_PATH
 INC_PATH = SRC_PATH
 LIB_PATH = SRC_PATH + '/' + '.libs'
+LIBSTROPHY_LIBS = ['strophe', 'ssl', 'crypto', 'resolv']
 
 if with_ra_ibb:
        # check 'libstrophe' library, if it doesn't exits, ask user to download it
@@ -68,8 +69,8 @@ if with_ra_ibb:
                Exit(2)
 
        print 'Building with ' + SRC_NAME + ' Completely.'
-       env.AppendUnique(CPPPATH = [INC_PATH], RALIBS = ['strophe', 'ssl', 'crypto', 'resolv'], RALIBPATH = [LIB_PATH], RARPATH = [LIB_PATH])
-
+       env.AppendUnique(CPPPATH = [INC_PATH], RALIBS = LIBSTROPHY_LIBS, RALIBPATH = [LIB_PATH], RARPATH = [LIB_PATH])
+       env.AppendUnique(LIBS= LIBSTROPHY_LIBS, LIBPATH = [LIB_PATH])
 if env.GetOption('clean') :
        act = env.Action(['cd ' + SRC_PATH, 'make clean'])
        env.Execute(act)
index c6bb6ce..649033f 100644 (file)
@@ -20,6 +20,7 @@ EXT_PATH = EXT_BASE + '/' + SRC_NAME
 SRC_PATH = base_dir + '/' + EXT_PATH
 INC_PATH = SRC_PATH + '/include'
 LIB_PATH = SRC_PATH
+WJSXMPPXEP_LIBS = ['wksxmppxep', 'm', 'crypto']
 
 if with_ra_ibb:
        env.SConscript(base_dir + '/extlibs/libstrophe/SConscript')
@@ -56,7 +57,9 @@ if with_ra_ibb:
 
        print 'Building with ' + SRC_NAME + ' Completely.'
 
-       env.PrependUnique(CPPPATH = [INC_PATH], RALIBS = ['wksxmppxep', 'm', 'crypto'], RALIBPATH = [LIB_PATH], RARPATH = [LIB_PATH])
+       env.PrependUnique(CPPPATH = [INC_PATH], RALIBS = WJSXMPPXEP_LIBS, RALIBPATH = [LIB_PATH], RARPATH = [LIB_PATH])
+       env.PrependUnique(LIBS = WJSXMPPXEP_LIBS, LIBPATH = [LIB_PATH])
+       env.PrependUnique(LIBS = ['boost_system', 'boost_thread'])
 
 if env.GetOption('clean') :
        act = env.Action(['cd ' + SRC_PATH, 'make clean'])
index b49e9c2..c305735 100644 (file)
@@ -10,6 +10,7 @@ ca_os = env.get('TARGET_OS')
 ca_transport = env.get('TARGET_TRANSPORT')
 secured = env.get('SECURED')
 with_ra = env.get ('WITH_RA')
+with_ra_ibb = env.get('WITH_RA_IBB')
 with_tcp = env.get('WITH_TCP')
 src_dir = env.get('SRC_DIR')
 root_dir = os.pardir
@@ -89,6 +90,9 @@ if ((secured == '1') and (with_tcp == True)):
 
 ca_common_src = None
 
+if with_ra_ibb:
+       env.SConscript('#extlibs/wksxmppxep/SConscript')
+
 if env.get('ROUTING') == 'GW':
        env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
 elif env.get('ROUTING') == 'EP':
@@ -209,6 +213,7 @@ if ca_os in ['android', 'tizen', 'linux']:
                lib_env.AppendUnique(LIBS = ['rt'])
                if ((lib_env.get('SECURED') == '1') and ((lib_env.get('WITH_TCP')) or (lib_env.get('WITH_CLOUD')))):
                        lib_env.AppendUnique(LIBS = ['mbedtls','mbedx509','mbedcrypto'])
+
        calib = lib_env.SharedLibrary('connectivity_abstraction', env.get('CA_SRC'))
 elif ca_os in ['msys_nt', 'windows']:
        lib_env.AppendUnique(LIBS = ['coap', 'mswsock', 'ws2_32', 'iphlpapi', 'logger'])
@@ -218,5 +223,6 @@ elif ca_os in ['msys_nt', 'windows']:
        calib = lib_env.StaticLibrary('connectivity_abstraction', env.get('CA_SRC'))
 else:
        calib = lib_env.StaticLibrary('connectivity_abstraction', lib_env.get('CA_SRC'))
+
 lib_env.InstallTarget(calib, 'connectivity_abstraction')
 lib_env.UserInstallTargetLib(calib, 'connectivity_abstraction')