--- libtool-1.5/ltmain.in.rpath 2004-03-22 19:53:45.000000000 +0100 +++ libtool-1.5/ltmain.in 2004-03-22 21:00:55.000000000 +0100 @@ -2164,7 +2164,7 @@ # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. - case "$temp_rpath " in + case "$temp_rpath $rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; @@ -2177,7 +2177,7 @@ case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) - case "$compile_rpath " in + case "$compile_rpath $rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac @@ -2186,7 +2186,7 @@ case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) - case "$finalize_rpath " in + case "$finalize_rpath $rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac @@ -3071,7 +3071,7 @@ temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) finalize_rpath="$libdir $finalize_rpath" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then @@ -4043,7 +4043,7 @@ # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; + *) finalize_rpath="$libdir $finalize_rpath" ;; esac done fi @@ -4051,7 +4051,7 @@ # Now hardcode the library paths rpath= hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do + for libdir in $finalize_rpath $compile_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then