1 ######################################################################
2 # Ref. libstrophe library build script
4 ######################################################################
10 base_dir = env.get('SRC_DIR')
11 target_os = env.get('TARGET_OS')
12 target_arch = env.get('TARGET_ARCH')
14 with_ra_ibb = env.get('WITH_RA_IBB')
16 SRC_NAME = 'wks_xep0047'
17 EXT_NAME = 'wksxmppxep'
18 EXT_BASE = 'extlibs/' + EXT_NAME
19 EXT_PATH = EXT_BASE + '/' + SRC_NAME
20 SRC_PATH = base_dir + '/' + EXT_PATH
21 INC_PATH = SRC_PATH + '/include'
23 WJSXMPPXEP_LIBS = ['wksxmppxep', 'm', 'crypto']
26 env.SConscript(base_dir + '/extlibs/libstrophe/SConscript')
27 if not os.path.exists(SRC_NAME):
28 raxmpp_env = Environment(ENV = os.environ)
29 c = raxmpp_env.Action(['git clone https://github.com/WorksSystems/wks_xep0047.git ' + SRC_NAME,
30 'cd ' + SRC_NAME + ' && git checkout 8e9f42d02a0f416001065d1cddc1ab07974cef14'
33 print 'Downloading', SRC_NAME ,'library ...'
34 if raxmpp_env.Execute(c):
36 *********************************** Error: ***********************************************
37 * Please download ra_xmpp as following:
38 * $ git clone https://github.com/WorksSystems/wksxmpp_chat.git extlibs/wksxmppxep/wksxmpp_chat
39 * $ cd extlibs/wksxmppxep/wksxmpp_chat
40 * $ git checkout 8e9f42d02a0f416001065d1cddc1ab07974cef14
41 ******************************************************************************************
45 print 'Download', SRC_NAME, 'library complete'
47 if not env.GetOption('clean'):
48 print 'Building with ' + SRC_NAME
50 if not os.path.exists('libwksxmppxep.so') :
51 LIBSTROPHE_BASE=base_dir + '/extlibs/libstrophe/libstrophe'
52 foo=commands.getoutput('make LIBSTROPHE_BASE=' + LIBSTROPHE_BASE + ' libraries')
54 if not os.path.exists('libwksxmppxep.so') :
55 print 'Building with ' + SRC_NAME + ' failed.'
58 foo = commands.getoutput('cp libwksxmppxep.so ' + env.get('BUILD_DIR'))
60 foo = commands.getoutput('cp libwksxmppxep.a ' + env.get('BUILD_DIR'))
63 print 'Building with ' + SRC_NAME + ' Completely.'
65 env.PrependUnique(CPPPATH = [INC_PATH], RALIBS = WJSXMPPXEP_LIBS, RALIBPATH = [LIB_PATH], RARPATH = [LIB_PATH])
66 env.AppendUnique(LIBS = WJSXMPPXEP_LIBS, LIBPATH = [LIB_PATH])
67 env.AppendUnique(LIBS = ['boost_system', 'boost_thread'])
69 if env.GetOption('clean') :
70 act = env.Action(['cd ' + SRC_PATH, 'make clean'])
72 if os.path.isfile(env.get('BUILD_DIR') + '/libwksxmppxep.so'):
73 act2 = env.Action(['rm ' + env.get('BUILD_DIR') + '/libwksxmppxep.*'])