summary refs log tree commit diff
path: root/pkgs/development/tools/misc/binutils/build-components-separately.patch
blob: 0b4162d848803359317f5b2ab87a7cc864fd5c4e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
diff --git a/bfd/configure.ac b/bfd/configure.ac
index fec067b2135..377e1f5443f 100644
--- a/bfd/configure.ac
+++ b/bfd/configure.ac
@@ -292,30 +292,16 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
 
 LT_LIB_M
 
-# When building a shared libbfd, link against the pic version of libiberty
-# so that apps that use libbfd won't need libiberty just to satisfy any
-# libbfd references.
-# We can't do that if a pic libiberty is unavailable since including non-pic
-# code would insert text relocations into libbfd.
 SHARED_LIBADD=
-SHARED_LDFLAGS=
+SHARED_LDFLAGS=-liberty
 if test "$enable_shared" = "yes"; then
-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
   # More hacks to build DLLs on Windows.
   *-*-cygwin*)
     SHARED_LDFLAGS="-no-undefined"
-    SHARED_LIBADD="-L`pwd`/../libiberty -liberty $SHARED_LIBADD -lcygwin -lkernel32"
+    SHARED_LIBADD="-liberty $SHARED_LIBADD -lcygwin -lkernel32"
   ;;
   esac
 
diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
index 0e04b4c05c4..848a02662e7 100644
--- a/opcodes/Makefile.am
+++ b/opcodes/Makefile.am
@@ -51,7 +51,7 @@ libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
 endif
 
 # This is where bfd.h lives.
-BFD_H = ../bfd/bfd.h
+BFD_H = $(BFDDIR)/bfd.h
 
 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
 
-AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
+AM_CPPFLAGS = -I. -I$(srcdir) -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
 
 disassemble.lo: disassemble.c
 if am__fastdepCC
@@ -327,9 +327,18 @@ libopcodes_la_SOURCES =  dis-buf.c disassemble.c dis-init.c
-libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@
+libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ libtool-soversion
 libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@
-libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@
+libopcodes_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
 # Allow dependency tracking to work on all the source files.
 EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES)
 
+libtool-soversion:
+	@echo "creating $@"
+	bfd_soversion="$(VERSION)" ;\
+	. $(BFDDIR)/development.sh ;\
+	if test "$$development" = true ; then \
+	  bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
+	fi ;\
+	echo "$${bfd_soversion}" > $@
+
 # libtool will build .libs/libopcodes.a.  We create libopcodes.a in
 # the build directory so that we don't have to convert all the
 # programs that use libopcodes.a simultaneously.  This is a hack which
diff --git a/opcodes/configure.ac b/opcodes/configure.ac
index e564f067334..5da62a3d58b 100644
--- a/opcodes/configure.ac
+++ b/opcodes/configure.ac
@@ -98,6 +98,8 @@ BFD_64_BIT
 AC_SUBST(HDEFINES)
 AC_PROG_INSTALL
 
+GCC_HEADER_STDINT(bfd_stdint.h)
+
 AC_CHECK_DECLS([basename, stpcpy])
 
 # Check if sigsetjmp is available.  Using AC_CHECK_FUNCS won't do
@@ -148,44 +150,21 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
 
 LT_LIB_M
 
-#Libs for generator progs
-if test "x$cross_compiling" = "xno"; then
-  BUILD_LIBS=../libiberty/libiberty.a
-  BUILD_LIB_DEPS=$BUILD_LIBS
-else
-  # if cross-compiling, assume that the system provides -liberty
-  # and that the version is compatible with new headers.
-  BUILD_LIBS=-liberty
-  BUILD_LIB_DEPS=
-fi
-BUILD_LIBS="$BUILD_LIBS $LIBINTL"
-BUILD_LIB_DEPS="$BUILD_LIB_DEPS $LIBINTL_DEP"
+BUILD_LIBS="-liberty $LIBINTL"
+BUILD_LIB_DEPS="$LIBINTL_DEP"
 
 AC_SUBST(BUILD_LIBS)
 AC_SUBST(BUILD_LIB_DEPS)
 
 # Horrible hacks to build DLLs on Windows and a shared library elsewhere.
 SHARED_LDFLAGS=
-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.
-# We can't do that if a pic libiberty is unavailable since including non-pic
-# code would insert text relocations into libopcodes.
 # 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"
 
@@ -193,11 +172,10 @@ if test "$enable_shared" = "yes"; then
   case "${host}" in
     *-*-cygwin*)
       SHARED_LDFLAGS="-no-undefined"
-      SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty $SHARED_LIBADD"
+      SHARED_LIBADD="-lbfd -liberty $SHARED_LIBADD"
       ;;
     *)
-      SHARED_LIBADD="../bfd/libbfd.la ${SHARED_LIBADD}"
-      SHARED_DEPENDENCIES="../bfd/libbfd.la"
+      SHARED_LIBADD="-lbfd ${SHARED_LIBADD}"
       ;;
   esac