Subject: Undesired buildlink2 <--> libtool interaction
To: Johnny C. Lam <jlam@netbsd.org>
From: Rene Hexel <rh@netbsd.org>
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 libgda-2.la
-rpath /usr/pkg/lib -version-info 1:1:0 *.lo -Wl,--export-dynamic
../libsql/libgdasql.la <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} libgda-2.la /usr/pkg/lib
this includes performing a
cc -o libgda-2.so.1.1 -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?
Cheers
,
Rene