wxlua and wxluaedit applications and the
wxbindstc binding library.
wxWidgets/contrib directory.contrib/stc/stc.contrib/src/stc after you have run
configure and have successfully built the main
wxWidgets libraries.USE_WXBINDSTC=0 option for Windows makefiles or
--disable-wxbindstc option for the Unix configure
script.--disable-wxluaedit-app for the Unix configure
script.configure.svn checkout
http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk
wxWidgets-trunksvn checkout
http://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH
wxWidgets-2.8wxWidgets\include\wx\msw\setup0.h to
wxWidgets\include\wx\msw\setup.h and adjust as desired."wx/msw/setup.h" copy it by
hand.wxWidgets\build\msw\wx.dsw
(for MSVC 6) and allow MSVC to convert it for a newer version of MSVC if
asked.wxWidgets\build\msw\wx_vc9.sln (for MSVC 2008 for example) or
the one closest to the version of MSVC you use.setup.h in between...wxWidgets\contrib\build\stc\stc.dsw and build the Scintilla
and wxStyledTextCtrl library for each configuration too.setup.h file too much.cmd.exe (DOS) prompt and cd to
wxWidgets\build\msw\nmake.exe
c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\bin\vcvars32.batc:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\bin\amd64\vcvarsamd64.batc:\Program Files\Microsoft Visual
Studio\VC98\Bin\VCVARS32.BATconfig.vc, but don't edit it,
rather override the default values of the variables on the
nmake command line.nmake -f makefile.vc SHARED=0 UNICODE=[0,1]
BUILD=[debug,release]nmake -f makefile.vc SHARED=0 UNICODE=[0,1]
BUILD=[debug,release] TARGET_CPU=AMD64UNICODE=1 and
BUILD=release would be appropriate.nmake -f makefile.vc SHARED=1 UNICODE=[0,1]
BUILD=[debug,release] MONOLITHIC=1nmake -f makefile.vc SHARED=1 UNICODE=[0,1]
BUILD=[debug,release] MONOLITHIC=1
TARGET_CPU=AMD64UNICODE=1 and
BUILD=release would be appropriate.wxWidgets/lib directory.cd into
wxWidgets\contrib\build\stc\ and run the same
nmake.exe command to build the wxStyledTextCtrl lib.cmd.exe (DOS) prompt and cd to
wxWidgets\build\msw\
set PATH=C:\MinGW\bin;%PATH% so that the compiler
can be found.cmd.exe (DOS) prompt.config.gcc, but don't edit it,
rather override the default values of the variables on the
make command line.mingw32-make.exe -f makefile.gcc SHARED=0 UNICODE=1
BUILD=[debug,release]mingw32-make.exe -f makefile.gcc SHARED=1 UNICODE=1
BUILD=[debug,release] MONOLITHIC=1-jN, e.g.
-j4 to use four processors, for multi-processor compilation.
make multiple times
since you may initially get errors since the compilers are not
synced.cd into
wxWidgets\contrib\build\stc\ and run the same
mingw32-make.exe command to build the wxStyledTextCtrl
lib.gtk2ud.wxWidgets/build_gtk2ud for a GTK2, Unicode, Debug
build.configure-gtk2ud.sh (or named appropriately) with this as its
content :../configure --prefix=$PWD \ --enable-gtk2 \ --enable-unicode \ --enable-shared \ --enable-optimise=no \ --enable-mem_tracing=no \ --enable-profile=no \ --with-dmalloc=no \ \ --enable-debug \ --enable-debug_flag \ --enable-debug_info \ --enable-debug_gdb \ --enable-debug_cntxt \ \ --with-sdl \ --with-gnomeprint \ \ --with-opengl \ --enable-sound \ --enable-mediactrl \ --enable-graphics_ctx \ --enable-controls \ --enable-dataviewctrl 2>&1 | tee configure-gtk2ud.log
configure script in the root wxWidgets
source directory will generate the build files in the directory it is run
from so do not run it in the root wxWidgets dir.configure-gtk2ud.log, to find any
problems.make -j4 (set 4 to the number
of processors you have) to build wxWidgets.wx-config../wx-config --prefix and ./wx-config
--cxxflags and ./wx-config --libs to get a feel for
the wxWidgets build settings.make install and in fact by setting
--prefix=$PWD it would only be installed to the build
directory where it already is.--prefix directory
as desired.cd into
wxWidgets/build_gtk2ud/contrib/src/stc/ and run
make to build the wxStyledTextCtrl lib.samples/widgets for example, cd into
build_gtk2ud/samples/widgets, run make, then
./widgets to run it.osx2ud.wxWidgets/build_osxud for a OSX, Unicode, Debug
build.configure-osxud.sh (or named appropriately) with this as its
content :../configure --prefix=$PWD \ --with-osx-cocoa \ --enable-unicode \ --disable-shared \ --enable-optimise=no \ --enable-mem_tracing=no \ --enable-profile=no \ --with-dmalloc=no \ \ --enable-debug \ --enable-debug_flag \ --enable-debug_info \ --enable-debug_gdb \ --enable-debug_cntxt \ \ --with-opengl \ --enable-sound \ --enable-mediactrl \ --enable-graphics_ctx \ --enable-controls \ --enable-dataviewctrl 2>&1 | tee configure-osx2ud.log
configure script in the root wxWidgets
source directory will generate the build files in the directory it is run
from so do not run it in the root wxWidgets dir.configure-osxud.log, to find any
problems.make -j4 (set 4 to the number
of processors you have) to build wxWidgets.wx-config../wx-config --prefix and ./wx-config
--cxxflags and ./wx-config --libs to get a feel for
the wxWidgets build settings.make install and in fact by setting
--prefix=$PWD it would only be installed to the build
directory where it already is.--prefix directory
as desired.cd into
wxWidgets/build_osxud/contrib/src/stc/ and run
make build the wxStyledTextCtrl lib.samples/widgets for example, cd into
build_osxud/samples/widgets, run make, then
./widgets to run it.wxLua/apps), modules
(wxLua/modules), and utilities
(wxLua/utils) and you should simply build them all.
wxLua/apps/wxlua - A wxLua code editor, interpreter, and
debugger; runs an embedded copy of the Lua program
samples/editor.wx.lua.wxLua/apps/wxluaedit - Another wxLua code editor and
interpreter, based on wxStEdit.wxLua/apps/wxluafreeze - A program to execute Lua or
wxLua programs. A replacement for the Lua executable that is capable of
running wxLua apps.wxLua/apps/wxluacan - An example of how to create C++
applications with an embedded wxLua interpreter.wxLua/modules/lua - Lua sources with patches applied,
see www.lua.orgwxLua/modules/wxlua - The base wxLua library, contains
the wxLuaState class that wraps a lua_State and loads the bindings.wxLua/modules/wxbind - The wxLua bindings for wxWidgets
broken up by the wxWidgets libraries: adv, aui, base, core, gl, html,
media, net, richtext, stc, xml, xrc.
wxLua/modules/wxluadebug - Helpful classes for debugging
Lua in C++; wxLuaCheckStack and wxLuaStackDialog.wxLua/modules/wxluasocket - Debugger socket classes to
run a wxLua program in a separate process and communicate with the parent
debuggerwxLua/utilities/bin2c.lua - Lua script to convert any
text file to a C const char* stringCMakeLists.txt file in
it.wxLua-build, at the same
level as the wxLua/ directory for "Where to build the
binaries."BUILD_SHARED_LIBS variable.Below are the CMake variables that you can and in some cases must adjust
to build wxLua. If you want to run CMake from the command line you would
specify these variables as : cmake -DBUILD_SHARED_LIBS=TRUE
...
make VERBOSE=1 to get the same effect.Linux and OSX configuration options
wxWidgets_ROOT_DIR=/path/to/wxWidgets wxWidgets_LIB_DIR=/path/to/wxWidgets/lib/vc_lib vc_amd64 for 64-bit, vc_dll for DLLs, and
vc_amd64_dll for 64-bit DLLswxWidgets_CONFIGURATION=[msw, mswu]wxWidgets_VERSION=[2.8.x,2.9.x]wxLua.sln in the build directory...Debug, Release, MinSizeRel,
RelWithDebInfo) that matches your wxWidgets build and build
everything.Debug build, but a wxWidgets release build works with a
wxLua Release, MinSizeRel, RelWithDebInfo build.build\bin\Debug or
Release, MinSizeRel, RelWithDebInfo as appropriate.cmd.exe (DOS) prompt and run it there and, if
you're lucky, an error message about a missing DLL will be printed to
the console.CMAKE_BUILD_TYPE that you want.Debug build, but a wxWidgets release build works with a
wxLua Release, MinSizeRel, RelWithDebInfo build.wxWidgets_ROOT_DIR=/path/to/wxWidgetswxWidgets_LIB_DIR=/path/to/wxWidgets/lib/gcc_lib gcc_dll for DLLswxWidgets_CONFIGURATION=[msw, mswu]wxWidgets_VERSION=[2.8.x,2.9.x]cmd.exe prompt to run mingw32-make.exe
help to display all the available targets.mingw32-make.exe with no parameters you will
build everything, which is probably best.build\bin\Debug or
Release, MinSizeRel, RelWithDebInfo as appropriate.CMAKE_BUILD_TYPE that you want.wxWidgets_CONFIG_EXECUTABLE=/path/to/wx-config, see above
about build wxWidgets for Linux for a description of it.make
help to display all the available targets.make with no parameters you will build
everything, which is probably best.build\bin\Debug or
Release, MinSizeRel, RelWithDebInfo as appropriate.You can set these environment variables in MS Windows either at a DOS prompt by typing
set WXWIN=c:\path\to\wxWidgetsset WXSTEDIT=c:\path\to\wxStEditor by right clicking on "My Computer" -> "System" -> "Environment Variables" and add it for yourself or for everyone. Don't forget to restart either the DOS prompt or the MSVC IDE if you change the environment variable through "My Computer."
Enter the wxLua/build/msw directory with a MSDOS prompt
and run one of the commands below to build all modules, applications, and
utilities of wxLua. See the sections for each compiler to learn about the
available command line settings to customize how the library and
executables are built.
MSVC : nmake -f
makefile.vcBorland : make -f makefile.bccMingw : mingw32-make -f
makefile.mingwWatcom : wmake -f makefile.watLook at the top of the makefile for your compiler to see the available build options. You do not have to (and should not) edit the makefiles to change any setting, instead you should set them on the command line as shown below.
For MSVC's nmake you will have to run the vcvars32.bat script in the DOS prompt before trying to build wxLua.
For example, Visual Studio 2008 installs it here in Windows 7:
>"c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\bin\vcvars32.bat"
NOTE: If you get an error about nmake.exe not found when you try to build wxLua, you need to (re)run vcvars32.bat.
The wxLua build options for nmake.exe are at the top of
build/msw/makefile.vc, please review it before trying to
build wxLua.
The typically used build options for wxLua using nmake.exe are:
nmake -f makefile.vc BUILD=[release/debug] UNICODE=[0/1]
SHARED=[0/1] WX_SHARED=[0/1] WX_MONOLITHIC=[0/1]
Two of the most commonly used build command lines to build wxLua are:
nmake -f makefile.vc BUILD=release UNICODE=0
SHARED=0nmake -f makefile.vc BUILD=release UNICODE=0 SHARED=1
WX_MONOLITHIC=1For comparison, typical options for building wxWidgets using nmake.exe are:
nmake -f makefile.vc SHARED=[1/0] UNICODE=[1/0] MONOLITHIC=[1/0]
BUILD=[release/debug]
TARGET_CPU=amd64UNICODE=0, but wxLua works with Unicode by translating
strings ANSI before pushing them into Lua.SHARED=1 & MONOLITHIC=1
to create DLLs or SHARED=0 & MONOLITHIC=0 to create
static libraries. With these settings you will have either one large
DLL which makes it easy to copy or multiple static lib files which are
easier to link to.NOTE: If you get a compiler error
complaining that wx/setup.h or wx/wx.h cannot
be found, this is because the default build options or the options you
gave did not match any of the available wxWidgets builds. You must choose
the wxLua build options BUILD, UNICODE, SHARED, WX_DIR, WX_SHARED,
WX_VERSION, WX_MONOLITHIC that match one of the existing wxWidgets
builds. The include file above is created by the wxWidgets build and is
placed into the wxWidgets/lib/[build]/msw[d]/wx/setup.h
directory.
Note that the wxLuaEdit app is not build by default; you need to
enable the wxStEdit dependency by using the
USE_WXLUAEDITAPP=1 option.
Some useful targets you can specify are:
Open the wxLua/build/msw/wxLua.dsw project file and
select the same configuration you used to build wxWidgets from the
"Build->Set Active Project" menu. Now build the wxLua
application right-clicking on the app_wxlua target and
choosing Build (or Generate). Then just repeat
this build command for the app_wxluacan and
app_wxluaedit targets. the mod_XXX targets will
be automatically built since they are dependency of the
app_XXX targets. You may also use "Batch Build" to build
multiple libraries and programs at once. In order to compile the
wxLuaEdit application you must compile the wxStEdit library by using its
project file with the same settings that you will use for wxLua.
Quickstart: Move to the root directory of the wxLua project and type:
./configure && make to build using the wxWidgets
default build settings and then execute, with root permissions
(you can use su or sudo commands...):
make install
If you want more control over configure you can type ./configure
--help to get a list of available options.
Note that --enable-XXX or --enable-XXX=yes
enables the option and --disable-XXX or
--enable-XXX=no disables it.
wxLua's configure tries to determine the wxWidgets build
settings automatically using the wx-config script, but if you
have multiple wxWidgets builds (you can list them using wx-config
--list) you can select the build you want using the
--enable-unicode, --enable-debug and
--with-wxshared, --with-gtk|msw|mgl|x11|motif
options. Note that you would use the --enable-unicode,
--enable-debug options only if you had built wxWidgets with
them. The build settings for wxLua must be identical to the ones used by
wxWidgets, i.e. you cannot build wxLua in ANSI mode and try to link to a
Unicode build of wxWidgets.
For example, if you have a unicode, release, shared library (as opposed to
static) build of wxWidgets and want to build wxLua in unicode, release,
static mode, then you can do:
./configure --enable-unicode --disable-debug --disable-shared
--with-wxshared
The options --enable-wxlua-app, --enable-wxluacan-app,
--enable-wxluaedit-app let you to enable or disable compiling the
applications which are part of wxLua.
The options --enable-wxbindstc,
--enable-wxluadebug, --enable-wxluasocket let you
to enable or disable compiling the wxLua modules.
You can compile multiple coexisting wxLua builds by running wxLua's
configure script in different folders; e.g. from the root wxLua
directory:
mkdir mybuild && cd mybuild && ../configure
&& make
which puts all objects and intermediate stuff in the mybuild
folder (exactly as you can do with wxWidgets). This is typically a good
idea even if you only have a single build so you don't pollute the main
wxLua directory with the build files.
If you do not want to install wxLua to the system directory
/usr/ you can specify
--prefix=/path/to/install/to and when you run make
install the headers, apps, and libs will be placed there. For
development purposes it is often not necessary to install wxLua, but you
may need to specify the shell environment variable
LD_LIBRARY_PATH to allow the executables to find the shared
libraries, e.g. export LD_LIBRARY_PATH=/path/to/wxLua/lib, be
careful not to override the variables existing value so you may want to
instead do export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/wxLua/lib.
The wxLuaEdit application depends on the wxStEdit library that you should
have compiled before trying to compile wxLua. There are two ways to let
wxLua's configure find the wxStEdit library: 1) Set the shell environment
variable before running configure export
WXSTEDIT=/path/to/wxstedit or 2) Use the
--with-wxstedit-prefix=/path/to/wxstedit configure directive.
As a last resort you can help wxLua's configure find wxStEdit or its
libraries by exporting these environment variables:
export CPPFLAGS="-I/path/to/wxstedit/include"
export LDFLAGS="-L/path/to/wxstedit/lib"
Other useful targets which you can use are:
docs: generates the HTML documentation for wxLua using
doxygeninstall-strip: like install but this target also strips
debugging informations out of the installed libraries and binaries so
that they take less space on disk and run fasterThese instructions are for C++ developers who want to use wxLua as a script interpreter in their own project. This means that you can write scripts to make your code simpler, load and run files on the fly, and allow users to more easily customize your program with their own Lua scripts.
wxLua/modules/lua and
wxLua/modules/wxlua at a minimum. With these two libraries
you have the ability to start an interpreter and run straight Lua code in
it using the wxLuaState class.modules/wxbind. The bindings in
modules/wxbind contain nearly all of the classes and
functions in wxWidgets. They also contain the appropriate #if
wxUSE_XXX statements and platform dependent
__WXMSW/GTK/MAC__ checks that wxWidgets uses in its headers
to ensure that no matter what platform or what type of build you use, the
bindings will compile without errors (if they don't compile for your
settings, please be sure to tell us on the wxlua-users mailing
list).wxluasetup.h (the name must be exactly
that, all lowercase!) which should start as a copy of
modules/wxbind/setup/wxluasetup.h. Once you have your custom
wxluasetup.h you can edit it to your liking. The header file
contains a number of wxLUA_USE_XXX #defines that are fairly
self explanitory. By setting some of them to 0 you can block
out large chunks of the bindings making them smaller.wxluasetup.h you can build
your wxBind custom library: on Windows, just open an
MSDOS prompt and move in the wxLua/modules/wxbind/build
directory and then launch a MAKE command using the
WXLUASETUP_DIR option to tell the makefile the path to your
custom wxluasetup.h and the WXLUABINDLIB_DIR
option to tell the makefile where the custom wxBind library should be
created:nmake -f makefile.vc WXLUASETUP_DIR=c:\myproj\include
WXLUABINDLIB_DIR=c:\myproj\lib (if using MSVC)make -f makefile.bcc WXLUASETUP_DIR=c:\myproj\include
WXLUABINDLIB_DIR=c:\myproj\lib (if using Borland)mingw32-make -f makefile.mingw
WXLUASETUP_DIR=c:\myproj\include WXLUABINDLIB_DIR=c:\myproj\lib
(if using Mingw)wmake -f makefile.wat WXLUASETUP_DIR=c:\myproj\include
WXLUABINDLIB_DIR=c:\myproj\lib (if using Watcom)--enable-customwxbind-install=no option, then the wxBind
sources will be installed to PREFIX/src/wxbind as soon as
you give the make install command.PREFIX/src/wxbind/build folder and type:make -f makefile.gnu WXLUASETUP_DIR=~/myproj/include
WXLUABINDLIB_DIR=~/myproj/libwxbind..., wxbindcore, wxbindbase, wxluasocket, wxluadebug, wxlua,
lua, wxWidgets libswxlua_$(WX_PORT_WITHVERSION)$(WXLIBPOSTFIX)_wxlua-$(WX_VERSION_MAJOR).$(WX_VERSION_MINOR)WX_PORT_WITHVERSION can be gtk2, msw, x11, etc;
WXLIBPOSTFIX can be u, d, ud.