#!/bin/sh
+# quote() - Creates a shell literal
+# Usage: echo "...$( quote "..." )..."
+quote() {
+ case "$1" in
+ '') echo "''" ;;
+ *) echo "$1" | sed 's/\([^a-zA-Z0-9.:_\-\/]\)/\\\1/g' ;;
+ esac
+}
+
case $PERL_CONFIG_SH in
'')
if test -f config.sh
# Prefix all runs of 'miniperl' and 'perl' with
# $ldlibpth so that ./perl finds *this* shared libperl.
case "$LD_LIBRARY_PATH" in
- '')
- ldlibpth="LD_LIBRARY_PATH=`pwd`";;
- *)
- ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";;
+ '') ldlibpth="LD_LIBRARY_PATH=$( quote "`pwd`" )" ;;
+ *) ldlibpth="LD_LIBRARY_PATH=$( quote "`pwd`" ):$( quote "$LD_LIBRARY_PATH" )" ;;
esac
pldlflags="$cccdlflags"
ldlibpth=''
;;
*)
- eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
+ eval "ldlibpthval=\"\$$ldlibpthname\""
+
+ case "$ldlibpthval" in
+ '') ldlibpth="$ldlibpthname=$( quote "`pwd`" )" ;;
+ *) ldlibpth="$ldlibpthname=$( quote "`pwd`" ):$( quote "$ldlibpthval" )" ;;
+ esac
+
;;
esac
- # Strip off any trailing :'s
- ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
+
;;
esac
- case "$ldlibpth" in
- # Protect any spaces
- *" "*) ldlibpth=`echo $ldlibpth|sed 's/ /\\\\ /g'` ;;
- esac
-
case "$osname" in
linux)
# If there is a pre-existing $libperl from a previous