This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid adding null components to LD_LIBRARY_PATH, OpenBSD has trouble
authorGurusamy Sarathy <gsar@cpan.org>
Fri, 4 Feb 2000 07:06:10 +0000 (07:06 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
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
        ;;