[Fwd: Re: [Fwd: Re: [Mapserver-dev] configure script problems with multiple GD]]

Daniel Morissette dmorissette at dmsolutions.ca
Wed Oct 27 10:41:24 EDT 2004


-------- Original Message --------
Subject: Re: [Fwd: Re: [Mapserver-dev] configure script problems with 
multiple GD]
Date: Wed, 27 Oct 2004 15:33:43 +0100 (BST)
From: Dirk Tilger <dirk at advtechme.com>
To: Daniel Morissette <dmorissette at dmsolutions.ca>

  --- Daniel Morissette <dmorissette at dmsolutions.ca>
wrote:
> Daniel Morissette wrote:
> > 
> > As there is no clever way to ask the runtime
> linker to
> > bind to the right library, the mapserver interface
> > should be at least stable to not to crash even in
> that
> > case.
> > 
> 
> I think you're confusing the runtime linker and the
> compile-time linker. 
> At least on Linux, the runtime linker always uses
> the version of the lib 
> that was specified at compile/link time.

It depends. For example, if I do:
| dirk at o2:~/src/mapserver-4.2.5-dirk/mapscript/php3
ldd php_mapscript.so
| libtiff.so  => /usr/freeware/lib32/libtiff.so
| libfreetype.so.7 =>
/usr/freeware/lib32/libfreetype.so.7
| libpng.so  => /usr/freeware/lib32/libpng.so
| libz.so  => /usr/freeware/lib32/libz.so
| libXpm.so  => /usr/freeware/lib32/libXpm.so
| libX11.so.1  =>  /usr/lib32/libX11.so.1
| libproj.so.1 => /usr/freeware/lib32/libproj.so.1

| libpdf.so.2 => /usr/freeware/lib32/libpdf.so.2

| libgd.so.3 => /usr/people/dirk/lib/libgd.so.3

| libm.so => /usr/lib32/libm.so
| libjpeg.so => /usr/freeware/lib32/libjpeg.so
| libc.so.1 => /usr/lib32/libc.so.1

I see no version numbers for libjpeg. If it would
instead link against 'libgd.so', there would be no way
to tell which library the right one is.

> The problem is the presence of multiple sets of
> headers and multiple 
> libgd.so. Keep only one and you're all set.

Its not unusual to have multiple versions of library
files on a computer. Many precompiled binaries,
especially of larger software components come with
precompile libraries as well. They might be in the
$PATH.

> Uh? "you cannot assume that the mapserver is linked
> to the library with 
> the according header files."? If we cannot assume
> that the library that 
> we link with matches the header files then how can
> we hope to compile 
> any program in a predictable way?

Imagine the following:

When autoconf tests for, let's say libxyz.h and it
will only look in $DIR1 for this than it decides this
gd is ok and proceeds. It will add -I$DIR1/include to
$CFLAGS and -L$DIR1/lib to $LDFLAGS.

Later on, it checks for libgd.h in $DIR2 and adds
-I$DIRS/include to $CFLAGS and -L$DIR2/lib to
$LDFLAGS.

CFLAGS=-I$DIR1/include -I$DIR2/include
LDFLAGS=-L$DIR1/lib -L$DIR2/lib

Imagine further, there is an old gd in $DIR1.
Guess what happens...
But you're true, if you have installed each library
only once, than all that is fine.

> I'm not familiar with sunfreeware packages, but I
> think that it's their 
> mistake if they didn't think that it would be smart
> to separate headers 
> and runtime libs. 

I believe, a good program/script should assume as few
as possible.

> The real long term solution to this IMHO is to
> provide precompiled 
> binaries so that the users don't have to compile
> themselves. 

Good idea. I'd like to contribute IRIX+Solaris bins.
But this will not solve the problem as long as we not
supply/static-link all the needed libraries as well.

Best regards,
Dirk.




More information about the mapserver-dev mailing list