Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 1 | """ Post process SWIG Bridge wrapper code Python script for Windows/LINUX/OSX platform |
| 2 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 3 | -------------------------------------------------------------------------- |
| 4 | File: finishSwigWrapperClasses.py |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 5 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 6 | Overview: Python script(s) to finish off the SWIG Python C++ Script |
| 7 | Bridge wrapper code on the Windows/LINUX/OSX platform. |
| 8 | The Python scripts are equivalent to the shell script (.sh) |
| 9 | files. |
| 10 | We use SWIG to create a C++ file containing the appropriate |
| 11 | wrapper classes and functions for each scripting language, |
| 12 | before liblldb is built (thus the C++ file can be compiled |
| 13 | into liblldb. In some cases, additional work may need to be |
| 14 | done after liblldb has been compiled, to make the scripting |
| 15 | language stuff fully functional. Any such post-processing |
| 16 | is handled through the Python scripts called here. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 17 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 18 | Gotchas: None. |
| 19 | |
| 20 | Copyright: None. |
| 21 | -------------------------------------------------------------------------- |
| 22 | |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 23 | """ |
| 24 | |
| 25 | # Python modules: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 26 | import sys # Provide argument parsing |
| 27 | import os # Provide directory and file handling |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 28 | |
| 29 | # Third party modules: |
| 30 | |
| 31 | # In-house modules: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 32 | import utilsArgsParse # Parse and validate this script's input arguments |
| 33 | import utilsOsType # Determine the OS type this script is running on |
| 34 | import utilsDebug # Debug Python scripts |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 35 | |
| 36 | # Instantiations: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 37 | gbDbgVerbose = False; # True = Turn on script function tracing, False = off. |
| 38 | gbDbgFlag = False; # Global debug mode flag, set by input parameter |
| 39 | # --dbgFlag. True = operate in debug mode. |
| 40 | gbMakeFileFlag = False; # True = yes called from makefile system, False = not. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 41 | |
| 42 | # User facing text: |
| 43 | strMsgErrorNoMain = "Program called by another Python script not allowed"; |
| 44 | strExitMsgSuccess = "Program successful"; |
| 45 | strExitMsgError = "Program error: "; |
| 46 | strParameter = "Parameter: "; |
| 47 | strMsgErrorOsTypeUnknown = "Unable to determine OS type" |
| 48 | strScriptDirNotFound = "Unable to locate the script directory \'/script\'"; |
| 49 | strScriptLangsFound = "Found the following script languages:"; |
| 50 | strPostProcessError = "Executing \'%s\' post process script failed: "; |
| 51 | strScriptNotFound = "Unable to locate the post process script file \'%s\' in \'%s\'"; |
| 52 | strScriptLangFound = "Found \'%s\' build script."; |
| 53 | strScriptLangsFound = "Found the following script languages:"; |
| 54 | strExecuteMsg = "Executing \'%s\' build script..."; |
| 55 | strExecuteError = "Executing \'%s\' build script failed: "; |
| 56 | strHelpInfo = "\ |
| 57 | Python script(s) to finish off the SWIG Python C++ Script \n\ |
| 58 | Bridge wrapper code on the Windows/LINUX/OSX platform. The Python \n\ |
| 59 | scripts are equivalent to the shell script (.sh) files \n\ |
| 60 | run on others platforms.\n\ |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 61 | Args: -h (optional) Print help information on this program.\n\ |
| 62 | -d (optional) Determines whether or not this script\n\ |
| 63 | outputs additional information when running.\n\ |
| 64 | -m (optional) Specify called from Makefile system.\n\ |
| 65 | --srcRoot= The root of the lldb source tree.\n\ |
| 66 | --targetDir= Where the lldb framework/shared library gets put.\n\ |
| 67 | --cfgBldDir= (optional) Where the build-swig-Python-LLDB.py program \n\ |
| 68 | will put the lldb.py file it generated from running\n\ |
| 69 | SWIG.\n\ |
| 70 | --prefix= (optional) Is the root directory used to determine where\n\ |
| 71 | third-party modules for scripting languages should\n\ |
| 72 | be installed. Where non-Darwin systems want to put\n\ |
| 73 | the .py and .so files so that Python can find them\n\ |
| 74 | automatically. Python install directory.\n\ |
| 75 | --cmakeBuildConfiguration= (optional) Is the build configuration(Debug, Release, RelWithDebugInfo)\n\ |
| 76 | used to determine where the bin and lib directories are \n\ |
| 77 | created for a Windows build.\n\ |
| 78 | --argsFile= The args are read from a file instead of the\n\ |
| 79 | command line. Other command line args are ignored.\n\ |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 80 | \n\ |
| 81 | Usage:\n\ |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 82 | finishSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath\n\ |
| 83 | --cfgBldDir=ADirPath --prefix=ADirPath -m -d\n\ |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 84 | \n\ |
| 85 | "; #TAG_PROGRAM_HELP_INFO |
| 86 | |
| 87 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 88 | # Details: Exit the program on success. Called on program successfully done |
| 89 | # its work. Returns a status result to the caller. |
| 90 | # Args: vnResult - (R) 0 or greater indicating success. |
| 91 | # vMsg - (R) Success message if any to show success to user. |
| 92 | # Returns: None. |
| 93 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 94 | #-- |
| 95 | def program_exit_success( vnResult, vMsg ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 96 | strMsg = ""; |
| 97 | |
Ed Maste | b933fb2 | 2015-03-20 19:59:35 +0000 | [diff] [blame] | 98 | if vMsg.__len__() != 0: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 99 | strMsg = "%s: %s (%d)" % (strExitMsgSuccess, vMsg, vnResult); |
Ed Maste | b933fb2 | 2015-03-20 19:59:35 +0000 | [diff] [blame] | 100 | print strMsg; |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 101 | |
| 102 | sys.exit( vnResult ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 103 | |
| 104 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 105 | # Details: Exit the program with error. Called on exit program failed its |
| 106 | # task. Returns a status result to the caller. |
| 107 | # Args: vnResult - (R) A negative number indicating error condition. |
| 108 | # vMsg - (R) Error message to show to user. |
| 109 | # Returns: None. |
| 110 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 111 | #-- |
| 112 | def program_exit_on_failure( vnResult, vMsg ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 113 | print "%s%s (%d)" % (strExitMsgError, vMsg, vnResult); |
| 114 | sys.exit( vnResult ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 115 | |
| 116 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 117 | # Details: Exit the program return a exit result number and print a message. |
| 118 | # Positive numbers and zero are returned for success other error |
| 119 | # occurred. |
| 120 | # Args: vnResult - (R) A -ve (an error), 0 or +ve number (ok or status). |
| 121 | # vMsg - (R) Error message to show to user. |
| 122 | # Returns: None. |
| 123 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 124 | #-- |
| 125 | def program_exit( vnResult, vMsg ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 126 | if vnResult >= 0: |
| 127 | program_exit_success( vnResult, vMsg ); |
| 128 | else: |
| 129 | program_exit_on_failure( vnResult, vMsg ); |
| 130 | |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 131 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 132 | # Details: Dump input parameters. |
| 133 | # Args: vDictArgs - (R) Map of input args to value. |
| 134 | # Returns: None. |
| 135 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 136 | #-- |
| 137 | def print_out_input_parameters( vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 138 | for arg, val in vDictArgs.iteritems(): |
| 139 | strEqs = ""; |
| 140 | strQ = ""; |
| 141 | if val.__len__() != 0: |
| 142 | strEqs = " ="; |
| 143 | strQ = "\""; |
| 144 | print "%s%s%s %s%s%s\n" % (strParameter, arg, strEqs, strQ, val, strQ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 145 | |
| 146 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 147 | # Details: Validate the arguments passed to the program. This function exits |
| 148 | # the program should error with the arguments be found. |
| 149 | # Args: vArgv - (R) List of arguments and values. |
| 150 | # Returns: Int - 0 = success, -ve = some failure. |
| 151 | # Dict - Map of arguments names to argument values |
| 152 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 153 | #-- |
| 154 | def validate_arguments( vArgv ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 155 | dbg = utilsDebug.CDebugFnVerbose( "validate_arguments()" ); |
| 156 | strMsg = ""; |
| 157 | dictArgs = {}; |
| 158 | nResult = 0; |
| 159 | strListArgs = "hdm"; # Format "hiox:" = -h -i -o -x <arg> |
| 160 | listLongArgs = ["srcRoot=", "targetDir=", "cfgBldDir=", "prefix=", "cmakeBuildConfiguration=", |
Zachary Turner | 0405d68 | 2015-04-22 22:53:18 +0000 | [diff] [blame] | 161 | "argsFile"]; |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 162 | dictArgReq = { "-h": "o", # o = optional, m = mandatory |
| 163 | "-d": "o", |
| 164 | "-m": "o", |
| 165 | "--srcRoot": "m", |
| 166 | "--targetDir": "m", |
| 167 | "--cfgBldDir": "o", |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 168 | "--prefix": "o", |
| 169 | "--cmakeBuildConfiguration": "o", |
| 170 | "--argsFile": "o" }; |
| 171 | |
| 172 | # Check for mandatory parameters |
| 173 | nResult, dictArgs, strMsg = utilsArgsParse.parse( vArgv, strListArgs, |
| 174 | listLongArgs, |
| 175 | dictArgReq, |
| 176 | strHelpInfo ); |
| 177 | if nResult < 0: |
| 178 | program_exit_on_failure( nResult, strMsg ); |
| 179 | |
| 180 | # User input -h for help |
| 181 | if nResult == 1: |
| 182 | program_exit_success( 0, strMsg ); |
| 183 | |
| 184 | return (nResult, dictArgs); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 185 | |
| 186 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 187 | # Details: Locate post process script language directory and the script within |
| 188 | # and execute. |
| 189 | # Args: vStrScriptLang - (R) Name of the script language to build. |
| 190 | # vstrFinishFileName - (R) Prefix file name to build full name. |
| 191 | # vDictArgs - (R) Program input parameters. |
| 192 | # Returns: Int - 0 = Success, < 0 some error condition. |
| 193 | # Str - Error message. |
| 194 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 195 | #-- |
| 196 | def run_post_process( vStrScriptLang, vstrFinishFileName, vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 197 | dbg = utilsDebug.CDebugFnVerbose( "run_post_process()" ); |
| 198 | nResult = 0; |
| 199 | strStatusMsg = ""; |
| 200 | strScriptFile = vstrFinishFileName % vStrScriptLang; |
Zachary Turner | eaa9266 | 2015-04-03 17:19:43 +0000 | [diff] [blame] | 201 | strScriptFileDir = os.path.normpath(os.path.join(vDictArgs["--srcRoot"], "scripts", vStrScriptLang)); |
| 202 | strScriptFilePath = os.path.join(strScriptFileDir, strScriptFile); |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 203 | |
| 204 | # Check for the existence of the script file |
| 205 | strPath = os.path.normcase( strScriptFilePath ); |
| 206 | bOk = os.path.exists( strPath ); |
| 207 | if bOk == False: |
| 208 | strDir = os.path.normcase( strScriptFileDir ); |
| 209 | strStatusMsg = strScriptNotFound % (strScriptFile, strDir); |
| 210 | return (-9, strStatusMsg); |
| 211 | |
| 212 | if gbDbgFlag: |
| 213 | print strScriptLangFound % vStrScriptLang; |
| 214 | print strExecuteMsg % vStrScriptLang; |
| 215 | |
| 216 | # Change where Python looks for our modules |
| 217 | strDir = os.path.normcase( strScriptFileDir ); |
| 218 | sys.path.append( strDir ); |
| 219 | |
| 220 | # Execute the specific language script |
| 221 | dictArgs = vDictArgs; # Remove any args not required before passing on |
| 222 | strModuleName = strScriptFile[ : strScriptFile.__len__() - 3 ]; |
| 223 | module = __import__( strModuleName ); |
| 224 | nResult, strStatusMsg = module.main( dictArgs ); |
| 225 | |
| 226 | # Revert sys path |
| 227 | sys.path.remove( strDir ); |
| 228 | |
| 229 | return (nResult, strStatusMsg); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 230 | |
| 231 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 232 | # Details: Step through each script language sub directory supported |
| 233 | # and execute post processing script for each scripting language, |
| 234 | # make sure the build script for that language exists. |
| 235 | # For now the only language we support is Python, but we expect this |
| 236 | # to change. |
| 237 | # Args: vDictArgs - (R) Program input parameters. |
| 238 | # Returns: Int - 0 = Success, < 0 some error condition. |
| 239 | # Str - Error message. |
| 240 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 241 | #-- |
| 242 | def run_post_process_for_each_script_supported( vDictArgs ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 243 | dbg = utilsDebug.CDebugFnVerbose( "run_post_process_for_each_script_supported()" ); |
| 244 | nResult = 0; |
| 245 | strStatusMsg = ""; |
Zachary Turner | eaa9266 | 2015-04-03 17:19:43 +0000 | [diff] [blame] | 246 | strScriptDir = os.path.normpath(os.path.join(vDictArgs["--srcRoot"], "scripts")); |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 247 | strFinishFileName = "finishSwig%sLLDB.py"; |
| 248 | |
| 249 | # Check for the existence of the scripts folder |
| 250 | strScriptsDir = os.path.normcase( strScriptDir ); |
| 251 | bOk = os.path.exists( strScriptsDir ); |
| 252 | if bOk == False: |
| 253 | return (-8, strScriptDirNotFound); |
| 254 | |
| 255 | # Look for any script language directories to build for |
| 256 | listDirs = []; |
| 257 | nDepth = 1; |
| 258 | for strPath, listDirs, listFiles in os.walk( strScriptDir ): |
| 259 | nDepth = nDepth - 1; |
| 260 | if nDepth == 0: |
| 261 | break; |
| 262 | |
Bruce Mitchener | 17d2730 | 2015-04-24 00:38:53 +0000 | [diff] [blame] | 263 | # Skip the directory that contains the interface files. |
| 264 | listDirs.remove('interface') |
Pavel Labath | 9c2f716 | 2015-06-29 13:51:49 +0000 | [diff] [blame] | 265 | # and the svn directory. |
| 266 | if '.svn' in listDirs: |
| 267 | listDirs.remove('.svn') |
Bruce Mitchener | 17d2730 | 2015-04-24 00:38:53 +0000 | [diff] [blame] | 268 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 269 | if gbDbgFlag: |
| 270 | print strScriptLangsFound, |
| 271 | for dir in listDirs: |
| 272 | print dir, |
| 273 | print "\n"; |
| 274 | |
| 275 | # Iterate script directory find any script language directories |
| 276 | for scriptLang in listDirs: |
| 277 | dbg.dump_text( "Executing language script for \'%s\'" % scriptLang ); |
| 278 | nResult, strStatusMsg = run_post_process( scriptLang, strFinishFileName, |
| 279 | vDictArgs ); |
| 280 | if nResult < 0: |
| 281 | break; |
| 282 | |
| 283 | if nResult < 0: |
| 284 | strTmp = strPostProcessError % scriptLang; |
| 285 | strTmp += strStatusMsg; |
| 286 | strStatusMsg = strTmp; |
| 287 | |
| 288 | return (nResult, strStatusMsg); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 289 | |
| 290 | #++--------------------------------------------------------------------------- |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 291 | # Details: Program's main() with arguments passed in from the command line. |
| 292 | # Program either exits normally or with error from this function - |
| 293 | # top most level function. |
| 294 | # Args: vArgv - (R) List of arguments and values. |
| 295 | # Returns: None |
| 296 | # Throws: None. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 297 | #-- |
| 298 | def main( vArgv ): |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 299 | dbg = utilsDebug.CDebugFnVerbose( "main()" ); |
| 300 | bOk = False; |
| 301 | dictArgs = {}; |
| 302 | nResult = 0; |
| 303 | strMsg = ""; |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 304 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 305 | # The validate arguments fn will exit the program if tests fail |
| 306 | nResult, dictArgs = validate_arguments( vArgv ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 307 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 308 | eOSType = utilsOsType.determine_os_type(); |
| 309 | if eOSType == utilsOsType.EnumOsType.Unknown: |
| 310 | program_exit( -4, strMsgErrorOsTypeUnknown ); |
| 311 | |
| 312 | global gbDbgFlag; |
| 313 | gbDbgFlag = dictArgs.has_key( "-d" ); |
| 314 | if gbDbgFlag: |
| 315 | print_out_input_parameters( dictArgs ); |
| 316 | |
| 317 | # Check to see if we were called from the Makefile system. If we were, check |
| 318 | # if the caller wants SWIG to generate a dependency file. |
| 319 | # Not used in this program, but passed through to the language script file |
| 320 | # called by this program |
| 321 | global gbMakeFileFlag; |
| 322 | gbMakeFileFlag = dictArgs.has_key( "-m" ); |
| 323 | |
| 324 | nResult, strMsg = run_post_process_for_each_script_supported( dictArgs ); |
| 325 | |
| 326 | program_exit( nResult, strMsg ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 327 | |
| 328 | #----------------------------------------------------------------------------- |
| 329 | #----------------------------------------------------------------------------- |
| 330 | #----------------------------------------------------------------------------- |
| 331 | |
| 332 | #TAG_PROGRAM_HELP_INFO |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 333 | """ Details: Program main entry point. |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 334 | |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 335 | -------------------------------------------------------------------------- |
| 336 | Args: -h (optional) Print help information on this program. |
| 337 | -d (optional) Determines whether or not this script |
| 338 | outputs additional information when running. |
| 339 | -m (optional) Specify called from Makefile system. If given locate |
| 340 | the LLDBWrapPython.cpp in --srcRoot/source folder |
| 341 | else in the --targetDir folder. |
| 342 | --srcRoot= The root of the lldb source tree. |
| 343 | --targetDir= Where the lldb framework/shared library gets put. |
| 344 | --cfgBldDir= Where the buildSwigPythonLLDB.py program will |
| 345 | (optional) put the lldb.py file it generated from running |
| 346 | SWIG. |
| 347 | --prefix= Is the root directory used to determine where |
| 348 | (optional) third-party modules for scripting languages should |
| 349 | be installed. Where non-Darwin systems want to put |
| 350 | the .py and .so files so that Python can find them |
| 351 | automatically. Python install directory. |
| 352 | --cmakeBuildConfiguration= (optional) Is the build configuration(Debug, Release, RelWithDebugInfo)\n\ |
| 353 | used to determine where the bin and lib directories are \n\ |
| 354 | created for a Windows build.\n\ |
| 355 | --argsFile= The args are read from a file instead of the |
| 356 | command line. Other command line args are ignored. |
| 357 | Usage: |
| 358 | finishSwigWrapperClasses.py --srcRoot=ADirPath --targetDir=ADirPath |
| 359 | --cfgBldDir=ADirPath --prefix=ADirPath -m -d |
| 360 | |
| 361 | Results: 0 Success |
| 362 | -1 Error - invalid parameters passed. |
| 363 | -2 Error - incorrect number of mandatory parameters passed. |
| 364 | |
| 365 | -4 Error - unable to determine OS type. |
| 366 | -5 Error - program not run with name of "__main__". |
| 367 | -8 Error - unable to locate the scripts folder. |
| 368 | -9 Error - unable to locate the post process language script |
| 369 | file. |
| 370 | |
| 371 | -100+ - Error messages from the child language script file. |
| 372 | |
| 373 | -------------------------------------------------------------------------- |
| 374 | |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 375 | """ |
| 376 | |
| 377 | # Called using "__main__" when not imported i.e. from the command line |
| 378 | if __name__ == "__main__": |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 379 | utilsDebug.CDebugFnVerbose.bVerboseOn = gbDbgVerbose; |
| 380 | dbg = utilsDebug.CDebugFnVerbose( "__main__" ); |
| 381 | main( sys.argv[ 1: ] ); |
Deepak Panickal | 9b35cf5 | 2014-07-01 17:57:19 +0000 | [diff] [blame] | 382 | else: |
Ed Maste | ae9d841 | 2015-03-20 19:53:49 +0000 | [diff] [blame] | 383 | program_exit( -5, strMsgErrorNoMain ); |
| 384 | |