[GRASS-dev] Re: proposal for grass extensions and addons

Glynn Clements glynn at gclements.plus.com
Thu Sep 20 05:36:14 EDT 2007


William Kyngesburye wrote:

> Glynn mentioned in the v.in.dwg discussion that the makefile  
> fragments present in a 6.3 install are meant to enable building  
> modules from source without the full GRASS source.

At present, using it is probably a bit more complex than it needs to
be. The *.make files still contain some references to the source
directory, which need to be overridden. Specifically, Platform.make
has:

	GRASS_HOME          = /usr/local/src/grass/cvs
	RUN_GISBASE         = /usr/local/src/grass/cvs/dist.i686-pc-linux-gnu

RUN_GISBASE is used for the dummy session for running GRASS commands
during the build process, for generating the HTML files (Html.make)
and getting strings to translate from scripts (Script.make). In both
cases, it's used like:

	GISRC=$(RUN_GISBASE)/demolocation/.grassrc${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} \
	GISBASE=$(RUN_GISBASE) \

Note that the demolocation directory *isn't* installed.

GRASS_HOME is used in a number of places; Grass.make has:

	ARCH_DISTDIR    = $(GRASS_HOME)/dist.$(ARCH)
	ARCH_BINDIR     = $(GRASS_HOME)/bin.$(ARCH)
	GRASS_INCDIR    = $(GRASS_HOME)/include
	GRASS_LIBDIR    = $(GRASS_HOME)/lib

	...

	ifdef INST_NOW
	ARCH_DISTDIR = $(INST_DIR)
	ARCH_BINDIR = $(UNIX_BIN)
	endif

While Dir.make has:

	$(MAKE) -C $$subdir || echo $(CURDIR)/$$subdir >> $(GRASS_HOME)/error.log; \

and Script.make has:

	$(BIN)/$(PGM).bat: $(GRASS_HOME)/scripts/windows_launch.bat
		sed -e "s#SCRIPT_NAME#$(PGM)#" $(GRASS_HOME)/scripts/windows_launch.bat > $@

If you forget about Script.make and Html.make for now, you will
probably need to use something like:

	make ... GRASS_HOME=. INST_NOW=y MODULE_TOPDIR=/usr/local/grass-6.3.cvs

The other variables are less important.

ARCH_BINDIR is only used for the grass63[.bat] script.

GRASS_INCDIR is erroneously used for dependencies in a small number of
Makefiles (the actual -I switches refer to ARCH_INCDIR, which is
dist.<arch>/include).

GRASS_LIBDIR is only used to find a couple of DBMI headers using:

	-I$(GRASS_LIBDIR)/db/dbmi_driver

As for fixes:

GRASS_INCDIR and GRASS_LIBDIR can probably be eliminated relatively
easily.

RUN_GISBASE should be split into RUN_GISBASE and RUN_GISRC.

The demolocation directory should be installed, along with a grassrc
file which refers to it.

There should be a specific ERRORLOG variable for error.log.

INST_NOW=y should set RUN_GISBASE and RUN_GISRC to point to the
installed versions, and ERRORLOG to "./error.log".

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




More information about the grass-dev mailing list