Skip Menu |

This queue is for tickets about the Config-AutoConf CPAN distribution.

Report information
The Basics
Id: 125274
Status: resolved
Priority: 0/
Queue: Config-AutoConf

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.316
Fixed in: (no value)



Subject: pkg_config_package_flags() does not work as documented
Documentation reads: pkg_config_package_flags($package, \%options?) Search for pkg-config flags for package as specified. The flags which are extracted are "--cflags" and "--libs". The extracted flags are appended to the global "extra_compile_flags" and "extra_link_flags", respectively. In case, no package configuration matching given criteria could be found, return a "false" value (0). But the extra_link_flags is not set for me. Here is a simple code that is supposed to read libstatgrab linker flags: #!/usr/bin/perl use Config::AutoConf; my $c = Config::AutoConf->new; $c->pkg_config_package_flags('libstatgrab') or die; print 'extra_link_flags: ' . join(' ', @{$c->{extra_link_flags}}) . "\n"; print 'extra_libs: ' . join(' ', @{$c->{extra_libs}}) . "\n"; print '_get_extra_linker_flags: ' . $c->_get_extra_linker_flags . "\n"; print 'pkg-config --libs: ' . `pkg-config --libs libstatgrab`; And the output is: Checking for pkg-config... /usr/bin/pkg-config Checking for pkg-config package of libstatgrab... -lstatgrab extra_link_flags: extra_libs: statgrab _get_extra_linker_flags: -lstatgrab pkg-config --libs: -lstatgrab As you can see the extra_link_flags array is empty contrary to the documentation. When reading Config::AutoConf I found that extra_libs and _get_extra_linker_flags. It looks like _get_extra_linker_flags method is the right way how to retrieve the linker flags. Is it possible to correct the code or the documentation? I found it when investigating Unix-Statgrab failure after Config-Autoconf upgrade (CPAN RT#125204).
Thanks for the ticket. I updated the code according the requirements of CBuilder and MakeMaker (see https://github.com/perl5-utils/Lib-Log4cplus) but forgot to update the documentation and present a reasonable synopsis (how is this method meant, how to use etc.).
Subject: Re: [rt.cpan.org #125274] pkg_config_package_flags() does not work as documented
Date: Wed, 9 May 2018 13:58:34 +0200
To: Jens Rehsack via RT <bug-Config-AutoConf [...] rt.cpan.org>
From: Petr Pisar <ppisar [...] redhat.com>
On Wed, May 09, 2018 at 03:06:10AM -0400, Jens Rehsack via RT wrote: Show quoted text
That looks good. -- Petr
Documentation improved and minor issues around that fixed.