summaryrefslogtreecommitdiffstats
path: root/RPM4/src/Makefile.PL
diff options
context:
space:
mode:
authornanardon <nanardon@971eb68f-4bfb-0310-8326-d2484c010a4c>2005-12-20 11:30:54 +0000
committernanardon <nanardon@971eb68f-4bfb-0310-8326-d2484c010a4c>2005-12-20 11:30:54 +0000
commitf14f74db3b500c14524312c0bb8e9d73c4c52162 (patch)
treef5d8f0232f123a8bac0f41c0fd522107fd02f121 /RPM4/src/Makefile.PL
parent15fd90f047eeb5405a4a9739d59bbf9d1ee3958c (diff)
downloadperl-RPM4-f14f74db3b500c14524312c0bb8e9d73c4c52162.tar
perl-RPM4-f14f74db3b500c14524312c0bb8e9d73c4c52162.tar.gz
perl-RPM4-f14f74db3b500c14524312c0bb8e9d73c4c52162.tar.bz2
perl-RPM4-f14f74db3b500c14524312c0bb8e9d73c4c52162.tar.xz
perl-RPM4-f14f74db3b500c14524312c0bb8e9d73c4c52162.zip
- try to autodetect rpm headers location
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@81 971eb68f-4bfb-0310-8326-d2484c010a4c
Diffstat (limited to 'RPM4/src/Makefile.PL')
-rw-r--r--RPM4/src/Makefile.PL18
1 files changed, 16 insertions, 2 deletions
diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL
index e01eade..133464d 100644
--- a/RPM4/src/Makefile.PL
+++ b/RPM4/src/Makefile.PL
@@ -9,6 +9,20 @@ GetOptions(
'rebuildh' => \my $rebh,
);
+my $rpmheaderlocation;
+
+foreach (qw(
+ /usr/include
+ /usr/local/include
+ )) {
+ if (-d "$_/rpm") {
+ $rpmheaderlocation = "$_/rpm";
+ last;
+ }
+}
+
+$rpmheaderlocation or die "Can't find rpmheader location";
+
my $rpmv ||= (`rpm --version` =~ /([\d\.]+)/)[0];
open($FH, "> rpmversion.h") or die "Can't open rpmversion.h";
print $FH "/* File generated by Mafile.PL\n";
@@ -50,7 +64,7 @@ rpmversion.h:
\$(PERL) Makefile.PL --rebuildh
rpmconstanttbl.c: Makefile rpmh2tbl
- perl rpmh2tbl /usr/include/rpm/*.h > \$@
+ perl rpmh2tbl $rpmheaderlocation/*.h > \$@
RPMCONSTTBL
# This code is to reduce duplication of files
@@ -71,7 +85,7 @@ WriteMakefile(
NAME => 'RPM4',
VERSION_FROM => '../lib/RPM4.pm',
OBJECT => "RPM4.o RPM4sign.o $obj",
- INC => '-I/usr/include/rpm',
+ INC => "-I$rpmheaderlocation",
LIBS => "-lrpm -lrpmio -lrpmdb -lrpmbuild -lpopt -lz -lbz2 $ldd",
'CCFLAGS' => $fl,
depend => { "RPM4.xs" => join(" ", @rpmconstantfiles) },