diff options
author | H.J. Lu <hjl@gcc.gnu.org> | 2004-12-19 20:01:20 -0800 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2004-12-19 20:01:20 -0800 |
commit | ad49d8653bc2ad7241def5825a07fdd9de204bf0 (patch) | |
tree | 493054be8e82cf0ab4256b3e63449e6dd366c8bf /libiberty/Makefile.in | |
parent | 6efa2c7134708e1554460a84280aa5a7272ba990 (diff) | |
download | gcc-ad49d8653bc2ad7241def5825a07fdd9de204bf0.zip gcc-ad49d8653bc2ad7241def5825a07fdd9de204bf0.tar.gz gcc-ad49d8653bc2ad7241def5825a07fdd9de204bf0.tar.bz2 |
re PR bootstrap/19072 (--disable-static bootstrap failure)
2004-12-19 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/19072
* Makefile.in (enable_shared): New substitute.
(LTTARGETLIB): New.
(PREFIXTARGETLIB): New.
(LTTESTLIB): New.
(PREFIXTESTLIB): New.
(CCLD): New.
(LINK): New.
($(TARGETLIB)): Use $(LINK) to create libraries and create
targets by hand.
($(TESTLIB)): Likewise.
(mostlyclean): Don't remove .libs. Remove the libtool object
directory.
* config.table (enable_shared): Removed.
* configure.ac (enable_static): Set to yes.
(AC_PROG_LIBTOOL): Removed.
(AM_DISABLE_SHARED): Uncommented.
(AM_PROG_LIBTOOL): Likewise.
(LIBOBJS): Add `./' to avoid VPATH.
(LTLIBOBJS): Likewise.
(enable_shared): Substitute.
* configure: Regenerated.
From-SVN: r92406
Diffstat (limited to 'libiberty/Makefile.in')
-rw-r--r-- | libiberty/Makefile.in | 51 |
1 files changed, 40 insertions, 11 deletions
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in index ba6ec40..0194e5b 100644 --- a/libiberty/Makefile.in +++ b/libiberty/Makefile.in @@ -31,6 +31,8 @@ srcdir = @srcdir@ top_builddir = . +enable_shared = @enable_shared@ + prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -70,7 +72,11 @@ PICFLAG = MAKEOVERRIDES = TARGETLIB = ./libiberty.a +LTTARGETLIB = ./libiberty.la +PREFIXTARGETLIB= ./libiberty TESTLIB = ./testlib.a +LTTESTLIB = ./testlib.la +PREFIXTESTLIB = ./testlib LIBOBJS = @LIBOBJS@ LTLIBOBJS = @LTLIBOBJS@ @@ -121,6 +127,8 @@ INCDIR=$(srcdir)/$(MULTISRCTOP)../include COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES) @ac_libiberty_warn_cflags@ LTCOMPILE = $(LIBTOOL) --mode=compile $(COMPILE.c) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(CFLAGS) # Just to make sure we don't use a built-in rule with VPATH .c.o: @@ -259,13 +267,25 @@ INSTALLED_HEADERS = \ $(INCDIR)/splay-tree.h \ $(INCDIR)/ternary.h +# FIXME: Libtool has to be used to create static and shared libraries +# if it is used to compile object files. Since libiberty doesn't really +# build shared library, we have to create the libraries we need by hand +# and remove those created by libtool. $(TARGETLIB): $(REQUIRED_LTOFILES) $(EXTRA_LTOFILES) $(LTLIBOBJS) - -rm -f $(TARGETLIB) .libs/$(TARGETLIB) - $(AR) $(AR_FLAGS) $(TARGETLIB) \ - $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS) - $(RANLIB) $(TARGETLIB) - if [ -d .libs ]; then \ - cd .libs; \ + libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \ + rm -f $(TARGETLIB) $$libtooldir/$(TARGETLIB) pic/$(TARGETLIB) \ + || true; \ + $(LINK) -o $(LTTARGETLIB) -rpath $(libdir) \ + $(REQUIRED_LTOFILES) $(EXTRA_LTOFILES) $(LTLIBOBJS); \ + if [ -f $$libtooldir/$(TARGETLIB) ]; then \ + cp $$libtooldir/$(TARGETLIB) $(TARGETLIB).tmp; \ + $(RANLIB) $(TARGETLIB).tmp; \ + $(SHELL) $(srcdir)/../move-if-change \ + $(TARGETLIB).tmp $(TARGETLIB); \ + else true; fi; \ + rm -f $(LTTARGETLIB) $$libtooldir/$(PREFIXTARGETLIB)*; \ + if [ x$(enable_shared) = xyes ]; then \ + cd $$libtooldir; \ $(AR) $(AR_FLAGS) $(TARGETLIB) \ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS); \ $(RANLIB) $(TARGETLIB); \ @@ -276,10 +296,17 @@ $(TARGETLIB): $(REQUIRED_LTOFILES) $(EXTRA_LTOFILES) $(LTLIBOBJS) else true; fi $(TESTLIB): $(REQUIRED_LTOFILES) $(CONFIGURED_LTOFILES) - -rm -f $(TESTLIB) - $(AR) $(AR_FLAGS) $(TESTLIB) \ - $(REQUIRED_OFILES) $(CONFIGURED_OFILES) - $(RANLIB) $(TESTLIB) + libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \ + rm -f $(TESTLIB) $$libtooldir/$(TESTLIB) || true; \ + $(LINK) -o $(LTTESTLIB) -rpath $(libdir) \ + $(REQUIRED_LTOFILES) $(CONFIGURED_LTOFILES); \ + if [ -f $$libtooldir/$(TESTLIB) ]; then \ + cp $$libtooldir/$(TESTLIB) $(TESTLIB).tmp; \ + $(RANLIB) $(TESTLIB).tmp; \ + $(SHELL) $(srcdir)/../move-if-change \ + $(TESTLIB).tmp $(TESTLIB); \ + else true; fi; \ + rm -f $(LTTESTLIB) $$libtooldir/$(PREFIXTESTLIB)* info: libiberty.info info-subdir install-info: install-info-subdir @@ -402,7 +429,9 @@ maint-deps : # Cleaning has to be done carefully to ensure that we don't clean our SUBDIRS # multiple times, hence our explicit recursion with an empty SUBDIRS. mostlyclean: mostlyclean-subdir - -rm -rf *.o *.lo pic .libs core errs \#* *.E a.out + -libtooldir=`$(LIBTOOL) --config | sed -n -e 's/^objdir=//p'`; \ + rm -f $$libtooldir + -rm -rf *.o *.lo pic core errs \#* *.E a.out -rm -f needed.awk needed2.awk errors dummy needed-list config.h stamp-* -rm -f $(CONFIG_H) $(NEEDED_LIST) -rm -f libiberty.aux libiberty.cp libiberty.cps libiberty.fn libiberty.ky |