From: oetiker Date: Thu, 5 Jan 2006 20:39:12 +0000 (+0000) Subject: let the building of the perl extension be more reliable ... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=058e21d399f637cfb60d6ea69a0e5f82e4b6279a;p=rrdtool-all.git let the building of the perl extension be more reliable ... git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2@740 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/bindings/Makefile.am b/program/bindings/Makefile.am index 6594e184..67df11f5 100644 --- a/program/bindings/Makefile.am +++ b/program/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/program/bindings/perl-shared/Makefile.PL b/program/bindings/perl-shared/Makefile.PL index 75834ecb..516cc39a 100644 --- a/program/bindings/perl-shared/Makefile.PL +++ b/program/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' } ); +