Subject: clash of wrapper framework and libtool (was: libtool problems with Sun Studio 11)
To: None <tech-pkg@NetBSD.org>
From: Klaus Heinz <k.heinz.dez.fuenf@onlinehome.de>
List: tech-pkg
Date: 12/20/2005 19:36:20
Hi,

earlier today I wrote about two problems I saw with libtool. Now I can see
the cause of the first on in package graphics/glu.

I wrote:

> I am seeing the following two problems with libtool on Solaris 10 with
> the SunStudio 11 compiler and I suspect that both may be related to an
> incorrectly working libtool:
> 
> 
>   $ cd graphics/glu
>   $ bmake
>   ...
>   ===> Building for glu-6.2.1nb1
>   cd /var/tmp/pkgsrc-obj32.studio/graphics/glu/work/Mesa-6.2.1 &&
>   /usr/bin/rm -fr src/mesa src/glut src/glw progs 
>   (cd configs && rm -f current && ln -s sunos5 current)
>   /opt/studio/pkg-current32/bin/bmake default
>   Making sources for sunos5
>   libtool  --mode=compile  cc -c -I../../../include -Iinclude -Iinternals
>   -Ilibnurbs/internals -Ilibnurbs/interface -Ilibnurbs/nurbtess -KPIC -Xa
>   -O -I/usr/openwin/include -I/usr/dt/include -DUSE_XSHM -DNDEBUG
>   -DLIBRARYBUILD libutil/error.c -o libutil/error.o
>   libtool: compile: unable to infer tagged configuration
>   libtool: compile: specify a tag with `--tag'
>   *** Error code 1
> 
>   Stop.
> 
> I haven't got any idea what this option "--tag" is supposed to do, I
> could not found it in the info pages about libtool 1.5.18.

  [ "--tag" seems to refer to distinct sets of variables recorded in the
    installed libtool script. There are heuristics to recognize which
    set should be used for the different libtool modes but you can
    choose such a set explicitly by supplying its identifier/tag with
    "--tag" ] 

During the build of package libtool-base the compiler command was
recorded as CC=gcc and LTCC=gcc, although PKGSRC_COMPILER was set to
"sunpro". I suppose this was done because the wrapper framework provided
the necessary wrapper commands.

On the other hand, graphics/glu knows about Solaris and the compilers
from Sun and chose to use its configursation file "sunos5" (see above
"Making sources for sunos5"), thus using "cc" as the compiler command.

Because graphics/glu did not supply the "--tag" option, the heuristics
of libtool kicked in and tried to determine the necessary set of
variables. This did not work because the first heuristic used a pattern
of "*cc" which unfortunatly matched the file
work/Mesa-6.2.1/src/glu/sgi/dummy.cc and the other heuristics depended
on the recorded value for CC to be "gcc", obviously wrong here.

When I deleted the file dummy.cc, libtool did not complain about being
unable to determine the configuration, but this would probably break
further down the way.
When I forced graphics/glu to choose sunos5-gcc as its configuration (in
graphics/Mesa/Makefile.common) it worked as well.

I suppose this shows there is a clash between packages using libtool
which are, at the same time, able to recognize the real compiler used
behind the scenes.

For the problem at hand, I think we should force sunos5-gcc in
graphics/Mesa/Makefile.common on Solaris.

ciao
     Klaus