Saturday, October 27, 2012

Setting up Debian based Linux to install/compile an application


http://ufoai.org/wiki/index.php/Debian

This is a simple guide on how to prepare your Debian distribution such as Ubuntu to compile an application.

Firstly you need to install a GNU compiler.

sudo apt-get install make gcc g++ git-core

Then you need to install the other development packages that is needed for the applicaiton. This is an example of the development packages installation.

sudo apt-get install \
   libsdl1.2-dev libsdl-ttf2.0-dev libvorbis-dev zlib1g-dev gettext libtheora-dev \
   libjpeg8-dev libpng12-dev libcurl3-dev libsdl-mixer1.2-dev \
   libxml2-dev libopenal-dev p7zip-full libcunit1-dev binutils-dev libxvidcore-dev libmxml-dev


If needed, then u need to install cunit to install the unittest suite.

sudo apt-get install libcunit1-dev

Install other development packages needed by the application.

Compilation time!!!

Now here comes the fun part. Compiling the source code so that it would be a running application. An example of what you must do could be like this.

./configure

This command would enable you to run a script called configure. Configure will set up all the required files etc before the main compiling. In other words, it will prepare a "makefile" before we run the new process.

To compile we will use the command:-

make

"make" is a UNIX utility that reads the "makefile" which has the sequence that the OS has to follow to compile the application.

For additional information on "make" please read the following.

http://linuxdevcenter.com/pub/a/linux/2002/01/31/make_intro.html
http://tldp.org/LDP/LG/current/smith.html
http://www.codecoffee.com/tipsforlinux/articles/27.html
http://linux.die.net/man/1/make
http://linux.about.com/library/cmd/blcmdl1_make.htm


No comments:

Post a Comment