Subject: Re: Shared libraries and libtool
To: Nick Hudson <skrll@netbsd.org>
From: Murray Armfield <murray@river-styx.org>
List: netbsd-help
Date: 03/22/2002 20:06:49
On Fri, 22 Mar 2002 19:40, you wrote:
> On Friday 22 March 2002 8:29 am, Murray Armfield wrote:
> > On Fri, 22 Mar 2002 19:01, you wrote:
> > > On Friday 22 March 2002 4:37 am, Murray Armfield wrote:
> > > > Hi Folks,
> > > > 	Is it possible to tell libtool to build only a shared library? On
> > > > libtool doco page it mentions options to do static only library; The
> > > > all-static option on link mode.
> > >
> > > There is a way at configure time to specify --with-pic that makes
> > > libtool prodcues only shared DSOs. devel/libtool-base is not configured
> > > with this option. Why would you want to do this?
>
> [...]
>
> > I'm playing with an update to textproc/xerces-c package and it only
> > builds a shared library. The software is not designed to build
> > statically. Hence it would be easier to just tell libtool to only build a
> > shared library rather than play around with the package unnecessarily.
>
> I don't see the harm in producing static libraries as well. Maybe you can
> post an example of where this is causing problems.
>
> Nick

The specific problem I'm trying to get around is the final linking stage of 
xerces-c. I have built all objects succesfully using libtool as documented in 
Packages.txt. Thought that if there was a quick answer to this, things might 
fall into place.

The error I have is...

/usr/pkg/bin/libtool  --mode=link c++ -DNETBSD -rpath /usr/pkg/lib 
-L/usr/home/admin/DEVELOPMENT/pkgsrc/textproc/xerces-c/work/.buildlink/lib  
-Wl,-R/usr/pkg/lib -version-info 1:7 -o 
/usr/home/admin/DEVELOPMENT/pkgsrc/textproc/xerces-c/work/xerces-c-src1_7_0/lib/libxerces-c1_7_0.so
<<<<<LOTS OF OBJECTS WITH .o EXTENSION>>>>>>>
libtool: link: warning: `-version-info' is ignored for programs


c++ -DNETBSD -Wl,-R/usr/pkg/lib -o 
/usr/home/admin/DEVELOPMENT/pkgsrc/textproc/xerces-c/work/xerces-c-src1_7_0/lib/libxerces-c1_7_0.so
<<<<<LOTS OF OBJECTS WITH .o EXTENSION>>>>
/usr/lib/crt0.o: In function `___start':
/usr/lib/crt0.o(.text+0xb8): undefined reference to `main'
gmake[1]: *** 
[/usr/home/admin/DEVELOPMENT/pkgsrc/textproc/xerces-c/work/xerces-c-src1_7_0/lib/libxerces-c1_7_0.so] 
Error
1
gmake[1]: Target `ALL' not remade because of errors.
gmake[1]: Leaving directory 
`/usr/home/admin/DEVELOPMENT/pkgsrc/textproc/xerces-c/work/xerces-c-src1_7_0/obj'
gmake: *** 
[/usr/home/admin/DEVELOPMENT/pkgsrc/textproc/xerces-c/work/xerces-c-src1_7_0/lib/libxerces-c1_7_0] 
Error 2
*** Error code 2

Stop.
make: stopped in /usr/home/admin/DEVELOPMENT/pkgsrc/textproc/xerces-c
*** Error code 1

Stop.
make: stopped in /home/admin/DEVELOPMENT/pkgsrc/textproc/xerces-c

Klaus Klein is updating this stuff starting with ICU where an earlier 
question on libtool usage on tech-pkg started (last month). I gave him my 
work on ICU as it worked on i386. I continued on xerces-c this time using 
libtool. 

Since I haven't used libtool much, just going off Packages.txt, I've probably 
done something wrong... Seems to think I'm building a program.

Any help would be highly appreciated.

Regards,
	Murray