From bf9335cef72ca7707e8e7b71e3ec99bc87762dd1 Mon Sep 17 00:00:00 2001 From: oetiker Date: Thu, 5 Jan 2006 20:39:12 +0000 Subject: [PATCH] let the building of the perl extension be more reliable ... git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@740 a5681a0c-68f1-0310-ab6d-d61299d08faa --- bindings/Makefile.am | 4 ++-- bindings/perl-shared/Makefile.PL | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/bindings/Makefile.am b/bindings/Makefile.am index 6594e18..67df11f 100644 --- a/bindings/Makefile.am +++ b/bindings/Makefile.am @@ -28,10 +28,10 @@ perl-piped/Makefile: perl-piped/Makefile.PL cd perl-piped && $(PERL) Makefile.PL $(PERL_MAKE_OPTIONS) perl_shared: perl-shared/Makefile - cd perl-shared && $(MAKE) RPATH=$(exec_prefix)/lib + cd perl-shared && $(MAKE) perl-shared/Makefile: perl-shared/Makefile.PL - cd perl-shared && $(PERL) Makefile.PL $(PERLFLAGS) $(PERL_MAKE_OPTIONS) + cd perl-shared && $(PERL) Makefile.PL $(PERLFLAGS) $(PERL_MAKE_OPTIONS) RPATH=$(exec_prefix)/lib # LIBS="$(LDFLAGS) $(LIBS)" $(PERLFLAGS) $(PERL_MAKE_OPTIONS) clean-local: diff --git a/bindings/perl-shared/Makefile.PL b/bindings/perl-shared/Makefile.PL index 75834ec..516cc39 100644 --- a/bindings/perl-shared/Makefile.PL +++ b/bindings/perl-shared/Makefile.PL @@ -3,14 +3,18 @@ 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"}; + } } # darwin works without this because librrd contains its @@ -29,3 +33,4 @@ WriteMakefile( 'dynamic_lib' => {'OTHERLDFLAGS' => "$librrd -lm"}, 'realclean' => {FILES => 't/demo?.rrd t/demo?.png' } ); + -- 2.11.0