[GRASS5] configure on systems other than linux

Glynn Clements glynn.clements at virgin.net
Tue Sep 11 18:38:18 EDT 2001

Andreas Lange wrote:

> sorry to insist again, but configure does not work for me. 

Nothing to be sorry about ;)

The nature of autoconf is such that you need to know what tests you
should be performing, and the only way to determine that is by trial
and error.

[Aside: Imake is a better idea in principle, but sucks in practice.]

> I just tested on Solaris 7 / SPARC and despite installing fftw-2.1.3,
> jpeg6b, png, gd-1.8.4, tcl/tk 8.2 and mesa (in /usr/local/lib|include,
> adding --with-libs=/usr/local/lib and --with-includes=/usr/local/include
> to
> ./configure), all these libraries are not found. 
> If i put all libraries on the command line:
> export
> PATH=$PATH/export/home/andreas/bin:/usr/dt/bin:/usr/openwin/bin:/bin:/usr
> /bin:/opt/Summertime_98.sparc/bin:/opt/sfw/bin:/usr/sbin:/usr/xpg4/bin:/usr/local/bin
> ./configure \
> --prefix=/export/home/andreas \
> --enable-postgres=no \
> --enable-opengl \
> --with-libes=/usr/local/include \

This should be --with-libs (no "e"). And it should be .../lib, not

> --with-includes=/usr/local/include \
> --with-tcltk-libs=/usr/local/lib \
> --with-tcltk-includes=/usr/local/include \
> --with-zlib-libs=/usr/local/lib \
> --with-zlib-includes=/usr/local/include \
> --with-tiff-libs=/usr/local/lib \
> --with-tiff-includes=/usr/local/include \
> --with-opengl-libs=/usr/local/lib \
> --with-opengl-includes=/usr/local/include \
> --with-fftw-libs=/usr/local/lib \
> --with-fftw-includes=/usr/local/include
> most of the libraries are found. 

Odd. The values passed to --with-libs and --with-includes are used to
set LDFLAGS and CPPFLAGS respectively, so they should be used for all
subsequent library/header tests.

> I think the reason is that the dependencies are different on each
> system, e.g. libgd needs -lgd -lpng -ljpeg -lz -lm on Solaris to link, but
> configure
> just uses -lgd -lpng.

Actually, configure tries:

	-lgd $PNGLIB

stopping at the first one which succeeds.

Note that $PNGLIB and $JPEGLIB may include additional -l and/or -L
switches for any detected dependencies. JPEGLIB is tried with $ZLIB if
it isn't detected without it. PNGLIB is always tried with $ZLIB and

> But why are the libraries found if specified on
> the command line? I am clueless.

Note: if a shared library has dependency information, you can link
against it without specifying the dependencies. That would explain why
configure doesn't detect all of the dependencies (it stops trying once
it finds a combination which works), but not why you have to specify
each directory individually.

> On cygwin this is similar, but just more weird.
> I can compile a test stub program with:
> gcc test-gd.c -lgd -lpng -ljpeg -lz -lm
> while:
> gcc -lgd -lpng -ljpeg -lz -lm test-gd.c
> miserably fails. 

That makes sense if one or more of the libraries is static.

When linking against static libraries, only object files which define
*existing* unresolved symbols are linked in. Subsequent libraries may
introduce further unresolved symbols which would have been satisfied
by the original library had the order been reversed.

> But configure just does not find the library, even if i build gd2
> without
> jpeg. I tried to implement the library checking the same way the tiff
> lib is
> checked, but i got stuck with all those nested [].
> I have access to machines with Solaris 7/SPARC, Solaris 7/x86, IRIX 6.5,
> Linux, FreeBSD 4.3 (Intel/Alpha) and cygwin. I volunteer to check, but
> first
> we should fix configure.in/configure for the known dependencies.
> I am waiting for your suggestions...

I really need to see the resulting config.log file in order to
determine what went wrong (also, the output from configure can
sometimes be useful).

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list