perl-dynloader.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 25a26c52c320e699b37a7ad1f4f045bc8aa4cb00 Mon Sep 17 00:00:00 2001
  2. From: Richard Purdie <richard@openedhand.com>
  3. Date: Sun, 27 May 2007 21:04:11 +0000
  4. Subject: [PATCH] perl: 5.8.7 -> 5.8.8 (from OE)
  5. Upstream-Status: Inappropriate [embedded specific]
  6. Allow the location that .so files are searched for for dynamic
  7. loading to be changed via an environment variable. This is to allow
  8. us to load .so's from the host system while building for the target
  9. system.
  10. Update by Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/21
  11. ---
  12. dist/XSLoader/XSLoader_pm.PL | 18 ++++++++++++++++++
  13. 1 file changed, 18 insertions(+)
  14. diff --git a/dist/XSLoader/XSLoader_pm.PL b/dist/XSLoader/XSLoader_pm.PL
  15. index ff5ca31..0d50803 100644
  16. --- a/dist/XSLoader/XSLoader_pm.PL
  17. +++ b/dist/XSLoader/XSLoader_pm.PL
  18. @@ -32,6 +32,24 @@ sub load {
  19. my ($caller, $modlibname) = caller();
  20. my $module = $caller;
  21. + # OE: Allow env to form dynamic loader to look in a different place
  22. + # This is so it finds the host .so files, not the targets
  23. + if (defined $ENV{PERLHOSTLIB})
  24. + {
  25. + my $hostlib = $ENV{PERLHOSTLIB};
  26. + my $hostarchlib = $ENV{PERLHOSTARCHLIB};
  27. + print STDERR "*** Module name IN: $modlibname\n";
  28. + my ($p1, $p2, $p3, $p4, $p5, $p6, $p7) = $modlibname =~ m/(^(.*lib\w*\/)?)((perl5\/[0-9\.]*\/)?)(([^\/]*)\/)?(.*)$/;
  29. + print STDERR "*** p1: $p1 p3: $p3 p5: $p5 p7: $p7\n";
  30. + if ( $p1 ne "" ) {
  31. + $modlibname = $hostlib.$p7;
  32. + }
  33. + if ( $p6 ne "" ) {
  34. + $modlibname = $hostarchlib.$p7;
  35. + }
  36. + print STDERR "*** Module name OUT: $modlibname\n";
  37. + }
  38. +
  39. if (@_) {
  40. $module = $_[0];
  41. } else {