summaryrefslogtreecommitdiff
path: root/Makefile.SH
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-04-03 18:50:48 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-04-05 21:10:00 +0000
commit9b9c6f34276ee8dd10904b2f4e725d7aaa1617e5 (patch)
tree947503ce1e8ee95559d8e8d4d3d928824e671ed3 /Makefile.SH
parentf918d67792522c30e735f8e174d716ee850902e6 (diff)
downloadperl-9b9c6f34276ee8dd10904b2f4e725d7aaa1617e5.tar.gz
LD_PRELOAD hack, still badly flawed / a solution
Message-ID: <20030403125048.GA6107@ratsnest.hole> On linux, when building a shared library, generate a small shell wrapper, "preload", that preloads libperl.so only if it exists. Useful when the 'make' process stops before the link phase. p4raw-id: //depot/perl@19150
Diffstat (limited to 'Makefile.SH')
-rw-r--r--Makefile.SH39
1 files changed, 23 insertions, 16 deletions
diff --git a/Makefile.SH b/Makefile.SH
index 63e3176a95..676eb52dca 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -96,26 +96,32 @@ true)
ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
;;
esac
- ;;
-*) pldlflags=''
- static_target='static'
- ;;
-esac
-case "$ldlibpth" in
-# Protect any spaces
-*" "*) ldlibpth=`echo $ldlibpth|sed 's/ /\\\\ /g'` ;;
-esac
+ case "$ldlibpth" in
+ # Protect any spaces
+ *" "*) ldlibpth=`echo $ldlibpth|sed 's/ /\\\\ /g'` ;;
+ esac
-case "$osname" in
-linux)
- case "$useshrplib" in
- true)
- ldlibpth="LD_PRELOAD=\"\$\$LD_PRELOAD `pwd`/$libperl\" $ldlibpth"
- ;;
+ case "$osname" in
+ linux)
+ cat <<-'EOT' >| preload
+ #! /bin/sh
+ lib=$1
+ shift
+ test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD"
+ exec "$@"
+ EOT
+ chmod 755 preload
+ ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl"
+ ;;
+ os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
+ ;;
esac
+
;;
-os390) test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
+
+*) pldlflags=''
+ static_target='static'
;;
esac
@@ -944,6 +950,7 @@ _cleaner2:
rm -f lib/.exists lib/*/.exists lib/*/*/.exists
rm -f h2ph.man pstruct
rm -rf .config
+ rm -f preload
rm -f testcompile compilelog
-rmdir lib/B lib/Data lib/Digest
rm -rf lib/Encode