[IOT-1294] install libraries when building WITH_RA_IBB flag
authorGeorge Nash <george.nash@intel.com>
Thu, 15 Sep 2016 21:14:07 +0000 (14:14 -0700)
committerRick Bell <richard.s.bell@intel.com>
Fri, 16 Sep 2016 18:51:49 +0000 (18:51 +0000)
When building with the TEST option the libraries will be picked
up at run time.

Changed the order of libraries to prevent linker error related
to the pthread library.

Change-Id: I39e70dc33b774dcf46559306df0c5558975ec451
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11851
Reviewed-by: Dave Thaler <dthaler@microsoft.com>
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>
extlibs/libstrophe/SConscript
extlibs/wksxmppxep/SConscript

index 24177bf..9d20cb2 100644 (file)
@@ -45,32 +45,40 @@ if with_ra_ibb:
                else:
                        print 'Download xmpp library complete'
 
-       print 'Building with ' + SRC_NAME
-       #print 'base_dir', base_dir
-       #print 'target_os', target_os
-       #print 'target_arch', target_arch
-
-       foo=commands.getoutput('patch -N -p1 -d libstrophe < strophe-xmpp_conn_is_secured.patch')
-       print foo
-
-       os.chdir(SRC_NAME)
-       #sconsflags = ' RELEASE=true' if  env['RELEASE'] else ' RELEASE=false'
-       if not os.path.exists('configure') :
-               foo=commands.getoutput('./bootstrap.sh')
-               print foo
-       if not os.path.exists('config.status') :
-               foo=commands.getoutput('./configure')
+       if not env.GetOption('clean'):
+               print 'Building with ' + SRC_NAME
+               #print 'base_dir', base_dir
+               #print 'target_os', target_os
+               #print 'target_arch', target_arch
+       
+               foo=commands.getoutput('patch -N -p1 -d libstrophe < strophe-xmpp_conn_is_secured.patch')
                print foo
-       if not os.path.exists('.libs/libstrophe.a') :
-               foo=commands.getoutput('make libstrophe.la')
-               print foo
-       if not os.path.exists('.libs/libstrophe.a') :
-               print 'Building with ' + SRC_NAME + ' failed.'
-               Exit(2)
+               os.chdir(SRC_NAME)
+               #sconsflags = ' RELEASE=true' if  env['RELEASE'] else ' RELEASE=false'
+               if not os.path.exists('configure') :
+                       foo=commands.getoutput('./bootstrap.sh')
+                       print foo
+               if not os.path.exists('config.status') :
+                       foo=commands.getoutput('./configure')
+                       print foo
+               if not os.path.exists('.libs/libstrophe.a') :
+                       foo=commands.getoutput('make libstrophe.la')
+                       print foo
+               if not os.path.exists('.libs/libstrophe.a') :
+                       print 'Building with ' + SRC_NAME + ' failed.'
+                       Exit(2)
+               else:
+                       foo = commands.getoutput('cp .libs/libstrophe.a ' + env.get('BUILD_DIR'))
+                       foo = commands.getoutput('cp .libs/libstrophe.so* ' + env.get('BUILD_DIR'))
+                       print foo
 
-       print 'Building with ' + SRC_NAME + ' Completely.'
+               print 'Building with ' + SRC_NAME + ' Completely.'
        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') :
+
+if env.GetOption('clean'):
        act = env.Action(['cd ' + SRC_PATH, 'make clean'])
        env.Execute(act)
+       if os.path.isfile(env.get('BUILD_DIR') + '/libstrophe.a'):
+               act2 = env.Action(['rm ' + env.get('BUILD_DIR') + '/libstrophe.*'])
+               env.Execute(act2)
index 649033f..f8e9b2c 100644 (file)
@@ -44,23 +44,31 @@ if with_ra_ibb:
                else:
                        print 'Download', SRC_NAME, 'library complete'
 
-       print 'Building with ' + SRC_NAME
-       os.chdir(SRC_NAME)
-       if not os.path.exists('libwksxmppxep.so') :
-               LIBSTROPHE_BASE=base_dir + '/extlibs/libstrophe/libstrophe'
-               foo=commands.getoutput('make LIBSTROPHE_BASE=' + LIBSTROPHE_BASE + ' libraries')
-               print foo
-
-       if not os.path.exists('libwksxmppxep.so') :
-               print 'Building with ' + SRC_NAME + ' failed.'
-               Exit(2)
-
-       print 'Building with ' + SRC_NAME + ' Completely.'
+       if not env.GetOption('clean'):
+               print 'Building with ' + SRC_NAME
+               os.chdir(SRC_NAME)
+               if not os.path.exists('libwksxmppxep.so') :
+                       LIBSTROPHE_BASE=base_dir + '/extlibs/libstrophe/libstrophe'
+                       foo=commands.getoutput('make LIBSTROPHE_BASE=' + LIBSTROPHE_BASE + ' libraries')
+                       print foo
+               if not os.path.exists('libwksxmppxep.so') :
+                       print 'Building with ' + SRC_NAME + ' failed.'
+                       Exit(2)
+               else:
+                       foo = commands.getoutput('cp libwksxmppxep.so ' + env.get('BUILD_DIR'))
+                       print foo
+                       foo = commands.getoutput('cp libwksxmppxep.a ' + env.get('BUILD_DIR'))
+                       print foo
+       
+               print 'Building with ' + SRC_NAME + ' Completely.'
 
        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'])
+       env.AppendUnique(LIBS = WJSXMPPXEP_LIBS, LIBPATH = [LIB_PATH])
+       env.AppendUnique(LIBS = ['boost_system', 'boost_thread'])
 
 if env.GetOption('clean') :
        act = env.Action(['cd ' + SRC_PATH, 'make clean'])
        env.Execute(act)
+       if os.path.isfile(env.get('BUILD_DIR') + '/libwksxmppxep.so'):
+               act2 = env.Action(['rm ' + env.get('BUILD_DIR') + '/libwksxmppxep.*'])
+               env.Execute(act2)
\ No newline at end of file