Hello, I'm new to wxLua and have spent last days compiling it "just
right". So, I'm posting this report in hope it will help anyone who
has problems similar to mine.

Intro.

SciTE editor (http://www.scintilla.org/SciTE.html) is a Scintilla based
source code editor, it supports all Scintilla features and is highly
configurable. It has built-in Lua interpreter (merged into SciTE.exe)
and provides Lua scripts control over Scintilla component, though not
in the way wxSTC does, its not wxWidgets-compatible.
So, the idea was to provide SciTE with wxLua capabilities using as
few DLL's as possible and utilizing its internal Lua capabilities.

And here goes "how-to" manual, detailed to the limit of being
offensive.

---------------------------------------------------------------------

0. Prerequisites:

Free downloadables (all native default packages):
MS Visual C++ 2008 Express
wxWidgets 2.8.11 source
wxLua 2.8.10.0 source
SciTE editor

unpack wxWidgets to C:\wxWidgets
unpack wxLua to C:\wxLua

create WXWIN environment variable and set it to 'C:\wxWidgets' (no quotes in 
value)

1. Make BUILD.BAT to compile makefile.vc 

        call "C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
        nmake /s /f makefile.vc 

2. Go to C:\wxWidgets\build\msw\

config.vc: 
        SHARED = 1
        WXUNIV = 0
        UNICODE = 0
        MSLU = 0
        BUILD = release
        TARGET_CPU = $(CPU)
        DEBUG_INFO = default
        DEBUG_FLAG = default
        DEBUG_RUNTIME_LIBS = default
        MONOLITHIC = 1
        USE_GUI = 1
        USE_HTML = 1
        USE_MEDIA = 1
        USE_XRC = 1
        USE_AUI = 1
        USE_RICHTEXT = 1
        USE_OPENGL = 1
        USE_ODBC = 1
        USE_QA = 1
        USE_EXCEPTIONS = 1
        USE_RTTI = 0
        USE_THREADS = 1
        USE_CAIRO = 0
        USE_GDIPLUS = 0
        OFFICIAL_BUILD = 0
        VENDOR = custom
        WX_FLAVOUR =
        WX_LIB_FLAVOUR =
        CFG = 
        CPPUNIT_CFLAGS = 
        CPPUNIT_LIBS = 
        RUNTIME_LIBS = dynamic

3. Run BUILD.BAT and build it (when I say 'run BUILD.BAT' I mean copy it in 
this folder and start it from here)
4. Go C:\wxWidgets\contrib\build\ogl and run BUILD.BAT
5. Go C:\wxWidgets\contrib\build\stc and run BUILD.BAT (some warnings may 
happen - its ok)
6. Go C:\wxWidgets\lib\vc_dll

Rename wxmsw28_ogl.lib to wxmsw28_gl.lib

7. Go C:\wxLua\modules\build\msw

makefile.vc: set config at file beginning as following
        CC = cl
        CXX = cl
        CFLAGS = 
        CXXFLAGS = 
        CPPFLAGS = 
        LDFLAGS = 
        BUILD = release
        UNICODE = 0
        SHARED = 1
        WX_SHARED = 1
        WX_VERSION = 28
        WX_MONOLITHIC = 1
        WX_DIR = $(WXWIN)
        USE_APPS = 0
        USE_SYSTEM_LUA = 0
        LUA_INCLUDE_DIR = ..\..\..\modules\lua\include
        LUA_LIB_DIR = ..\..\..\modules\lua\lib
        RUNTIME_LIBS = dynamic
        THREADING = multi
        USE_WXBINDADV = 1
        USE_WXBINDAUI = 1
        USE_WXBINDBASE = 1
        USE_WXBINDCORE = 1
        USE_WXBINDGL = 1
        USE_WXBINDHTML = 1
        USE_WXBINDMEDIA = 1
        USE_WXBINDNET = 1
        USE_WXBINDRICHTEXT = 1
        USE_WXBINDSTC = 1
        USE_WXBINDXML = 1
        USE_WXBINDXRC = 1
        USE_WXLUADEBUG = 1
        USE_WXLUASOCKET = 0
        USE_LUAMODULE = 1
        MONOLITHIC_LUAMODULE = 1
        USE_WXLUAAPP = 0
        USE_WXLUACANAPP = 0
        WXSTEDIT_DIR = $(WXSTEDIT)
        USE_WXLUAEDITAPP = 0
        USE_WXLUAFREEZEAPP = 0

makefile.vc: scroll to line "..\..\..\lib\vc_$(VAR_205)\lua5.1.dll: 
make_dir_lua_dll  $(LUA_DLL_OBJECTS)" and fix "/OUT" argument on line after 
this one as following
        /OUT:..\..\..\lib\vc_$(VAR_205)\SciTE.exe
        
this will enable to use SciTE.exe as a host app for wxLUA (instead of 
lua5.1.dll)

8. (Optional) Disable wxSTC component (cause SciTE is built on Scintilla anyway 
and you probably wont need one more text editor inside)

Go C:\wxLua\modules\build\msw

makefile.vc: set config at file beginning as in [7], only change
        CPPFLAGS = /DwxLUA_USEBINDING_WXSTC^#0 

scroll to line "        
vcmsw$(WXLIBPOSTFIX)$(_BUILDDIR_SHARED_SUFFIX)\mod_luamodule_mono_wxstc_bind.obj
 \" and put '#' in front of it to comment this line out

9. run BAT and build wxLua

10. Now we done compiling. The result is 3 dll files (or 2 if you disabled 
wxSTC):

        C:\wxWidgets\lib\vc_dll\wxmsw28_vc_custom.dll           (around 6Mb)
        C:\wxWidgets\lib\vc_dll\wxmsw28_stc_vc_custom.dll       (optional)
        C:\wxLua\lib\vc_dll\wx.dll                                              
(2-3 Mb)
        
11. Install wxLua as a module to SciTE

Put all 3 (or 2) dll's into SciTE installation folder (where SciTE.exe is)
Open 'SciTEGlobal.properties' and make sure startup lua script is set:
        ext.lua.startup.script=$(SciteDefaultHome)\Startup.lua

Create/edit 'Startup.lua', adding following lines:
        package.cpath = package.cpath..";./?.dll;"
        require("wx")
        
Close and restart SciTE.exe - if no error message boxes pops up and no error 
messages in output window of SciTE, installation is successful

12. Test wxLua from SciTE.
Open 'lua.properties' config file and scroll to the bottom of it.
Make sure SciTE will use internal LUA interpreter to run *.lua files - insert 
following 2 lines at the end of a file
        command.go.*.lua=dofile $(FileNameExt)
        command.go.subsystem.*.lua=3

Restart SciTE and open some *.lua from 'C:\wxLua\samples'
Hit F5 to start file execution
note: editor.wx.lua wont run if you disable wxSTC. Also i had problems with 
'controls.wx.lua' (some controls and events wont work)

--------------------------------------------------------

Conclusion.

To allow SciTE run several Lua scripts at once look here:
http://lua-users.org/wiki/SciteExtMan

It would be nice to also have wxSTC interface to SciTE's Scintilla
component, but it's highly unlikely for SciTE author to switch into
using wxWidgets and would require otherwise creating bindings from
Lua to Scintilla directly, while emulating wxWidgets framework,
which is way beyond my capabilities.

Also I'd like to mention I never worked outside of Windows© so i wont
be able to 'translate' this how-to into $(YOUR_OS_OF_CHOICE).



------------------------------------------------------------------------------

_______________________________________________
wxlua-users mailing list
wxlua-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxlua-users

Reply via email to