Subject: buildlink2 problems with new libogg and libvorbis packages
To: NetBSD Packages Technical Discussion List <tech-pkg@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 10/04/2002 14:31:34
I was attempting to upgrade vorbis-tools and all the libraries it uses,
and suddenly found that audio/libvorbis wouldn't build.  It seemed as
though the configure sript was insisting on finding a libpthread, so I
made the following change:

Index: audio/libvorbis/Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/audio/libvorbis/Makefile,v
retrieving revision 1.21
diff -c -r1.21 Makefile
*** audio/libvorbis/Makefile	2 Oct 2002 19:45:55 -0000	1.21
--- audio/libvorbis/Makefile	4 Oct 2002 18:09:06 -0000
***************
*** 17,21 ****
--- 17,22 ----
  PLIST_SUBST+=		DISTNAME=${DISTNAME}
  
  .include "../../audio/libogg/buildlink2.mk"
+ .include "../../devel/pth/buildlink2.mk"
  .include "../../lang/gcc/buildlink2.mk"
  .include "../../mk/bsd.pkg.mk"


However now configure bombs out when trying to test libogg because
LDFLAGS in its environment doesn't include "-Wl,-R${PREFIX}/lib":

	checking for pthread_create in -lpthread... yes
	checking for Ogg... no
	*** Could not run Ogg test program, checking why...
	*** The test program compiled, but did not run. This usually means
	*** that the run-time linker is not finding Ogg or finding the wrong
	*** version of Ogg. If it is not finding Ogg, you'll need to set your
	*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point
	*** to the installed location  Also, make sure you have run ldconfig if that
	*** is required on your system
	***
	*** If you have an old version installed, it is best to remove it, although
	*** you may also be able to get things to work by modifying LD_LIBRARY_PATH
	configure: error: must have Ogg installed!
	*** Error code 1
	
	Stop.
	make: stopped in /work/woods/m-NetBSD-pkgsrc/audio/libvorbis
	*** Error code 1

FYI the underlying error (which unfortunately does not appear in
config.log for reasons I don't quite understand) is:

	$ ./conftest
	Shared object "libogg.so.4" not found

I could fix that with a quick hack to LDFLAGS, but isn't that something
the 'cc' wrapper in buildlink2 should be doing automatically?

Is -lpthread really required? or was that just an artifact of the libogg
test not working right?

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>