44f22e
From c2fc4b379565552ba6c82553ceceb7d4cd754cc5 Mon Sep 17 00:00:00 2001
44f22e
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
44f22e
Date: Tue, 2 Jul 2013 10:28:15 +0200
44f22e
Subject: [PATCH] Link to libperl explicitly on Linux
44f22e
MIME-Version: 1.0
44f22e
Content-Type: text/plain; charset=UTF-8
44f22e
Content-Transfer-Encoding: 8bit
44f22e
44f22e
<https://bugzilla.redhat.com/show_bug.cgi?id=960048>
44f22e
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327585#50>
44f22e
44f22e
Signed-off-by: Petr Písař <ppisar@redhat.com>
44f22e
---
44f22e
 lib/ExtUtils/MM_Unix.pm | 8 +++++++-
44f22e
 1 file changed, 7 insertions(+), 1 deletion(-)
44f22e
44f22e
diff --git a/lib/ExtUtils/MM_Unix.pm b/lib/ExtUtils/MM_Unix.pm
44f22e
index 25a1778..fcd130a 100644
44f22e
--- a/lib/ExtUtils/MM_Unix.pm
44f22e
+++ b/lib/ExtUtils/MM_Unix.pm
44f22e
@@ -30,6 +30,7 @@ BEGIN {
44f22e
     $Is{IRIX}    = $^O eq 'irix';
44f22e
     $Is{NetBSD}  = $^O eq 'netbsd';
44f22e
     $Is{Interix} = $^O eq 'interix';
44f22e
+    $Is{Linux}   = $^O eq 'linux';
44f22e
     $Is{SunOS4}  = $^O eq 'sunos';
44f22e
     $Is{Solaris} = $^O eq 'solaris';
44f22e
     $Is{SunOS}   = $Is{SunOS4} || $Is{Solaris};
44f22e
@@ -1022,7 +1023,7 @@ sub xs_make_dynamic_lib {
44f22e
     push(@m,"	\$(RM_F) \$\@\n");
44f22e
 
44f22e
     my $libs = '$(LDLOADLIBS)';
44f22e
-    if (($Is{NetBSD} || $Is{Interix} || $Is{Android}) && $Config{'useshrplib'} eq 'true') {
44f22e
+    if (($Is{Linux} || $Is{NetBSD} || $Is{Interix} || $Is{Android}) && $Config{'useshrplib'} eq 'true') {
44f22e
         # Use nothing on static perl platforms, and to the flags needed
44f22e
         # to link against the shared libperl library on shared perl
44f22e
         # platforms.  We peek at lddlflags to see if we need -Wl,-R
44f22e
@@ -1035,6 +1036,11 @@ sub xs_make_dynamic_lib {
44f22e
             # The Android linker will not recognize symbols from
44f22e
             # libperl unless the module explicitly depends on it.
44f22e
             $libs .= ' "-L$(PERL_INC)" -lperl';
44f22e
+        } else {
44f22e
+            if ($ENV{PERL_CORE}) {
44f22e
+                $libs .= ' -L$(PERL_INC)';
44f22e
+            }
44f22e
+            $libs .= ' -lperl';
44f22e
         }
44f22e
     }
44f22e
 
44f22e
-- 
44f22e
2.5.5
44f22e