Commit 3affd5f0 by Jeff Law

Update from Cygnus libiberty.

libiberty uses autoconf now.

From-SVN: r19791
parent fe806bdd
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.
......
......@@ -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.
/* 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
/* "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__) */
/* 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
......@@ -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
......@@ -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>
......
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
RANLIB=ranlib
CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__
# 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
......
RANLIB=true
CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__
HDEFINES=-DNEED_sys_siglist -DNEED_basename -DNEED_strsignal
EXTRA_OFILES=random.o
HDEFINES=-DHAVE_GETRUSAGE
# HPPA hosts using BSD
RANLIB=true
CC = cc -cckr
RANLIB = true
INSTALL = cp
EXTRA_OFILES = alloca.o
# 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
# 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
HDEFINES = -DHAVE_SYSCONF
RANLIB=true
INSTALL = cp
HDEFINES=-DNEED_basename -DNEED_sys_siglist -DNEED_strsignal -DNO_SYS_FILE_H
EXTRA_OFILES=asprintf.o strcasecmp.o strncasecmp.o vasprintf.o
# 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
XTRAFLAGS = -isystem /s1/cygnus/dejagnu/sparc-sun-sunos4.1.3/include/
LOADLIBES = -L/s1/cygnus/dejagnu/sparc-sun-sunos4.1.3/lib
# 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
......@@ -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
......
......@@ -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)
{
......
#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);
}
/*
* 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)
......@@ -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>
......
......@@ -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
......
......@@ -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>
......
......@@ -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;
# 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
......
......@@ -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 */
/*
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment