girtobac  0.4
Create FB Headers from GObject Introspection *.gir files
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
Preparation

This chapter is about

  • how to prepare your system to use girtobac by installing tools,
  • how to get the package and
  • how to build the executable and the documentation.

Tools

The following table lists all dependencies for girtobac and their types. At least, you have to install the GLib library (containing GObject) and the FreeBASIC compiler on your system to build your girtobac executable. (Of course, later you'll need it for your projects as well.) Beside this mandatory (M) tool, the others are optional. Some are recommended (R) in order to make use of all package features. LINUX users find some packages in their distrubution management system (D).

Name Type Function
GLib M D Integrated development environment (ie. to test templates)
fbc M FreeBASIC compiler to compile the source code
GIT R D version control system to organize the files
CMake R D build management system to build executables and documentation
cmakefbc R FreeBASIC extension for CMake
fb-doc R FreeBASIC extension tool for Doxygen
Doxygen R D documentation generator (ie. for this text)
Graphviz R D Graph Visualization Software (caller/callee graphs)

It's beyond the scope of this guide to describe the installation for those programming tools. Find detailed installation instructions on the related websides, linked by the name in the first column.

  1. First, install the distributed (D) packages of your choise.
  2. Make the FB compiler working. If you aren't confident about the task you can find a few notes on the Installing FreeBASIC wiki page.
  3. Install cmakefbc, if wanted. That's easy, when you have GIT and CMake. Execute the commands
    git clone https://github.com/DTJF/cmakefbc
    cd cmakefbc
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
    Note
    Omit sudo in case of non-LINUX systems.
  4. And similar, install fb-doc, if wanted, using GIT and CMake. Execute the commands
    git clone https://github.com/DTJF/fb-doc
    cd fb-doc
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
    Note
    Omit sudo in case of non-LINUX systems.

Get Package

Depending on whether you installed the optional GIT package, there're two ways to get the girtobac package.

GIT

Using GIT is the prefered way to download the girtobac package (since it helps users to get involved in to the development process). Get your copy and change to the source tree by executing

git clone https://github.com/DTJF/girtobac
cd girtobac

ZIP

As an alternative you can download a Zip archive by clicking the Download ZIP button on the girtobac website, and use your local Zip software to unpack the archive. Then change to the newly created folder.

Build the executable

Before you can use the girtobac tool to generate your header files, you've to compile the source code first by either

  • using the CMake build scripts, or
  • direct compiling by calling the FB compiler in the src folder.

CMake build

The prefered way to build the executable and the documentation files is to use the scripts for the CMake build system. If you don't want to install or to use CMake, then skip this section and continue at Direct compiling.

The CMake scripts check your system and through warnings if anything is missing. Otherwise you can either perform an in-source or an out-of-source build. The later should be your prefered choise.

In-Source-Build

The following command triple will compile the executable in the source tree and install it on your system:

cmake .
make
sudo make install
Note
Omit sudo in case of non-LINUX systems.
In-Source-Builds polute the source tree by newly created files.

Out-Of-Source-Build

The following command quintuple will create a new build folder, change to that folder, compile the executable and install it on your system:

mkdir build
cd build
cmake ..
make
sudo make install
Note
Omit sudo in case of non-LINUX systems.

Documentation-Build

In order to build the documentation, all recommended packages listed in section Tools have to get installed. The following command will build the documentation in form of an HTML file tree and in form of a PDF file (either in-source or out-of-source):

make doc
Note
Find the HTML start file at doc/html/index.html.
Find the PDF file at doc/girtobac.pdf.

Both targets can get build separately by executing

make doc_htm
make doc_pdf

Direct compiling

Executable

In order to build the executable change from the package root directory to the src folder and compile by executing

cd src
fbc -e -w all girtobac.bas

This creates an executable binary named

  • girtobac (on UNIX-like systems) or
  • girtobac.exe (on other systems).

that you can install wherever you need it.

Documentation

In order to build the documentation, install the tools fb-doc, Doxygen and Graphviz. Then change from the package root directory to the doc folder, up-date the file fb-doc.lfn, execute the Doxygen generator and adapt correct listings by executing

cd doc
fb-doc -l
doxygen Doxyfile
fb-doc -s

to build the documentation in subfolders html (start file = index.html) and latex (call make in that folder to build refman.pdf).

Note
Adapt the configuration file Doxyfile (or your customized copy) in order to fit the output to your needs.