merge from gcc

This commit is contained in:
DJ Delorie 2004-12-20 04:20:34 +00:00
parent 12769ad22a
commit 11a338da34
4 changed files with 1125 additions and 1054 deletions

View file

@ -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

View file

@ -30,12 +30,5 @@ for frag in ${frags}; do
fi
done
# record if we want to build shared libs.
if [ "${shared}" = "yes" ]; then
echo enable_shared = yes >> temp-frag
else
echo enable_shared = no >> temp-frag
fi
frag=xhost-mkfrag
${CONFIG_SHELL-/bin/sh} ${libiberty_topdir}/move-if-change temp-frag xhost-mkfrag

2086
libiberty/configure vendored

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,9 @@ AC_PREREQ(2.59)
AC_INIT
AC_CONFIG_SRCDIR([xmalloc.c])
# FIXME: libiberty doesn't support --disable-static
enable_static=yes
# This works around the fact that libtool configuration may change LD
# for this particular configuration, but some shells, instead of
# keeping the changes in LD private, export them just because LD is
@ -113,8 +116,6 @@ GCC_NO_EXECUTABLES
AC_PROG_CC
AC_PROG_CPP_WERROR
AC_PROG_LIBTOOL
if test x$GCC = xyes; then
ac_libiberty_warn_cflags='-W -Wall -Wtraditional -pedantic'
fi
@ -124,13 +125,11 @@ AC_C_CONST
AC_C_INLINE
AC_C_BIGENDIAN_CROSS
dnl When we start using libtool:
dnl Default to a non shared library. This may be overridden by the
dnl configure option --enable-shared.
dnl AM_DISABLE_SHARED
AM_DISABLE_SHARED
dnl When we start using libtool:
dnl AM_PROG_LIBTOOL
AM_PROG_LIBTOOL
dnl When we start using automake:
dnl AM_CONFIG_HEADER(config.h:config.in)
@ -529,6 +528,30 @@ else
fi
AC_SUBST(INSTALL_DEST)
# Add `./' to avoid VPATH.
m4_pattern_allow(LIBOBJS)
L=""
for l in x $LIBOBJS; do
case $l in
x) ;;
*) L="$L ./$l" ;;
esac
done
LIBOBJS="$L"
m4_pattern_allow(LTLIBOBJS)
L=""
for l in x $LTLIBOBJS; do
case $l in
x) ;;
*) L="$L ./$l" ;;
esac
done
LTLIBOBJS="$L"
dnl Delete it when we start creating shared library with libtool.
AC_SUBST(enable_shared)
# We need multilib support, but only if configuring for the target.
AC_CONFIG_FILES([Makefile testsuite/Makefile])
AC_CONFIG_COMMANDS([default],