avoid adding null components to LD_LIBRARY_PATH, OpenBSD has trouble
Gurusamy Sarathy [Fri, 4 Feb 2000 07:06:10 +0000 (07:06 +0000)]
with them (from Todd C. Miller <Todd.Miller@courtesan.com>)

p4raw-id: //depot/perl@4977

Makefile.SH

index fc1b606..044317d 100644 (file)
@@ -30,7 +30,12 @@ case "$useshrplib" in
 true)
        # Prefix all runs of 'miniperl' and 'perl' with 
        # $ldlibpth so that ./perl finds *this* shared libperl.
-       ldlibpth="LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH"
+       case "$LD_LIBRARY_PATH" in
+       '')
+               ldlibpth="LD_LIBRARY_PATH=`pwd`";;
+       *)
+               ldlibpth="LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}";;
+       esac
 
        pldlflags="$cccdlflags"
        case "${osname}${osvers}" in
@@ -78,6 +83,8 @@ true)
                eval "ldlibpth=\"$ldlibpthname=`pwd`:\$$ldlibpthname\""
                ;;
            esac
+           # Strip off any trailing :'s
+           ldlibpth=`echo $ldlibpth | sed 's/:*$//'`
            ;;
         esac
        ;;