Subject: Re: pkg/33665 (g-wrap Makefile needs to set LTDL_LIBRARY_PATH)
To: None <gdt@NetBSD.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,>
From: Darrin B.Jewell <dbj@netbsd.org>
List: pkgsrc-bugs
Date: 10/07/2006 22:20:05
The following reply was made to PR pkg/33665; it has been noted by GNATS.

From: "Darrin B.Jewell" <dbj@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: gdt@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	gdt@netbsd.org
Subject: Re: pkg/33665 (g-wrap Makefile needs to set LTDL_LIBRARY_PATH)
Date: 07 Oct 2006 15:14:54 -0700

 I've actually investigated this quite a bit further, but haven't
 had the chance to write it up.  Instead of the original patch, I have
 been running more recently with the patch included below to the guile
 buildlink support, which adds this for all guile dependent packages,
 but it's basically the same idea.
 
 I've tracked this down much further and determed that on most
 platforms, the ltdl will eventually fall back to the system dlopen
 which will look in the rpath coded in the binary.  However, darwin
 doesn't have an rpath, and instead uses abolute paths on each of the
 libraries listed in a binary.  (There is a tools for editing them if
 they move, install_name_tool(1)).  Therefore darwin requires the
 environment var to be set for guile to find its modules, since
 loaded modules do not have an abolute path in the binary.
 
 Btw, guile doesn't need a buildlink or dependency on devel/libltdl,
 it ships with its own modified copy of ltdl which is the one it
 seems to be using.
 
 Thanks,
 Darrin
 
 Index: buildlink3.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/guile/buildlink3.mk,v
 retrieving revision 1.11
 diff -u -r1.11 buildlink3.mk
 --- buildlink3.mk       8 Jul 2006 23:10:55 -0000       1.11
 +++ buildlink3.mk       7 Oct 2006 21:53:59 -0000
 @@ -17,7 +17,12 @@
  BUILDLINK_PKGSRCDIR.guile?=    ../../lang/guile
  .endif # GUILE_BUILDLINK3_MK
  
 +.include "../../mk/bsd.prefs.mk"
 +.if ${OPSYS} == "Darwin"
 +CONFIGURE_ENV+=                LTDL_LIBRARY_PATH=${LOCALBASE}/lib
 +MAKE_ENV+=             LTDL_LIBRARY_PATH=${LOCALBASE}/lib
 +.endif
 +
  .include "../../devel/libltdl/buildlink3.mk"
  .include "../../devel/ncurses/buildlink3.mk"
  .include "../../devel/readline/buildlink3.mk"
  .include "../../mk/pthread.buildlink3.mk"