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