[GRASS5] Autoconf problems, Grass 5.1 solaris 8 sparc

I decided to enable everything in the configure script and I cannot get 3
of the optional libraries to work.

_________________________________________________
MySQL:

checking whether to use MySQL... yes
checking for location of MySQL includes... /usr/local/include
checking for mysql/mysql.h... yes
checking for location of MySQL library... /usr/local/lib
checking for mysql_query in -lmysqlclient... no
checking for mysql_query in -lmysqlclient... no
configure: error *** Unable to locate MySQL library.

but nm gives:
nm /usr/local/lib/libmysqlclient.a | grep mysql_query
0000000000002ed0 T mysql_query
________________________________________
Readline:

checking whether to use Readline... yes
checking for location of Readline includes...
checking for readline/readline.h... yes
checking for location of Readline library... /usr/local/lib
checking for readline in -lreadline... no
configure: error *** Unable to locate Readline library.

nm gives:

nm /usr/local/lib/libreadline.a |grep readline
readline.o
00000000000098 T readline
_________________________________________

GLw:

checking whether to use GLw... yes
checking for location of GLw includes... /usr/local/include
checking for GL/GLwMDrawA.h... yes
checking for location of GLw library... /usr/local/lib
checking for GLwCreateMDrawingArea in -lGLw... no
checking for GLwCreateM1DrawingArea in -lGLw... no
checking for GLwCreateM2DrawingArea in -lGLw... no
checking for GLwCreateMDrawingArea in -lGLwM... no
checking for GLwCreateM1DrawingArea in -lGLwM... no
checking for GLwCreateM2DrawingArea in -lGLwM... no
checking for GLwCreateMDrawingArea in -lMesaGLw... no
checking for GLwCreateMDrawingArea in -lMesaGLwM... no
configure: error: *** Unable to locate GLwM library.

nm gives:
nm /usr/local/lib/libMesaGLwM.a | grep GLwC
GLwCreateMDrawingArea.o:
0000000000000000 T GLwCreateMDrawingArea
_________________________________________________

cheg01@attbi.com wrote:

I decided to enable everything in the configure script and I cannot get 3
of the optional libraries to work.

Look in error.log. In all three cases, the problem is almost certainly
because the library which is being checked requires some other library
which configure hasn't been told about.

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

----- Original Message -----
From: "Glynn Clements" <glynn.clements@virgin.net>
To: <cheg01@attbi.com>
Cc: "grass5 developers list" <grass5@grass.itc.it>
Sent: Saturday, March 15, 2003 12:32 PM
Subject: Re: [GRASS5] Autoconf problems, Grass 5.1 solaris 8 sparc

cheg01@attbi.com wrote:

> I decided to enable everything in the configure script and I cannot get

3

> of the optional libraries to work.

Look in error.log. In all three cases, the problem is almost certainly
because the library which is being checked requires some other library
which configure hasn't been told about.

Yes, there are missing dependencies.

For GLw, I edited configure line 11229 to include "-lm" in the LIBS.
Apparently it is needed by libGLu.

For MySQL, I edited line 9521 in configure to include "-lm -lresolv" in
LIBS. The need for libresolv may be unique to Solaris.

For Readline, I added "-lncurses" on line 5347. That fixed several errors,
but I still get some errors in readline:

configure:5361: gcc -o conftest -g -Wall
   conftest.c -lreadline -lncurses 1>&5
/usr/local/lib/libreadline.so: In function `_init':
/usr/local/lib/libreadline.so(.init+0x0): multiple definition of `_init'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/crti.o(.init+0x0): first
defined here
/usr/local/lib/libreadline.so: In function `_start':
/usr/local/lib/libreadline.so(.text+0x0): multiple definition of `_start'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/crt1.o(.text+0x0): first
defined here
/usr/local/lib/libreadline.so: In function `_fini':
/usr/local/lib/libreadline.so(.fini+0x0): multiple definition of `_fini'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/crti.o(.fini+0x0): first
defined here
/usr/local/lib/libreadline.so(.rodata+0x0): multiple definition of
`_lib_version'
/usr/ccs/lib/values-Xa.o(.rodata+0x0): first defined here
collect2: ld returned 1 exit status
configure: failed program was:
#line 5350 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply. */
char readline();

int main() {
readline()
; return 0; }

cheg01@attbi.com wrote:

> > I decided to enable everything in the configure script and I cannot get 3
> > of the optional libraries to work.
>
> Look in error.log. In all three cases, the problem is almost certainly
> because the library which is being checked requires some other library
> which configure hasn't been told about.
>

Yes, there are missing dependencies.

For GLw, I edited configure line 11229 to include "-lm" in the LIBS.
Apparently it is needed by libGLu.

The GLU check should already check for the math library; AFAICT, the
problem was that the libMesaGLw[M] check didn't check for GLU. NB:
This only applies to Mesa's libMesaGLw[M] from widgets-mesa; Mesa's
SGI-compatible version (in widgets-sgi) and the original SGI version
don't need GLU or the math library.

OTOH, none of the standard modules use libGLw, so omitting --with-glw
should be harmless.

For MySQL, I edited line 9521 in configure to include "-lm -lresolv" in
LIBS. The need for libresolv may be unique to Solaris.

Even so, it should be added. However, it probably isn't specific to
MySQL (if that's the only case which causes problems, it's probably
because it's a static library; linking against a shared library
normally links its dependencies automatically).

Which symbols are required from this library?

For Readline, I added "-lncurses" on line 5347. That fixed several errors,

Awkward; curses may be overkill, as readline only actually needs the
termcap functions (tgetent etc). Ideally we should try libtermcap or
libtinfo before curses, but whichever library we choose, there's
always the possibility that it will turn out to be the wrong one for
some reason.

but I still get some errors in readline:

configure:5361: gcc -o conftest -g -Wall
   conftest.c -lreadline -lncurses 1>&5
/usr/local/lib/libreadline.so: In function `_init':
/usr/local/lib/libreadline.so(.init+0x0): multiple definition of `_init'
/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.2/crti.o(.init+0x0): first
defined here

I have no idea about this one. So don't use --with-readline (it's only
used by r.mapcalc).

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

I also get a compile time error when "--with-nls" is used. libgis fails
because of a problem with glocale.h:

make[2]: Entering directory `/usr3/grass51/lib/gis'
gcc -g -Wall -Wall -I/usr3/grass51/include -I/usr3/grass51/dist.sparc-sun
-solaris2.8/include -I/usr3/grass51/include \
            -I/usr3/grass51/dist.sparc-sun-solaris2.8/include \
        -o OBJ.sparc-sun-solaris2.8/adj_cellhd.o -c adj_cellhd.c
adj_cellhd.c: In function `G_adjust_Cell_head':
adj_cellhd.c:44: `PACKAGE' undeclared (first use in this function)
adj_cellhd.c:44: (Each undeclared identifier is reported only once
adj_cellhd.c:44: for each function it appears in.)
adj_cellhd.c: At top level:
/usr3/grass51/include/gis.h:36: warning: `GRASS_copyright' defined but not
used
make[2]: *** [OBJ.sparc-sun-solaris2.8/adj_cellhd.o] Error 1
make[2]: Leaving directory `/usr3/grass51/lib/gis'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/usr3/grass51/lib'
make: *** [default] Error 1

adj_cellhd.c #includes glocale.h, which contains:

extern char * G_gettext(const char *, const char *);

#if defined(HAVE_LIBINTL_H) && defined(USE_NLS)
#include <libintl.h>
#define _(str) G_gettext(PACKAGE,(str))
#else
#define _(str) (str)
#endif

Looks like PACKAGE is supposed to be #defined somewhere but it is not.The
variable PACKAGE is used quite extensively in Grass5.0.1 makefiles but it
does not appear anywhere else in the 5.1 code.

cheg01@attbi.com wrote:

I also get a compile time error when "--with-nls" is used. libgis fails
because of a problem with glocale.h:

make[2]: Entering directory `/usr3/grass51/lib/gis'
gcc -g -Wall -Wall -I/usr3/grass51/include -I/usr3/grass51/dist.sparc-sun
-solaris2.8/include -I/usr3/grass51/include \
            -I/usr3/grass51/dist.sparc-sun-solaris2.8/include \
        -o OBJ.sparc-sun-solaris2.8/adj_cellhd.o -c adj_cellhd.c
adj_cellhd.c: In function `G_adjust_Cell_head':
adj_cellhd.c:44: `PACKAGE' undeclared (first use in this function)

Every Makefile which compiles internationalised code (this now
includes libgis, libraster, s.surf.rst, and most of the PostgreSQL
modules) needs to define the PACKAGE macro.

The 5.0 Gmakefiles do this; the 5.1 Makefiles don't. This needs to be
fixed before the --with-nls option will work on 5.1.

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