Subject: configure/libtool problems: kdelibs3 on 1.6
To: None <>
From: Mark Derbyshire <>
List: tech-pkg
Date: 10/17/2002 12:35:09
I'm converting some machines to NetBSD 1.6 and ran into problems building 
kdelibs3. I've worked around them all, but as I'm a newcomer, I'd like to 
determine what went wrong. All of the builds have been on mac68k and I 
pulled pkgsrc through sup on 5 Oct. Initially I built into /usr/pkg, but 
problems with some non-NetBSD packages finally forced me to deinstall and 
rebuild into /usr/local via mk.conf. I've since built a number of NetBSD 
packages without any problems, but things went haywire in kdelibs3 when 
building kde3. The only other non-standard thing I recall is using the 
NetBSD tcsh package as my shell.

1. The kdelibs3 configure script doesn't see that the NetBSD CUPS package 
is installed. First config.log complained that there was no -lcups lib, 
even though it was in /usr/local/lib. So I short circuited that and it next 
claimed that the header cups/cups.h wasn't there, in spite of the path 
being in /usr/local/include. Even config.log shows all the correct paths 
(especially /usr/local/include & lib) on the cc command lines.

I manually ran the CUPS conftest.c codes from configure using the cc 
command line as pasted from config.log. Both had no problem outside the 
script. I even dumped out the env and some other debug to make sure I had 
replicated the evals properly. Always worked fine outside but not inside 
the script. I wasted so much time (because of the 68k) that I finally 
hardcoded the CUPS results and at least things proceeded. Other configure 
checks seem to work before and after the CUPS checks and I didn't notice 
anything that would inherently cause the CUPS checks to fail. I also 
checked my manual tcsh env vars, but there was nothing related to the 
include paths. There are a lot of env vars in the script.

2. The kdelibs3 make started off with dcop. Things worked until the 
linking, when libtool started looking to build

*** Warning: linker path does not have real file for library -lgcc_pic.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libgcc_pic and none of the candidates passed a file format test
*** using a regex pattern. Last file checked: /usr/lib/libgcc_pic.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.

Of course anything that used DCOP afterwards (almost all) whined similarly, 
as I realized all the KDE shared libs were turning into statics, which was 
going to blow away my paltry 68k memory at runtime, even if this build ever 

I started tracing back the dependencies to libgcc_pic.a and they seemed 
legit. Not being a NetBSD geek, I wondered why this lib wasn't built as 
shared, until I went in with nm and found out it was. The mail archives 
hinted at the history of libgcc_pic.a and suggested the NetBSD libtool was 
tweaked to identify lib*_pic.a as shared. I realized that kdelibs3 was 
probably using its own libtool, so I slipped in the NetBSD version, which 
seems to cure the gcc_pic problem. I'm not sure I agree with the lib*_pic.a 
philosophy, but either way kdelibs3 has a problem.

3. The next problem hit building in kdelibs3.0.3/kdeprint/cups/cupsdconf2. 
The "make package" I did in x11/kde3 recursed down to this point and the 
compiles failed because they couldn't find cups/cups.h, cups/ipp.h and 
cups/language.h. But the cups directory with these files was still in 
/usr/local/include and the cc calls had more than one -I/usr/local/include. 
Having seen this in #1, I now felt that I had really done something wrong, 
but couldn't see what was happening.

Finally I cd'ed down to this directory and typed make: the compiles found 
all the include files and ran fine [Note: the make in cupsdconf2 did not 
completely work as it did not build the *.moc dependencies at all. When I 
did these manually, everything completed]. The same happened in the parent 

The kdelibs3 build is winding down and looks like my hacks are working. 
Still there should be a reason for the weird behavior I've seen with this 
package. I hope it's just me. If there's anything I can do to help, please 
let me know.


PS: I've listed the packages I have installed with pkg_info:

digest-20010807     Message digest wrapper utility
libtool-base-1.4.20010614nb9 Generic shared library support script (the 
script itself)
db4-4.0.14          Sleepycat Software's Berkeley DB version 4
perl-5.6.1nb7       Practical Extraction and Report Language
tcsh-6.12.00nb1     Extended C-shell with many useful features
gmake-3.79.1nb1     GNU version of 'make' utility
bison-1.35          GNU yacc(1) replacement
curl-7.9.7          client that groks URLs
wget-1.7nb1         Retrieve files from the 'net via HTTP and FTP
p5-Net-SSLeay-1.20  perl5 module for using OpenSSL
jpeg-6b             IJG's jpeg compression utilities
x11-links-0.8       shadow tree of links to X11R6 headers and libraries
MesaLib-3.4.2       Graphics library similar to SGI's OpenGL
glu-3.4.2           GLU polygon tesselation facility for Mesa
glut-3.4.2          GLUT Graphics library similar to SGI's OpenGL
lcms-1.06           Light Color Management System -- a color management 
mng-1.0.4           Multiple-image Network Graphics (MNG) reference library
png-1.2.4           Library for manipulating PNG images
freetype2-2.0.5     font rendering engine and library API
pth-1.4.1nb2        GNU Portable Thread library
qt3-libs-3.0.5      C++ X GUI toolkit
openldap-2.0.27     Lightweight directory access protocol server and client 
libaudiofile-0.2.3nb1 Sound library for SGI audio file
qt3-tools-3.0.5     QT GUI (WYSIWYG) builder and other tools
arts-1.0.3          Analog Real-Time Synthesizer
pcre-3.9            Perl Compatible Regular Expressions library
tiff-3.5.7          Library and tools for reading and writing TIFF data 
libiconv-1.8        character set conversion library
libxml2-2.4.24nb1   XML parser library for GNOME
libxslt-1.0.20      XSLT parser library for GNOME
openslp-1.0.9a      Open-source implementation of the Service Location 
cups-       Common UNIX Printing System