[GRASS5] Solaris, GRASS 5.1, and Proj

Markus Neteler neteler at itc.it
Fri Sep 12 09:23:44 EDT 2003


Hi Beverly, Paul, 

On Thu, Sep 11, 2003 at 08:43:01PM +0100, Paul Kelly wrote:
> On Thu, 11 Sep 2003, Wallace, Beverly T wrote:
> > I am trying to build the experimental GRASS 5.1.
> >
> > I downloaded the 2003_09_06 snapshots for 5.0 and 5.1.
> > I successfully built 5.0.
[...]
> >
> > (2)  There is no setenv function for Solaris.  I solved that by adding a
> > setenv function in lib/db/dbmi_client/start.c.
> 
> No setenv in IRIX either. It was suggested to me before to replace
> setenv() by putenv() and I recall that that worked. I haven't had that
> particular error compiling on IRIX; maybe I have disabled something in
> configure that doesn't compile that part of the database code.

We should aim at portability. Is there anything we could do to get
that code portion working? Go for "putenv()" or use the proposed
patch (modified?):

patch for lib/db/dbmi_client/start.c

	#ifdef __sun
	int setenv (const char *name, const char *value, int overwrite) {
	    /* Allocate more space each call */
	    char *buffer;
	    int len;
	    if (!overwrite && getenv(name)) return 0;
	    len = strlen(name) + strlen(value) + 2;
	    buffer = (char *) G_malloc (len);
	    sprintf (buffer, "%s=%s", name, value);
	    return putenv (buffer);
	}
	#endif /* __sun */

What about G_setenv() from libgis?


Markus




More information about the grass-dev mailing list