# Info

Compiling programs that use X

Please read the `GCC-FAQ`, that can be found in the `docs` directories of `sunsite` and `tsx-11` before compiling any programs. Many questions (in fact, most) on compiling programs with Linux are answered there. Many Linux distributions include most relevant FAQs in the directory `/usr/doc`, so you might look there first.

If you have the source code for a program that uses X11, usually it will be shipped with an Imakefile instead of a Makefile. What to do now?

Run `xmkmf` in the directory that containes the Imakefile. If there is a hierarchy of directories with Imakefiles, you usually only have to run `xmkmf` in the root directory of that hierachy. You can configure the rest by typing make Makefiles. This will build the Makefiles in all directories in the hierachy. Then you should run `make depend`. Don't be afraid if include files like `stddef.h`, `varargs.h`, ... are not found, they are `gcc` proprietary header files and therefore not in the standard include directories (XFree86 versions prior to 2.1 use a `makedepend` not based on `gcc -M`). After that you can make the program by running make and you can install it (usually in `/usr/X386/bin`) by running `make install`, installing of the manpages is done by running `make install.man`. Of course, before even running `xmkmf`, you should have read the documentation that comes usually with such packages.

If libraries are missing, please read section <here> above.