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 (version >= 1.54 should
work 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 etc.
as the wxWidgets library.( Unicode build is required )  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.
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.
You also need to set a BOOST_LIB_DIR environment variable which points to
the directory where the Boost libraries are. The default location would be
$(BOOST_ROOT)/stage/lib, but you may have changed that. For systems where
both 32 and 64 bit versions of FlameRobin are to be built consider the
following Stack Overflow post about how to build Boost in both versions:

  http://stackoverflow.com/a/2326485/30568
  (accepted answer to "64-bit version of Boost for 64-bit windows")

For the sole purpose of building FlameRobin only a few libraries are needed,
and only the version for static linking, so the following invocations are
all that is needed:

  bjam link=static --with-thread --with-date_time --with-system stage

(for 32 bit build) and

  bjam address-model=64 link=static --with-thread --with-date_time --with-system stage

(for 64 bit build).

For other systems the configure script checks for the used header files and
libraries of Boost. On Debian and Ubuntu use the following commands to
install the headers and thread library:

  sudo apt-get install libboost-dev libboost-thread-dev

If you have problems building FR, 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

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

------------------------------------------------------
-- MSW - Visual C++ 20xx 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

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++ 20xx Express --
-----------------------------------------------------------

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

* 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 cmd.exe  prompt and go into "build\msw" directory:
set WXWIN=c:\wxWin
set WXDIR=c:\wxWin
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.


----------------------------------------
-- 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.



----------------------------------------------
-- 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 Gtk static release build with Unicode support:

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

make -j4
make install


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