]> granicus.if.org Git - sudo/commitdiff
libtool patches for HP-UX to support DESTDIR
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 26 Jun 2014 21:50:56 +0000 (15:50 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 26 Jun 2014 21:50:56 +0000 (15:50 -0600)
configure
ltmain.sh
m4/libtool.m4

index 7f94f9cbbfddd969945acb82a74815d86d05325b..8b66569798ca253db57113d27b338d6f9ffdc067 100755 (executable)
--- a/configure
+++ b/configure
@@ -10957,6 +10957,8 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
   hardcode_libdir_separator=
   hardcode_minus_L=no
   hardcode_shlibpath_var=unsupported
+  fix_hardcoded_libdir_flag_spec=
+  fix_hardcoded_libdir_flag_spec_ld=
   inherit_rpath=no
   link_all_deplibs=unknown
   module_cmds=
 
     hpux10*)
       if test yes,no = "$GCC,$with_gnu_ld"; then
-       archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags $fix_hardcoded_libdir_flag'
       else
-       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags $fix_hardcoded_libdir_flag'
       fi
       if test no = "$with_gnu_ld"; then
-       hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+       hardcode_libdir_flag_spec='$wl+b $wl$libdir $fix_hardcoded_libdir_flag'
        hardcode_libdir_separator=:
        hardcode_direct=yes
        hardcode_direct_absolute=yes
        # hardcode_minus_L: Not really in the search PATH,
        # but as the default location of the library.
        hardcode_minus_L=yes
+       # gcc-3.0.1 (collect2) breaks on -Wl,+cdp.
+       # HP-cc ignores -Wl,+cdp, and we test the linker for +cdp support.
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking if +cdp linker flag works" >&5
+$as_echo_n "checking if +cdp linker flag works... " >&6; }
+if ${lt_cv_ldflag_cdp_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ldflag_cdp_works=no
+         save_LDFLAGS=$LDFLAGS
+         LDFLAGS="$LDFLAGS -Wl,+cdp -Wl,/usr/lib/libc.1:/nonexistent -Wl,+cdp -Wl,/lib/libc.1:/nonexistent"
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ldflag_cdp_works=yes
+else
+  lt_cv_ldflag_cdp_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+         LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ldflag_cdp_works" >&5
+$as_echo "$lt_cv_ldflag_cdp_works" >&6; }
+       if test "$lt_cv_ldflag_cdp_works" = yes; then
+         fix_hardcoded_libdir_flag_spec='${wl}+cdp ${wl}${linkdir}/${dlname}:${libdir}/${dlname}'
+         fix_hardcoded_libdir_flag_spec_ld='+cdp ${linkdir}/${dlname}:${libdir}/${dlname}'
+       fi
       fi
       ;;
 
@@ -11731,7 +11770,7 @@ fi
          archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
          ;;
        *)
-         archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags $fix_hardcoded_libdir_flag'
          ;;
        esac
       else
 $as_echo "$lt_cv_prog_compiler__b" >&6; }
 
 if test yes = "$lt_cv_prog_compiler__b"; then
-    archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+    archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags $fix_hardcoded_libdir_flag'
 else
-    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+    archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags $fix_hardcoded_libdir_flag'
 fi
 
          ;;
        esac
       fi
       if test no = "$with_gnu_ld"; then
-       hardcode_libdir_flag_spec='$wl+b $wl$libdir'
+       hardcode_libdir_flag_spec='$wl+b $wl$libdir $fix_hardcoded_libdir_flag'
        hardcode_libdir_separator=:
 
        case $host_cpu in
          # hardcode_minus_L: Not really in the search PATH,
          # but as the default location of the library.
          hardcode_minus_L=yes
+         # gcc-3.0.1 (collect2) breaks on -Wl,+cdp.
+         # HP-cc ignores -Wl,+cdp, and we test the linker for +cdp support.
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if +cdp linker flag works" >&5
+$as_echo_n "checking if +cdp linker flag works... " >&6; }
+if ${lt_cv_ldflag_cdp_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ldflag_cdp_works=no
+           save_LDFLAGS=$LDFLAGS
+           LDFLAGS="$LDFLAGS -Wl,+cdp -Wl,/usr/lib/libc.1:/nonexistent -Wl,+cdp -Wl,/lib/libc.1:/nonexistent"
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ldflag_cdp_works=yes
+else
+  lt_cv_ldflag_cdp_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ldflag_cdp_works" >&5
+$as_echo "$lt_cv_ldflag_cdp_works" >&6; }
+         if test "$lt_cv_ldflag_cdp_works" = yes; then
+           fix_hardcoded_libdir_flag_spec='${wl}+cdp ${wl}${linkdir}/${dlname}:${libdir}/${dlname}'
+           fix_hardcoded_libdir_flag_spec_ld='+cdp ${linkdir}/${dlname}:${libdir}/${dlname}'
+         fi
          ;;
        esac
       fi
@@ -12315,6 +12391,16 @@ esac
 
 
 
+
+
+
+
+
+
+
+
+
+
 
 
 
@@ -13184,6 +13270,7 @@ if test -n "$hardcode_libdir_flag_spec" ||
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
      ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+     test -z "$fix_hardcoded_libdir_flag_spec" &&
      test no != "$hardcode_minus_L"; then
     # Linking always hardcodes the temporary library directory.
     hardcode_action=relink
@@ -23427,6 +23514,8 @@ hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_sing
 hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
 hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
 hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+fix_hardcoded_libdir_flag_spec='`$ECHO "$fix_hardcoded_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+fix_hardcoded_libdir_flag_spec_ld='`$ECHO "$fix_hardcoded_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
 inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
 link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
 always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
@@ -23530,6 +23619,8 @@ allow_undefined_flag \
 no_undefined_flag \
 hardcode_libdir_flag_spec \
 hardcode_libdir_separator \
+fix_hardcoded_libdir_flag_spec \
+fix_hardcoded_libdir_flag_spec_ld \
 exclude_expsyms \
 include_expsyms \
 file_list_spec \
@@ -24587,6 +24678,12 @@ hardcode_shlibpath_var=$hardcode_shlibpath_var
 # against it.
 hardcode_automatic=$hardcode_automatic
 
+# Flag to modify a path being hardcoded into the resulting binary.
+fix_hardcoded_libdir_flag_spec=$lt_fix_hardcoded_libdir_flag_spec
+
+# If ld is used when linking,flag to modify a path being hardcoded into the resulting binary.
+fix_hardcoded_libdir_flag_spec_ld=$lt_fix_hardcoded_libdir_flag_spec_ld
+
 # Set to yes if linker adds runtime paths of dependent libraries
 # to runtime path list.
 inherit_rpath=$inherit_rpath
index a50a21a67ca5469243ff2b3d34e748ec8c8fa91c..5696a02944b701abbf1c5002f86a1ed3ab3f2e94 100644 (file)
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -6387,6 +6387,8 @@ func_mode_link ()
     lib_search_path=`pwd`
     inst_prefix_dir=
     new_inherited_linker_flags=
+    fix_hardcoded_libdir_flag=
+    fix_hardcoded_libdir_flag_ld=
 
     avoid_version=no
     bindir=
@@ -8103,6 +8105,15 @@ func_mode_link ()
              elif test no = "$hardcode_shlibpath_var"; then
                add_shlibpath=$dir
                add=-l$name
+             elif test -n "$fix_hardcoded_libdir_flag_spec"; then
+               add_dir="-L${absdir}"
+               add="-l$name"
+               if test "${linkmode}" = prog && test "X${absdir}" != "X${libdir}"; then
+                 linkdir=$absdir
+                 eval "fix_hardcoded_libdir_flag=\"\${fix_hardcoded_libdir_flag} ${fix_hardcoded_libdir_flag_spec}\""
+                 # fix_hardcoded_libdir_flag_ld not needed, programs are linked with $CC
+                 $lt_unset linkdir
+               fi
              else
                lib_linked=no
              fi
@@ -8122,6 +8133,15 @@ func_mode_link ()
                  esac
                fi
                add=-l$name
+               if test -n "$inst_prefix_dir" &&
+                  test -f "$inst_prefix_dir$libdir/$linklib" &&
+                  test -n "${fix_hardcoded_libdir_flag_spec}"; then
+                 linkdir="$inst_prefix_dir$libdir"
+                 add_dir="-L$linkdir"
+                 eval "fix_hardcoded_libdir_flag=\"\${fix_hardcoded_libdir_flag} ${fix_hardcoded_libdir_flag_spec}\""
+                 eval "fix_hardcoded_libdir_flag_ld=\"\${fix_hardcoded_libdir_flag_ld} ${fix_hardcoded_libdir_flag_spec_ld}\""
+                 $lt_unset linkdir
+               fi
              elif test yes = "$hardcode_shlibpath_var"; then
                add_shlibpath=$dir
                add=-l$name
index 4bc6b22c80fc3ebca845d66e6d7f6e8cc2e6686f..232659d83437e90c62d5da2c725849e02ed932f8 100644 (file)
@@ -2145,6 +2145,7 @@ if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
      # have to relink, otherwise we might link with an installed library
      # when we should be linking with a yet-to-be-installed one
      ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+     test -z "$_LT_TAGVAR(fix_hardcoded_libdir_flag_spec, $1)" &&
      test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
     # Linking always hardcodes the temporary library directory.
     _LT_TAGVAR(hardcode_action, $1)=relink
@@ -4731,6 +4732,8 @@ m4_if([$1], [CXX], [
   _LT_TAGVAR(hardcode_libdir_separator, $1)=
   _LT_TAGVAR(hardcode_minus_L, $1)=no
   _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(fix_hardcoded_libdir_flag_spec, $1)=
+  _LT_TAGVAR(fix_hardcoded_libdir_flag_spec_ld, $1)=
   _LT_TAGVAR(inherit_rpath, $1)=no
   _LT_TAGVAR(link_all_deplibs, $1)=unknown
   _LT_TAGVAR(module_cmds, $1)=
@@ -5368,12 +5371,12 @@ _LT_EOF
 
     hpux10*)
       if test yes,no = "$GCC,$with_gnu_ld"; then
-       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags $fix_hardcoded_libdir_flag'
       else
-       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags $fix_hardcoded_libdir_flag'
       fi
       if test no = "$with_gnu_ld"; then
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir $fix_hardcoded_libdir_flag'
        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
        _LT_TAGVAR(hardcode_direct, $1)=yes
        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
@@ -5381,6 +5384,22 @@ _LT_EOF
        # hardcode_minus_L: Not really in the search PATH,
        # but as the default location of the library.
        _LT_TAGVAR(hardcode_minus_L, $1)=yes
+       # gcc-3.0.1 (collect2) breaks on -Wl,+cdp.
+       # HP-cc ignores -Wl,+cdp, and we test the linker for +cdp support.
+       AC_CACHE_CHECK([if +cdp linker flag works],
+         [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)],
+         [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=no
+         save_LDFLAGS=$LDFLAGS
+         LDFLAGS="$LDFLAGS -Wl,+cdp -Wl,/usr/lib/libc.1:/nonexistent -Wl,+cdp -Wl,/lib/libc.1:/nonexistent"
+         AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+           [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=yes],
+           [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=no])
+         LDFLAGS="$save_LDFLAGS"
+       ])
+       if test "$_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)" = yes; then
+         _LT_TAGVAR(fix_hardcoded_libdir_flag_spec, $1)='${wl}+cdp ${wl}${linkdir}/${dlname}:${libdir}/${dlname}'
+         _LT_TAGVAR(fix_hardcoded_libdir_flag_spec_ld, $1)='+cdp ${linkdir}/${dlname}:${libdir}/${dlname}'
+       fi
       fi
       ;;
 
@@ -5394,7 +5413,7 @@ _LT_EOF
          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
          ;;
        *)
-         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags $fix_hardcoded_libdir_flag'
          ;;
        esac
       else
@@ -5411,14 +5430,14 @@ _LT_EOF
          # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
          _LT_LINKER_OPTION([if $CC understands -b],
            _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
-           [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
-           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
-         [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+           [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags $fix_hardcoded_libdir_flag'],
+           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags $fix_hardcoded_libdir_flag'])],
+         [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags $fix_hardcoded_libdir_flag'])
          ;;
        esac
       fi
       if test no = "$with_gnu_ld"; then
-       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir $fix_hardcoded_libdir_flag'
        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
        case $host_cpu in
@@ -5434,6 +5453,22 @@ _LT_EOF
          # hardcode_minus_L: Not really in the search PATH,
          # but as the default location of the library.
          _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         # gcc-3.0.1 (collect2) breaks on -Wl,+cdp.
+         # HP-cc ignores -Wl,+cdp, and we test the linker for +cdp support.
+         AC_CACHE_CHECK([if +cdp linker flag works],
+           [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)],
+           [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=no
+           save_LDFLAGS=$LDFLAGS
+           LDFLAGS="$LDFLAGS -Wl,+cdp -Wl,/usr/lib/libc.1:/nonexistent -Wl,+cdp -Wl,/lib/libc.1:/nonexistent"
+           AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+             [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=yes],
+             [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=no])
+           LDFLAGS="$save_LDFLAGS"
+         ])
+         if test "$_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)" = yes; then
+           _LT_TAGVAR(fix_hardcoded_libdir_flag_spec, $1)='${wl}+cdp ${wl}${linkdir}/${dlname}:${libdir}/${dlname}'
+           _LT_TAGVAR(fix_hardcoded_libdir_flag_spec_ld, $1)='+cdp ${linkdir}/${dlname}:${libdir}/${dlname}'
+         fi
          ;;
        esac
       fi
@@ -5827,6 +5862,10 @@ _LT_TAGDECL([], [hardcode_automatic], [0],
     [Set to "yes" if building a shared library automatically hardcodes DIR
     into the library and all subsequent libraries and executables linked
     against it])
+_LT_TAGDECL([], [fix_hardcoded_libdir_flag_spec], [1],
+    [Flag to modify a path being hardcoded into the resulting binary])
+_LT_TAGDECL([], [fix_hardcoded_libdir_flag_spec_ld], [1],
+    [If ld is used when linking, flag to modify a path being hardcoded into the resulting binary])
 _LT_TAGDECL([], [inherit_rpath], [0],
     [Set to yes if linker adds runtime paths of dependent libraries
     to runtime path list])
@@ -5968,6 +6007,8 @@ _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
 _LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(fix_hardcoded_libdir_flag_spec, $1)=
+_LT_TAGVAR(fix_hardcoded_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(inherit_rpath, $1)=no
 _LT_TAGVAR(module_cmds, $1)=
 _LT_TAGVAR(module_expsym_cmds, $1)=
@@ -6394,7 +6435,7 @@ if test yes != "$_lt_caught_CXX_error"; then
 
       hpux10*|hpux11*)
         if test no = "$with_gnu_ld"; then
-         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir $fix_hardcoded_libdir_flag'
          _LT_TAGVAR(hardcode_libdir_separator, $1)=:
 
           case $host_cpu in
@@ -6416,6 +6457,21 @@ if test yes != "$_lt_caught_CXX_error"; then
             _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
                                                 # but as the default
                                                 # location of the library.
+           # gcc-3.0.1 (collect2) breaks on -Wl,+cdp.
+           # HP-aCC ignores -Wl,+cdp, and we test the linker for +cdp support.
+           AC_CACHE_CHECK([if +cdp linker flag works],
+             [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)],
+             [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=no
+             save_LDFLAGS=$LDFLAGS
+             LDFLAGS="$LDFLAGS -Wl,+cdp -Wl,/usr/lib/libc.1:/nonexistent -Wl,+cdp -Wl,/lib/libc.1:/nonexistent"
+             AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+               [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=yes],
+               [_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)=no])
+             LDFLAGS="$save_LDFLAGS"
+           ])
+           if test "$_LT_TAGVAR(lt_cv_ldflag_cdp_works, $1)" = yes; then
+             _LT_TAGVAR(fix_hardcoded_libdir_flag_spec, $1)='${wl}+cdp ${wl}${linkdir}/${dlname}:${libdir}/${dlname}'
+           fi
             ;;
         esac
 
@@ -6433,7 +6489,7 @@ if test yes != "$_lt_caught_CXX_error"; then
                _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
                ;;
              *)
-               _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $fix_hardcoded_libdir_flag'
                ;;
            esac
            # Commands to make compiler produce verbose output that lists
@@ -6457,7 +6513,7 @@ if test yes != "$_lt_caught_CXX_error"; then
                    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
                    ;;
                  *)
-                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $fix_hardcoded_libdir_flag'
                    ;;
                esac
              fi
@@ -7298,6 +7354,10 @@ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
 _LT_TAGVAR(hardcode_libdir_separator, $1)=
 _LT_TAGVAR(hardcode_minus_L, $1)=no
 _LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(fix_hardcoded_libdir_flag_spec, $1)=
+_LT_TAGVAR(fix_hardcoded_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(fix_hardcoded_libdir_flag_spec, $1)=
+_LT_TAGVAR(fix_hardcoded_libdir_flag_spec_ld, $1)=
 _LT_TAGVAR(inherit_rpath, $1)=no
 _LT_TAGVAR(module_cmds, $1)=
 _LT_TAGVAR(module_expsym_cmds, $1)=