Clarence Verge wrote:
>I've just been out shopping for 9wm and AGAIN the problem arises:
>I have to compile it. :((
>
>Would your binary run on my RH5.1or2 system ? Or does it have YOUR
>video driver(s) as part of its internal configuration ?
Compiling is easy, thanks to the "make" program. A certain script called
"Makefile" it is used by the make program to automate the building of the
source.
Due to the differences between every user's configuration (and to ensure
portability between OS'es), there are also scripts that determine the
particularities of every system and update the makefile consequently. Software
developers use most frequently the "automake" and "autoconf" programs, in
order to generate such a script named "configure". This script should be run
by the normal user in order to generate the required makefile. Normal users
don't need "autoconf " or "automake" in order to run the "configure" script.
The developer must supply a template called "Makefile.in" (particular for
every program) and the "configure" script along with the source of the program
9wm is a particular case. This is a simpler program which does not care too
much about configuration differences. The only thing interesting for 9wm is
the X server, particularly the X libraries to link with. In this case the
Makefile is generated by a program called "xmkmf".
All this being said, we observe now that is much better to compile the
programs from sources, because the result will be tailored after your system.
Using precompiled binaries can be a tricky job, because one has to find the
package for a particular type of system. This is the reason tarballs are often
more up-to-date than binary packages
Let's say we have unpacked the source in a particular directory. We switch to
that directory
$ cd <directory>
If there is a README and/or INSTALL file there, we must read them carrefully
in order to learn about particular switches applied to the "configure" script,
or, what configuration program is used, or, simply, if we need to run any .
Usually there is a script named "configure", situated in that directory
$ configure
Instead, 9wm uses xmkmf program, as stated in the README
$ xmkmf
We can use the particular switches we have learned about in the README or
INSTALL file
e.g. $ configure --prefix=/usr/local should instruct make to install the
program in /usr/local
Lots of checkings will be made. You'll learn about your missing /obsolete
libraries and the fact you will have to get/upgrade them if you still want to
compile the source.
If everything OK, after running the configuration script the "make" command
compiles and links the program.
$ make
If no compiling errors have occured, become root in order to install the
program in any other directory except your home directory.
$ make install
"make install" command should employ a particular section of the makefile
which
puts the files in their directories (binaries in "bin", libraries in
"lib/<program name>" data files in "share/<program name>", etc.
To compile and build the sources the user needs
- C compiler, and binutils (linker, assembler, library archiver, object
converter etc.)
- The make program.
The Red Hat distributions install them all on your filesystem. The
minidistros don't.
Try gcc --v for compiler (see the compiler's version)
ld -v for binutils (test the linker's version)
make -v (ditto)
Hoping this should be of any help to someone
Cristian Burneci
Bucharest, Romania