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