Subject: Undesired buildlink2 <--> libtool interaction
To: Johnny C. Lam <>
From: Rene Hexel <>
List: tech-pkg
Date: 10/29/2002 18:34:49
  I've just been trying to convert the libgda package from PR 18660 from
buildlink1 to buildlink2 and had an interesting experience:

  The package uses libtool to create a number of shared libraries and a
main library, libgda, that uses some of the other libraries.  What
happens is that the package links using something like

libtool --mode=link cc -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -o
-rpath /usr/pkg/lib -version-info 1:1:0  *.lo  -Wl,--export-dynamic
../libsql/ <some_other_libs>

  Due to this, libtool decides it needs to relink against libgdasql
during install time.  Therefore, when 'make install' calls

  libtool --mode install ${BSD_INSTALL_DATA} /usr/pkg/lib

  this includes performing a

  cc -o -Wl,-R/usr/pkg/lib -L/usr/pkg/lib ... -lgdasql

  Without buildlink2, this works fine, because libgdasql has already
been installed at its final location (/usr/pkg/lib) at this stage.

  With buildlink2, this won't work, because the 'cc' wrapper translates
-L to point to the buildlink directory (which won't contain the freshly
generated libgdasql, of course).

  Any ideas how such problems should be solved without ugly tricks like
manually copying the library to the .buildlink directory during
pre-install, or switching off buildlink in the install phase?