From 0ab4b48992cec1101c32e60a33d2d3c2503058f8 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Thu, 10 Jul 2014 23:47:42 +0000 Subject: Get the python scripting interface working on Windows. This patch fixes a number of issues with embedded Python on Windows. In particular: 1) The script that builds the python modules was normalizing the case of python filenames during copies. The module name is the filename, and is case-sensitive, so this was breaking code. 2) Changes the build to not attempt to link against python27.lib (e.g. the release library) when linking against msvcrt debug library. Doing a debug build of LLDB with embedded python support now requires you to provide your own self-compiled debug version of python. 3) Don't import termios when initializing the interpreter. This is part of a larger effort to remove the dependency on termios since it is not available on Windows. This particular instance was unnecessary and unused. Reviewed by: Todd Fiala Differential Revision: http://reviews.llvm.org/D4441 llvm-svn: 212785 --- lldb/scripts/Python/finishSwigPythonLLDB.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lldb/scripts/Python/finishSwigPythonLLDB.py') diff --git a/lldb/scripts/Python/finishSwigPythonLLDB.py b/lldb/scripts/Python/finishSwigPythonLLDB.py index 2fc6f29..a2e35c5 100644 --- a/lldb/scripts/Python/finishSwigPythonLLDB.py +++ b/lldb/scripts/Python/finishSwigPythonLLDB.py @@ -71,7 +71,7 @@ strMsgFrameWkPyExists = "Python output folder '%s' already exists"; strMsgFrameWkPyMkDir = "Python output folder '%s' will be created"; strErrMsgCreateFrmWkPyDirFailed = "Unable to create directory '%s' error: %s"; strMsglldbsoExists = "Symlink '%s' already exists"; -strMsglldbsoMk = "Creating symlink for _lldb.so"; +strMsglldbsoMk = "Creating symlink for _lldb.so (%s -> %s)"; strErrMsgCpLldbpy = "copying lldb to lldb package directory"; strErrMsgCreatePyPkgMissingSlash = "Parameter 3 fn create_py_pkg() missing slash"; strErrMsgMkLinkExecute = "Command mklink failed: %s"; @@ -135,7 +135,6 @@ def create_py_pkg( vDictArgs, vstrFrameworkPythonDir, vstrPkgDir, vListPkgFiles strPkgName = vstrPkgDir; strPkgName = "lldb" + strPkgName.replace( "/", "." ); - strPkgName = os.path.normcase( strPkgName ); strPkgDir = vstrFrameworkPythonDir; strPkgDir += vstrPkgDir; @@ -148,10 +147,9 @@ def create_py_pkg( vDictArgs, vstrFrameworkPythonDir, vstrPkgDir, vListPkgFiles for strPkgFile in vListPkgFiles: if os.path.exists( strPkgFile ) and os.path.isfile( strPkgFile ): - strPyFile = os.path.normcase( strPkgFile ); if bDbg: print(strMsgCreatePyPkgCopyPkgFile % (strPkgFile, strPkgDir)); - shutil.copy( strPyFile, strPkgDir ); + shutil.copy( strPkgFile, strPkgDir ); # Create a packet init files if there wasn't one strPkgIniFile = strPkgDir + "/__init__.py"; @@ -162,8 +160,7 @@ def create_py_pkg( vDictArgs, vstrFrameworkPythonDir, vstrPkgDir, vListPkgFiles strPyScript = "__all__ = ["; strDelimiter = ""; for strPkgFile in vListPkgFiles: - strPyFile = os.path.normcase( strPkgFile ); - if os.path.exists( strPyFile ) and os.path.isfile( strPyFile ): + if os.path.exists( strPkgFile ) and os.path.isfile( strPkgFile ): strBaseName = os.path.basename( strPkgFile ); nPos = strBaseName.find( "." ); if nPos != -1: @@ -257,7 +254,7 @@ def make_symlink_windows( vDictArgs, vstrFrameworkPythonDir, vstrDllName ): return (bOk, strMsg); if bDbg: - print strMsglldbsoMk; + print strMsglldbsoMk % (os.path.abspath(strSrc), os.path.abspath(strTarget)); try: csl = ctypes.windll.kernel32.CreateHardLinkW -- cgit v1.1