summaryrefslogtreecommitdiffstats
path: root/RPM4/src/Makefile.PL
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2017-10-29 17:12:03 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2017-11-06 11:20:34 +0100
commit66504834514cdf96f5a366864982f0d2a0267ea2 (patch)
treea131fd9331ebc3744d7201ba4a418ded101a7228 /RPM4/src/Makefile.PL
parent70228b90bc5d369b13ff9f06559ab700a4b9eac3 (diff)
downloadperl-RPM4-66504834514cdf96f5a366864982f0d2a0267ea2.tar
perl-RPM4-66504834514cdf96f5a366864982f0d2a0267ea2.tar.gz
perl-RPM4-66504834514cdf96f5a366864982f0d2a0267ea2.tar.bz2
perl-RPM4-66504834514cdf96f5a366864982f0d2a0267ea2.tar.xz
perl-RPM4-66504834514cdf96f5a366864982f0d2a0267ea2.zip
use ExtUtils::PkgConfig in order to find rpm
We need to include {cflags} even if empty on Linux as it contains -I/usr/local/include on eg: FreeBSD
Diffstat (limited to 'RPM4/src/Makefile.PL')
-rw-r--r--RPM4/src/Makefile.PL8
1 files changed, 5 insertions, 3 deletions
diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL
index 7474562..0295f36 100644
--- a/RPM4/src/Makefile.PL
+++ b/RPM4/src/Makefile.PL
@@ -2,6 +2,7 @@
# use 5.008;
use ExtUtils::MakeMaker;
+use ExtUtils::PkgConfig;
use Getopt::Long;
my $rpmv;
@@ -24,7 +25,8 @@ foreach (qw(
$rpmheaderlocation or die "Can't find rpmheader location";
-$rpmv ||= (`rpm --version` =~ /([\d\.]+)/)[0];
+my %cfg = ExtUtils::PkgConfig->find("rpm");
+$rpmv ||= $cfg{modversion};
open(my $FH, "> rpmversion.h") or die "Can't open rpmversion.h";
print $FH "/* File generated by Mafile.PL\n";
print $FH ' * $Id$' . "\n";
@@ -86,7 +88,7 @@ WriteMakefile(
VERSION_FROM => '../lib/RPM4.pm',
OBJECT => "RPM4.o $obj",
INC => "-I$rpmheaderlocation",
- LIBS => "-lrpmsign -lrpm -lrpmio -lrpmbuild -lpopt -lz -lbz2 $ldd",
- 'CCFLAGS' => "-Wall $fl",
+ LIBS => [ $cfg{libs} . " -lrpmsign -lrpmbuild $ldd" ],
+ CCFLAGS => "$cfg{cflags} -Wall $fl",
depend => { "RPM4.xs" => join(" ", @rpmconstantfiles) },
);