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