summaryrefslogtreecommitdiff
blob: 1b12c9b1a360d891104a20c550d7bddeac34679c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
--- ltmain.sh	2003-09-24 18:22:17.528129376 +0200
+++ ltmain.sh	2003-09-24 18:23:17.101072912 +0200
@@ -1582,6 +1582,8 @@
 	  # Only check for convenience libraries
 	  deplibs="$lib $deplibs"
 	  tmp_libs=
+	  # PKGW 
+	  dependency_libs=
 	  for deplib in $dependency_libs; do
 	    #echo "Adding $deplib to \$deplibs"
 	    deplibs="$deplib $deplibs"
@@ -1699,6 +1701,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
@@ -1860,6 +1864,16 @@
 		add="$dir/$linklib"
 	      elif test "$hardcode_minus_L" = yes; then
 		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case "$libdir" in
+		    [\\/]*)
+		      # Add the install location to the beginning, minimising possiblilty
+		      # of linking to older version of the lib already installed.
+		      add_dir="-L$inst_prefix_dir$libdir $add_dir"
+		      ;;
+		  esac
+		fi
 		add="-l$name"
 	      elif test "$hardcode_shlibpath_var" = yes; then
 		add_shlibpath="$dir"
@@ -1918,6 +1932,16 @@
 	    else
 	      # We cannot seem to hardcode it, guess we'll fake it.
 	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+	        case "$libdir" in
+	          [\\/]*)
+	            # Add the install location to the beginning, minimising possiblilty
+	            # of linking to older version of the lib already installed.
+	            add_dir="-L$inst_prefix_dir$libdir $add_dir"
+	            ;;
+	        esac
+	      fi
 	      add="-l$name"
 	    fi
 
@@ -2117,7 +2141,7 @@
 	    -L*)
 	      case " $tmp_libs " in
 	      *" $deplib "*) ;;
-	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      *) tmp_libs="$deplib $tmp_libs" ;;
 	      esac
 	      ;;
 	    *) tmp_libs="$tmp_libs $deplib" ;;