X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2Fperl-shared%2FMakefile.PL;h=8dd92d69e7e6121ca609f4471a1fdf1ae4258ca4;hb=d4110e29da41ce702bcc3327e86768c6f266915e;hp=75834ecbeabaab8358bf87bd07d2223d3fa73994;hpb=f1352f994e3b5820f9fbad4f950d8598b6d578e7;p=rrdtool.git diff --git a/bindings/perl-shared/Makefile.PL b/bindings/perl-shared/Makefile.PL index 75834ec..8dd92d6 100644 --- a/bindings/perl-shared/Makefile.PL +++ b/bindings/perl-shared/Makefile.PL @@ -3,14 +3,20 @@ use Config; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. -# Specify the location of the archive containing PIC compiled object files. -my $R = ""; - - -for ($^O){ - /linux/ && do{ $R = "-Wl,--rpath -Wl,\$(RPATH)"}; - /hpux/ && do{ $R = "+b\$(RPATH)"}; - /solaris/ && do{ $R = "-R\$(RPATH)"}; +# if the last argument when calling Makefile.PL is RPATH=/... and ... is the +# path to librrd.so then the Makefile will be written such that RRDs.so knows +# where to find librrd.so later on ... +my $R=""; +if ($ARGV[-1] =~ /RPATH=(\S+)/){ + pop @ARGV; + my $rp = $1; + for ($^O){ + /linux/ && do{ $R = "-Wl,--rpath -Wl,$rp"}; + /hpux/ && do{ $R = "+b$rp"}; + /solaris/ && do{ $R = "-R$rp"}; + /bsd/ && do{ $R = "-R$rp"}; + /aix/ && do{ $R = "-Wl,-blibpath:$rp"}; + } } # darwin works without this because librrd contains its @@ -26,6 +32,9 @@ WriteMakefile( 'DEFINE' => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}", 'INC' => '-I../../src', # Perl will figure out which one is valid - 'dynamic_lib' => {'OTHERLDFLAGS' => "$librrd -lm"}, + #'dynamic_lib' => {'OTHERLDFLAGS' => "$librrd -lm"}, + 'depend' => {'RRDs.c' => "../../src/librrd.la"}, + 'LDFROM' => '$(OBJECT) '.$librrd, 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' } ); +