summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-05-15 17:42:58 -0600
committerJeff Law <law@gcc.gnu.org>1998-05-15 17:42:58 -0600
commit3affd5f0f4b9f9e7d3ecac2881604692ae52681e (patch)
treee6ad5341787fa143c7cb10c7384c960aecfa1ede /libiberty
parentfe806bddb81ada7a8797cf387ff7c1427ed3d6bb (diff)
Update from Cygnus libiberty.
libiberty uses autoconf now. From-SVN: r19791
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog199
-rw-r--r--libiberty/Makefile.in249
-rw-r--r--libiberty/README109
-rw-r--r--libiberty/alloca-botch.h5
-rw-r--r--libiberty/alloca-norm.h25
-rw-r--r--libiberty/atexit.c6
-rw-r--r--libiberty/basename.c6
-rw-r--r--libiberty/clock.c4
-rw-r--r--libiberty/config.table45
-rw-r--r--libiberty/config/mh-a68bsd2
-rw-r--r--libiberty/config/mh-aix2
-rw-r--r--libiberty/config/mh-apollo682
-rw-r--r--libiberty/config/mh-cygwin322
-rw-r--r--libiberty/config/mh-go321
-rw-r--r--libiberty/config/mh-hpbsd2
-rw-r--r--libiberty/config/mh-irix44
-rw-r--r--libiberty/config/mh-ncr300019
-rw-r--r--libiberty/config/mh-riscix6
-rw-r--r--libiberty/config/mh-sysv1
-rw-r--r--libiberty/config/mh-sysv43
-rw-r--r--libiberty/config/mh-windows1
-rw-r--r--libiberty/config/mt-mingw3227
-rw-r--r--libiberty/config/mt-sunos42
-rw-r--r--libiberty/config/mt-vxworks528
-rw-r--r--libiberty/configure.bat1
-rw-r--r--libiberty/configure.in370
-rw-r--r--libiberty/cplus-dem.c35
-rw-r--r--libiberty/dummy.c49
-rw-r--r--libiberty/functions.def70
-rw-r--r--libiberty/getcwd.c4
-rw-r--r--libiberty/getpagesize.c4
-rw-r--r--libiberty/getruntime.c14
-rw-r--r--libiberty/makefile.vms4
-rw-r--r--libiberty/mpw-config.in2
-rw-r--r--libiberty/strerror.c18
-rw-r--r--libiberty/strsignal.c18
-rw-r--r--libiberty/vmsbuild.com2
37 files changed, 629 insertions, 712 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index b99961fc9c0..20fc2840e8f 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,11 +1,159 @@
Wed May 13 14:24:38 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
- * cplus-dem.c (squangle_mop_up): Change return type to void.
- (internal_cplus_demangle): Remove unused parameter `options'.
- All callers changed.
- (cplus_demangle_opname): Remove function wide variable `int i' and
- replace with `size_t i' at each location where it is used.
- (cplus_mangle_opname): change type of `i' from int to size_t.
+ * cplus-dem.c (squangle_mop_up): Change return type to void.
+ (internal_cplus_demangle): Remove unused parameter `options'.
+ All callers changed.
+ (cplus_demangle_opname): Remove function wide variable `int i' and
+ replace with `size_t i' at each location where it is used.
+ (cplus_mangle_opname): change type of `i' from int to size_t.
+
+Wed May 13 13:39:38 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * alloca-conf.h: Include config.h. Check HAVE_ALLOCA_H rather
+ than sparc or sun.
+ * Makefile.in (argv.o): Depend upon config.h and alloca-conf.h.
+
+Fri May 8 00:23:51 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Set libiberty_topdir correctly when srcdir is
+ "." and with_target_subdir is not set.
+ * configure: Rebuild.
+
+Thu May 7 13:01:44 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Add *-*-mingw32* case.
+ * configure: Rebuild.
+
+Wed May 6 11:33:51 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config.table: Never use a PIC file for *-*-cygwin32*.
+
+ * Makefile.in (config.status): Depend upon config.table.
+
+ * configure.in: On a cygwin32 host, always compile random, and
+ don't test for sys_siglist, strsignal, or psignal.
+ * configure: Rebuild.
+
+ * clock.c: Check HAVE_SYS_PARAM_H rather than NO_SYS_PARAM_H.
+ * getcwd.c: Likewise.
+ * getpagesize.c: Likewise.
+ * getruntime.c: Likewise.
+
+Tue May 5 18:08:32 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ Use autoconf tests rather than the old dummy.c test:
+ * configure.in: Add AC_ARG_WITH calls for --with-target-subdir and
+ --with-newlib. Add AC_CONFIG_HEADER. Use AC_REPLACE_FUNCS for
+ most functions. Add special cases to handle newlib and VxWorks.
+ Remove target_makefile_frag. Create stamp-h in AC_OUTPUT if
+ CONFIG_HEADERS is set. Only call config-ml.in in AC_OUTPUT if
+ CONFIG_FILES is set; set ac_file before calling it.
+ * config.table (arm-*-riscix*, *-*-cygwin32): Remove.
+ (*-*-hpux*, *-*-hiux*, *-*-irix4*, *-*-solaris2*): Remove.
+ (*-*-sysv4*, *-*-go32, *-*-vxworks5*, *-*-vxworks): Remove
+ (i[3456]-*-mingw32*): Remove.
+ * Makefile.in (ERRORS_CC, CONFIG_H, NEEDED_LIST): Remove.
+ (LIBOBJS): New variable.
+ (HOST_OFILES, DO_ALSO, STAGESTUFF): Remove.
+ (all): Depend upon needed-list. Don't check RULE1.
+ (@target_makefile_frag@): Remove.
+ (COMPILE.c): Include @DEFS@.
+ (HFILES): Add alloca-conf.h.
+ (REQUIRED_OFILES): Remove basename.o.
+ ($(TARGETLIB)): New target.
+ (stamp-needed, lneeded-list, needed.awk, stamp-config): Remove.
+ (lconfig.h, needed2.awk, dummy.o, errors): Remove.
+ (needed-list, config.h): Rewrite.
+ (RULE1, $(RULE1), RULE2, $(RULE2)): Remove.
+ (.always.): Remove.
+ (Makefile): Set CONFIG_FILES and CONFIG_HEADERS.
+ (stamp-h): New target.
+ (atexit.o, clock.o, getcwd.o, getpagesize.o): New targets.
+ (basename.o): Don't depend upon config.h.
+ (getruntime.o): Depend upon config.h.
+ * atexit.c: Include config.h. Check HAVE_ON_EXIT rather than
+ NEED_on_exit.
+ * basename.c: Don't include config.h. Don't check NEED_basename.
+ * clock.c: Include config.h.
+ * getcwd.c: Likewise.
+ * getpagesize.c: Likewise.
+ * getruntime.c: Likewise. Fix checks which set HAVE_GETRUSAGE and
+ HAVE_TIMES.
+ * strerror.c: Change uses of NEED_sys_errlist to
+ HAVE_SYS_ERRLIST. Likewise for NEED_strerror and HAVE_STRERROR.
+ * strsignal.c: Likewise for NEED_sys_siglist and HAVE_SYS_SIGLIST,
+ and for NEED_strsignal and HAVE_STRSIGNAL and for NEED_psignal and
+ HAVE_PSIGNAL.
+ * acconfig.h: New file.
+ * dummy.c: Remove.
+ * functions.def: Remove.
+ * config/mh-cxux7 (HDEFINES): Remove -DHAVE_SYSCONF.
+ * config/mh-windows (HDEFINES): Remove.
+ * config/mh-cygwin32: Remove.
+ * config/mh-go32: Remove.
+ * config/mh-irix4: Remove.
+ * config/mh-riscix: Remove.
+ * config/mh-sysv4: Remove.
+ * config/mt-mingw32: Remove.
+ * config/mt-vxworks5: Remove.
+ * config.in: New file, generated using autoheader.
+ * configure: Rebuild.
+
+Mon May 4 13:00:28 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * configure.in: Rewrite to use autoconf.
+ * configure: Generate using autoconf.
+ * config/mh-a68bsd: Remove.
+ * config/mh-apollo68: Remove.
+ * config/mh-hpbsd: Remove.
+ * config/mh-ncr3000: Remove.
+ * config/mh-sysv: Remove.
+ * config/mh-aix (RANLIB, INSTALL): Don't define.
+ * config/mh-cxux7 (RANLIB, INSTALL): Don't define.
+ * config/mh-irix4 (CC, RANLIB, INSTALL): Don't define.
+ * config/mh-sysv4 (RANLIB, INSTALL): Don't define.
+ * config.table: Change config_shell to CONFIG_SHELL, and use
+ libiberty_topdir to find move-if-change.
+ (m68k-apollo-bsd*, m68k-apollo-sysv*): Remove.
+ (i[3456]86-ncr-sysv4*, *-*-dgux*, hppa*-hp-bsd*): Remove.
+ (*-*-irix*, *-*-m88kbcs*, *-*-sysv*): Remove.
+ * Makefile.in (srcdir): Set to @srcdir@.
+ (VPATH): Likewise.
+ (prefix, exec_prefix, bindir, libdir): Set to autoconf variables.
+ (SHELL, INSTALL, INSTALL_PROGRAM, INSTALL_DATA): Likewise.
+ (CC, CFLAGS, RANLIB)): Likewise.
+ (datadir, man*dir, infodir, includedir, MAKEINFO): Remove.
+ (target_makefile_frag, host_makefile_frag): Add substitutions.
+ (INSTALL_DEST): Set to @INSTALL_DEST@.
+ (Makefile): Depend upon config.status. Don't depend upon
+ $(host_makefile_frag) or $(target_makefile_frag).
+ (config.status): New target.
+
+Sun May 3 17:58:49 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * config/mt-sunos4: Remove. Should be handled by --with-headers
+ and --with-libraries options at top level.
+ * config.table: Never use mt-sunos4.
+
+ * alloca-conf.h: New file, combining alloca-norm.h and
+ alloca-botch.h.
+ * alloca-norm.h: Remove.
+ * alloca-botch.h: Remove.
+ * configure.in: Set shell variables files and links to empty.
+ * config.table: Don't set shell variable files.
+ * configure.bat: Don't create alloca-conf.h.
+ * makefile.vms: Likewise.
+ * mpw-config.in: Likewise.
+ * vmsbuild.com: Likewise.
+
+Fri May 1 11:41:42 1998 Ian Lance Taylor <ian@cygnus.com>
+
+ * Makefile.in ($(HOST_OFILES) $(REQUIRED_OFILES)): Remove old
+ target depending upon config.h.
+ (alloca.o): Add target depending upon config.h
+ (basename.o, choose-temp.o, fnmatch.o): Likewise.
+ (getopt.o, getopt1.o, pexecute.o, strerror.o): Likewise.
+ (strsignal.o, xstrerror.o): Likewise.
Fri May 1 04:26:25 1998 Peter Schauer <pes@regent.e-technik.tu-muenchen.de>
@@ -39,22 +187,9 @@ Wed Apr 22 10:53:49 EDT 1998 Andrew MacLeod <amacleod@cygnus.com>
(register_Btype, remember_Btype): New functions for B codes.
(forget_B_and_K_types): New function to destroy B and K info.
-Fri Apr 10 01:45:09 1998 Jeffrey A Law (law@cygnus.com)
+Fri Apr 10 01:49:10 1998 Jeffrey A Law (law@cygnus.com)
- * cplus-dem.c: Sync with gcc.
-
-Thu Apr 2 13:53:54 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
-
- * choose-temp.c: Include system.h when IN_GCC.
-
-1998-04-01 Mark Mitchell <mmitchell@usa.net>
-
- * cplus-dem.c (optable): Add sizeof.
- (demangle_template_value_parm): New function containing code
- previously found in demangle_template.
- (demangle_integral_value): New function which handles complicated
- integral expressions.
- (demangle_template): Use them.
+ * COPYING.LIB, choose-temp.c, cplus-dem.c: Sync with egcs & gcc.
Thu Mar 5 09:23:28 1998 Manfred Hollstein <manfred@s-direktnet.de>
@@ -65,6 +200,10 @@ Mon Feb 23 14:33:15 1998 Ian Lance Taylor <ian@cygnus.com>
* choose-temp.c: Fix handling of sys/file.h to work in libiberty.
+Sun Feb 22 18:03:23 1998 Jeffrey A Law (law@cygnus.com)
+
+ * choose-temp.c: Sync with copy in gcc.
+
Thu Feb 12 16:29:49 1998 Ian Lance Taylor <ian@cygnus.com>
* getopt.c: Update to latest FSF version.
@@ -75,17 +214,17 @@ Tue Feb 10 16:58:33 1998 Stan Shebs <shebs@andros.cygnus.com>
* cplus-dem.c (gnu_special): Don't get confused by .<digits>
strings that are not actually lengths.
-Thu Feb 5 18:48:56 1998 Geoffrey Noer <noer@cygnus.com>
-
- * config/mh-cygwin32: remove vasprintf.o from EXTRA_OFILES
- since it gets built automatically
-
Fri Feb 6 01:35:17 1998 Manfred Hollstein <manfred@s-direktnet.de>
* Makefile.in (FLAGS_TO_PASS): Don't pass PICFLAG.
(.c.o): Check value of enable_shared, not PICFLAG.
(stamp-picdir): Dito.
+Thu Feb 5 18:48:56 1998 Geoffrey Noer <noer@cygnus.com>
+
+ * config/mh-cygwin32: remove vasprintf.o from EXTRA_OFILES
+ since it gets built automatically
+
Sun Feb 1 02:52:32 1998 Mike Stump <mrs@wrs.com>
* config.table (vxworks configs): Default to VxWorks 5.x, as that is
@@ -107,7 +246,7 @@ Sun Jan 18 15:57:28 1998 Michael Snyder <msnyder@cleaver.cygnus.com>
* vasprintf.c (int_vasprintf): Increase buffer size for float/double
values.
-Sat Jan 17 22:28:38 1997 Mumit Khan <khan@xraylith.wisc.edu>
+Sat Jan 17 22:28:38 1998 Mumit Khan <khan@xraylith.wisc.edu>
J.J. VanderHeijden <J.J.vanderHeijden@student.utwente.nl>
Add mingw32 support.
@@ -224,12 +363,6 @@ Tue Aug 19 17:10:56 1997 Jason Merrill <jason@yorick.cygnus.com>
* cplus-dem.c: Add 'extern' to prepends_underscore.
-Wed Jul 30 11:42:19 1997 Per Bothner <bothner@cygnus.com>
-
- * cplus-dem.c: Various changes to produce Java output when passed
- DMGL_JAVA. Thus "::" becomes "." and "JArray<Foo>" becomes "Foo[]".
- (main): Support --java and -j flags to set DMGL_JAVA.
-
Tue Jul 22 19:05:23 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
* config/mh-go32 (CC, AR, RANLIB): Don't define.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index b68d1f5f953..9c7ed27485c 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -1,6 +1,7 @@
#
# Makefile
-# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation
+# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998
+# Free Software Foundation
#
# This file is part of the libiberty library.
# Libiberty is free software; you can redistribute it and/or
@@ -19,37 +20,22 @@
# Boston, MA 02111-1307, USA.
#
-# This file was written, and is maintained by K. Richard Pixley
-# <rich@cygnus.com>.
+# This file was written by K. Richard Pixley <rich@cygnus.com>.
#
# Makefile for libiberty directory
#
-srcdir = .
+srcdir = @srcdir@
+VPATH = @srcdir@
-prefix = /usr/local
+prefix = @prefix@
-exec_prefix = $(prefix)
-bindir = $(exec_prefix)/bin
-libdir = $(exec_prefix)/lib
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+libdir = @libdir@
-datadir = $(prefix)/share
-
-mandir = $(prefix)/man
-man1dir = $(mandir)/man1
-man2dir = $(mandir)/man2
-man3dir = $(mandir)/man3
-man4dir = $(mandir)/man4
-man5dir = $(mandir)/man5
-man6dir = $(mandir)/man6
-man7dir = $(mandir)/man7
-man8dir = $(mandir)/man8
-man9dir = $(mandir)/man9
-infodir = $(prefix)/info
-includedir = $(prefix)/include
-
-SHELL = /bin/sh
+SHELL = @SHELL@
# Multilib support variables.
MULTISRCTOP =
@@ -59,19 +45,17 @@ MULTISUBDIR =
MULTIDO = true
MULTICLEAN = true
-INSTALL = $(SHELL) $(srcdir)/../install-sh -c
-INSTALL_PROGRAM = $(INSTALL)
-INSTALL_DATA = $(INSTALL)
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
-AR = ar
+AR = @AR@
AR_FLAGS = rc
-ERRORS_CC = $(CC)
-CC = cc
-CFLAGS = -g
+CC = @CC@
+CFLAGS = @CFLAGS@
LIBCFLAGS = $(CFLAGS)
-MAKEINFO = makeinfo
-RANLIB = ranlib
+RANLIB = @RANLIB@
PICFLAG =
@@ -79,19 +63,7 @@ MAKEOVERRIDES =
TARGETLIB = libiberty.a
-CONFIG_H = lconfig.h
-NEEDED_LIST = lneeded-list
-
-# HOST_OFILES contains the list of objects that should be in the
-# library (in addition to the REQUIRED_OFILES and EXTRA_OFILES).
-# A configuration may override this with a fixed list a object files
-# names (hard to maintain), or some other way to generate a list.
-HOST_OFILES=`cat needed-list`
-
-# Extra targets that the top-level target depends on.
-# Specifically, what needs to be made before HOST_OFILES can be used.
-# Can be empty if HOST_OFILES is just a list of file names.
-DO_ALSO = needed-list
+LIBOBJS = @LIBOBJS@
# A configuration can specify extra .o files that should be included,
# even if they are in libc. (Perhaps the libc version is buggy.)
@@ -114,60 +86,54 @@ FLAGS_TO_PASS = \
"RANLIB=$(RANLIB)" \
"SHELL=$(SHELL)"
-all: stamp-picdir $(TARGETLIB) required-list
- @if [ "$(RULE1)" != "not-used" ]; then \
- $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all; \
- else true; \
- fi
+all: stamp-picdir $(TARGETLIB) needed-list required-list
+ @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
.PHONY: check installcheck
check installcheck:
-
-#### Host, target, and site specific Makefile fragments come in here.
-###
+@host_makefile_frag@
INCDIR=$(srcdir)/$(MULTISRCTOP)../include
-COMPILE.c = $(CC) -c $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES)
+COMPILE.c = $(CC) -c @DEFS@ $(LIBCFLAGS) -I. -I$(INCDIR) $(HDEFINES)
.c.o:
test x"$(enable_shared)" != xyes || \
$(COMPILE.c) $(PICFLAG) $< -o pic/$@
$(COMPILE.c) $<
-# The default target just invokes make recursively.
-# However, the automatic configuration (in config/mh_default).
-# first causes it to figure out the objects missing in libc.
info install-info clean-info dvi:
# Include files that are in this directory.
-HFILES =
+HFILES = alloca-conf.h
# NOTE: If you add new files to the library, add them to this list
-# (alphabetical), and add them to REQUIRED_OFILES or 'functions.def'.
-CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c bzero.c \
- choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c fnmatch.c \
- getcwd.c getopt.c getopt1.c getpagesize.c getruntime.c \
- floatformat.c hex.c index.c insque.c \
- memchr.c memcmp.c memcpy.c memmove.c memset.c objalloc.c \
- obstack.c pexecute.c random.c rename.c rindex.c sigsetmask.c spaces.c \
- strcasecmp.c strncasecmp.c \
- strchr.c strdup.c strerror.c strrchr.c strsignal.c \
- strstr.c strtod.c strtol.c strtoul.c tmpnam.c \
- vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c waitpid.c \
- xatexit.c xexit.c xmalloc.c xstrdup.c xstrerror.c
+# (alphabetical), and add them to REQUIRED_OFILES or funcs in
+# configure.in.
+CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \
+ bzero.c choose-temp.c clock.c concat.c cplus-dem.c fdmatch.c \
+ fnmatch.c getcwd.c getopt.c getopt1.c getpagesize.c \
+ getruntime.c floatformat.c hex.c index.c insque.c memchr.c \
+ memcmp.c memcpy.c memmove.c memset.c objalloc.c obstack.c \
+ pexecute.c random.c rename.c rindex.c sigsetmask.c spaces.c \
+ strcasecmp.c strncasecmp.c strchr.c strdup.c strerror.c \
+ strrchr.c strsignal.c strstr.c strtod.c strtol.c strtoul.c \
+ tmpnam.c vasprintf.c vfork.c vfprintf.c vprintf.c vsprintf.c \
+ waitpid.c xatexit.c xexit.c xmalloc.c xstrdup.c xstrerror.c
+
# These are always included in the library.
-REQUIRED_OFILES = argv.o basename.o choose-temp.o concat.o cplus-dem.o \
+REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o \
fdmatch.o fnmatch.o getopt.o getopt1.o getruntime.o hex.o \
floatformat.o objalloc.o obstack.o pexecute.o spaces.o strerror.o \
strsignal.o xatexit.o xexit.o xmalloc.o xstrdup.o xstrerror.o
-# Do we want/need any config overrides?
-#
-
-STAGESTUFF = $(TARGETLIB) *.o
+$(TARGETLIB): $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
+ rm -f $(TARGETLIB)
+ $(AR) $(AR_FLAGS) $(TARGETLIB) \
+ $(REQUIRED_OFILES) $(EXTRA_OFILES) $(LIBOBJS)
+ $(RANLIB) $(TARGETLIB)
-INSTALL_DEST = libdir
+INSTALL_DEST = @INSTALL_DEST@
install: install_to_$(INSTALL_DEST)
install_to_libdir: all
@@ -182,100 +148,26 @@ install_to_tooldir: all
mv -f $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB).n $(tooldir)/lib$(MULTISUBDIR)/$(TARGETLIB)
@$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
-# The default configuration adds to libiberty all those functions that are
-# missing in libc. More precisely, it includes whatever $(CC) fails to find.
-# Then a sed+awk combination translates the ld error messages into
-# a list of .o files.
-
-stamp-needed: stamp-picdir $(NEEDED_LIST)
- cp $(NEEDED_LIST) needed-tmp
- $(SHELL) $(srcdir)/$(MULTISRCTOP)../move-if-change needed-tmp needed-list
- touch stamp-needed
-
-needed-list: stamp-needed ; @true
-
-lneeded-list: $(EXTRA_OFILES) needed.awk errors
- rm -f lneeded-list
- f=""; \
- for i in `awk -f needed.awk <errors` $(EXTRA_OFILES) ; do \
- case " $$f " in \
- *" $$i "*) ;; \
- *) f="$$f $$i" ;; \
- esac ; \
- done ; \
+# needed-list is used by libstdc++.
+needed-list: Makefile
+ f="$(LIBOBJS) $(EXTRA_OFILES)"; \
case $$f in \
- *alloca.o*) f="$$f xmalloc.o xexit.o" ;; \
- esac ; \
- echo $$f >>lneeded-list
-
-# Generate an awk script that looks for functions in functions.def
-
-needed.awk: $(srcdir)/functions.def Makefile
- echo "# !Automatically generated from $(srcdir)/functions.def"\
- "- DO NOT EDIT!" >needed.awk
- grep '^DEF(' < $(srcdir)/functions.def \
- | sed -e '/DEF/s|DEF.\([^,]*\).*|/\1/ { printf "\1.o " }|' \
- >>needed.awk
-
-stamp-config: $(CONFIG_H)
- cp $(CONFIG_H) config.tmp
- $(SHELL) $(srcdir)/$(MULTISRCTOP)../move-if-change config.tmp config.h
- touch stamp-config
-
-config.h: stamp-config ; @true
-
-lconfig.h: needed2.awk errors
- echo "/* !Automatically generated from $(srcdir)/functions.def"\
- "- DO NOT EDIT! */" >lconfig.h
- awk -f needed2.awk <errors >>lconfig.h
-
-# Generate an awk script that looks for variables in functions.def
-
-needed2.awk: $(srcdir)/functions.def Makefile
- echo "# !Automatically generated from $(srcdir)/functions.def"\
- "- DO NOT EDIT!" >needed2.awk
- grep '^DEFVAR(' < $(srcdir)/functions.def \
- | sed -e '/DEFVAR/s|DEFVAR.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' \
- >>needed2.awk
- grep '^DEFFUNC(' < $(srcdir)/functions.def \
- | sed -e '/DEFFUNC/s|DEFFUNC.\([^,]*\).*|/\1/ { printf "#ifndef NEED_\1\\n#define NEED_\1\\n#endif\\n" }|' \
- >>needed2.awk
-
-dummy.o: $(srcdir)/dummy.c $(srcdir)/functions.def
- $(CC) -c $(CFLAGS) -I. -I$(INCDIR) $(HDEFINES) $(srcdir)/dummy.c 2>/dev/null
-
-errors: dummy.o $(EXTRA_OFILES)
- -($(ERRORS_CC) -o dummy $(CFLAGS) $(LDFLAGS) $(ERRORS_LDFLAGS) dummy.o $(EXTRA_OFILES) $(LOADLIBES)) >errors 2>&1 || true
-
-# required-list is used when building a shared bfd/opcodes/libiberty library.
+ *alloca.o*) f="$$f xmalloc.o xexit.o" ;; \
+ esac; \
+ echo $$f > needed-list
+
+# required-list was used when building a shared bfd/opcodes/libiberty
+# library. I don't know if it used by anything currently.
required-list: Makefile
echo $(REQUIRED_OFILES) > required-list
-$(HOST_OFILES) $(REQUIRED_OFILES) : config.h
-
-RULE1 = $(TARGETLIB)
-$(RULE1): $(REQUIRED_OFILES) $(DO_ALSO) .always.
- @$(MAKE) RULE1=not-used RULE2=$(TARGETLIB) $(FLAGS_TO_PASS) \
- "HOST_OFILES=$(HOST_OFILES)"
-
-# Rule invoked by recursive make in $(RULE1).
-RULE2 = not-used
-$(RULE2): $(REQUIRED_OFILES) $(HOST_OFILES)
- rm -rf $(TARGETLIB)
- $(AR) $(AR_FLAGS) $(TARGETLIB) \
- $(REQUIRED_OFILES) $(HOST_OFILES)
- $(RANLIB) $(TARGETLIB)
-
stamp-picdir:
if [ x"$(enable_shared)" = xyes ] && [ ! -d pic ]; then \
mkdir pic; \
else true; fi
touch stamp-picdir
-.always.:
-# Do nothing.
-
-.PHONY: all etags tags ls clean stage1 stage2 .always.
+.PHONY: all etags tags ls clean stage1 stage2
etags tags: TAGS
@@ -308,28 +200,41 @@ maintainer-clean realclean: distclean
force:
-Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
- $(SHELL) ./config.status
+Makefile: $(srcdir)/Makefile.in config.status
+ CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
+
+config.h: stamp-h ; @true
+stamp-h: config.in config.status
+ CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
+
+config.status: $(srcdir)/configure $(srcdir)/config.table
+ $(SHELL) ./config.status --recheck
-argv.o: $(INCDIR)/libiberty.h
+alloca.o: config.h
+atexit.o: config.h
+argv.o: config.h alloca-conf.h $(INCDIR)/libiberty.h
basename.o: $(INCDIR)/libiberty.h
+choose-temp.o: config.h
+clock.o: config.h
concat.o: $(INCDIR)/libiberty.h
cplus-dem.o: $(INCDIR)/demangle.h
fdmatch.o: $(INCDIR)/libiberty.h
-fnmatch.o: $(INCDIR)/fnmatch.h
-getopt.o: $(INCDIR)/getopt.h
-getopt1.o: $(INCDIR)/getopt.h
-getruntime.o: $(INCDIR)/libiberty.h
+fnmatch.o: config.h $(INCDIR)/fnmatch.h
+getcwd.o: config.h
+getopt.o: config.h $(INCDIR)/getopt.h
+getopt1.o: config.h $(INCDIR)/getopt.h
+getpagesize.o: config.h
+getruntime.o: config.h $(INCDIR)/libiberty.h
hex.o: $(INCDIR)/libiberty.h
floatformat.o: $(INCDIR)/floatformat.h
objalloc.o: $(INCDIR)/objalloc.h
obstack.o: $(INCDIR)/obstack.h
-pexecute.o: $(INCDIR)/libiberty.h
+pexecute.o: config.h $(INCDIR)/libiberty.h
spaces.o: $(INCDIR)/libiberty.h
-strerror.o: $(INCDIR)/libiberty.h
-strsignal.o: $(INCDIR)/libiberty.h
+strerror.o: config.h $(INCDIR)/libiberty.h
+strsignal.o: config.h $(INCDIR)/libiberty.h
xatexit.o: $(INCDIR)/libiberty.h
xexit.o: $(INCDIR)/libiberty.h
xmalloc.o: $(INCDIR)/libiberty.h
xstrdup.o: $(INCDIR)/libiberty.h
-xstrerror.o: $(INCDIR)/libiberty.h
+xstrerror.o: config.h $(INCDIR)/libiberty.h
diff --git a/libiberty/README b/libiberty/README
index 92dc202929b..9f5226a6b1d 100644
--- a/libiberty/README
+++ b/libiberty/README
@@ -27,62 +27,29 @@ that are "optional" will be included in the library only if "needed."
To add a new required file, edit Makefile to add the source file
name to CFILES and the object file to REQUIRED_OFILES.
-Adding a new optional file is more fragile. As a general rule,
-an optional file will be included in the library if it provides
-functionality missing in the "standard" C library.
-For most hosts, the Makefile automatically figures out which
-functionality is missing by compiling and linking a dummy test
-program, and examining the error messages.
-
-So to get this to work, you should do the following:
-
-1) Select one function defined in the file you're adding.
-For example, the getcwd function.
-2) Add that function to the list in the file functions.def.
-3) The name of the new file must be the same as the function
-you've chosen with the .c suffix added. E.g. getcwd() must be
-defined in getcwd.c. (The file can define other functions as well.)
-4) In Makefile.in, add the name of the source file (e.g. getcwd.c)
-to CFILES.
-
-The file you've added (e.g. getcwd.c) should compile and work
-on all hosts where it is needed (e.g. not found when linking
-the dummy.c program). It does not have to work or even
-compile on hosts where it is not needed.
+To add a new optional file, it must provide a single function, and the
+name of the function must be the same as the name of the file.
+
+ * Add the source file name to CFILES.
+
+ * Add the function to name to the funcs shell variable in
+ configure.in.
-HOW THE AUTOMATIC CONFIGURATION WORKS
-=====================================
-
-The libiberty.a target (in RULE1) depends on $(DO_ALSO).
-For normal configurations, DO_ALSO=needed-list.
-
-So needed-list is first made. The needed-list rule compiles
-dummy.c. Because dummy.c includes functions.def, the
-resulting object file will contain a call to each of the
-optional functions (for simplicity assume each optional file
-defines a single function). This object file will be linked
-against the standard libraries (as defined by using $(CC)
-and various flags). Any function missing will causes the
-linker to emit an error message. We assume the name
-of the missing function(s) are in the error message(s).
-The awk script find-needed.awk has been generated from
-functions.def. It is used to search the linker output
-messages for words that match the functions listed in
-functions.def. The list of functions found is written
-on a single line to the file needed-list.
-
-After needed-list has been generated, the libiberty.a
-target (in RULE1) just calls 'make' recursively.
-It passes the contents of needed-list using the
-definition (expanded) HOST_OFILES="`cat needed-list`".
-It also tells the inferior 'make' to use RULE2.
-
-The inferior 'make' is very conventional: The main
-rule is $(RULE2) (which is libiberty.a). It depends
-on a list of object files: $(REQUIRED_OFILES) $(HOST_OFILES)
-(and $(EXTRA_OFILES), which is usually empty). The superior
-'make' passes in $(HOST_OFILES); the others are fixed
-in the Makefile.
+ * Add the function to the AC_CHECK_FUNCS lists just after the
+ setting of the funcs shell variable. These AC_CHECK_FUNCS calls
+ are never executed; they are there to make autoheader work
+ better.
+
+ * Consider the special cases of building libiberty; as of this
+ writing, the special cases are newlib and VxWorks. If a
+ particular special case provides the function, you do not need
+ to do anything. If it does not provide the function, add the
+ object file to LIBOBJS, and add the function name to the case
+ controlling whether to define HAVE_func.
+
+The optional file you've added (e.g. getcwd.c) should compile and work
+on all hosts where it is needed. It does not have to work or even
+compile on hosts where it is not needed.
ADDING A NEW CONFIGURATION
==========================
@@ -95,34 +62,4 @@ If the fully automatic scheme doesn't work, you may be able to get
by with defining EXTRA_OFILES in your Makefile stub. This is
a list of object file names that should be treated as required
for this configuration - they will be included in libiberty.a,
-regardless of whatever might be in the C library. Moreover,
-when the dummy.c program is linked, it will be linked with
-$(EXTRA_OFILES). Therefore, if a function in functions.def
-is defined by one of the EXTRA_OFILES, it will not be listed as
-"needed". Thus if your hal9000 host needs a special implementation
-of getcwd, you can just create hal9000-getcwd.c, and define:
- EXTRA_OFILES=hal9000-getcwd.o
-Or if you want to use the libiberty version of strstr(),
-even though there is a version in the C library (it might be
-buggy or slow), just define:
- EXTRA_OFILES=strstr.o
-
-You can create a "manual" host configuration FOO with a file
-config/mh-FOO. In it, the HOST_OFILES macro should explicitly
-list that subset of the optional files that should be in the
-library. You should also set:
- DO_ALSO =
-This overrides all of the magic needed to automatically
-determine which files are "needed." However, keeping that list
-up to date is another matter...
-
-HOW THE MANUAL CONFIGURATION WORKS
-==================================
-
-This also uses a recursive make, but the superior make
-does not do anything interesting - it just calls the
-inferior make with HOST_OFILES defined as $(HOST_OFILES),
-which is the list you created in your configuration.
-
-You probably don't want to depend on manual configuration,
-because keeping the HOST_OFILES list up-to-date will be a pain.
+regardless of whatever might be in the C library.
diff --git a/libiberty/alloca-botch.h b/libiberty/alloca-botch.h
deleted file mode 100644
index c909573f58c..00000000000
--- a/libiberty/alloca-botch.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* RS/6000 AIX botched alloca and requires a pragma, which ordinary compilers
- throw up about, so we have to put it in a specially-configured file.
- Like this one. */
-
-#pragma alloca
diff --git a/libiberty/alloca-norm.h b/libiberty/alloca-norm.h
deleted file mode 100644
index bda4fc049ad..00000000000
--- a/libiberty/alloca-norm.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* "Normal" configuration for alloca. */
-
-#ifdef __GNUC__
-#ifndef alloca
-#define alloca __builtin_alloca
-#endif
-#else /* ! defined (__GNUC__) */
-#if defined (sparc) && defined (sun)
-#include <alloca.h>
-#ifdef __STDC__
-extern void *__builtin_alloca();
-#else /* ! defined (__STDC__) */
-extern char *__builtin_alloca(); /* Stupid include file doesn't declare it */
-#endif /* ! defined (__STDC__) */
-#else /* ! defined (sparc) || ! defined (sun) */
-#ifdef __STDC__
-PTR alloca (size_t);
-#else /* ! defined (__STDC__) */
-PTR alloca (); /* must agree with functions.def */
-#endif /* ! defined (__STDC__) */
-#endif /* ! defined (sparc) || ! defined (sun) */
-#ifdef _WIN32
-#include <malloc.h>
-#endif
-#endif /* ! defined (__GNUC__) */
diff --git a/libiberty/atexit.c b/libiberty/atexit.c
index 4463cb69501..137d985e4cb 100644
--- a/libiberty/atexit.c
+++ b/libiberty/atexit.c
@@ -1,7 +1,10 @@
/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
/* This function is in the public domain. --Mike Stump. */
-#ifndef NEED_on_exit
+#include "config.h"
+
+#ifdef HAVE_ON_EXIT
+
int
atexit(f)
void (*f)();
@@ -11,4 +14,5 @@ atexit(f)
on_exit (f, 0);
return 0;
}
+
#endif
diff --git a/libiberty/basename.c b/libiberty/basename.c
index 689b0c2d39a..f544c853910 100644
--- a/libiberty/basename.c
+++ b/libiberty/basename.c
@@ -20,10 +20,6 @@ BUGS
#include "ansidecl.h"
#include "libiberty.h"
-#include "config.h"
-
-#ifdef NEED_basename
-
char *
basename (name)
const char *name;
@@ -39,5 +35,3 @@ basename (name)
}
return (char *) base;
}
-
-#endif
diff --git a/libiberty/clock.c b/libiberty/clock.c
index b60de1657a4..b204566ff25 100644
--- a/libiberty/clock.c
+++ b/libiberty/clock.c
@@ -22,13 +22,15 @@ the resulting executable to be covered by the GNU General Public License.
This exception does not however invalidate any other reasons why
the executable file might be covered by the GNU General Public License. */
+#include "config.h"
+
#ifdef HAVE_GETRUSAGE
#include <sys/time.h>
#include <sys/resource.h>
#endif
#ifdef HAVE_TIMES
-#ifndef NO_SYS_PARAM_H
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include <sys/times.h>
diff --git a/libiberty/config.table b/libiberty/config.table
index f302956725b..07f4baf8b06 100644
--- a/libiberty/config.table
+++ b/libiberty/config.table
@@ -1,50 +1,10 @@
case "${host}" in
rs6000-ibm-aix3.1 | rs6000-ibm-aix)
- frag=mh-aix
- files=${xsrcdir}alloca-botch.h ;;
- *-ibm-aix*) files=${xsrcdir}alloca-botch.h ;;
- arm-*-riscix*) frag=mh-riscix ;;
- m68k-apollo-bsd*) frag=mh-a68bsd ;;
- m68k-apollo-sysv*) frag=mh-apollo68 ;;
- i[3456]86-ncr-sysv4*) frag=mh-ncr3000 ;;
+ frag=mh-aix ;;
*-*-cxux7*) frag=mh-cxux7 ;;
- *-*-cygwin32) frag=mh-cygwin32 ;;
- *-*-dgux*) frag=mh-sysv ;;
*-*-freebsd2.1.*) frag=mh-fbsd21 ;;
*-*-freebsd2.2.*) frag=mh-fbsd21 ;;
- hppa*-hp-bsd*) frag=mh-hpbsd ;;
- *-*-hpux*) frag=mh-hpux ;;
- *-*-hiux*) frag=mh-hpux ;;
- *-*-irix4*) frag=mh-irix4 ;;
- *-*-irix*) frag=mh-sysv ;;
- *-*-m88kbcs*) frag=mh-sysv ;;
- *-*-solaris2*) frag=mh-sysv4 ;;
- *-*-sysv4*) frag=mh-sysv4 ;;
- *-*-sysv*) frag=mh-sysv ;;
- *-*-go32) frag=mh-go32 ;;
i[345]86-*-windows*) frag=mh-windows ;;
-
- *-*-vxworks5* | *-*-vxworks)
- # VxWorks 5 needs special action, because the usual
- # autoconfiguration scheme does not work.
- frag=mt-vxworks5
- ;;
-
- i[3456]86-*-mingw32*)
- # Mingw32 does not require strerror.o from REQUIRED_OFILES.
- # Worse: it will not compile it because of an incompatible sys_errlist
- # definition.
- frag=mt-mingw32
- ;;
-esac
-
-# Try to handle funky case of solaris 2 -> sun 4.
-case "${host}" in
- sparc-sun-sunos4.1.3)
- if [ "${with_cross_host}" != "${host}" ] ; then
- frag=mt-sunos4
- fi
- ;;
esac
frags=$frag
@@ -57,6 +17,7 @@ case "${enable_shared}" in
esac
if [ "${shared}" = "yes" ]; then
case "${host}" in
+ *-*-cygwin32*) ;;
hppa*-*-*) frags="${frags} ../../config/mh-papic" ;;
i[3456]86-*-*) frags="${frags} ../../config/mh-x86pic" ;;
*-*-*) frags="${frags} ../../config/mh-${host_cpu}pic" ;;
@@ -83,4 +44,4 @@ for frag in ${frags}; do
done
frag=xhost-mkfrag
-${config_shell} ${moveifchange} temp-frag xhost-mkfrag
+${CONFIG_SHELL} ${libiberty_topdir}/move-if-change temp-frag xhost-mkfrag
diff --git a/libiberty/config/mh-a68bsd b/libiberty/config/mh-a68bsd
deleted file mode 100644
index 3c5a237e60b..00000000000
--- a/libiberty/config/mh-a68bsd
+++ /dev/null
@@ -1,2 +0,0 @@
-RANLIB=ranlib
-CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__
diff --git a/libiberty/config/mh-aix b/libiberty/config/mh-aix
index ee84d03ff33..6b645058fa9 100644
--- a/libiberty/config/mh-aix
+++ b/libiberty/config/mh-aix
@@ -1,7 +1,5 @@
# This file is only needed by AIX 3.1.
HDEFINES = -D__IEEE_BIG_ENDIAN
-RANLIB=true
-INSTALL=cp
# Most releases of AIX 3.1 include an incorrect internal version of copysign
# in libc.a for use by some libc public functions including modf. The public
diff --git a/libiberty/config/mh-apollo68 b/libiberty/config/mh-apollo68
deleted file mode 100644
index 651770ce31c..00000000000
--- a/libiberty/config/mh-apollo68
+++ /dev/null
@@ -1,2 +0,0 @@
-RANLIB=true
-CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__
diff --git a/libiberty/config/mh-cygwin32 b/libiberty/config/mh-cygwin32
deleted file mode 100644
index 42b1afb64c0..00000000000
--- a/libiberty/config/mh-cygwin32
+++ /dev/null
@@ -1,2 +0,0 @@
-HDEFINES=-DNEED_sys_siglist -DNEED_basename -DNEED_strsignal
-EXTRA_OFILES=random.o
diff --git a/libiberty/config/mh-go32 b/libiberty/config/mh-go32
deleted file mode 100644
index 919290ef539..00000000000
--- a/libiberty/config/mh-go32
+++ /dev/null
@@ -1 +0,0 @@
-HDEFINES=-DHAVE_GETRUSAGE
diff --git a/libiberty/config/mh-hpbsd b/libiberty/config/mh-hpbsd
deleted file mode 100644
index ce11dcd6ac9..00000000000
--- a/libiberty/config/mh-hpbsd
+++ /dev/null
@@ -1,2 +0,0 @@
-# HPPA hosts using BSD
-RANLIB=true
diff --git a/libiberty/config/mh-irix4 b/libiberty/config/mh-irix4
deleted file mode 100644
index ace76782712..00000000000
--- a/libiberty/config/mh-irix4
+++ /dev/null
@@ -1,4 +0,0 @@
-CC = cc -cckr
-RANLIB = true
-INSTALL = cp
-EXTRA_OFILES = alloca.o
diff --git a/libiberty/config/mh-ncr3000 b/libiberty/config/mh-ncr3000
deleted file mode 100644
index 3a45c22b128..00000000000
--- a/libiberty/config/mh-ncr3000
+++ /dev/null
@@ -1,19 +0,0 @@
-# Host configuration file for an NCR 3000 (i486/SVR4) system.
-
-# The NCR 3000 ships with a MetaWare compiler installed as /bin/cc.
-# This compiler not only emits obnoxious copyright messages every time
-# you run it, but it chokes and dies on a whole bunch of GNU source
-# files. Default to using the AT&T compiler installed in /usr/ccs/ATT/cc.
-# Unfortunately though, the AT&T compiler sometimes generates code that
-# the assembler barfs on if -g is used, so disable it by default as well.
-CC = /usr/ccs/ATT/cc
-CFLAGS =
-
-RANLIB = true
-
-# The /usr/ucb/install program is incompatible (complains about unknown
-# group staff). Use good old cp...
-INSTALL = cp
-
-# The l flag generates a warning from the SVR4 archiver, remove it.
-AR_FLAGS = cq
diff --git a/libiberty/config/mh-riscix b/libiberty/config/mh-riscix
deleted file mode 100644
index 0209279de56..00000000000
--- a/libiberty/config/mh-riscix
+++ /dev/null
@@ -1,6 +0,0 @@
-# The native linker only reports the first undefined symbol if linking with a
-# shared library. So build using gcc and link statically (this requires
-# gcc 2.6.0 or above).
-
-ERRORS_CC = gcc
-ERRORS_LDFLAGS = -static
diff --git a/libiberty/config/mh-sysv b/libiberty/config/mh-sysv
deleted file mode 100644
index eb102d55010..00000000000
--- a/libiberty/config/mh-sysv
+++ /dev/null
@@ -1 +0,0 @@
-RANLIB=true
diff --git a/libiberty/config/mh-sysv4 b/libiberty/config/mh-sysv4
deleted file mode 100644
index 4d1aa3cd61d..00000000000
--- a/libiberty/config/mh-sysv4
+++ /dev/null
@@ -1,3 +0,0 @@
-HDEFINES = -DHAVE_SYSCONF
-RANLIB=true
-INSTALL = cp
diff --git a/libiberty/config/mh-windows b/libiberty/config/mh-windows
index 3dbd6ef694a..3ff5f794e9f 100644
--- a/libiberty/config/mh-windows
+++ b/libiberty/config/mh-windows
@@ -1,2 +1 @@
-HDEFINES=-DNEED_basename -DNEED_sys_siglist -DNEED_strsignal -DNO_SYS_FILE_H
EXTRA_OFILES=asprintf.o strcasecmp.o strncasecmp.o vasprintf.o
diff --git a/libiberty/config/mt-mingw32 b/libiberty/config/mt-mingw32
deleted file mode 100644
index 2fb17d783d0..00000000000
--- a/libiberty/config/mt-mingw32
+++ /dev/null
@@ -1,27 +0,0 @@
-# Mingw32 target Makefile fragment.
-# The autoconfiguration fails for a Mingw32 target, because of an
-# incompatible definition of sys_errlist, which is imported from a DLL.
-# Therefore, we compute the dependencies by hand.
-
-HDEFINES = -DNO_SYS_PARAM_H -DNO_SYS_FILE_H
-CONFIG_H = mgconfig.h
-NEEDED_LIST = mgneeded-list
-
-mgconfig.h: Makefile
- if [ -f ../newlib/Makefile ]; then \
- $(MAKE) $(FLAGS_TO_PASS) xconfig.h; \
- cp xconfig.h mgconfig.h; \
- else \
- echo "#define NEED_sys_siglist 1" >>mgconfig.h; \
- echo "#define NEED_strsignal 1" >>mgconfig.h; \
- echo "#define NEED_psignal 1" >>mgconfig.h; \
- echo "#define NEED_basename 1" >>mgconfig.h; \
- fi
-
-mgneeded-list: Makefile
- if [ -f ../newlib/Makefile ]; then \
- $(MAKE) $(FLAGS_TO_PASS) xneeded-list; \
- cp xneeded-list mgneeded-list; \
- else \
- echo getopt.o vasprintf.o >mgneeded-list; \
- fi
diff --git a/libiberty/config/mt-sunos4 b/libiberty/config/mt-sunos4
deleted file mode 100644
index c25baa6ead6..00000000000
--- a/libiberty/config/mt-sunos4
+++ /dev/null
@@ -1,2 +0,0 @@
-XTRAFLAGS = -isystem /s1/cygnus/dejagnu/sparc-sun-sunos4.1.3/include/
-LOADLIBES = -L/s1/cygnus/dejagnu/sparc-sun-sunos4.1.3/lib
diff --git a/libiberty/config/mt-vxworks5 b/libiberty/config/mt-vxworks5
deleted file mode 100644
index 916d69e5521..00000000000
--- a/libiberty/config/mt-vxworks5
+++ /dev/null
@@ -1,28 +0,0 @@
-# VxWorks 5.x target Makefile fragment.
-# The autoconfiguration fails for a VxWorks target, because the
-# libraries are actually on the target board, not in the file system.
-# Therefore, we compute the dependencies by hand.
-
-HDEFINES = -DNO_SYS_PARAM_H -DNO_SYS_FILE_H
-CONFIG_H = vxconfig.h
-NEEDED_LIST = vxneeded-list
-
-vxconfig.h: Makefile
- if [ -f ../newlib/Makefile ]; then \
- $(MAKE) $(FLAGS_TO_PASS) xconfig.h; \
- cp xconfig.h vxconfig.h; \
- else \
- echo "#define NEED_sys_nerr 1" >vxconfig.h; \
- echo "#define NEED_sys_errlist 1" >>vxconfig.h; \
- echo "#define NEED_sys_siglist 1" >>vxconfig.h; \
- echo "#define NEED_strsignal 1" >>vxconfig.h; \
- echo "#define NEED_psignal 1" >>vxconfig.h; \
- fi
-
-vxneeded-list: Makefile
- if [ -f ../newlib/Makefile ]; then \
- $(MAKE) $(FLAGS_TO_PASS) xneeded-list; \
- cp xneeded-list vxneeded-list; \
- else \
- echo getopt.o getpagesize.o insque.o random.o strcasecmp.o strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o >vxneeded-list; \
- fi
diff --git a/libiberty/configure.bat b/libiberty/configure.bat
index ed33777174b..18881ac2f75 100644
--- a/libiberty/configure.bat
+++ b/libiberty/configure.bat
@@ -5,7 +5,6 @@ echo Configuring libiberty for go32
copy Makefile.dos Makefile
echo #define NEED_sys_siglist 1 >> config.h
echo #define NEED_psignal 1 >> config.h
-update alloca-normal.h alloca-conf.h
goto exit
:h8300
diff --git a/libiberty/configure.in b/libiberty/configure.in
index b0020d8bab4..05a9df1e975 100644
--- a/libiberty/configure.in
+++ b/libiberty/configure.in
@@ -1,66 +1,328 @@
-# This file is a shell script fragment that supplies the information
-# necessary for a configure script to process the program in
-# this directory. For more information, look at ../configure.
+dnl Process this file with autoconf to produce a configure script
-configdirs=
-srctrigger=getopt1.c
-srcname="-liberty library"
+AC_PREREQ(2.5)
+AC_INIT(pexecute.c)
-# per-host:
+dnl We use these options to decide which functions to include.
+AC_ARG_WITH(target-subdir,
+[ --with-target-subdir=SUBDIR Configuring with a cross compiler])
+AC_ARG_WITH(newlib,
+[ --with-newlib Configuring with newlib])
-files="alloca-norm.h"
-links="alloca-conf.h"
+if test "${srcdir}" = "."; then
+ if test -z "${with_target_subdir}"; then
+ libiberty_topdir="${srcdir}/.."
+ else
+ if test "${with_target_subdir}" != "."; then
+ libiberty_topdir="${srcdir}/${with_multisrctop}../.."
+ else
+ libiberty_topdir="${srcdir}/${with_multisrctop}.."
+ fi
+ fi
+else
+ libiberty_topdir="${srcdir}/.."
+fi
+AC_CONFIG_AUX_DIR($libiberty_topdir)
+
+AC_CANONICAL_HOST
+
+dnl When we start using automake:
+dnl AM_INIT_AUTOMAKE(libiberty, 1.0)
+
+dnl These must be called before AM_PROG_LIBTOOL, because it may want
+dnl to call AC_CHECK_PROG.
+AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+
+# FIXME: We temporarily define our own version of AC_PROG_CC. This is
+# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
+# are probably using a cross compiler, which will not be able to fully
+# link an executable. This should really be fixed in autoconf
+# itself.
+
+AC_DEFUN(LIB_AC_PROG_CC,
+[AC_BEFORE([$0], [AC_PROG_CPP])dnl
+AC_PROVIDE([AC_PROG_CC])
+AC_CHECK_PROG(CC, gcc, gcc)
+if test -z "$CC"; then
+ AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
+ test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+fi
+
+AC_PROG_CC_GNU
+
+if test $ac_cv_prog_gcc = yes; then
+ GCC=yes
+dnl Check whether -g works, even if CFLAGS is set, in case the package
+dnl plays around with CFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+ ac_test_CFLAGS="${CFLAGS+set}"
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS=
+ AC_PROG_CC_G
+ if test "$ac_test_CFLAGS" = set; then
+ CFLAGS="$ac_save_CFLAGS"
+ elif test $ac_cv_prog_cc_g = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-O2"
+ fi
+else
+ GCC=
+ test "${CFLAGS+set}" = set || CFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CC
+
+AC_ISC_POSIX
+
+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
+
+dnl When we start using libtool:
+dnl AM_PROG_LIBTOOL
+
+dnl When we start using automake:
+dnl AM_CONFIG_HEADER(config.h:config.in)
+AC_CONFIG_HEADER(config.h:config.in)
+
+dnl When we start using automake:
+dnl AM_MAINTAINER_MODE
+dnl AM_EXEEXT
+
+dnl When we start using automake:
+dnl AM_PROG_INSTALL
+AC_PROG_INSTALL
. ${srcdir}/config.table
host_makefile_frag=${frag}
+AC_SUBST_FILE(host_makefile_frag)
+
+# It's OK to check for header files. Although the compiler may not be
+# able to link anything, it had better be able to at least compile
+# something.
+AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h)
-# per-target:
-
-# post-target:
-
-# If this is the target libiberty, check at compile time whether we are using
-# newlib. If we are, we already know the files we need, since the linker
-# will fail when run on some of the newlib targets.
-if [ -n "${with_target_subdir}" ] ; then
- cat > Makefile.tem <<'!EOF!'
-CONFIG_H = xconfig.h
-NEEDED_LIST = xneeded-list
-
-xconfig.h: Makefile
- if [ -f ../newlib/Makefile ]; then \
- echo "#define NEED_sys_nerr 1" >xconfig.h; \
- echo "#define NEED_sys_errlist 1" >>xconfig.h; \
- echo "#define NEED_sys_siglist 1" >>xconfig.h; \
- echo "#define NEED_strsignal 1" >>xconfig.h; \
- echo "#define NEED_psignal 1" >>xconfig.h; \
- else \
- $(MAKE) $(FLAGS_TO_PASS) lconfig.h; \
- cp lconfig.h xconfig.h; \
- fi
-
-xneeded-list: Makefile
- if [ -f ../newlib/Makefile ]; then \
- echo insque.o random.o strdup.o alloca.o vasprintf.o >xneeded-list; \
- else \
- $(MAKE) $(FLAGS_TO_PASS) lneeded-list; \
- cp lneeded-list xneeded-list; \
- fi
-!EOF!
-sed -e "/^####/ r Makefile.tem" \
- -e '/INSTALL_DEST =/s/libdir/tooldir/' ${Makefile} > Makefile.tem3
-mv Makefile.tem3 ${Makefile}
-rm -f Makefile.tem
+# This is the list of functions which libiberty will provide if they
+# are not available on the host.
+
+funcs="asprintf"
+funcs="$funcs atexit"
+funcs="$funcs basename"
+funcs="$funcs bcmp"
+funcs="$funcs bcopy"
+funcs="$funcs bzero"
+funcs="$funcs clock"
+funcs="$funcs getcwd"
+funcs="$funcs getpagesize"
+funcs="$funcs index"
+funcs="$funcs insque"
+funcs="$funcs memchr"
+funcs="$funcs memcmp"
+funcs="$funcs memcpy"
+funcs="$funcs memmove"
+funcs="$funcs memset"
+funcs="$funcs random"
+funcs="$funcs rename"
+funcs="$funcs rindex"
+funcs="$funcs sigsetmask"
+funcs="$funcs strcasecmp"
+funcs="$funcs strchr"
+funcs="$funcs strdup"
+funcs="$funcs strncasecmp"
+funcs="$funcs strrchr"
+funcs="$funcs strstr"
+funcs="$funcs strtod"
+funcs="$funcs strtol"
+funcs="$funcs strtoul"
+funcs="$funcs tmpnam"
+funcs="$funcs vasprintf"
+funcs="$funcs vfprintf"
+funcs="$funcs vprintf"
+funcs="$funcs vsprintf"
+funcs="$funcs waitpid"
+
+# Also in the old function.def file: alloca, vfork, getopt.
+
+vars="sys_errlist sys_nerr sys_siglist"
+
+checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times"
+
+# These are neither executed nor required, but they help keep
+# autoheader happy without adding a bunch of text to acconfig.h.
+if test "x" = "y"; then
+ AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bzero clock getcwd)
+ AC_CHECK_FUNCS(getpagesize index insque memchr memcmp memcpy memmove)
+ AC_CHECK_FUNCS(memset random rename rindex sigsetmask strcasecmp)
+ AC_CHECK_FUNCS(strchr strdup strncasecmp strrchr strstr strtod strtol)
+ AC_CHECK_FUNCS(strtoul tmpnam vasprintf vfprintf vprintf vsprintf waitpid)
+ AC_DEFINE(HAVE_SYS_ERRLIST)
+ AC_DEFINE(HAVE_SYS_NERR)
+ AC_DEFINE(HAVE_SYS_SIGLIST)
+ AC_CHECK_FUNCS(getrusage on_exit psignal strerror strsignal sysconf times)
fi
-# We need multilib support, but only if configuring for the target.
-if [ -n "${with_target_subdir}" ] ; then
- if [ "${srcdir}" = "." ] ; then
- if [ "${with_target_subdir}" != "." ] ; then
- . ${with_multisrctop}../../config-ml.in
+# For each of these functions, if the host does not provide the
+# function we want to put FN.o in LIBOBJS, and if the host does
+# provide the function, we want to define HAVE_FN in config.h. Also,
+# if the host does not provide alloca, we set ALLOCA to alloca.o
+
+setobjs=
+if test -n "${with_target_subdir}"; then
+
+ # We are being configured with a cross compiler. AC_REPLACE_FUNCS
+ # may not work correctly, because the compiler may not be able to
+ # link executables.
+
+ # If we are being configured for newlib, we know which functions
+ # newlib provide and which ones we will be expected to provide.
+
+ if test "x${with_newlib}" = "xyes"; then
+ ALLOCA="alloca.o"
+ LIBOBJS="basename.o insque.o random.o strdup.o vasprintf.o"
+
+ for f in $funcs; do
+ case "$f" in
+ basename | insque | random | strdup | vasprintf)
+ ;;
+ *)
+ n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ AC_DEFINE_UNQUOTED($n)
+ ;;
+ esac
+ done
+
+ # newlib doesnt provide any of the variables in $vars, so we
+ # dont have to check them here.
+
+ # Of the functions in $checkfuncs, VxWorks only has strerror.
+ AC_DEFINE(HAVE_STRERROR)
+
+ setobjs=yes
+
+ fi
+fi
+
+if test -z "${setobjs}"; then
+ case "${host}" in
+
+ *-*-vxworks*)
+ # Handle VxWorks configuration specially, since on VxWorks the
+ # libraries are actually on the target board, not in the file
+ # system.
+ LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
+ LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
+ for f in $funcs; do
+ case "$f" in
+ basename | getpagesize | insque | random | strcasecmp)
+ ;;
+ strncasecmp | strdup | vfork | waitpid | vasprintf)
+ ;;
+ *)
+ n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ AC_DEFINE_UNQUOTED($n)
+ ;;
+ esac
+ done
+
+ # VxWorks doesn't provide any of the variables in $vars, so we
+ # don't have to check them here.
+
+ # Of the functions in $checkfuncs, VxWorks only has strerror.
+ AC_DEFINE(HAVE_STRERROR)
+
+ setobjs=yes
+ ;;
+
+ esac
+fi
+
+if test -z "${setobjs}"; then
+
+ case "${host}" in
+
+ *-*-cygwin32*)
+ # The cygwin32 library actually uses a couple of files from
+ # libiberty when it is built. If we are building a native
+ # cygwin32, and we run the tests, we will appear to have these
+ # files. However, when we go on to build winsup, we will wind up
+ # with a library which does not have the files, since they should
+ # have come from libiberty.
+
+ # We handle this by removing the functions the winsup library
+ # provides from our shell variables, so that they appear to be
+ # missing.
+
+ funcs="`echo $funcs | sed -e 's/random//'`"
+ LIBOBJS="$LIBOBJS random.o"
+ vars="`echo $vars | sed -e 's/sys_siglist//'`"
+ checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//`"
+ ;;
+
+ *-*-mingw32*)
+ # Under mingw32, sys_nerr and sys_errlist exist, but they are
+ # macros, so the test below won't find them.
+ vars="`echo $vars | sed -e 's/sys_nerr//' -e 's/sys_errlist//'`"
+ AC_DEFINE(HAVE_SYS_NERR)
+ AC_DEFINE(HAVE_SYS_ERRLIST)
+ ;;
+
+ esac
+
+ # We haven't set the list of objects yet. Use the standard autoconf
+ # tests. This will only work if the compiler works.
+ AC_PROG_CC_WORKS
+ AC_REPLACE_FUNCS($funcs)
+ AC_FUNC_ALLOCA
+ AC_FUNC_VFORK
+ if test $ac_cv_func_vfork_works = no; then
+ LIBOBJS="$LIBOBJS vfork.o"
+ fi
+ for v in $vars; do
+ AC_MSG_CHECKING([for $v])
+ AC_CACHE_VAL(libiberty_cv_var_$v,
+ [AC_TRY_LINK([int *p;], [extern int $v; p = &$v;],
+ [eval "libiberty_cv_var_$v=yes"],
+ [eval "libiberty_cv_var_$v=no"])])
+ if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
+ AC_DEFINE_UNQUOTED($n)
else
- . ${with_multisrctop}../config-ml.in
+ AC_MSG_RESULT(no)
fi
- else
- . ${srcdir}/../config-ml.in
- fi
+ done
+ AC_CHECK_FUNCS($checkfuncs)
+fi
+
+# Install a library built with a cross compiler in $(tooldir) rather
+# than $(libdir).
+if test -z "${with_target_subdir}"; then
+ INSTALL_DEST=libdir
+else
+ INSTALL_DEST=tooldir
fi
+AC_SUBST(INSTALL_DEST)
+
+# We need multilib support, but only if configuring for the target.
+AC_OUTPUT(Makefile,
+[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+if test -n "$CONFIG_FILES"; then
+ if test -n "${with_target_subdir}"; then
+ # FIXME: We shouldn't need to set ac_file
+ ac_file=Makefile
+ . ${libiberty_topdir}/config-ml.in
+ fi
+fi],
+srcdir=${srcdir}
+host=${host}
+target=${target}
+with_target_subdir=${with_target_subdir}
+with_multisubdir=${with_multisubdir}
+ac_configure_args="--enable-multilib ${ac_configure_args}"
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+libiberty_topdir=${libiberty_topdir}
+)
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index c5bcc47664c..ccf7aef4a85 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -890,7 +890,8 @@ demangle_signature (work, mangled, declp)
{
remember_type (work, oldmangled, *mangled - oldmangled);
}
- string_append(&tname, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (&tname, "::");
+
string_prepends(declp, &tname);
if (work -> destructor & 1)
{
@@ -1374,7 +1375,6 @@ demangle_template (work, mangled, tname, trawname, is_type)
int need_comma = 0;
int success = 0;
const char *start;
- int is_java_array = 0;
string temp;
(*mangled)++;
@@ -1418,16 +1418,10 @@ demangle_template (work, mangled, tname, trawname, is_type)
}
if (trawname)
string_appendn (trawname, *mangled, r);
- is_java_array = (work -> options & DMGL_JAVA)
- && strncmp (*mangled, "JArray1Z", 8) == 0;
- if (! is_java_array)
- {
string_appendn (tname, *mangled, r);
- }
*mangled += r;
}
}
- if (!is_java_array)
string_append (tname, "<");
/* get size of template parameter list */
if (!get_count (mangled, &r))
@@ -1555,11 +1549,6 @@ demangle_template (work, mangled, tname, trawname, is_type)
}
need_comma = 1;
}
- if (is_java_array)
- {
- string_append (tname, "[]");
- }
- else
{
if (tname->p[-1] == '>')
string_append (tname, " ");
@@ -1723,7 +1712,7 @@ demangle_class (work, mangled, declp)
}
remember_Ktype (work, class_name.b, LEN_STRING(&class_name));
remember_Btype (work, class_name.b, LEN_STRING(&class_name), btype);
- string_prepend (declp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_prepend (declp, "::");
string_prepends (declp, &class_name);
success = 1;
}
@@ -2025,8 +2014,7 @@ gnu_special (work, mangled, declp)
{
if (p != NULL)
{
- string_append (declp,
- (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (declp, "::");
(*mangled)++;
}
}
@@ -2064,7 +2052,7 @@ gnu_special (work, mangled, declp)
/* Consumed everything up to the cplus_marker, append the
variable name. */
(*mangled)++;
- string_append (declp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (declp, "::");
n = strlen (*mangled);
string_appendn (declp, *mangled, n);
(*mangled) += n;
@@ -2361,7 +2349,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
if (qualifiers > 0)
{
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (&temp, "::");
}
}
@@ -2372,7 +2360,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
if (isfuncname && (work->constructor & 1 || work->destructor & 1))
{
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (&temp, "::");
if (work -> destructor & 1)
{
string_append (&temp, "~");
@@ -2391,7 +2379,7 @@ demangle_qualified (work, mangled, result, isfuncname, append)
{
if (!STRING_EMPTY (result))
{
- string_append (&temp, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_append (&temp, "::");
}
string_prepends (result, &temp);
}
@@ -2486,7 +2474,6 @@ do_type (work, mangled, result)
case 'P':
case 'p':
(*mangled)++;
- if (! (work -> options & DMGL_JAVA))
string_prepend (&decl, "*");
break;
@@ -2569,7 +2556,7 @@ do_type (work, mangled, result)
}
string_append (&decl, ")");
- string_prepend (&decl, (work -> options & DMGL_JAVA) ? "." : "::");
+ string_prepend (&decl, "::");
if (isdigit (**mangled))
{
n = consume_count (mangled);
@@ -3622,7 +3609,6 @@ static struct option long_options[] = {
{"strip-underscores", no_argument, 0, '_'},
{"format", required_argument, 0, 's'},
{"help", no_argument, 0, 'h'},
- {"java", no_argument, 0, 'j'},
{"no-strip-underscores", no_argument, 0, 'n'},
{"version", no_argument, 0, 'v'},
{0, no_argument, 0, 0}
@@ -3667,9 +3653,6 @@ main (argc, argv)
case '_':
strip_underscore = 1;
break;
- case 'j':
- flags |= DMGL_JAVA;
- break;
case 's':
if (strcmp (optarg, "gnu") == 0)
{
diff --git a/libiberty/dummy.c b/libiberty/dummy.c
deleted file mode 100644
index 08da647e30e..00000000000
--- a/libiberty/dummy.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <ansidecl.h>
-
-#ifdef __STDC__
-#include <stddef.h>
-#define clock_t unsigned long
-#define DEF(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME (ARGS);
-#define DEFFUNC(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME (ARGS);
-#else
-#define void int
-#define size_t unsigned long
-#define clock_t unsigned long
-#define DEF(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME ();
-#define DEFFUNC(NAME, RETURN_TYPE, ARGLIST, ARGS) extern RETURN_TYPE NAME ();
-#endif
-
-#define DEFVAR(NAME,DECL,USE) extern DECL;
-
-#define NOTHING /*nothing*/
-
-#include "alloca-conf.h"
-#include "functions.def"
-
-/* Always use our: getopt.o getopt1.o obstack.o spaces.o */
-
-int
-main (argc, argv)
- int argc; char **argv;
-{
-
-/* Create a dummy function call for each DEF-defined function. */
-
-#undef DEF
-#undef DEFVAR
-#undef DEFFUNC
-#undef AND
-#define AND = 0;
-/* ARGS expands into a set of declaration. NAME ARG_LIST expands
- info a function call that uses those variables as actual parameters.
- If the function has been DEF'ed correctly, we can pass the right
- number and types of parameters, which is nice. (E.g. gcc may
- otherwise complain about the wrong number of parameters to certain
- builtins.) */
-#define DEF(NAME, RETURN_TYPE, ARG_LIST, ARGS) { ARGS; NAME ARG_LIST; }
-#define DEFVAR(NAME, DECL, USE) { USE; }
-#define DEFFUNC(NAME, RETURN_TYPE, ARG_LIST, ARGS) { ARGS; NAME ARG_LIST; }
-#include "functions.def"
-
- return (0);
-}
diff --git a/libiberty/functions.def b/libiberty/functions.def
deleted file mode 100644
index 0f13f107868..00000000000
--- a/libiberty/functions.def
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * List of function definitions that may *optionally* be included
- * in libiberty.a. The function names must match the filenames,
- * e.g. bzero() is defined in bzero.c. (While each file can contain
- * extra functions, do not list them.)
- *
- * In the default libiberty configuration, these object files
- * (e.g bzero.o) are included if and only if cc fails to find
- * the corresponding function in libc.
- */
-
-DEF(asprintf, int, (), NOTHING)
-DEF(atexit, int, (f), void (*f)())
-DEF(bcmp, int, (s1, s2, length), char *s1 AND char *s2 AND int length )
-DEF(bcopy, void, (s1, s2, length), char *s1 AND char *s2 AND int length )
-DEF(bzero, void, (s, length), char *s AND int length)
-DEF(clock, clock_t, (), NOTHING)
-DEF(getopt, int, (argc, argv, optstring),
- int argc AND char **argv AND CONST char *optstring)
-DEF(getpagesize, int , (), NOTHING)
-DEF(getcwd, char*, (buf, len), char *buf AND int len)
-DEF(index, char*, (s, c), char *s AND int c)
-DEF(insque, void, (), NOTHING)
-DEF(memchr, PTR, (s, c, length), CONST PTR s AND int c AND size_t length)
-DEF(memcmp, int, (s1, s2, length),
- CONST PTR s1 AND CONST PTR s2 AND size_t length)
-DEF(memcpy, PTR, (s1, s2, length), PTR s1 AND CONST PTR s2 AND size_t length)
-DEF(memmove, PTR, (s1, s2, length), PTR s1 AND CONST PTR s2 AND size_t length)
-DEF(memset, PTR, (s, val, length), PTR s AND int val AND size_t length )
-DEF(random, long int, (), NOTHING)
-DEF(rename, int, (f, t), char *f AND char *t)
-DEF(rindex, char*, (s, c), char *s AND int c)
-DEF(strcasecmp, int, (s1, s2), char *s1 AND char *s2)
-DEF(strncasecmp, int, (s1, s2, n), char *s1 AND char *s2 AND int n)
-DEF(strchr, char*, (s, c), CONST char *s AND int c)
-DEF(strdup, char*, (s1), char * s1)
-DEF(strrchr, char*, (s, c), CONST char *s AND int c)
-DEF(strstr, char*, (), NOTHING)
-DEF(strtod, double, (), NOTHING)
-DEF(strtol, long, (), NOTHING)
-DEF(strtoul, unsigned long, (), NOTHING)
-DEF(tmpnam, char *, (s), char * s)
-DEF(vfork, int, (), NOTHING)
-DEF(vfprintf, int, (), NOTHING)
-DEF(vprintf, int, (), NOTHING)
-DEF(vsprintf, int, (), NOTHING)
-DEF(sigsetmask, int, (), NOTHING)
-DEF(alloca, PTR, (size), size_t size)
-DEF(waitpid, int, (pid, statp, opts), int pid AND int* statp AND int opts )
-DEF(vasprintf, int, (), NOTHING)
-
-/* List of global variables that we want to look for in the host
- environment, and to generate an entry NEED_<variable> in config.h
- if they are not found. The first arg is the variable name, the
- second arg is how to declare the variable, and the third is how to
- use it. */
-
-DEFVAR(sys_nerr, int sys_nerr, sys_nerr = 0)
-DEFVAR(sys_errlist, char *sys_errlist[], sys_errlist[0] = 0)
-DEFVAR(sys_siglist, char *sys_siglist[], sys_siglist[0] = 0)
-
-/* List of global functions that we want to look for in the host
- environment, and to generate an entry NEED_<funcname> in config.h
- if they are not found. */
-
-DEFFUNC(strerror, char*, (errnoval), int errnoval)
-DEFFUNC(psignal, void, (signo, message), unsigned signo AND char *message)
-DEFFUNC(basename, char *, (name), CONST char *name)
-DEFFUNC(on_exit, void, (f, arg), void (*f)() AND char *arg)
-DEFFUNC(strsignal, const char *, (signo), int signo)
diff --git a/libiberty/getcwd.c b/libiberty/getcwd.c
index 60c1dd84eed..06d55c04f58 100644
--- a/libiberty/getcwd.c
+++ b/libiberty/getcwd.c
@@ -20,7 +20,9 @@ BUGS
*/
-#ifndef NO_SYS_PARAM_H
+#include "config.h"
+
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include <errno.h>
diff --git a/libiberty/getpagesize.c b/libiberty/getpagesize.c
index e9784b8520b..d6327a8887d 100644
--- a/libiberty/getpagesize.c
+++ b/libiberty/getpagesize.c
@@ -28,8 +28,10 @@ BUGS
#ifndef VMS
+#include "config.h"
+
#include <sys/types.h>
-#ifndef NO_SYS_PARAM_H
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
diff --git a/libiberty/getruntime.c b/libiberty/getruntime.c
index 1be3b4c4a2a..86162225901 100644
--- a/libiberty/getruntime.c
+++ b/libiberty/getruntime.c
@@ -17,6 +17,8 @@ License along with libiberty; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include "config.h"
+
#include "ansidecl.h"
#include "libiberty.h"
@@ -26,23 +28,13 @@ Boston, MA 02111-1307, USA. */
#include <time.h>
-/* These should go away when libiberty uses autoconf. */
-
-#if defined(__sun__) && !defined(__svr4__)
-#define HAVE_GETRUSAGE
-#endif
-
-#ifdef HAVE_SYSCONF
-#define HAVE_TIMES
-#endif
-
#ifdef HAVE_GETRUSAGE
#include <sys/time.h>
#include <sys/resource.h>
#endif
#ifdef HAVE_TIMES
-#ifndef NO_SYS_PARAM_H
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#include <sys/times.h>
diff --git a/libiberty/makefile.vms b/libiberty/makefile.vms
index 6f49ee1b1ea..b61b51290da 100644
--- a/libiberty/makefile.vms
+++ b/libiberty/makefile.vms
@@ -23,15 +23,11 @@ libiberty.olb: config.h alloca-conf.h $(OBJS)
purge
lib/create libiberty *.obj
-alloca-conf.h: alloca-norm.h
- $(CP) $< $@
-
config.h: config.h-vms
$(CP) $< $@
clean:
$$ purge
- $(RM) alloca-conf.h;
$(RM) config.h;
$(RM) *.obj;
$(RM) libiberty.olb;
diff --git a/libiberty/mpw-config.in b/libiberty/mpw-config.in
index 829d8e730d4..2a21802148d 100644
--- a/libiberty/mpw-config.in
+++ b/libiberty/mpw-config.in
@@ -1,7 +1,5 @@
# MPW configuration fragment for libiberty.
-forward-include "{srcdir}"alloca-norm.h alloca-conf.h
-
Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new
MoveIfChange "{o}"config.new "{o}"config.h
diff --git a/libiberty/strerror.c b/libiberty/strerror.c
index f5e2eebee2e..644cc75462a 100644
--- a/libiberty/strerror.c
+++ b/libiberty/strerror.c
@@ -7,7 +7,7 @@
#include "config.h"
-#ifndef NEED_sys_errlist
+#ifdef HAVE_SYS_ERRLIST
/* Note that errno.h (not sure what OS) or stdio.h (BSD 4.4, at least)
might declare sys_errlist in a way that the compiler might consider
incompatible with our later declaration, perhaps by using const
@@ -19,7 +19,7 @@
#include <stdio.h>
#include <errno.h>
-#ifndef NEED_sys_errlist
+#ifdef HAVE_SYS_ERRLIST
#undef sys_errlist
#endif
@@ -55,12 +55,12 @@ struct error_info
{
int value; /* The numeric value from <errno.h> */
const char *name; /* The equivalent symbolic value */
-#ifdef NEED_sys_errlist
+#ifndef HAVE_SYS_ERRLIST
const char *msg; /* Short message about this value */
#endif
};
-#ifdef NEED_sys_errlist
+#ifndef HAVE_SYS_ERRLIST
# define ENTRY(value, name, msg) {value, name, msg}
#else
# define ENTRY(value, name, msg) {value, name}
@@ -455,7 +455,7 @@ static int num_error_names = 0;
same name, it differs from other implementations in that it is dynamically
initialized rather than statically initialized. */
-#ifdef NEED_sys_errlist
+#ifndef HAVE_SYS_ERRLIST
static int sys_nerr;
static const char **sys_errlist;
@@ -532,7 +532,7 @@ init_error_tables ()
}
}
-#ifdef NEED_sys_errlist
+#ifndef HAVE_SYS_ERRLIST
/* Now attempt to allocate the sys_errlist table, zero it out, and then
initialize it from the statically initialized error_table. */
@@ -595,7 +595,7 @@ errno_max ()
return (maxsize - 1);
}
-#ifdef NEED_strerror
+#ifndef HAVE_STRERROR
/*
@@ -634,7 +634,7 @@ strerror (errnoval)
char *msg;
static char buf[32];
-#ifdef NEED_sys_errlist
+#ifndef HAVE_SYS_ERRLIST
if (error_names == NULL)
{
@@ -668,7 +668,7 @@ strerror (errnoval)
return (msg);
}
-#endif /* NEED_strerror */
+#endif /* ! HAVE_STRERROR */
/*
diff --git a/libiberty/strsignal.c b/libiberty/strsignal.c
index d517eed0df1..c7bb10c441c 100644
--- a/libiberty/strsignal.c
+++ b/libiberty/strsignal.c
@@ -64,12 +64,12 @@ struct signal_info
{
int value; /* The numeric value from <signal.h> */
const char *name; /* The equivalent symbolic value */
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
const char *msg; /* Short message about this value */
#endif
};
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
# define ENTRY(value, name, msg) {value, name, msg}
#else
# define ENTRY(value, name, msg) {value, name}
@@ -236,7 +236,7 @@ static int num_signal_names = 0;
same name, it differs from other implementations in that it is dynamically
initialized rather than statically initialized. */
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
static int sys_nsig;
static const char **sys_siglist;
@@ -319,7 +319,7 @@ init_signal_tables ()
}
}
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
/* Now attempt to allocate the sys_siglist table, zero it out, and then
initialize it from the statically initialized signal_table. */
@@ -414,7 +414,7 @@ DESCRIPTION
*/
-#ifdef NEED_strsignal
+#ifndef HAVE_STRSIGNAL
const char *
strsignal (signo)
@@ -423,7 +423,7 @@ strsignal (signo)
const char *msg;
static char buf[32];
-#ifdef NEED_sys_siglist
+#ifndef HAVE_SYS_SIGLIST
if (signal_names == NULL)
{
@@ -452,7 +452,7 @@ strsignal (signo)
return (msg);
}
-#endif /* NEED_strsignal */
+#endif /* ! HAVE_STRSIGNAL */
/*
@@ -580,7 +580,7 @@ DESCRIPTION
followed by a newline.
*/
-#ifdef NEED_psignal
+#ifndef HAVE_PSIGNAL
void
psignal (signo, message)
@@ -601,7 +601,7 @@ psignal (signo, message)
}
}
-#endif /* NEED_psignal */
+#endif /* ! HAVE_PSIGNAL */
/* A simple little main that does nothing but print all the signal translations
diff --git a/libiberty/vmsbuild.com b/libiberty/vmsbuild.com
index 368521c1c20..4fede380bfd 100644
--- a/libiberty/vmsbuild.com
+++ b/libiberty/vmsbuild.com
@@ -31,8 +31,6 @@ $ create config.h
#define NEED_strsignal
#define NEED_psignal
#define NEED_basename
-$ if f$search("alloca-conf.h").eqs."" then -
- copy alloca-norm.h alloca-conf.h
$ LIBR 'WORK_LIB' /Create
$
$! first pass: compile "required" modules