Search Contact information
University of Cambridge Home Department of Engineering
University of Cambridge >  Engineering Department >  computing help

Using source code from archives

Finding and copying the source code

Some sites specialise in certain software.

Preparing the archive file for compilation under Unix

Many of the big files on archives are compressed. If the filename ends in .Z it's been compressed using the compress program. Files with .z or .gz need to be uncompressed using unzip or gunzip.

If the filename also has a .tar in it, it's a tar file which in turn contains many other files. To see what a compressed tar file contains, do

      zcat source.tar.Z | tar tvf -
or
      gunzip -c  source.tar.gz | tar tvf -

depending on how the file was compressed. Once you're sure that these files won't overwrite existing files, extract them by replacing the "tar tvf -" command above by "tar xf -".

Updates to large packages sometimes come in the form of patch files - file that just contain the changes. Strip off any mail headers that maybe at the top of the patch file then do

      patch patchfile

This will modify the files that need changing, backing-up the originals.

Compiling the source code

Most distributions have README or INSTALL files explaining what needs to be done. Distributions generally support many types of machines. Two utilities are often used to ease compilation are configure and imake. configure is a script that tries to identify relevant characteristics of your machine. When in doubt it asks. imake is used by some X programs. It is called by xmkmf and creates from a generic file called Imakefile a system-specific Makefile. Typing
  xmkmf  
  make Makefiles
  makedepend
  make
should produce the required executable (the README will tell if you need to do anything else). Both of these utilities use the invaluable make command. See the manual page if you want to know the details.

Other Sources of Information

See the Computer service's Getting Software from an Internet Archive Server.

© Cambridge University Engineering Dept
Information provided by Tim Love (tpl)
Last updated: June 2008