This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Remove dependency on libiberty from libbfd.so.


On Fri, Oct 19, 2001 at 03:38:51PM -0400, DJ Delorie wrote:
> 
> > How about this patch?
> 
> Shouldn't this be handled in configure?  It should *know* which
> libiberty we're going to need, right?  The build would also do the
> right thing (i.e. stop) if libiberty.a is missing but *supposed* to be
> there.

Here is a new patch. I noticed that WIN32LIBADD include
"-L`pwd`/../libiberty -liberty" for the same purpose. Maybe a new
variable should be added.

> 
> And if configure is handling it, why use -l at all?  Why not just
> list ../libiberty/libiberty.a in LIBADD?

It won't work with archive.


H.J.
----
2001-10-19  H.J. Lu <hjl@gnu.org>

	* configure.in (WIN32LIBADD): Include -L../libiberty/pic -liberty
	if shared library is enabled.
	* configure: Rebuild.

	* Makefile.in ($(TARGETLIB)): Also generate pic/$(TARGETLIB) if
	necessary.

--- binutils/bfd/configure.in.liberty	Thu Oct 18 09:44:41 2001
+++ binutils/bfd/configure.in	Fri Oct 19 13:26:07 2001
@@ -410,6 +410,13 @@ case "${host}" in
     WIN32LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
   fi
   ;;
+*)
+  # We borrow WIN32LIBADD so that the shared libbfd won't depend on
+  # libiberty.a.
+  if test "$enable_shared" = "yes"; then
+    WIN32LIBADD="-L../libiberty/pic -liberty"
+  fi
+  ;;
 esac
 AC_SUBST(WIN32LDFLAGS)
 AC_SUBST(WIN32LIBADD)
--- binutils/libiberty/Makefile.in.liberty	Mon Oct 15 21:04:27 2001
+++ binutils/libiberty/Makefile.in	Fri Oct 19 11:35:56 2001
@@ -155,10 +155,17 @@ CONFIGURED_OFILES = asprintf.o atexit.o 
 	vsprintf.o waitpid.o
 
 $(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
-	-rm -f $(TARGETLIB)
+	-rm -f $(TARGETLIB) pic/$(TARGETLIB)
 	$(AR) $(AR_FLAGS) $(TARGETLIB) \
 	  $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
 	$(RANLIB) $(TARGETLIB)
+	if [ x"$(PICFLAG)" != x ]; then \
+	  cd pic; \
+	  $(AR) $(AR_FLAGS) $(TARGETLIB) \
+	   $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \
+	   $(RANLIB) $(TARGETLIB); \
+	   cd ..; \
+	else true; fi
 
 info: libiberty.info info-subdir
 install-info: install-info-subdir


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]