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'
24 LIBSTROPHY_LIBS = ['strophe', 'ssl', 'crypto', 'resolv']
27 # check 'libstrophe' library, if it doesn't exits, ask user to download it
28 if not os.path.exists(SRC_NAME):
29 raxmpp_env = Environment(ENV = os.environ)
30 c = raxmpp_env.Action(['git clone https://github.com/strophe/libstrophe.git ' + SRC_NAME,
31 'cd ' + SRC_NAME + ' && git checkout 527bc0573a52f2af3ecad5b9ef39aeec7b669f77'
34 print('Downloading xmpp library ...')
35 if raxmpp_env.Execute(c):
37 *********************************** Error: ***********************************************
38 * Please download ra_xmpp as following:
39 * $ git clone https://github.com/strophe/libstrophe.git extlibs/libstrophe/libstrophe
40 * $ cd extlibs/libstrophe/libstrophe
41 * $ git checkout 527bc0573a52f2af3ecad5b9ef39aeec7b669f77
42 ******************************************************************************************
46 print('Download xmpp library complete')
48 if not env.GetOption('clean'):
49 print('Building with ' + SRC_NAME)
50 #print 'base_dir', base_dir
51 #print 'target_os', target_os
52 #print 'target_arch', target_arch
54 foo=subprocess.getoutput('patch -N -p1 -d libstrophe < strophe-xmpp_conn_is_secured.patch')
57 #sconsflags = ' RELEASE=true' if env['RELEASE'] else ' RELEASE=false'
58 if not os.path.exists('configure') :
59 foo=subprocess.getoutput('./bootstrap.sh')
61 if not os.path.exists('config.status') :
62 foo=subprocess.getoutput('./configure')
64 if not os.path.exists('.libs/libstrophe.a') :
65 foo=subprocess.getoutput('make libstrophe.la')
67 if not os.path.exists('.libs/libstrophe.a') :
68 print('Building with ' + SRC_NAME + ' failed.')
71 foo = subprocess.getoutput('cp .libs/libstrophe.a ' + env.get('BUILD_DIR'))
72 foo = subprocess.getoutput('cp .libs/libstrophe.so* ' + env.get('BUILD_DIR'))
75 print('Building with ' + SRC_NAME + ' Completely.')
76 env.AppendUnique(CPPPATH = [INC_PATH], RALIBS = LIBSTROPHY_LIBS, RALIBPATH = [LIB_PATH], RARPATH = [LIB_PATH])
77 env.AppendUnique(LIBS= LIBSTROPHY_LIBS, LIBPATH = [LIB_PATH])
79 if env.GetOption('clean'):
80 act = env.Action(['cd ' + SRC_PATH, 'make clean'])
82 if os.path.isfile(env.get('BUILD_DIR') + '/libstrophe.a'):
83 act2 = env.Action(['rm ' + env.get('BUILD_DIR') + '/libstrophe.*'])