Opened 15 years ago

Closed 6 years ago

#596 closed enhancement (wontfix)

provide a grass-config script

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 7.4.0
Component: Installation Version: svn-trunk
Keywords: gdal-plugin Cc: rouault, wolf
CPU: All Platform: All

Description

fwd from gdal's tracker:

"Grass enhancement request : it would be cool if GRASS had a grass-config script."

https://trac.osgeo.org/gdal/ticket/2953#comment:2

Attachments (1)

grass-config.patch (4.1 KB ) - added by wolf 13 years ago.
Patch to add grass-config to trunk

Download all attachments as: .zip

Change History (10)

comment:1 by neteler, 15 years ago

A grass-config would probably facilitate the development of an automated GRASS-Addons integration script (which downloads Addon from SVN, then compiles it according to the local settings)

Markus

comment:2 by hamish, 15 years ago

Keywords: gdal-plugin added

idea for how this could be done:

write a GRASS_BATCH_FILE which would start grass in a dummy location and run a single g.version -b command, then exit.

(add new flags to g.version as needed for the info you want)

or probably much simpler to just write a script which parses $GISBASE/include/Make/* as needed.

gdal-config has:

Usage: gdal-config [OPTIONS]
Options:
        [--prefix[=DIR]]
        [--libs]
        [--dep-libs]
        [--cflags]
        [--datadir]
        [--version]
        [--ogr-enabled]
        [--formats]

which of those would be useful in a grass-config? (obviously not the last two)

any additional requests for options?

Hamish

in reply to:  1 comment:3 by glynn, 15 years ago

Replying to neteler:

A grass-config would probably facilitate the development of an automated GRASS-Addons integration script (which downloads Addon from SVN, then compiles it according to the local settings)

Add-ons should get all the configuration information they need from the *.make files.

Replying to hamish:

or probably much simpler to just write a script which parses $GISBASE/include/Make/* as needed.

Parsing *.make won't work; given that values can be arbitrary make expressions, you would need to duplicate make's functionality exactly.

You would be better off just invoking make on a suitable Makefile, e.g.:

$ cat foo.mk
MODULE_TOPDIR = $(GISBASE)
include $(MODULE_TOPDIR)/include/Make/Vars.make
var.%:
	@echo $($*)

$ make -f foo.mk var.PNGLIB
-lpng -lz -lm

gdal-config has:

[snip]

which of those would be useful in a grass-config? (obviously not the last two)

None of them, really. GRASS isn't a single library; you would need separate options for each component.

by wolf, 13 years ago

Attachment: grass-config.patch added

Patch to add grass-config to trunk

comment:4 by wolf, 13 years ago

Cc: wolf added

The file grass-config.patch adds a basic version of what grass-config could be. Note that it uses the configured values of /prefix and so on to figure out where GRASS has been installed. Applies to trunk. This can be expanded to have more options or more varied options...

comment:5 by dylan, 13 years ago

I think that there is a typo in the patch as submitted: "--restlibs" should be "--rastlibs".

comment:6 by martinl, 8 years ago

Milestone: 7.0.07.0.5

comment:7 by martinl, 8 years ago

Milestone: 7.0.57.3.0

comment:8 by martinl, 8 years ago

Milestone: 7.3.07.4.0

Milestone renamed

comment:9 by martinl, 6 years ago

Resolution: wontfix
Status: newclosed

Closing, feel free to reopen if needed.

Note: See TracTickets for help on using tickets.