\section{How to compile DCS Software and build IPKGs}

\subsection{How to compile Feeserver, libTRD and so on} \label{fee_compile}
In this description the home directory of the user is /home/trd. First create in this directory where all necessary files will find their new home \inputcmd{mkdir trdfee} and go to this directory.

Then you have to chekc out the following directories from the repository in Heidelberg:
\begin{itemize}
\item \url{https://alice.physi.uni-heidelberg.de/svn/trd/feeserver/trunk/feeserver-dlopen}
\item \url{https://alice.physi.uni-heidelberg.de/svn/trd/libdim/trunk}
\item \url{https://alice.physi.uni-heidelberg.de/svn/trd/feeserver/trunk/control-engine}
\item \url{https://alice.physi.uni-heidelberg.de/svn/trd/libTRD/trunk}
\end{itemize}

After this you have all necessary files and you can start building the different libraries. You should create a directory where all compiled files will go to, for example \inputcmd{mkdir armfs}.

Now we can start building the libraries and programs. The procedure is the same for all four components:

\begin{enumerate}
\item  go to the directory where you have checked out the source
\item \inputcmd{./bootstrap}
\item \inputcmd{./configure $--$host=arm-linux-uclibc \\  $--$with-rootfs=/home/trd/trdfee/armfs $--$prefix=/usr/local}
\item \inputcmd{make DESTDIR=/home/trd/trdfee/armfs install-strip}
\item remove the files \filepath{lib*.la} in \filepath{/home/trd/trdfee/armfs/usr/local/lib}
\end{enumerate}

\emph{Annotation:} You have to keep a specific build order:
\begin{enumerate}
\item libdim
\item feeserver-dlopen
\item libTRD
\item libCE
\end{enumerate}

\subsection{How to build IPKGs}

After you have successfully finished the last section you can start building the IPKG packages.
The procedure is nearly the same for all four projects (libdim, feeserver-dlopen, libTRD and libCE). 
First go to the project directory and run there \inputcmd{make distclean} to remove all unnecessary files.
After that execute the following commands
\begin{enumerate}
\item \inputcmd{./bootstrap}
\item \inputcmd{ipkg/rules configure}
\item \inputcmd{fakeroot ipkg-buildpackage}
\end{enumerate}

You will find the IPKG packages in the directory \filepath{/home/trd/trdfee} if you have used the directory names
from section \ref{fee_compile}.

\textbf{ATTENTION:} Before building ipkg packages of the feeserver or libCE you have to modify the file
\filepath{rules} in the \filepath{ipkg} subdirectorys of the two projects. In this file you will find an
entry \code{--with-rootfs path}. You have to set path to the same directory that you have used in the command \inputcmd{make DESTDIR} in section \ref{fee_compile}.
