summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-09-27 23:47:39 +0200
committerNicholas Clark <nick@ccl4.org>2011-09-27 23:47:39 +0200
commit698ca84cd388c82246e9cc3789248bc413591374 (patch)
treee4f417eb94a7bef95325ba5c05ea29cc2caca0be /Configure
parentae60cb464cebf89579ec0ff91db8b792b2f1e7cd (diff)
downloadperl-698ca84cd388c82246e9cc3789248bc413591374.tar.gz
In Configure, refactor the test for procselfexe into a loop.
This removes code duplication, and makes it easy to add more variants. Based on a patch from Johann 'Myrkraverk' Oskarsson.
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure29
1 files changed, 14 insertions, 15 deletions
diff --git a/Configure b/Configure
index 1f0dbefee4..80923f6060 100755
--- a/Configure
+++ b/Configure
@@ -16047,23 +16047,22 @@ echo " "
procselfexe=''
val="$undef"
case "$d_readlink" in
-"$define")
- if $issymlink /proc/self/exe ; then
- $ls -l /proc/self/exe > reflect
- if $contains /`basename $ls` reflect >/dev/null 2>&1; then
- echo "You have Linux-like /proc/self/exe."
- procselfexe='"/proc/self/exe"'
- val="$define"
- fi
- fi
- if $issymlink /proc/curproc/file ; then
- $ls -l /proc/curproc/file > reflect
+ "$define")
+ set Linux /proc/self/exe BSD /proc/curproc/file
+ while test $# -gt 0; do
+ type=$1; try=$2
+ shift; shift
+ if $issymlink $try; then
+ $ls -l $try > reflect
if $contains /`basename $ls` reflect >/dev/null 2>&1; then
- echo "You have BSD-like /proc/curproc/file."
- procselfexe='"/proc/curproc/file"'
- val="$define"
+ echo "You have $type-like $try."
+ procselfexe='"'$try'"'
+ val="$define"
+ : This will break out of the loop
+ set X; shift
fi
- fi
+ fi
+ done
;;
esac
$rm -f reflect