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