Subject: Re: when should mk/dlopen.buildlink3.mk be used? and chat/gaim
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 08/13/2005 14:42:12
On Sat, 13 Aug 2005, Todd Vierling wrote:

>> mk/dlopen.buildlink3.mk is not covered in the pkgsrc guide.
>>
>> When should it be used?
>
> Whenever dlopen is used in the package.  For instance, packages that use
> devel/libltdl (a dlopen abstraction layer) indirectly include
> dlopen.buildlink3.mk also.
>
>> /usr/lib/silc/libsilc.so: undefined reference to `dlerror'
>> /usr/lib/silc/libsilc.so: undefined reference to `dlclose'
>> /usr/lib/silc/libsilc.so: undefined reference to `dlopen'
>> /usr/lib/silc/libsilc.so: undefined reference to `dlsym'
>
> Then yes, dlopen.buildlink3.mk is needed.  It's a no-op on platforms with
> dlopen in libc -- such as NetBSD.

I first tried with including it with the silc-toolkit before building and 
install it. Then I tried with chat/gaim. But neither worked.

Then I saw that patch-ad removes the -ldl from the configure script.

My CONFIGURE_ENV has:

PTHREAD_CFLAGS=\ -pthread\  PTHREAD_LDFLAGS=\ -pthread 
PTHREAD_LIBS=-lpthread\ -lrt PTHREADBASE=/usr 
DL_CFLAGS="" DL_LDFLAGS="" DL_LIBS=""
...

My libdl comes from pkgsrc installed glibc (my package). I don't have a 
buildlink3.mk file for it and I install to /usr. So I set 
IS_BUILTIN.dl=yes,

I see mk/dlopen.builtin.mk has:

# No need to add this to BUILDLINK_LIBS.dl since most GNU configure
# scripts already check for -ldl themselves.
#
BUILDLINK_LDADD.dl=     -ldl

And the gaim configure script does check for libdl and also it does: 
pkg-config --libs "silcclient" which returns:

-L/usr/lib/silc -lsilcclient -ldl -lpthread -lsilc

I don't know why it doesn't use the above -ldl and I don't know why it 
doesn't use the -ldl is detected.

I will ask the gaim developers about this.


  Jeremy C. Reed

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