Building wxWidgets for Jazz++
Jazz++ uses a non-stock build of the
wxWidgets library.
wxWidgets lets developers create applications for Win32, Mac OS X, GTK+, X11,
Motif, WinCE, and more using one codebase. This page describes how the Jazz++
version of wxWidgets was compiled for Windows, Linux, and the Mac. The Windows
build was generated using Visual Studio. Either Visual Studio .NET 2008 or
Visual Studio .NET 2010 can be used on Windows. The Linux install was tested
using Fedora 17 using GCC 4.7.2, Mandriva 2008.0 using GCC 4.2.2, and Debian 4.0
(i386 & amd64) using gcc-4.1.2. The Mac build was tested using Mac OS X 10.5.2
and GCC 4.0.1.
Building wxWidgets for Windows
I have used these instructions with Visual Studio .NET 2008 (VC9) and Visual
Studio .NET 2010 (VC10). I used VC10 in the following text, but simply
substitute the appropriate VC9 verbiage to create a Visual Studio .NET 2008
build. I have both builds living side-by-side on my hard drive.
-
Download
wxWidgets-2.9.4.zip from the wxWidgets web site.
-
Extract the zip file to C:\ExternalPackages. Extracting creates a
wxWidgets-2.9.4 directory directly under C:\ExternalPackages.
-
Change the name of the top-level wxWidgets directory to
wxMSW-2.9.4-VC10 so other versions of wxWidgets can be built with
other compilers in parallel with this directory.
-
Make the following changes to
C:\ExternalPackages\wxMSW-2.9.4-VC10\include\wx\msw\setup.h:
Macro |
From |
To |
wxUSE_STL |
0 |
1 |
-
Use Start | All Programs | Microsoft Visual Studio 2010 |
Visual Studio Tools | Visual Studio Command Prompt (2010) to
start a console session to compile a 32-bit version of the library.
-
Ensure that the command-line compiler and tools (including nmake)
are installed and ready to run.
-
Change directory to C:\ExternalPackages\wxMSW-2.9.4-VC10\build\msw.
-
Build the 32-bit, debug, static version of the wxWidgets libraries by typing:
nmake BUILD=debug SHARED=0 USE_OPENGL=1 -f makefile.vc
-
Build the 32-bit, release static version of the wxWidgets libraries by typing:
nmake BUILD=release SHARED=0 USE_OPENGL=1 -f makefile.vc
- To conserve disk space, remove the build directories (vc_mswu and
vc_mswud) under
c:\ExternalPackages\wxMSW-2.9.4-VC10\build\msw.
Building wxWidgets for Linux
-
Before we start the build process, set your PATH and
LD_LIBRARY_PATH environment variables so your shell will find the
non-stock wxWidgets binaries and libraries that we are about to create and
install. Adding the following lines in .bash_profile will do the
trick.
export PATH=/usr/local/wx-svn/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/wx-svn/lib:$LD_LIBRARY_PATH
After adding the above lines to your .bash_profile
file, it is necessary to reload your bash environment to make these changes
available. Use the following command to accomplish this.
source .bash_profile
- Create a directory under your home directory. I typically use
OutsideSource and change directory to that location.
cd
mkdir OutsideSource
cd OutsideSource
- Checkout the trunk of wxWidgets using the following command.
You must have a Subversion client loaded on your machine.
svn checkout http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk wxWidgets
- Create two directories called WxBuildRelease and
WxBuildDebug in parallel with the wxWidgets directory
and change directory to the WxBuildDebug directory.
mkdir WxBuildRelease WxBuildDebug
cd WxBuildDebug
- Run the wxWidgets supplied configure command with the following
configure options.
../wxWidgets/configure \
--prefix=/usr/local/wxsvnd \
--with-gtk \
--enable-exceptions \
--disable-compat28 \
--with-regex \
--enable-stl \
--enable-debug \
--enable-debug_gdb
The prefix option is used so that the resulting wxWidgets build
will be installed in a non-standard location to prevent conflicts with OS
installed versions and to make it easy to remove the installation.
- Run make using the following command. This will write a file
called BuildLog that may be useful if you run into trouble.
make 2>&1 | tee BuildLog
- If all goes well with the build, try to install wxWidgets as root.
sudo make install
- Now repeat with in the WxBuildRelease directory with the
following configure options and install the release version as root.
cd ../WxBuildRelease
../wxWidgets/configure \
--prefix=/usr/local/wxsvn \
--with-gtk \
--enable-exceptions \
--disable-compat28 \
--with-regex \
--enable-stl
make 2>&1 | tee BuildLog
sudo make install
-
Depending on the version of Linux you are using, you may have to run
ldconfig as root.
sudo ldconfig
-
You can run the following command to determine the default configuration.
wx-config --list
Building wxWidgets for Mac OS X 10.5.2
- Create a directory under your home directory. I typically use
OutsideSource and change directory to that location.
cd
mkdir OutsideSource
cd OutsideSource
-
Download
wxWidgets-2.9.4.tar.bz2 from the wxWidgets web site and extract this
file under your OutsideSource directory.
- Create a directory called WxBuild-2.9.4 in parallel with the
wxWidgets-2.9.4 directory and change directory to that location.
mkdir WxBuild-2.9.4
cd WxBuild-2.9.4
- Run the wxWidgets supplied configure command with the following
configure options.
../wxWidgets-2.9.4/configure \
--prefix=$HOME/wx-2.9.4 \
--enable-exceptions \
--disable-compat28 \
--with-regex \
--enable-stl \
--with-mac \
--enable-debug \
--enable-debug_gdb
The prefix option is used so that the resulting wxWidgets build
will be installed in a non-standard under the user's home directory to
prevent conflicts with OS installed versions.
- Run make using the following command. This will write a file
called BuildLog that may be useful if you run into trouble.
make 2>&1 | tee BuildLog
- If all goes well with the build, try to install wxWidgets.
make install
-
Make sure your PATH and LD_LIBRARY_PATH environment
variables are set to find the non-stock wxWidgets binaries and libraries
just created before building Jazz++. Adding the following lines in
.bash_profile will do the trick.
export PATH=/usr/local/wx-2.9.4/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/wx-2.9.4/lib:$LD_LIBRARY_PATH
After adding the above lines to your .bash_profile
file, it is necessary to reload your bash environment to make these
changes available. Use the following command to accomplish this.
source .bash_profile
This project is hosted by SourceForge. Special thanks for SourceForge and the OSDN.
|