[GRASS5] Re: [GRASSLIST:2065] Re: Compiling grass5.0.0pre1 under Solaris 8???

Glynn Clements glynn.clements at virgin.net
Fri Jul 6 00:45:10 EDT 2001


[This started on GRASSLIST, but should be brought to the attention of
the developers.]

Lawrence Houston wrote:

> > > Having troubles compiling grass5.0.0pre1 under Solaris 8 (Intel) using
> > > SUN's Companion (04/01).  LIBGIS fails within error.c:
> > >
> > > --------------------------------------------------------------------------------
> > > gcc -g -O2  -I/opt/sfw/include -I/opt/grass5/grass5.0.0pre1/src/include  -I/usr/include  -c error.c -o OBJ.i386-pc-solaris2.8/error.o
> > > error.c: In function `G_fatal_error':
> > > error.c:72: `__builtin_va_alist' undeclared (first use in this function)
> > > error.c:72: (Each undeclared identifier is reported only once
> > > error.c:72: for each function it appears in.)
> > > error.c: In function `G_warning':
> > > error.c:87: `__builtin_va_alist' undeclared (first use in this function)
> > > *** Error code 1
> > > make: Fatal error: Command failed for target `OBJ.i386-pc-solaris2.8/error.o'
> > > --------------------------------------------------------------------------------
> >
> > Apparently this can occur when gcc tries to use vendor-supplied
> > headers in preference to its own (typically in the directory
> > /usr/lib/gcc-lib/<platform>/<version>/include).
> >
> > Try removing all occurrences of -I/usr/include from the file
> > src/CMD/head/head.<platform>
> 
> Glynn:
> 
> Thanks very much since removing all occurrences of -I/usr/include from
> head.i386-pc-solaris2.8 has done the trick, I now have grass5.0.0pre1
> built under Solaris 8 (Intel)!  There were also warnings about conflicts
> between the System TERMLIB and NCURSES, although I those may NOT be
> critical since full-screen cursor movement appears to "work"?
> 
> I thought using the gcc (2.95.2) included in SUN's Companion would be an
> quick way to build GRASS under Solaris 8, did NOT anticipate conflicts
> with the existing System "stuff"???

It appears that the configure script needs to avoid using
-I/usr/include when checking for header file locations.

AFAIK, the compiler ought to search that directory automatically (and
if it doesn't, the user should be able to use the "--with-includes="
switch). It seems that explicitly adding -I/usr/include prevents
compiler-specific headers (e.g. stdarg.h) from being used correctly.

Currently, the header file checks loop over a list of directories
(including /usr/include), performing each test with "-I$dir". Any such
test needs to first be performed without any "-I" switch, rather than
with "-I/usr/include".

NB: my original advice was based upon comments made on the xemacs-beta
list. That related to someone who explicitly added /usr/include via
"--site-includes="; XEmacs' configure script (unlike GRASS') doesn't
add "-I/usr/include" automatically.

Looking at some configure.in scripts from other packages, most of them
don't go to great lengths to find include directories automatically. 
Mostly they require the user to explicitly specify non-standard
include directories.

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



More information about the grass-dev mailing list