--- ltmain.sh.orig	Sat Mar 23 22:48:45 2002
+++ ltmain.sh	Sat Mar 23 22:45:38 2002
@@ -1553,6 +1553,8 @@
 	    convenience="$convenience $ladir/$objdir/$old_library"
 	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
 	    tmp_libs=
+	    # PKGW 
+	    dependency_libs=
 	    for deplib in $dependency_libs; do
 	      deplibs="$deplib $deplibs"
 	      case "$tmp_libs " in
@@ -1668,6 +1670,8 @@
 	  fi
 
 	  tmp_libs=
+	  #PKGW
+	  dependency_libs=
 	  for deplib in $dependency_libs; do
 	    case $deplib in
 	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
@@ -2081,7 +2085,7 @@
 	    -L*)
 	      case " $tmp_libs " in
 	      *" $deplib "*) ;;
-	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      *) tmp_libs="$deplib $tmp_libs" ;;
 	      esac
 	      ;;
 	    *) tmp_libs="$tmp_libs $deplib" ;;
