Skip to content

The Build Environment

franke-hub edited this page Apr 4, 2020 · 2 revisions

Look at the Step by Step Ubuntu Installation Guide too. It has a lot of detail. You can also look at "~/src/log/howto/howto.installLinux.log" which is my installation cheat sheet. This guide is incomplete at least in that it doesn't deal with some ~/obj issues. It hasn't been tested, and we all know what that means.

We assume that you have a good working knowledge of Cygwin and/or Linux and are comfortable working in a command prompt environment. Create a project subdirectory, the place where you want this repository to reside. For exposition purposes, we'll call that subdirectory ~/project. Clone or download this entire repository into that repository. As an aside, I personally have a set of files that I share among real and virtual machine residing in /home/data on every machine. This repository resides in /home/data/home, and my $HOME directory links there as follows:

~/bat -> /home/data/home/bat
~/bin (Local)
~/obj (Local)
~/src -> /home/data/home/src
~/usr -> /home/data/home/usr

However, I'm going to assume that your build environment is in "~/project" keeping it separate from your $HOME.

In a bash shell run these commands:

chdir ~/project/obj

The .README file in that directory is an executable script allowing backup and restore of your ~/obj subdirectory. Since it expects the target "obj" directory to be in your home directory, we're going to update it in-place instead:

rename git .git
git reset --hard HEAD

This expands the git-compressed ~/project/obj subdirectory tree.

Next we need an executable file that automatically creates make dependency information from the source. Let's create it now:

cd ~/project/obj/cpp/Tools/Makeproj
./make 
mv makeproj ~/project/bin

You now need to update your $PATH environment. The files I commonly put in my $HOME directory to accomplish this are located in ~/project/bat/.home/. Using these as examples, at least insure that your $PATH includes:

~/project/bin  
~/project/bat

And I prefer my PATH to include ".", the current directory.

Once you've done that we're ready to build a set of C++ libraries provided by the distribution. They are built from ~/project/obj/cpp/lib/. Unfortunately, there are lots of prerequisite libraries.

Prerequisite libraries

I use the jpeg libraries from ijg.org. These are C libraries, not C++. Download from ijg.org (the Independent JPEG Group), and follow the instructions in ~/project/src/c/lib/1st/jpeg for extraction and building. I would prefer that a distribution's jpeg libraries be used, but haven't verified that this is possible yet. The C libraries are built using:

cd ~/project/obj/c/lib
make

Just FYI, libcom.a is essentially empty.

All other prerequisite libraries are available in the associated distributions. The packages may have different names in different distributions, but you will need:

autoconf
automake
binutils
gcc, gcc-c++, g++
libtool
make
patch
ImageMagick-c++-devel, and/or ImageMagick-devel
libdb-devel and/or libdb-dev
libdb-cxx-devel and/or libdb++-dev

Fedora:

boost-devel
bzip2-devel
libcurl-devel
ncurses-devel
glm-devel
openssl-devel
libX11-devel
zlib-devel

Ubuntu:

libboost-all-dev
libbz2-dev
libcurl-openssl-dev
libcurses5-dev
libglm-dev
libssl-dev
libx11-dev

I also install mono-complete, mariadb-server, and nfs-server, gimp, gpg, and yum-cron on Linux systems, but these are not needed to build.

Building the C++ libraries

Once the environment is set up, building is straight forward:

cd ~/project/obj/cpp/lib
make

Building dll versions of these libraries is also simple:

cd ~/project/obj/cpp/dll
make