--- ltmain.sh 2014-11-29 08:42:58.000000000 -0800 +++ ltmain.sh.new 2016-01-20 04:13:31.816743474 -0800 @@ -8316,7 +8316,7 @@ test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then - add_dir=-L$libdir + add_dir=-L$lt_sysroot/$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in @@ -8333,7 +8333,7 @@ fi else # We cannot seem to hardcode it, guess we'll fake it. - add_dir=-L$libdir + add_dir=-L$lt_sysroot/$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in