[libvirt] perl-Sys-Virt docs and linker options

The docs in libvirt-perl.git refer still to Makefile.PL. In the buildlog I noticed that somehow /usr/local is used, nothing uses the relevant flags from libvirt.pc: cc -shared -L/usr/local/lib64 -fstack-protector -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -lvirt But even the patch below just appends -L %{_libdir} to that command. Any idea how to suppress -L/usr/local/lib64? It happens to work for me, likely because the toolchain has /usr/lib64 in a default path. Olaf --- Sys-Virt-20180703T160550.57299b4.orig/Build.PL +++ Sys-Virt-20180703T160550.57299b4/Build.PL @@ -24,6 +24,7 @@ die "libvirt >= $libvirtver is required\ my $LIBVIRT_LIBS = `pkg-config --libs libvirt`; my $LIBVIRT_CFLAGS = `pkg-config --cflags libvirt`; +my $LIBVIRT_LIBDIR = `pkg-config --variable=libdir libvirt`; my $GCC_CFLAGS = ""; if ($ENV{TEST_MAINTAINER}) { @@ -76,7 +77,7 @@ my $b = Module::Build->new( 'perl' => '5.8.0', }, extra_compiler_flags => $GCC_CFLAGS . $LIBVIRT_CFLAGS, - extra_linker_flags => $LIBVIRT_LIBS, + extra_linker_flags => "-L" . $LIBVIRT_LIBDIR . $LIBVIRT_LIBS , build_requires => { 'ExtUtils::CBuilder' => 0, 'Sys::Hostname' => 0,

On Wed, Jul 04, 2018 at 12:05:27PM +0200, Olaf Hering wrote:
The docs in libvirt-perl.git refer still to Makefile.PL.
In the buildlog I noticed that somehow /usr/local is used, nothing uses the relevant flags from libvirt.pc:
cc -shared -L/usr/local/lib64 -fstack-protector -o blib/arch/auto/Sys/Virt/Virt.so lib/Sys/Virt.o -lvirt
But even the patch below just appends -L %{_libdir} to that command. Any idea how to suppress -L/usr/local/lib64? It happens to work for me, likely because the toolchain has /usr/lib64 in a default path.
I expect /usr/local/lib64 is coming from Perl/Module::Buld itself. Any -L/path needed for libvirt would be reported by pkgconfig, if it is needed. When you install libvirt into /usr, pkgconfig will never output -L/usr/lib64, because that's in the compilers default search path. It'll only output a -L flag if installed somewhere unusual $ PKG_CONFIG_PATH=/usr/lib64/pkgconfig pkg-config --libs libvirt -lvirt $ PKG_CONFIG_PATH=/opt/libvirt/4.4.0/lib/pkgconfig pkg-config --libs libvirt -L/opt/libvirt/4.4.0/lib -lvirt So I'm not seeing anything that needs fixing here. Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
participants (2)
-
Daniel P. Berrangé
-
Olaf Hering