X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=bindings%2Fperl-shared%2FMakefile.PL;h=516cc39a50aaf7bd2af9908a1d8578e7940820c1;hb=ac2cd917b8b2c9a76824285c3d01050665d6b5c7;hp=b7732be459178295e68c133396a3bde17e40917c;hpb=5837606887a6d81e8b1f7588525cb1c8783fb62b;p=rrdtool.git diff --git a/bindings/perl-shared/Makefile.PL b/bindings/perl-shared/Makefile.PL index b7732be..516cc39 100644 --- a/bindings/perl-shared/Makefile.PL +++ b/bindings/perl-shared/Makefile.PL @@ -3,17 +3,34 @@ 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 $librrd = "-L../../src/.libs/ -lrrd_private" ; +# 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"}; + } +} + +# darwin works without this because librrd contains its +# install_name which will includes the final location of the +# library after it is installed. This install_name gets transfered +# to the perl shared object. + +my $librrd = "-L../../src/.libs/ $R -lrrd"; WriteMakefile( 'NAME' => 'RRDs', 'VERSION_FROM' => 'RRDs.pm', # finds $VERSION 'DEFINE' => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}", - 'INC' => '-I../../src -I../../libraries/gd1.3', - # where to look for the necessary libraries + 'INC' => '-I../../src', # Perl will figure out which one is valid - 'depend' => {'RRDs.c' => "../../src/.libs/librrd_private.a"}, 'dynamic_lib' => {'OTHERLDFLAGS' => "$librrd -lm"}, - 'realclean' => {FILES => 't/demo?.rrd t/demo?.gif' } + 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' } ); +