Subject: Re: X compiling query
To: None <port-arm32@NetBSD.ORG>
From: Stefan Voss <voss@yoda.in-berlin.de>
List: port-arm32
Date: 07/10/1996 19:28:40
In message <9607101245.AA17692@apg.ph.ucl.ac.uk>,
     Bevis Peters wrote:

> Now compiling X code on my work alpha / DEC i can use the line "cc blah -lX11"
> and #include <X11/Xlib.h> sort of thing in the code, and all is fine. This
> does not work on RBSD, though. "-lX11" gives an error. I have to run this
> code on a variety of platforms, and so I cannot explicitly put the pathname
> in the #include lines, and putting a "-I/usr/X11R6/include (or whatever)"
> does not seem to work. In short, how do I set this "X11" type variable?

If your code needs to compile on various plattforms I'd suggest that you
create an imakefile (note the "i" as first letter). These files are used
as source for the commands "xmkmf" and "imake".

In short imakefiles together with a X11 configuration file are used by
xmkmf and imake to automatically create a normal makefile that is used for
compiling. All good X11 development environments (e.g. RiscBSD) have such
a configuration file. This file specifies e.g. 

- where the X11 root directory is (/usr/X11R6 or /usr/X11)
- which X libs are typically needed for linking and in which order they
  should appear.
- which flags are used for compiling
- etc.

Please have a look at the respective man pages. With a good written
imakefile you only need a "xmkmf -a" and you're done on all plattforms.

Regards,
   Stefan

-- 
Stefan Voss
(voss@yoda.in-berlin.de)