Fix build error with scons-4.4.0 version which is based on python3
[platform/upstream/iotivity.git] / extlibs / libstrophe / SConscript
index 9d20cb2..c8e0b65 100644 (file)
@@ -3,7 +3,7 @@
 #
 ######################################################################
 import os
-import commands
+import subprocess
 
 Import('env')
 
@@ -31,48 +31,48 @@ if with_ra_ibb:
                        'cd ' + SRC_NAME + ' && git checkout 527bc0573a52f2af3ecad5b9ef39aeec7b669f77'
                        ])
 
-               print 'Downloading xmpp library ...'
+               print('Downloading xmpp library ...')
                if raxmpp_env.Execute(c):
-                       print '''
+                       print('''
        *********************************** Error: ***********************************************
        * Please download ra_xmpp as following:
        *     $ git clone https://github.com/strophe/libstrophe.git extlibs/libstrophe/libstrophe
        *     $ cd  extlibs/libstrophe/libstrophe
        *     $ git checkout 527bc0573a52f2af3ecad5b9ef39aeec7b669f77
        ******************************************************************************************
-       '''
+       ''')
                        Exit(1)
                else:
-                       print 'Download xmpp library complete'
+                       print('Download xmpp library complete')
 
        if not env.GetOption('clean'):
-               print 'Building with ' + SRC_NAME
+               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
+               foo=subprocess.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
+                       foo=subprocess.getoutput('./bootstrap.sh')
+                       print(foo)
                if not os.path.exists('config.status') :
-                       foo=commands.getoutput('./configure')
-                       print foo
+                       foo=subprocess.getoutput('./configure')
+                       print(foo)
                if not os.path.exists('.libs/libstrophe.a') :
-                       foo=commands.getoutput('make libstrophe.la')
-                       print foo
+                       foo=subprocess.getoutput('make libstrophe.la')
+                       print(foo)
                if not os.path.exists('.libs/libstrophe.a') :
-                       print 'Building with ' + SRC_NAME + ' failed.'
+                       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
+                       foo = subprocess.getoutput('cp .libs/libstrophe.a ' + env.get('BUILD_DIR'))
+                       foo = subprocess.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])