From eb67d0bdd774241d93c7aad72fa894da725020aa Mon Sep 17 00:00:00 2001
From: Vladimir Smirnov <civil@gentoo.org>
Date: Mon, 19 May 2014 19:41:49 +0400
Subject: [PATCH] Set libperl soname

Bug-Gentoo: https://bugs.gentoo.org/286840

Patch-Name: gentoo/create_libperl_soname.diff

Ported to Perl 5.20
---
 Makefile.SH | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Makefile.SH b/Makefile.SH
index b65a7f3..a8b838f 100755
--- Makefile.SH
+++ Makefile.SH
@@ -59,7 +59,7 @@ true)
 				${api_revision}.${api_version}.${api_subversion} \
 			     -current_version \
 				${revision}.${patchlevel}.${subversion} \
-			     -install_name \$(shrpdir)/\$@"
+			     -install_name \$(shrpdir)/libperl.${revision}.${patchlevel}.dylib"
 		;;
 	cygwin*)
 		shrpldflags="$shrpldflags -Wl,--out-implib=libperl.dll.a -Wl,--image-base,0x52000000"
@@ -67,13 +67,15 @@ true)
 		;;
 	sunos*)
 		linklibperl="-lperl"
+		shrpldflags="$shrpldflags -Wl,-soname -Wl,libperl.so.${revision}.${patchlevel}"
 		;;
-	netbsd*|freebsd[234]*|openbsd*|dragonfly*|bitrig*)
+	netbsd*|freebsd*|openbsd*|dragonfly*|bitrig*)
 		linklibperl="-L. -lperl"
+		shrpldflags="$shrpldflags -Wl,-soname -Wl,libperl.so.${revision}.${patchlevel}"
 		;;
 	interix*)
 		linklibperl="-L. -lperl"
-		shrpldflags="$shrpldflags -Wl,--image-base,0x57000000"
+		shrpldflags="$shrpldflags -Wl,--image-base,0x57000000 -Wl,-soname -Wl,libperl.so.${revision}.${patchlevel}"
 		;;
 	aix*)
 		case "$cc" in
@@ -111,6 +113,9 @@ true)
 	    linklibperl='libperl.x'
 	    DPERL_EXTERNAL_GLOB=''
 	    ;;
+	linux*)
+	    shrpldflags="$shrpldflags -Wl,-soname -Wl,libperl.so.${revision}.${patchlevel}"
+	    ;;
 	esac
 	case "$ldlibpthname" in
 	'') ;;
-- 
1.9.3

