Ok, so, I figured out a couple ways to fix this, which I thought I would
share.  The first method would be to add the following into the spec
file itself.

case "%{l_platform -t}" in
        *-sunos* ) ldflags="$ldflags -lrt" ;;
esac

This method resolves the necessary "-lrt" on Solaris systems, however it
requires modifying the spec file.  This other method, simply involves
editing the local users' ".rpmmacros" file to include the following line
on Solaris systems.

%l_ldflags              -lrt

By doing this second method, it should solve all of the problematic
"-lrt" issues on Solaris systems without having to modify spec files at
all.  This is theory, as I haven't fully tested it yet.  It is also a
method used on OpenPKG 2.3 and may not be applicable or even necessary
in newer versions.  I mainly just wanted to let those who are still
using the older version know.

Oh, and as a side note, openssh will fail to build even with "-lrt" if
you have enabled the with_private_namespace option within tcpwrappers.
You will get an error as such if it is enabled:

: undefined reference to `sock_host'
collect2: ld returned 1 exit status
make: *** [sshd] Error 1
make: *** Waiting for unfinished jobs....

FYI.

On Tue, 2006-02-21 at 14:56 -0800, David M. Fetter wrote: 
> So, Mark over here figured out that it is another "-lrt" thing in
> solaris.  Is this something that is fixed in newer OpenPKG versions?  We
> are probably going to be upgrading in the near future, but I was just
> curious if it has been addressed.
> 
> See Mark's comments here:
> 
> If you look at the config.log in
> the /usr/local/RPM/USER/TMP/openssh-3.9p1. 
> Here is why it failed:
> 
> configure:9555: /usr/local/bin/gcc -o conftest -O2 -pipe 
> -I/usr/local/include  -I/usr/include -DWITH_LDAP_PUBKEY -Wall 
> -Wpointer-arith -Wno-uninitialized -I/usr/local/include 
> -I/usr/local/include  -L/usr/local/lib -R/usr/local/lib
> -L/usr/local/lib 
> -R/usr/local/lib -L/usr/local/lib -L/usr/local/lib  -L/lib -lldap
> -llber 
> -lcrypto -lssl conftest.c -lwrap -lz -lfsl -lsocket -lnsl >&5
> /usr/local/lib/libwrap.so(misc.o)(.text+0x1b4): In function 
> `tcpd_safe_sleep':
> : undefined reference to `nanosleep'
> collect2: ld returned 1 exit status
> configure:9561: $? = 1
> configure: failed program was:
> 
> The " undefined reference to `nanosleep'" is the problem. If you do a
> "man 
> nanosleep" on Solaris it shows that you need to use "-lrt" to link an 
> executable with nanosleep.
> 
> I think this is the same problem that berkely db has.
> 
> 
> On Tue, 2006-02-21 at 12:40 -0800, David M. Fetter wrote:
> > Ok, so I'm pretty sure that this has been brought up and even fixed a
> > while back, but I'm having some issue with this working.  Now we're
> > still using OpenPKG 2.3 and that might be part of the issue.  It builds
> > fine on RHEL3 but not on Solaris 9.  I get the infamous error of
> > "checking for libwrap... configure: error: *** libwrap missing".  The
> > only reference I found on this however in the mailing list archives was
> > related to a patch but it seemed to be quite old and supposedly was
> > adopted right away.  Can anybody help me out here?
> > 
-- 
David M. Fetter - UNIX System Administrator
"Change is inevitable. Growth is optional." ~unknown

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to