
Compiling glBSP
===============

by Andrew Apted.  27th September 2004.


glBSP comes in three flavours: a text/command-line utility "glbsp",
a graphical/GUI version "glBSPX", and it can be compiled as a
library for other programs to use: "libglbsp".

Currently the following operating systems are supported: Unix (Linux),
Windows (95/98/etc), MacOS X, and DOS.  All flavours are supported in
all systems except for glBSPX and the plugin under DOS.

There are two compiling methods: using a makefile, and using an IDE.
Currently the Unix, MacOS X and DOS versions all use makefiles, and
under Windows there are project files for Dev-C++ (see the "Links"
below) and for Microsoft MSVC.NET 2002.

The GUI version (glBSPX) requires a graphical toolkit called FLTK
(Fast Light Tool Kit) version 1.1.4.  Other versions may work, but
you're on your own there.  See the "Links" section below if you
need to download it.  

The Unix makefiles support a "make install", which has to be done
as root.  None of the other methods have an automatic installation:
just copy the glbsp (or glBSPX) executable where you want it.


Command-line glBSP
------------------

Unix/Linux: make
MacOS X:    make -f Makefile.osx

MSDOS with DJGPP: make -f Makefile.dj

Windows with Dev-C++:  open the Cmdline.dev project file.
Windows with MSVC.NET: open the Cmdline.vcproj project file.


Plugin Library
--------------

The plugin version of glBSP is a special version that can be used
within other programs, e.g. a DOOM engine.  The result of the build 
is a library file: libglbsp.a (libglbsp.lib for VC++ under Win32).

Unix/Linux: make -f Plugin.mak
MacOS X:    make -f Plugin_osx.mak

Windows with Dev-C++:  open the Plugin.dev project file.
Windows with MSVC.NET: open the Plugin.vcproj project file.

NOTE WELL:
    Since glBSP is under the GNU General Public License (GPL), it
    can only be incorporated into other programs that are also
    under the GPL.  See the file COPYING.txt for all the details.


Graphical version: glBSPX
-------------------------

glBSPX is the GUI version of glBSP, written in C++ and requires the
FLTK toolkit, version 1.1.4.  FLTK needs to be built before trying
to build glBSPX: see the next section for some guidelines.

Unix/Linux: make -f GUI.mak
MacOS X:    make -f GUI_osx.mak

Windows with Dev-C++: open the GUI.dev project file.


Building FLTK
-------------

Unix / Linux:

    Use the normal method (configure, make, make install).  Make sure the
    static library is built (although dynamic should work).  Since OpenGL
    isn't needed, I usually configure with "--disable-gl".

MacOS X:

    Similar, but should use "./configure --prefix=$HOME" (that's where the
    glBSPX makefile expects to find it).  Edit fltk/makefile.osx if it has
    been installed somewhere else.  Also I've only tested the static
    library.  After configuring FLTK you must apply the glBSP patch in
    patches/FLTK_MACOSX.diff (to get the Fl_Sys_Menu_Bar class built).

Windows with Dev-C++:

    Note that the glBSPX project file (GUI.dev) assumes that fltk-1.1.4
    and glbsp-2.10 are in the same directory.

    First copy the files from the glbsp "patches/fltk_win32" directory
    into the fltk-1.1.4 directory.  (Copy "devcpp" whole, and copy
    "src/Fl_Win32.cxx" into fltk-1.1.4/src and overwrite the
    existing one).  Then you can build FLTK with the Dev-C++ IDE by
    using the project files in the fltk-1.1.4/devcpp directory
    (both fltk.lib.dev and fltkimages.lib.dev).


Success Stories
---------------

The command line version has run successfully on these platforms:

   +  Linux 2.1.126, libc5, GCC 2.7.2.1.
   +  Linux 2.2.18, glibc 2.2, GCC 2.95.2.
   +  Linux 2.4.22-PPC, glibc 2.3.1, GCC 3.2.2.

   +  MacOS X (10.2.4) with GCC 3.1.

   +  Win32, with Dev-C++ and MinGW.
   +  Win32, with MSVC.NET 2002.

   +  MSDOS 6.22, with DJGPP 2.02.

   +  IRIX 6.5.
   +  Digital Unix 4.0.


Links
-----

Dev-C++ (an open source IDE for Windows) home page:
    http://dev-cpp.sourceforge.net

Fast Light Toolkit home page:
    http://www.fltk.org

