Subject: REQUIRES= is broken with ldd having non-NetBSD-like output
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 02/10/2005 03:05:39
I noticed this week that new glibc 2.3.4 caused my ldd output to have
new first entry:

        linux-gate.so.1 =>  (0xffffe000)

I thought this caused my REQUIRES= to fail. But now I see none of it is
there. (PROVIDES= works fine it appears.)

ldd output on a NetBSD box is
\tab -lfoo => /path/to/libfoo.
(That is a space after the tab.)

This works on NetBSD:

   ldd foo | awk 'NF == 3 { print $3 }'

But does not work on Linux which has:
\tablibfoo => /path/to/libfoo (0xb777000)

This works on Linux:

 awk 'NF == 4 { print $3 }

Anyways, I had proposed that we should not use ldd and use objdump (for
NEEDED) on systems that provide it.

Until then do we need some operating system specific LDD_FIELDS variable,
like LDD_FIELDS=4 for Linux?

I now have LDD_FIELDS?=	3 and set to 4 in my own mk.conf
and use it for the above awk expression in bsd.pkg.mk. It works for me.

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/