Compiling from .tar.gz
The archive contains the source code files and supporting resources (bitmaps etc). So we'll need to compile this to make our executable program.
First extract the archive somewhere. I use a subdirectory off my home called src:
cd ~/src tar -zxvf ~/download/newapp.tar.gzIf the archive is compressed with bzip (extension is .bz2), use option j instead of z:
cd ~/src tar -jxvf ~/download/newapp.tar.bz2Then change to the newly extracted folder eg cd ~/src/newapp. Most source packages come with a configure script which you need to run before compilation. To compile using all defaults, just run these three commands:
./configure make sudo make installA whole load of options can be passed to configure though, some are standard for all compilations, while others are specific to the application being compiled. To view the application-specific options that are available run:
./configure --help=shortTo view all options, use --help. One good global option is the -q switch, for quiet, which skips printing all the checking... lines, making it easier to tell where any problems occur, if any.
It's quite likely that the configure script will error-out at least once, usually because it's detected a missing dependency. The last line of its output will be something like this:
configure: error: IMWheel depends on the XTest extention!You'll need to find and install the missing package; searching on Google should get you through. Once configure completes successfully, which it will indicate simply by not ending with any error, you can run make.
This may also fail due to missing dependencies. To know which, you'll have to scroll up through various warning messages the compiler has spat out before you get to the error which actually caused it to halt compilation:
imwheel.c:26:29: error: X11/Xmu/WinUtil.h: No such file or directoryThis message tells us that the error occurred on line 26, column 29, of the C source file imwheel.c, and that the problem is that it cannot find a particular header file. Out of interest, we can look at the indicated line of imwheel.c, and we see:
#include <X11/Xmu/WinUtil.h>This is a C directive telling the compiler to import the X11/Xmu/WinUtil.h header file, and as you'd expect, it matches the error thrown by make.
The standard include location for C header files is /usr/include, and we can even check this to see that the header is truly not there (we all know how computers sometimes tell lies in order to put off doing any work for as long as possible).
It can be a bit harder finding the right package for your particular distro for missing files at this stage, and may take some perseverance for less popular ones. For this particular header on Ubuntu, we need to install libxmu-dev.
Once I had this, make failed again, this time with the message "undefined reference to `XmuClientWindow'". This appears to be somehow related to TeX, the electronic typesetting system, and also GPM (for General Purpose Mouse, a project for mouse support on Xterms I think). We can sidestep this error by running configure again, but disabling GPM support (or does it just disable making documentation for GPM? Don't know but it worked for me!):
./configure --disable-gpm-docmake also signals its success by an absence of error messages (plenty of warnings though, this is normal). So we're ready to install, sudo make install. There shouldn't be any problems at this stage, as we've already compiled the executable successfully, so touch wood you'll then be good to go.
When you want to compile a new version, uninstall the old one first from the program's source directory, by running:
sudo make uninstall