[GRASSLIST:3289] Re: re-compile a display driver

Glynn Clements glynn.clements at virgin.net
Mon Mar 4 20:47:37 EST 2002


John Gillette wrote:

> I have just compiled GD version 1.8.4.  I want to add a PNG driver.
> I previously used without: dbm, gd, postgress, odbc, fftw. I am not sure
> how to go back and add the PNG driver (without completely recompiling).
>  
> (1) Do I need to rerun ./config and modify --without-gd to 
> --with-gd-includes=/<path to GD>/include --with-gd-libs=/<path to GD>/lib ?

Certainly, you need to rerun configure without the "--without-gd"
switch. But only specify --with-gd-{includes,libs} if they aren't in
the compiler's/linker's default search path (i.e. don't specify e.g. 
/usr/include or /usr/lib).

> (2) Do I cd down into .../grass5.0.0pre3/src/display/devices or do I
>     go down to .../grass5.0.0pre3/src/display/devices/PNGdriver and 
>    execute /<path to binaries>/gmake5 -i and
>     /<path to binaries>/gmakelink5 -i ?

Or use:

	gmake5 -i src/display/devices/PNGdriver

You don't need to run gmakelinks5 for PNGdriver. The links are only
for "user-visible" commands (i.e. those in $GISBASE/bin).

> (3) Or should I just recompile the whole thing?
>  
> (4) recently there were updates made to implement -GRASS_BACKGROUNDCOLOR
> and
>      -GRASS_TRANSPARENT (see [GRASSLIST:3113] ).  If I download from 
>  
> http://freegis.org/cgi-bin/viewcvs.cgi/grass/src/display/devices/PNGdriver/
> <http://freegis.org/cgi-bin/viewcvs.cgi/grass/src/display/devices/PNGdriver/
> >   and replace 
>    what I currently have would that include those recent changes?

The code at the above URLs will include those changes. But updating
individual files may cause problems if the rest of the source code
isn't recent, so back up the existing files first.

> (5) I am on a Sun which only has pseudo color (?) display.  I assume the PNG
> driver will give me
>      an 8 bit color output file (with GD 1.8.4) IRRESPECTIVE of the hardware
> I have.

Yes. The PNG driver doesn't use any graphics hardware.

> (I will then
>     drag this to my windows box and view it with Internet Explorer and have
> lots more colors)
>     Is this assumption correct?

I wouldn't expect to see any more colours when viewing it on the
Windows box, unless the Sun's graphics hardware is very basic (i.e. 16
colours).

If you use GD-2.x (currently beta), you can create 24-bit PNG images;
they would show a noticable difference between pseudo-colour and
true-colour displays.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-user mailing list