Subject: Re: cad/pcb-current build failure on Solaris 9/sparc
To: John D. Baker <jdbaker@mylinuxisp.com>
From: Dan McMahill <dmcmahill@NetBSD.org>
List: tech-pkg
Date: 04/23/2004 07:46:34
On Fri, Apr 23, 2004 at 02:54:57AM -0500, John D. Baker wrote:
> On Wed, 21 Apr 2004, Dan McMahill wrote:
> 
> > > Undefined                       first referenced
> > >  symbol                             in file
> > > yywrap                              parse_l.o
> > > ld: fatal: Symbol referencing errors. No output written to pcb-bin
> > > collect2: ld returned 1 exit status
> 
> > Right.  It wants flex instead of lex.  Can you try adding
> >
> > USE_GNU_TOOLS+=	lex
> >
> > to cad/pcb-current/Makefile
> >
> > and see if that fixes it?
> 
> Nope, I'm afraid it fails in exactly the same way, whether flex is
> installed (it was a dependency of a subsequently-installed package)
> or not (finds native lex on Solaris 9).

hmm.   USE_GNU_TOOLS+=     lex is actually supposed to do more than
make sure flex is installed.  It also should allow the pcb configure
script to find libfl.a (-lfl).  That _should_ have fixed it.  I'll try
to look more into this.

> The config output is a telltale:
> 
> [...]
> checking for flex... flex
> checking for yywrap in -lfl... no
> checking for yywrap in -ll... yes
> [...]

Right.  This is certainly the problem.  Its even a pcb FAQ....

> And the corresponding segment in pcb-current/work/pcb-20040215/config.log:
> 
> [...]
> configure:2845: checking for flex
> configure:2861: found /usr/pkg/bin/flex
> configure:2871: result: flex
> configure:2884: checking for yywrap in -lfl
> configure:2914: gcc -o conftest -O -I/usr/pkg/include -I/usr/pkg/include -L/usr/
> pkg/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3 -Wl,-R/usr/pkg/gcc3/lib/gcc-lib/sp
> arc-sun-solaris2/3.3.3 -L/usr/pkg/gcc3/lib -Wl,-R/usr/pkg/gcc3/lib -L/usr/pkg/li
> b -Wl,-R/usr/pkg/lib -L/usr/openwin/lib -Wl,-R/usr/openwin/lib conftest.c -lfl
>  >&5
> ld: fatal: library -lfl: not found
> ld: fatal: File processing errors. No output written to conftest
> collect2: ld returned 1 exit status


> Only /usr/pkg/lib/libfl.a was built, no dynamic library, but even
> then, the config script can't find it.

I see that there is a -L/usr/pkg/lib up there.  So I guess the devel/flex 
buildlink3 stuff isn't set up right.  Otherwise we would find -lfl.


> configure:2946: result: no
> configure:2951: checking for yywrap in -ll
> configure:2981: gcc -o conftest -O -I/usr/pkg/include -I/usr/pkg/include -L/usr/
> pkg/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.3 -Wl,-R/usr/pkg/gcc3/lib/gcc-lib/sp
> arc-sun-solaris2/3.3.3 -L/usr/pkg/gcc3/lib -Wl,-R/usr/pkg/gcc3/lib -L/usr/pkg/li
> b -Wl,-R/usr/pkg/lib -L/usr/openwin/lib -Wl,-R/usr/openwin/lib conftest.c -ll
> >&5
> configure:2987: $? = 0
> configure:2991: test -z
>        || test ! -s conftest.err
> configure:2994: $? = 0
> configure:2997: test -s conftest
> configure:3000: $? = 0
> configure:3013: result: yes
> 
> [...]
> 
> It finds /usr/lib/libl.{a|so|so.$ver} OK, but neither -lfl nor -ll are
> specified to the linker in:

It is strange that -ll is not included, but I'm still wondering why
USE_GNU_TOOLS+=	lex
didn't help pcb find -lfl....

I'll look more tonight.

-Dan

--