Compiling the Borg Source
Make sure to get the latest sources, go to the topdirectory and
either type make. Make will inform you of the possible actual make
commands.
Currently these are a combination of a frontend with a borgcore. There
are two possible borgcores. cborg and bborg:
cborg: the borgcore written in C.
bborg: the borgcore written in Borg itself.
The possible user interfaces are:
kborg: a KDE 1 frontend
wborg: a windows frontend
tborg: a text frontend
hborg: a html frontend
Specify which frontend and borgcore you want is done by the two
first
letter of the make command. For example make kcborg will compile a KDE
frontend and link it to a cborgcore. make kbborg will compile a KDE
frontend
and link it with a bborgcore. And so on.
Of course, it's quite difficult to make source which compiles on
different
architectures. Teherefore we created a file Defines.h in the toplevel
directory
which checks your hostname and creates a set of defines. This file can
and should be changed to refelect your specific machine. The Defines.h
file contains platform specific information, such as where to find
libraries,
where to look for include files and the location of binaries. In
addition
this file also contains the current version number.
Linux/Kde1
Requirements:
- flex to compile the syntax
- bison to compile the grammar
- kde1.1.2 libraries
- qt1.44 or qt1.45 libraries
- gcc/g++
- readline libraries
- cvs 1.11
Compiling kborg under kde probably requires the change of the Defines.h
file. The relevant flags are:
KBORG_MOC which should point to the moc (Meta Object
compiler)
of QT 1.4. This is probably located in /usr/local/qt-1.44/bin/moc, or
another
directory.
KBORG_INCLUDE_PATH which should contain options to g++ to find
the qt and kde includes. Most of the time these can be found in
-I/usr/local/qt/include
-I/usr/local/kde/include
KBORG_LIBRARY_PATH which should point to the locations of the
.a libraries of qt, kde and X11R6. Probably these will be located in
-L/usr/local/qt/lib
-L/usr/local/kde/lib -L/usr/X11R6/lib
Linux/Kde2
Requirements:
- Gcc/g++
- flex to compile the syntax
- bison to compile the grammar
- kde1.1.2 libraries.
- qt1.44 or qt1.45 libraries
- readline libraries
- cvs 1.11
If you want to compile kborg on a KDE2 system you should do the
following
a. Install qt1 & the kde1 libraries (kdelibs) in some directory
(NOT the default, I too /usr/local/qt1 & /usr/local/kde1, resp)
b. Make sure /usr/local/kde1/bin is in the path, /usr/local/qt1/lib
is included in LD_LIBRARY_PATH
c. Enter the locations of these libraries in Defines.h as specified
in the above section.
d. make kcborg
You can find the QT and KDE1 libs on
ftp://progpc26.vub.ac.be/cborg/QtKde1Libs/
Normally you will only need qt_1_44.tgz and kdelibs.tgz. Unzip the file
in the root of you system.
Execute /install/doinst.sh and start
ldconfig -v !
PalmOS
Requirements:
- gcc >2.95 <3.0
- pilrc
- prctools
- palmos 3.5 headers
- flex to compile the syntax
- bison to compile the grammar
- cvs 1.11
Cross Compilation under Linux
You can find all the tools described here on the palmos website
unless said otherwise.
$tar -xvpfz pilrc_src.tgz
Change to the PilRC directory (for example, pilrc-2.5c) and type
the
following
comands:
$./configure
If configure gives an error, you have most likely a GCC version below
2.95
$make
If you encounter any problems here, be sure you have the latest version
with the latest patch level Become the root and then type the
following command:
$make install
This copies a PilRC binary file to the usr/local/bin directory
The palmos SDK files for the PalmOS you like to work with.
On the
current
models the PalmOS 3.5 is most likely to be used this can be found
at:http://www.palmos.com/dev/tools/sdk/sdk2452534/sdk35.html.
The most recent and new
models ship with version 4.0 of the palmOS
Unpackage the SDK package to obtain the contents.
You need to add the header files and libraries to your "palmdev"
directory.The
default is /usr/local/palmdev
In your "palmdev" directory, create a directory "/sdk-3.5" and
create
two
subdirectories of it:
/include directory
/lib directory
Copy the contents of "Palm OS 3.5 Support/Incs" to the new
/include
directory.
Copy the contens of "Palm OS 3.5 Support/GCC Libraries" to the
new /lib
directory. Be sure to install the latest SDK patch here too. Just be
carefull,
if you simply overwrite the existing m68k library with the new one, you
will erase a crucial library (who has not been updated) Simply copy the
2 new files into the top directory .../lib/m68k.../ overwriting the 2
existing
files and leaving the 3rd unharmed.
You can now compile your programs using Palm OS 3.5 headers and
libraries
by adding a "-palmos3.5" option to your compile and link commands. For
example:
$ m68k-palmos-gcc -O2 -o hello hello.c -palmos3.5
To use the Palm OS 3.5 headers and libraries by default, you can
change
the "sdk" symbolic link in the "palmdev" directory to point to the new
SDK by typing the following commands:
$ cd /usr/local/palmdev
$ rm sdk=20
$ln -s sdk-3.5 sdk
The resulting directory structure should match this structure:
/usr/local/palmdev/sdk-3.5
/usr/local/palmdev/sdk-3.5/include
/usr/local/palmdev/sdk-3.5/include/Core
/usr/local/palmdev/sdk-3.5/include/Core/System
/usr/local/palmdev/sdk-3.5/include/Dynamic
/usr/local/palmdev/sdk-3.5/lib
/usr/local/palmdev/sdk-3.5/lib/m68k-palmos-coff=20
These are all you need to compile for palm/visor
The compilation itself is pretty straightforward and always happens
in three steps :
$ m68k-palmos-gcc -O2 -o hello hello.c -palmos*.*
This compiles you're palmos program using the palm library's
$ m68k-palmos-obj-res hello
$ build-prc hello.prc "Hello, World" WRLD *.hello.grc
The latter links you're compiled program with a form (mostly in a grc
file).
It is easiest to automate these steps using a makefile. Look at the
pborg
makefile for an example.
When those three operations are succesfull you will find a .prc
file.
Upload this file to you're palm/visor using coldsync, palmpilot or some
other exotic linux tool and hope for the best.
Freebsd
Compiling Borg under FreeBSD cannot be a problem if you use gmake and
specify
the locations of the kde/qt libraries. If you are using an a.out system
please make sure to insert the kde1 libs in your LD_LIBRARY_PATH, since
the make files may output an elf binary.
Windows
Requirements:
If you want to compile borg for Windows, get the cygwin tools, install
the compiler and all tools (the source is not needed). Get the compiler
up and running and enter make wcborg in the borg root directory.
Solaris
Be sure to download the correct readline library for compiling text
borg
(readline-4.1 is the good one). The wendy defines is an example of a
solaris
makefile.
Working with the Source
Online Source Access
Cvs Repository -- was once
online, no longer supported
Borg Crossreferencer -- was once
online, no longer supported
If you are planning to do some serieus development don't hesitate to
contact
us to get access to the CVS repository. If you are a user which found
one
bug too much and is utterly frustrated about it, please fix some of
them
and commit them.
Never add editor-specific files to the source repository.
Source Conventions
The source consists of a number of conventions:
- We do not use // - comments in the cborgcore. This because a
number of
macinotsh comilers are completely unable to deal with this kind of
(valid)
comments.
- If you add a comment add your name.
- In the cborgcore we NEVER includes specific headers. A source
file can
define something like #define NeedFile. The correct headers will be
included
from AllHeaders.h. AllHeaders.h loads all necessary headers for a
certain
platform. This is done by including standard C headers and by including
platform specific headers (StdLinux.h, StdSolaris.h and so on). In
these
file you can include whatever you want. As long as it compiles of
course.
[Non]-Frequently asked Questions
- How to write your own natives ?
(Paul
Henri Van Der Steichel) (.lyx file)
- A discussion why the we stopped
using
Unions
- Why we distinguish between
references
and strings