Fixed build issue with SECURED=0 option
[platform/upstream/iotivity.git] / extlibs / wksxmppxep / SConscript
index f30b3cd..f8e9b2c 100644 (file)
@@ -20,13 +20,14 @@ 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')
        if not os.path.exists(SRC_NAME):
                raxmpp_env = Environment(ENV = os.environ)
                c = raxmpp_env.Action(['git clone https://github.com/WorksSystems/wks_xep0047.git ' + SRC_NAME,
-                       'cd ' + SRC_NAME + ' && git checkout 1d2edd460c0e85e2b647176e74ebbe519e6019de'
+                       'cd ' + SRC_NAME + ' && git checkout 8e9f42d02a0f416001065d1cddc1ab07974cef14'
         ])
 
                print 'Downloading', SRC_NAME ,'library ...'
@@ -36,20 +37,38 @@ if with_ra_ibb:
        * Please download ra_xmpp as following:
        *     $ git clone https://github.com/WorksSystems/wksxmpp_chat.git extlibs/wksxmppxep/wksxmpp_chat
        *     $ cd extlibs/wksxmppxep/wksxmpp_chat
-       *     $ git checkout 9f5d726df9779bec5d3036acfbca70c97958921d
+       *     $ git checkout 8e9f42d02a0f416001065d1cddc1ab07974cef14
        ******************************************************************************************
        '''
                        Exit(1)
                else:
                        print 'Download', SRC_NAME, 'library complete'
 
-       os.chdir(SRC_NAME)
-       if not os.path.exists(SRC_NAME + '/libwksxmppxep.so') :
-               LIBSTROPHE_BASE=base_dir + '/extlibs/libstrophe/libstrophe'
-               foo=commands.getoutput('make LIBSTROPHE_BASE=' + LIBSTROPHE_BASE + ' libraries')
-               #print foo
-       env.PrependUnique(CPPPATH = [INC_PATH], RALIBS = ['wksxmppxep', 'm', 'crypto'], RALIBPATH = [LIB_PATH], RARPATH = [LIB_PATH])
+       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.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