1 ######################################################################
2 # ref. raxmpp 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')
13 build_path = Dir('.').abspath
15 with_ra_ibb = env.get('WITH_RA_IBB')
17 SRC_NAME = 'libstrophe'
18 EXT_NAME = 'libstrophe'
19 EXT_BASE = 'extlibs/' + EXT_NAME
20 EXT_PATH = EXT_BASE + '/' + SRC_NAME
21 SRC_PATH = base_dir + '/' + EXT_PATH
23 LIB_PATH = SRC_PATH + '/' + '.libs'
26 # check 'libstrophe' library, if it doesn't exits, ask user to download it
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/strophe/libstrophe.git ' + SRC_NAME,
30 'cd ' + SRC_NAME + ' && git checkout 527bc0573a52f2af3ecad5b9ef39aeec7b669f77'
33 print 'Downloading xmpp library ...'
34 if raxmpp_env.Execute(c):
36 *********************************** Error: ***********************************************
37 * Please download ra_xmpp as following:
38 * $ git clone https://github.com/strophe/libstrophe.git extlibs/libstrophe/libstrophe
39 * $ cd extlibs/libstrophe/libstrophe
40 * $ git checkout 527bc0573a52f2af3ecad5b9ef39aeec7b669f77
41 ******************************************************************************************
45 print 'Download xmpp library complete'
47 print 'Building with ' + SRC_NAME
48 #print 'base_dir', base_dir
49 #print 'target_os', target_os
50 #print 'target_arch', target_arch
52 foo=commands.getoutput('patch -N -p1 -d libstrophe < strophe-xmpp_conn_is_secured.patch')
56 #sconsflags = ' RELEASE=true' if env['RELEASE'] else ' RELEASE=false'
57 if not os.path.exists('configure') :
58 foo=commands.getoutput('./bootstrap.sh')
60 if not os.path.exists('config.status') :
61 foo=commands.getoutput('./configure')
63 if not os.path.exists('.libs/libstrophe.a') :
64 foo=commands.getoutput('make libstrophe.la')
66 if not os.path.exists('.libs/libstrophe.a') :
67 print 'Building with ' + SRC_NAME + ' failed.'
70 print 'Building with ' + SRC_NAME + ' Completely.'
71 env.AppendUnique(CPPPATH = [INC_PATH], RALIBS = ['strophe', 'ssl', 'crypto', 'resolv'], RALIBPATH = [LIB_PATH], RARPATH = [LIB_PATH])
73 if env.GetOption('clean') :
74 act = env.Action(['cd ' + SRC_PATH, 'make clean'])