  # Note that linking against libbfd as we do here, which is itself linked
  # against libiberty, may not satisfy all the libopcodes libiberty references
  # since libbfd may not pull in the entirety of libiberty.
+ # Also, jam libintl into the right place in all of this: after libiberty,
+ # which uses it, but before -lcygwin, which it uses.
 -changequote(,)dnl
 -  x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
 -changequote([,])dnl
 -  if test -n "$x"; then
 -    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
 -  fi
+-fi
 -
+ SHARED_LIBADD="$SHARED_LIBADD $LIBINTL"
+ 
+ if test "$enable_shared" = "yes"; then
    case "${host}" in
      *-*-cygwin*)
        SHARED_LDFLAGS="-no-undefined"
--      SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
-+      SHARED_LIBADD="-lbfd -liberty -lintl -lcygwin"
+-      SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD"
++      SHARED_LIBADD="-lbfd -liberty $SHARED_LIBADD"
        ;;
 -   *-*-darwin*)
 -     SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}"

-SHARED_LIBADD=
+SHARED_LIBADD=-liberty
 SHARED_DEPENDENCIES=
 if test "$enable_shared" = "yes"; then
-# When building a shared libopcodes, link against the pic version of libiberty
-# so that apps that use libopcodes won't need libiberty just to satisfy any
-# libopcodes references.

 
 BUILD_LIBS = @BUILD_LIBS@
 BUILD_LIB_DEPS = @BUILD_LIB_DEPS@
@@ -303,7 +303,7 @@ OFILES = @BFD_MACHINES@
 # development.sh is used to determine -Werror default.
 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
 
