[GRASS5] GRASS extensions build system, r.cva

Glynn Clements glynn at gclements.plus.com
Thu Mar 17 15:25:13 EST 2005


Daniel Calvelo Aros wrote:

> From: Benjamin Ducke <benducke at compuserve.de>
> Sent: Wed, 16 Mar 2005 21:55:45 +0100
> > I am trying to put together a build system
> > for building GRASS modules and libraries externally and
> > installing them into the binary installation tree.
> > 
> > As the recent discussion thread has shown, the necessary
> > libs and header files are being installed by recent
> > GRASS versions, so that this should in principle be possible.
> > 
> > Unfortunately, things seem to be a bit more complicated,
> > because the build system still has to take into account
> > some machine and OS dependent compile options,
> > different C compiler names and options etc.
> 
> Have you thought about writing a grass-config executable to be included in the
> grass binary? 
> 
> Several packages do this: they use the @vars@ markers expected by autoconf in
> a very simple executable that responds to options such as '--libs',
> '--include' and so on. It is intended to be used like this (totally fictitious
> example to give an idea):
> 
> $ gcc module.c `grass-config --include --libs` -o module

It isn't quite this simple. GRASS consists of over 30 libraries, many
of which have external dependencies. It wouldn't be practical to
output the switches to link against every single GRASS library and
their dependencies.

At a minimum, you would need to supply a list of the libraries which
were required, e.g.

	gcc module.c `grass-config --include --libs gis display vector`

Such a script would be somewhat more complex than e.g. the gtk-config
script.

It would be better for external modules to use the GRASS Makefile
fragments from the include/Make directory. However, "make install"
would need to install them; also, the installed versions would need to
be processed to reflect the installed locations rather than the
build-time locations.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list