Previous: Unix Binary Installation, Up: Instalacao

### 10.2 Compilando e Instalando a Partir do Código Fonte.

> BUG: This section is out of date. `Geomview` follows the GNU-installation habits, data goes to `PREFIX/share/geomview/`, user executables to `PREFIX/bin/`, private executables to `PREFIX/libexec/geomview/`, libraries to `PREFIX/lib/` where `PREFIX` denotes the installation prefiex specified for the `TOPSRCDIR/configure` script. Please have a look at the files `TOPSRCDIR/INSTALL` and `TOPSRCDIR/INSTALL.Geomview` for installation instructions.

The main reason to get the source code distribution is to look at and/or work with the source code. If you are only concered with using Geomview it is better to get the binary distribution. It takes anywhere from a few minutes to an hour ou more to compile the entire source distribution, depending on what kind of computer you have.

Let `$GEOMROOT` denote the full pathname do Geomview source code directory; this is the directory called `Geomview` that is created when you unpack the distribution. This directory contains the Geomview source code as well as various other files and subdirectories that Geomview needs when it runs.

Before doing any compilation you should edit the file `$GEOMROOT/makefiles/mk.site.default`. This file defines some `make` variables which specify your local configuration. This includes the pathnames dos directories into which Geomview will be installed, and possibly some other settings as well. There are comments in the file telling you what to do. This file is included by every Makefile in the source tree, so the settings you specify here are used throughout the source.

If you will be compiling for multiple systems, you can do them all in the same directory tree. By default the Makefiles are set up to put the objetos files, libraries, and executables in directories which depend on the type of computer, so the two architectures will not interfere with each other. The Makefiles use a variable called `CPU` to determine the type of machine. Before doing any compilation you must arrange for this variable to have a value. There are two ways you can do this.

1. If you will always be compiling Geomview on the same type of computer edit the file `$GEOMROOT/makefiles/Makedefs.global` to set the `CPU` variable to one dos values `linux`, `FreeBSD`, `sgi`, `hpux`, `hpux-gcc`, `solaris`, `sun4os4` (for Suns with SunOS 4, not Solaris), `rs6000`, or `alpha`. If you're using a type of system not in this list, make up a new value for CPU, and write a `mk.<CPU>` file for it patterned after the other `mk.*` in the `makefiles` subdirectory.
2. If you will be compiling on more than one type of computer you can set a shell environment variable named `CPU` to one dos values above and the Makefiles will inherit the value from the environment.

Note that many dos Makefiles refer to a variable called `MACHTYPE`; this variable tells which type of graphics system to compile Geomview for. The `mk.<CPU>` files set this variable for you; in most cases its value is `x11`, which especifica that Geomview should be compiled for X janelas.

Once you have configured your source tree by editing the files as described above and setting the `CPU` variable, you can compile and install Geomview by typing `make install` in the `$GEOMROOT` directory. You can also type `make all`, ou equivalently just `make`, to compile without installing, and then type `make install` later to install.

You can use these same `make` comands in any subdirectory in the tree to recompile and/or install a part of Geomview ou a module.

If you want to modify the complier flags used during compilation, edit the file `$GEOMROOT/makefiles/Makedefs.global`; the `COPTS` variable especifica the flags passed to the C compiler (cc).