1 diff --git a/bfd/configure.ac b/bfd/configure.ac
2 index fec067b2135..377e1f5443f 100644
5 @@ -292,30 +292,16 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
9 -# When building a shared libbfd, link against the pic version of libiberty
10 -# so that apps that use libbfd won't need libiberty just to satisfy any
12 -# We can't do that if a pic libiberty is unavailable since including non-pic
13 -# code would insert text relocations into libbfd.
16 +SHARED_LDFLAGS=-liberty
17 if test "$enable_shared" = "yes"; then
19 - x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'`
21 - if test -n "$x"; then
22 - SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
26 SHARED_LIBADD="$SHARED_LIBADD $LIBINTL"
28 -if test "$enable_shared" = "yes"; then
30 # More hacks to build DLLs on Windows.
32 SHARED_LDFLAGS="-no-undefined"
33 - SHARED_LIBADD="-L`pwd`/../libiberty -liberty $SHARED_LIBADD -lcygwin -lkernel32"
34 + SHARED_LIBADD="-liberty $SHARED_LIBADD -lcygwin -lkernel32"
38 diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
39 index 0e04b4c05c4..848a02662e7 100644
40 --- a/opcodes/Makefile.am
41 +++ b/opcodes/Makefile.am
42 @@ -51,7 +51,7 @@ libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
45 # This is where bfd.h lives.
47 +BFD_H = $(BFDDIR)/bfd.h
49 BUILD_LIBS = @BUILD_LIBS@
50 BUILD_LIB_DEPS = @BUILD_LIB_DEPS@
51 @@ -303,7 +303,7 @@ OFILES = @BFD_MACHINES@
52 # development.sh is used to determine -Werror default.
53 CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
55 -AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
56 +AM_CPPFLAGS = -I. -I$(srcdir) -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
58 disassemble.lo: disassemble.c
60 @@ -327,9 +327,18 @@ libopcodes_la_SOURCES = dis-buf.c disassemble.c dis-init.c
61 -libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@
62 +libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ libtool-soversion
63 libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@
64 -libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@
65 +libopcodes_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
66 # Allow dependency tracking to work on all the source files.
67 EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES)
71 + bfd_soversion="$(VERSION)" ;\
72 + . $(BFDDIR)/development.sh ;\
73 + if test "$$development" = true ; then \
74 + bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
76 + echo "$${bfd_soversion}" > $@
78 # libtool will build .libs/libopcodes.a. We create libopcodes.a in
79 # the build directory so that we don't have to convert all the
80 # programs that use libopcodes.a simultaneously. This is a hack which
81 diff --git a/opcodes/configure.ac b/opcodes/configure.ac
82 index e564f067334..5da62a3d58b 100644
83 --- a/opcodes/configure.ac
84 +++ b/opcodes/configure.ac
85 @@ -98,6 +98,8 @@ BFD_64_BIT
89 +GCC_HEADER_STDINT(bfd_stdint.h)
91 AC_CHECK_DECLS([basename, stpcpy])
93 # Check if sigsetjmp is available. Using AC_CHECK_FUNCS won't do
94 @@ -148,44 +150,21 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
98 -#Libs for generator progs
99 -if test "x$cross_compiling" = "xno"; then
100 - BUILD_LIBS=../libiberty/libiberty.a
101 - BUILD_LIB_DEPS=$BUILD_LIBS
103 - # if cross-compiling, assume that the system provides -liberty
104 - # and that the version is compatible with new headers.
105 - BUILD_LIBS=-liberty
108 -BUILD_LIBS="$BUILD_LIBS $LIBINTL"
109 -BUILD_LIB_DEPS="$BUILD_LIB_DEPS $LIBINTL_DEP"
110 +BUILD_LIBS="-liberty $LIBINTL"
111 +BUILD_LIB_DEPS="$LIBINTL_DEP"
114 AC_SUBST(BUILD_LIB_DEPS)
116 # Horrible hacks to build DLLs on Windows and a shared library elsewhere.
119 +SHARED_LIBADD=-liberty
121 -if test "$enable_shared" = "yes"; then
122 -# When building a shared libopcodes, link against the pic version of libiberty
123 -# so that apps that use libopcodes won't need libiberty just to satisfy any
124 -# libopcodes references.
125 -# We can't do that if a pic libiberty is unavailable since including non-pic
126 -# code would insert text relocations into libopcodes.
127 # Note that linking against libbfd as we do here, which is itself linked
128 # against libiberty, may not satisfy all the libopcodes libiberty references
129 # since libbfd may not pull in the entirety of libiberty.
130 # Also, jam libintl into the right place in all of this: after libiberty,
131 # which uses it, but before -lcygwin, which it uses.
133 - x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'`
135 - if test -n "$x"; then
136 - SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
140 SHARED_LIBADD="$SHARED_LIBADD $LIBINTL"
142 @@ -193,11 +172,10 @@ if test "$enable_shared" = "yes"; then
145 SHARED_LDFLAGS="-no-undefined"
146 - SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD"
147 + SHARED_LIBADD="-lbfd -liberty $SHARED_LIBADD"
150 - SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}"
151 - SHARED_DEPENDENCIES="../bfd/libbfd.la"
152 + SHARED_LIBADD="-lbfd ${SHARED_LIBADD}"