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