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