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