Compiling a Source Package in Pisi Linux / Linux Part 2 configure, make, make install

Hi to all

Today we will compile a package with configure, make and make install

You can click on each Screenshot to enlarge it for a better Viewing

What you need for your Building is the same as in the Tutorial Part 1 for cmake You can read it here: Compiling a Source Package in Pisi Linux / Linux Part 1 cmake

There can Ubuntuuser read too what they need for package building, while Ubuntu has no Compiler C/C++ installed by default.

Now let us start:

You found normally in the extract Folder any scripts as example: configure, config.guess, config.sub, aclocal.m4, install.sh and more.

Did you not found a configure script so could you not run ./configure, when you found a script with the Name autogen.sh, is the configure script replace with it.

Then can you run the command

./autogen.sh

Before you build something, take each time a look at the README and the INSTALL file  when it is available, there found you at the most Time all Instructions for the Building of the package.

I will give you here a example with the Package libotr, while it takes not too long by Building, and i can give you a simple view for the building.

image

 

 

You see in the Screenshot above all the files who are in the source package for building.

 

readme

install

 

 

The README and the INSTALL are very Important for you read it, in this 2 text files you found informations about dependencies. compiling and a bit more.

Has your Package not this Files and you know not where can i find it, take a look to other Linux Distributions and look what need it for Dependencies, or commands to compile.

configure

 

You see here have give in as last command “–disable-static” you can read more about it here: –disable-static

 

make

 

The make command can be very much more than could be described here, so it just follows a brief explanation of what is actually going on. A makefile can be used to describe how certain targets can be created. These can depend on other destinations or files.

For example, you create an object file from a source file by compiling it. To do this, the source file must be available. Such a rule might look like this:

1
2
hello.o: hello.c
      $(CC) -c $(CFLAGS) hello.c

The first line says that the file hello.c is needed to create hello.o. The second says how to create hello.o. Variables are introduced with $. For example, $ (CC) usually contains the name of the C compiler.

 

sudo-make-install

 

That was it now.

A Tip from me, become you a error by Package build copy the error open your Web Browser and give in a Search Machine ( Google or whatever) the Name of the Package that you would build and after it the error, at the most Times helps this to solved your Problem.

For more Informations about Package Building can you look here:

About GCC

Making Configure Scripts

The Configure and Build System

An Beginners Guide to compile Programs under Linux

And you can found a lot more at the World Wide Web.

Happy coding, and many thanks for reading this little Tutorial

Advertisements