FlameRobin Build Instructions
-----------------------------
Below are build instructions for FlameRobin on all supported build environments.

Instructions assume that you have already compiled wxWidgets.
There are some tips regarding that at the end of this file.

To build FR a recent installation of the Boost libraries is also necessary,
at the time of writing version 1.44 is the current one, but 1.43 should
work just as well. FR uses the header-only libraries, so building the Boost
libraries for the used compiler isn't necessary, adding the directories to
the list of includes will be enough.

--------------------------
-- Common to all builds --
--------------------------

FR must be built with the same settings for debug/release, Ansi/Unicode etc.
as the wxWidgets library.  Failing to do so will usually lead to compile or
link errors. This does not apply completely to Linux/GCC build, as you can
build wx in release mode and FlameRobin in debug mode - in case you just want
to debug FR code, and not code of wxWidgets.

Before building on Windows, you MUST set a WXDIR environment variable which
points to your wxWidgets root directory (unless you use MinGW and configure
script to build a Makefile). To do this, go to:
Start->Control Panel->System and select the "Advanced" tab. Then, click the
"Environment Variables" button and add WXDIR to the user or system env vars.
If you are using Windows98, you can set the variable from the command line,
using the "set" command.

For Windows you must also set a BOOST_ROOT environment variable which points
to the Boost root directory, see the previous section for how to do this. For
other systems the configure script needs to be amended to search for
installed Boost libraries and add the necessary directories to the compiler
invocation, but unfortunately this hasn't been done yet.
For Debian and Ubuntu at least installing Boost should make the headers
available without any more work. But if you have problems building FR on
platforms other than Windows, please post to the development list.

-----------------------------------------
-- MSW - Visual C++ Build Instructions --
-----------------------------------------

There are two ways to build using Microsoft Visual C++. One is via the dsp/dsw
project files, and the other is via the makefile.vc command line makefile.

* Using the dsp/dsw projects *

Since custom build steps are not set up for the Visual Studio build the
update-svn-rev.cmd script is not automatically run during the build, so the
src/frsvnrev.h file may be missing or outdated. Please run the
update-svn-rev.cmd manually after a checkout of the sources and each svn
update.

Double click on flamerobin\flamerobin.dsw, select a build configuration by
going to the Build menu, selecting "Set build configuration" and then
picking a config, then build!

* Using the makefiles *
To use the makefiles, start up a command line and navigate to the
flamerobin directory. There, run the following command:

nmake -f makefile.vc <BUILD OPTIONS>

Build options can be any of the following:

WXDIR=<dir> - tells the makefile where to find the root wxWidgets directory
FINAL=<0,1> - tells whether to build debug (0) or release (1) build
USEDLL=<0,1> - tells whether to link against wx static or dynamic libs
UNICODE=<0,1> - tells whether to link against wx ansi or unicode build

WXDIR *must* be specified (or set as an environment variable), but the rest
default to 0 and are optional.

------------------------------------------------------
-- MSW - Visual C++ 2005 Express Build Instructions --
------------------------------------------------------

Microsoft Visual C++ Express is a freeware version of MS Visual Studio.
There are two ways to build FlameRobin. One is via the dsp/dsw
project files, and the other is via the makefile.vc command line makefile.

* Using the dsp/dsw/sln projects *

Double click on flamerobin\flamerobin_flamerobin.sln, select a build
configuration by going to the Build menu, selecting "Set build configuration"
and then picking a config, then build!

* Using the makefiles *
To use the makefiles, start up a command line and navigate to the
flamerobin directory. There, run the following command:

nmake -f makefile.vc <BUILD OPTIONS>

Build options can be any of the following:

WXDIR=<dir> - tells the makefile where to find the root wxWidgets directory
FINAL=<0,1> - tells whether to build debug (0) or release (1) build
USEDLL=<0,1> - tells whether to link against wx static or dynamic libs
UNICODE=<0,1> - tells whether to link against wx ansi or unicode build

WXDIR *must* be specified (or set as an environment variable), but the rest
default to 0 and are optional.

-----------------------------------------------------------
-- MSW - Building wxWidgets with Visual C++ 2005 Express --
-----------------------------------------------------------

Unpack the archive somewhere, for example c:\wxWin286:

* Using the dsp/dsw/sln projects *

Double click on build\msw\wx.dsw, convert to new format, select a build
configuration by going to the Build menu, selecting "Set build configuration"
and then picking a config, then build!

Double click on contrib\build\stc\stc.dsw, convert to new format, select a
build configuration by going to the Build menu, selecting "Set build
configuration" and then picking a config, then build!


* Using the makefiles *
Open MS-DOS prompt and go into "build\msw" directory:
set WXWIN=c:\wxWin286
set WXDIR=c:\wxWin286
nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static
cd ..\..
cd contrib\build\stc
nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static

As you can see, it is important to build STC package too. It is for
wxStyledTextControl which is used in many places in FlameRobin.

If you wish to build an executable that is small in size (just like the
official one), you need to build wx from the command line using modified
makefile.vc. Just edit the makefile.vc and change the __OPTIMIZEFLAG setting
from /O2 to /O1.


-------------------------------------------------
-- MSW - Borland's Free C++ Build Instructions --
-------------------------------------------------

Borland's Free C++ Compiler (in short BCC) is a freeware version of
Borland's C++ compiler used in C++ Builder product:

http://www.borland.com/bcppbuilder/freecompiler/

I have used version 5.5.1.

Borland's command line linker (ilink32) has bugs that sometime make is crash
when linking FlameRobin executable. We haven't been able to determine the
cause of this. Since version 0.4.0, build was brome, then after 0.4.5 it
started to work until 0.7.0. Since 0.7.2 it works again. This build is NOT
OFFICIALLY SUPPORTED by our team, although it may work for you. In case you
want to give it a shot, here's how:

Assuming that you have wxWidgets installed in c:\wxwin286, you should open
MS-DOS prompt, cd to flamerobin root directory, and execute:

set WXDIR=c:\wxwin286
make -f makefile.bcc STATICRTL=1 FINAL=1

for release build, or

set WXDIR=c:\wxwin286
make -f makefile.bcc STATICRTL=1 FINAL=0

for debug build. Explanantion:

WXDIR=<dir>     - tells the makefile where to find the root wx directory
FINAL=<0,1>     - tells to build debug(0) or release(1) build
STATICRTL=<0,1> - tells to link against wx static(1) or dynamic(0) libs


----------------------------------------
-- Unix - Autoconf Build Instructions --
----------------------------------------

To build on Unix or MinGW, simply open a command line, cd into the flamerobin
root directory, and execute the following commands:

mkdir debug
cd debug
../configure --with-wx-config=/my/path/to/wx-config --enable-debug

for a build in debug configuration, and the following commands

mkdir release
cd release
../configure --with-wx-config=/my/path/to/wx-config --disable-debug

for a build in release configuration.

You only need to specify wx-config if you do not have a wx-config that can
be found on the PATH, or if you want to use a wx-config other than the
default one.

Running the command

make

should build the flamerobin executable. If you experience any problems,
please check the flamerobin developer mailing list archive, or ask a
question there.


--------------------------------------------
-- Mac OS X - Autoconf Build Instructions --
--------------------------------------------

To build FlameRobin on Mac OS X 10.5 for compatibility with 10.4, open
a command line, cd into the flamerobin root directory, and execute the
following commands:

mkdir ppcu
cd ppcu
../configure --disable-debug --disable-dependency-tracking \
  CFLAGS="-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc" \
  LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc \
    -Wl,-macosx_version_min -Wl,10.4" \
  CXXFLAGS="-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc" \
  --with-wx-config=/my/path/to/wx-config_for_ppc_unicode
make

cd ..
mkdir i386u
cd i386u
../configure --disable-debug --disable-dependency-tracking \
  CFLAGS="-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386" \
  LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 \
    -Wl,-macosx_version_min -Wl,10.4" \
  CXXFLAGS="-mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386" \
  --with-wx-config=/my/path/to/wx-config_for_i386_unicode
make

The resulting bundles differ only in the flamerobin executable, the lipo
tool can be used to make a Universal Build out of them.


---------------------------------------------------------------
-- MSW - Building wxWidgets with Borland's Free C++ Compiler --
---------------------------------------------------------------

Unpack the archive somewhere, for example c:\wxWin286, open MS-DOS prompt
and go into "build\msw" directory:

set WXWIN=c:\wxWin286
set WXDIR=c:\wxWin286
make -f makefile.bcc BUILD=release RUNTIME_LIBS=static
cd ..\..
cd contrib\build\stc
make -f makefile.bcc BUILD=release RUNTIME_LIBS=static

As you can see, it is important to build STC package too. It is for
wxStyledTextControl which is used in many places in FlameRobin.


----------------------------------------------
-- Unix - Building wxWidgets with configure --
----------------------------------------------

Unpack the sources, enter "build" directory and run "./configure". There
are many options you may like to set, run "./configure --help" to find about
them. We assume Gtk2 static release build with Unicode support:

./configure --disable-shared --disable-debug --enable-unicode --prefix=/opt/wxwidgets
make
make install

Now, you have to compile STC library. It is needed for wxStyledTextControl which
is used in many places in FlameRobin. Enter "contrib/src/stc" directory:

make
make install

Depending on your --prefix setting, you might need to run 'make install' as
superuser (root).
