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 09:48:22AM -0700, H . J . Lu wrote:
> > 
> > > It works with and without shared library enabled. Any comments?
> > 
> > It looks extremely fragile and platform-dependent to me.
> 
> That is why it is called hack. I guess we can do something like gcc
> where symlinks are made from libiberty.

How about this patch? I am not 100% sure if bfd/config.h is compatible
with libiberty/config.h for those files nor CFLAGS.


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

	* Makefile.am (LIBERTY_CFILES): New.
	(CFILES): Add $(LIBERTY_CFILES)
	(DISTCLEANFILES): Likewise.
	(LIBERTY_OFILES): New.
	(OFILES): Add $(LIBERTY_OFILES).
	(concat.c): New target.
	(objalloc.c): Likewise.
	(hashtab.c): Likewise.
	(hex.c): Likewise.
	(safe-ctype.c): Likewise.
	(xexit.c): Likewise.
	(xmalloc.c): Likewise.
	(xstrerror.c): Likewise.

--- Makefile.am.liberty	Thu Oct  4 08:34:17 2001
+++ Makefile.am	Fri Oct 19 10:16:56 2001
@@ -494,7 +494,11 @@ SOURCE_CFILES = \
 BUILD_CFILES = \
 	elf32-ia64.c elf64-ia64.c peigen.c pepigen.c
 
-CFILES = $(SOURCE_CFILES) $(BUILD_CFILES)
+LIBERTY_CFILES = \
+	concat.c objalloc.c hashtab.c hex.c safe-ctype.c \
+	xexit.c xmalloc.c xstrerror.c 
+
+CFILES = $(SOURCE_CFILES) $(BUILD_CFILES) $(LIBERTY_CFILES)
 
 ## This is a list of all .h files which are in the source tree.
 SOURCE_HFILES = \
@@ -535,11 +539,15 @@ po/POTFILES.in:
 
 diststuff: info
 
+LIBERTY_OFILES = \
+	concat.lo objalloc.lo hashtab.lo hex.lo safe-ctype.lo \
+	xexit.lo xmalloc.lo xstrerror.lo 
+
 # Various kinds of .o files to put in libbfd.a:
 # BFD_BACKENDS	Routines the configured targets need.
 # BFD_MACHINES	Architecture-specific routines the configured targets need.
 # COREFILE	Core file routines for a native configuration
-OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@
+OFILES = $(BFD_BACKENDS) $(BFD_MACHINES) @COREFILE@ $(LIBERTY_OFILES)
 
 stamp-ofiles: Makefile
 	rm -f tofiles
@@ -747,12 +755,43 @@ MOSTLYCLEANFILES = ofiles stamp-ofiles
 CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \
 	stmp-bin2-h stmp-lbfd-h stmp-lcoff-h
 
-DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES)
+DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) $(LIBERTY_CFILES)
 
 # We want to rerun configure if config.bfd or configure.host change.
 config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
 	$(SHELL) ./config.status --recheck
 
+concat.c: $(srcdir)/../libiberty/concat.c
+	rm -f $@
+	$(LN_S) $(srcdir)/../libiberty/$@ $@
+
+objalloc.c: $(srcdir)/../libiberty/objalloc.c
+	rm -f $@
+	$(LN_S) $(srcdir)/../libiberty/$@ $@
+
+hashtab.c: $(srcdir)/../libiberty/hashtab.c
+	rm -f $@
+	$(LN_S) $(srcdir)/../libiberty/$@ $@
+
+hex.c: $(srcdir)/../libiberty/hex.c
+	rm -f $@
+	$(LN_S) $(srcdir)/../libiberty/$@ $@
+
+safe-ctype.c: $(srcdir)/../libiberty/safe-ctype.c
+	rm -f $@
+	$(LN_S) $(srcdir)/../libiberty/$@ $@
+
+xexit.c: $(srcdir)/../libiberty/xexit.c
+	rm -f $@
+	$(LN_S) $(srcdir)/../libiberty/$@ $@
+
+xmalloc.c: $(srcdir)/../libiberty/xmalloc.c
+	rm -f $@
+	$(LN_S) $(srcdir)/../libiberty/$@ $@
+
+xstrerror.c: $(srcdir)/../libiberty/xstrerror.c
+	rm -f $@
+	$(LN_S) $(srcdir)/../libiberty/$@ $@
 
 # What appears below is generated by a hacked mkdep using gcc -MM.
 


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