Commit 6599da04 by Jason Merrill

Initial revision

From-SVN: r14877
parent 8975416c
*-all
*-co
*-dirs
*-done
*-info
*-install
*-install-info
*-src
*-stamp-*
*-tagged
blockit
cfg-paper.info
config.status
configure.aux
configure.cp
configure.cps
configure.dvi
configure.fn
configure.fns
configure.ky
configure.kys
configure.log
configure.pg
configure.pgs
configure.toc
configure.tp
configure.tps
configure.vr
configure.vrs
dir.info
Makefile
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
README for GNU development tools
This directory contains various GNU compilers, assemblers, linkers,
debuggers, etc., plus their support routines, definitions, and documentation.
If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README; if with a libg++ release,
see libg++/README, etc. That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.
It is now possible to automatically configure and build a variety of
tools with one command. To build all of the tools contained herein,
run the ``configure'' script here, e.g.:
./configure
make
To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
make install
(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''. You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)
If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make. For example (assuming sh/bash/ksh):
CC=gcc ./configure
make
A similar example using csh:
setenv CC gcc
./configure
make
Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc. See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.
REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Wed Jul 23 12:32:18 1997 Robert Hoehne <robert.hoehne@Mathematik.TU-Chemnitz.DE>
* mh-go32 (CFLAGS): Don't set -fno-omit-frame-pointer.
Mon Jun 16 19:06:41 1997 Geoff Keating <geoffk@ozemail.com.au>
* mh-ppcpic: New file.
* mt-ppcpic: New file.
Thu Mar 27 15:52:40 1997 Geoffrey Noer <noer@cygnus.com>
* mh-cygwin32: override CXXFLAGS, setting to -O2 only
(no debug)
Tue Mar 25 18:16:43 1997 Geoffrey Noer <noer@cygnus.com>
* mh-cygwin32: override LIBGCC2_DEBUG_CFLAGS so debug info
isn't included in cygwin32-hosted libgcc2.a by default
Wed Jan 8 19:56:43 1997 Geoffrey Noer <noer@cygnus.com>
* mh-cygwin32: override CFLAGS so debug info isn't included
in cygwin32-hosted tools by default
Tue Dec 31 16:04:26 1996 Ian Lance Taylor <ian@cygnus.com>
* mh-linux: Remove.
Mon Nov 11 10:29:51 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* mt-ppc: Delete file, options moved to newlib configure.
Fri Oct 4 12:21:03 1996 Angela Marie Thomas (angela@cygnus.com)
* mh-dgux386: New file. x86 dgux specific flags
Mon Sep 30 15:10:07 1996 Stan Shebs <shebs@andros.cygnus.com>
* mpw-mh-mpw (EXTRALIBS_PPC_XCOFF): New, was EXTRALIBS_PPC.
(EXTRALIBS_PPC): Use shared libraries instead of xcoff.
Sat Aug 17 04:56:25 1996 Geoffrey Noer <noer@skaro.cygnus.com>
* mh-cygwin32: don't -D_WIN32 here anymore
Thu Aug 15 19:46:44 1996 Stan Shebs <shebs@andros.cygnus.com>
* mpw-mh-mpw (SEGFLAG_68K, SEGFLAG_PPC): Remove.
(EXTRALIBS_PPC): Add libgcc.xcoff.
Thu Aug 8 14:51:47 1996 Michael Meissner <meissner@tiktok.cygnus.com>
* mt-ppc: New file, add -mrelocatable-lib and -mno-eabi to all
target builds for PowerPC eabi targets.
Fri Jul 12 12:06:01 1996 Stan Shebs <shebs@andros.cygnus.com>
* mpw: New subdir, Mac MPW configuration support bits.
Mon Jul 8 17:30:52 1996 Jim Wilson <wilson@cygnus.com>
* mh-irix6: New file.
Mon Jul 8 15:15:37 1996 Jason Merrill <jason@yorick.cygnus.com>
* mt-sparcpic (PICFLAG_FOR_TARGET): Use -fPIC.
Fri Jul 5 11:49:02 1996 Ian Lance Taylor <ian@cygnus.com>
* mh-irix4 (RANLIB): Don't define; Irix 4 does have ranlib.
Sun Jun 23 22:59:25 1996 Geoffrey Noer <noer@cygnus.com>
* mh-cygwin32: new file. Like mh-go32 without the CFLAGS entry.
Tue Mar 26 14:10:41 1996 Ian Lance Taylor <ian@cygnus.com>
* mh-go32 (CFLAGS): Define.
Thu Mar 14 19:20:54 1996 Ian Lance Taylor <ian@cygnus.com>
* mh-necv4: New file.
Thu Feb 15 13:07:43 1996 Ian Lance Taylor <ian@cygnus.com>
* mh-cxux (CC): New variable.
(CFLAGS, LDFLAGS): Remove.
* mh-ncrsvr43 (CC): New variable.
(CFLAGS): Remove.
* mh-solaris (CFLAGS): Remove.
* mh-go32: Remove most variable settings, since they presumed a
Canadian Cross, which is now handled correctly by the configure
script.
* mh-sparcpic (PICFLAG): Set to -fPIC, not -fpic.
Mon Feb 12 14:53:39 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* mh-m68kpic, mt-m68kpic: New files.
Thu Feb 1 14:15:42 1996 Stan Shebs <shebs@andros.cygnus.com>
* mpw-mh-mpw (CC_MWC68K): Add options similar to those used
in CC_MWCPPC, and -mc68020 -model far.
(AR_MWLINK68K): Add -xm library.
(AR_AR): Define.
(CC_LD_MWLINK68K): Remove -d.
(EXTRALIBS_MWC68K): Define.
Thu Jan 25 16:05:33 1996 Ian Lance Taylor <ian@cygnus.com>
* mh-ncrsvr43 (CFLAGS): Remove -Hnocopyr.
Tue Nov 7 15:41:30 1995 Stan Shebs <shebs@andros.cygnus.com>
* mpw-mh-mpw (CC_MWC68K, CC_MWCPPC): Remove unused include path.
(CC_MWCPPC): Add -mpw_chars, disable warnings, add comments
explaining reasons for various flags.
(EXTRALIBS_PPC, EXTRALIBS_MWCPPC ): Put runtime library first.
Fri Oct 13 14:44:25 1995 Jason Molenda (crash@phydeaux.cygnus.com)
* mh-aix, mh-sun: Removed.
* mh-decstation (X11_EXTRA_CFLAGS): Define.
* mh-sco, mh-solaris, mh-sysv4 (X11_EXTRA_LIBS): Define.
* mh-hp300, mh-hpux, mh-hpux8, mh-solaris, mh-sun3, mh-sysv4: Don't
hardcode location of X stuff here.
Thu Sep 28 13:14:56 1995 Stan Shebs <shebs@andros.cygnus.com>
* mpw-mh-mpw: Add definitions for various 68K and PowerMac
compilers, add definitions for library and link steps for
PowerMacs.
Thu Sep 14 08:20:04 1995 Fred Fish <fnf@cygnus.com>
* mh-hp300 (CC): Add "CC = cc -Wp,-H256000" to avoid
"too much defining" errors from the HPUX compiler.
Thu Aug 17 17:28:56 1995 Ken Raeburn <raeburn@kr-laptop.cygnus.com>
* mh-hp300 (RANLIB): Use "ar ts", in case GNU ar was used and
didn't build a symbol table.
Thu Jun 22 17:47:24 1995 Stan Shebs <shebs@andros.cygnus.com>
* mpw-mh-mpw (CC): Define ANSI_PROTOTYPES.
Mon Apr 10 12:29:48 1995 Stan Shebs <shebs@andros.cygnus.com>
* mpw-mh-mpw (EXTRALIBS): Always link in Math.o, CSANELIB.o,
and ToolLibs.o.
* mpw-mh-mpw (CC): Define ALMOST_STDC.
(CFLAGS): Remove ALMOST_STDC, -mc68881.
(LDFLAGS): add -w.
* mpw-mh-mpw (CFLAGS): Add -b option to put strings at the ends of
functions.
* mpw-mh-mpw: New file, host makefile definitions for MPW.
Fri Mar 31 11:35:17 1995 Jason Molenda (crash@phydeaux.cygnus.com)
* mt-netware: New file.
Mon Mar 13 12:31:29 1995 Ian Lance Taylor <ian@cygnus.com>
* mh-hpux8: New file.
* mh-hpux: Use X11R5 rather than X11R4.
Thu Feb 9 11:04:13 1995 Ian Lance Taylor <ian@cygnus.com>
* mh-linux (SYSV): Don't define.
(RANLIB): Don't define.
Wed Jan 11 16:29:34 1995 Jason Merrill <jason@phydeaux.cygnus.com>
* m?-*pic (LIBCXXFLAGS): Add -fno-implicit-templates.
Thu Nov 3 17:27:19 1994 Ken Raeburn <raeburn@cujo.cygnus.com>
* mh-irix4 (CC): Increase maximum string length.
* mh-sco (CC): Define away const, it doesn't work right; elements
of arrays of ptr-to-const are considered const themselves.
Sat Jul 16 12:17:49 1994 Stan Shebs (shebs@andros.cygnus.com)
* mh-cxux: New file, from Bob Rusk (rrusk@mail.csd.harris.com).
Sat Jun 4 17:22:12 1994 Per Bothner (bothner@kalessin.cygnus.com)
* mh-ncrsvr43: New file from Tom McConnell
<tmcconne@sedona.intel.com>.
Thu May 19 00:32:11 1994 Jeff Law (law@snake.cs.utah.edu)
* mh-hpux (CC): Add -Wp,-H256000 to avoid "too much defining"
errors from the HPUX 8 compilers.
Wed May 4 20:14:47 1994 D. V. Henkel-Wallace (gumby@cygnus.com)
* mh-lynxrs6k: set SHELL to /bin/bash
Tue Apr 12 12:38:17 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* mh-irix4 (CC): Change -XNh1500 to -XNh2000.
Sat Dec 25 20:03:45 1993 Jeffrey A. Law (law@snake.cs.utah.edu)
* mt-hppa: Delete.
Tue Nov 16 22:54:39 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* mh-a68bsd: Define CC to gcc.
Mon Nov 15 16:56:51 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* mh-linux: Don't put -static in LDFLAGS. Add comments.
Mon Nov 15 13:37:58 1993 david d `zoo' zuhn (zoo@cirdan.cygnus.com)
* mh-sysv4 (AR_FLAGS): change from cq to cr
Fri Nov 5 08:12:32 1993 D. V. Henkel-Wallace (gumby@blues.cygnus.com)
* mh-unixware: remove. It's the same as sysv4, and config.guess
can't tell the difference. So don't allow skew.
Wed Oct 20 20:35:14 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* mh-hp300: Revert yesterday's change, but add comment explaining.
Tue Oct 19 18:58:21 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* mh-hp300: Don't define CFLAGS to empty. Why should hp300 be
different from anything else? ("gdb doesn't understand the native
debug format" isn't a good enough answer because we might be using
gcc).
Tue Oct 5 12:17:40 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
* mh-alphaosf: Remove, no longer necessary now that gdb knows
how to handle OSF/1 shared libraries.
Tue Jul 6 11:27:33 1993 Steve Chamberlain (sac@phydeaux.cygnus.com)
* mh-alphaosf: New file.
Thu Jul 1 15:49:33 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
* mh-riscos: New file.
Mon Jun 14 12:03:18 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com)
* mh-aix, mh-aix386, mh-decstation, mh-delta88, mh-hpux, mh-irix4,
mh-ncr3000, mh-solaris, mh-sysv, mh-sysv4: remove INSTALL=cp line,
now that we're using install.sh globally
Fri Jun 4 16:09:34 1993 Ian Lance Taylor (ian@cygnus.com)
* mh-sysv4 (INSTALL): Use cp, not /usr/ucb/install.
Thu Apr 8 11:21:52 1993 Ian Lance Taylor (ian@cygnus.com)
* mt-a29k, mt-ebmon29k, mt-os68k, mt-ose68000, mt-ose68k,
mt-vxworks68, mt-vxworks960: Removed obsolete, unused target
Makefile fragment files.
Mon Mar 8 15:05:25 1993 Ken Raeburn (raeburn@cambridge.cygnus.com)
* mh-aix386: New file; old mh-aix, plus no-op RANLIB.
Thu Oct 1 13:50:48 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com)
* mh-solaris: INSTALL is NOT /usr/ucb/install
Mon Aug 24 14:25:35 1992 Ian Lance Taylor (ian@cygnus.com)
* mt-ose68000, mt-ose68k: renamed from mt-OSE*.
Tue Jul 21 02:11:01 1992 D. V. Henkel-Wallace (gumby@cygnus.com)
* mt-OSE68k, mt-680000: new configs.
Thu Jul 16 17:12:09 1992 K. Richard Pixley (rich@rtl.cygnus.com)
* mh-irix4: merged changes from progressive.
Tue Jun 9 23:29:38 1992 Per Bothner (bothner@rtl.cygnus.com)
* Everywhere: Change RANLIB=echo>/dev/null (which confuses
some shells - and I don't blame them) to RANLIB=true.
* mh-solaris: Use /usr/ucb/install for INSTALL.
Sun May 31 14:45:23 1992 Mark Eichin (eichin at cygnus.com)
* mh-solaris2: Add new configuration for Solaris 2 (sysv, no ranlib)
Fri Apr 10 23:10:08 1992 Fred Fish (fnf@cygnus.com)
* mh-ncr3000: Add new configuration for NCR 3000.
Tue Dec 10 00:10:55 1991 K. Richard Pixley (rich at rtl.cygnus.com)
* ChangeLog: fresh changelog.
RANLIB=true
#None of the Apollo compilers can compile gas or binutils. The preprocessor
# chokes on bfd, the compiler won't let you assign integers to enums, and
# other problems. Defining CC to gcc is a questionable way to say "don't use
# the apollo compiler" (the preferred version of GCC could be called cc,
# or whatever), but I'm not sure leaving CC as cc is any better...
#CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG
CC=gcc
BISON=yacc
HDEFINES = -DUSG
RANLIB=true
CC= cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG
# Configuration for Harris CX/UX 7 (and maybe 6), based on sysv4 configuration.
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV -DSVR4
RANLIB = true
# C++ debugging is not yet supported under SVR4 (DWARF)
CXXFLAGS=-O
# The l flag generates a warning from the SVR4 archiver, remove it.
AR_FLAGS = cq
# Under CX/UX, we want to tell the compiler to use ANSI mode.
CC=cc -Xa
# We don't want debugging info in Win32-hosted toolchains.
# Accomplish this by overriding CFLAGS.
CFLAGS=-O2
CXXFLAGS=-O2
# We also need to override LIBGCC2_DEBUG_CFLAGS so libgcc2 will be
# build without debugging information
LIBGCC2_DEBUG_CFLAGS=
# We set MAKEINFOFLAGS to not split .info files, because the resulting
# file names don't work on DOS.
MAKEINFOFLAGS=--no-split
# custom installation rules for cygwin32 (append .exe to binaries, etc.)
INSTALL_DOSREL=install-dosrel
CC = cc -Wf,-XNg1000
# for X11, since the native DECwindows include files are really broken when
# it comes to function prototypes.
X11_EXTRA_CFLAGS = "-DNeedFunctionPrototypes=0"
RANLIB = true
HDEFINES=-DHOST_SYS=DGUX_SYS
CC=gcc -Wall -ansi -D__using_DGUX
RANLIB=true
# from mh-dgux
HDEFINES=-DHOST_SYS=DGUX_SYS
CC=gcc -Wall -ansi -D__using_DGUX
RANLIB = true
# from mh-sysv4
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV -DSVR4
RANLIB = true
# C++ debugging is not yet supported under SVR4 (DWARF)
CXXFLAGS=-O
# The l flag generates a warning from the SVR4 archiver, remove it.
AR_FLAGS = cr
X11_EXTRA_LIBS = -lnsl
# from angela
# no debugging due to broken compiler, use BSD style timeofday
CFLAGS=-O -D_BSD_TIMEOFDAY_FLAVOR
# We don't want to use debugging information on DOS. Unfortunately,
# this requires that we set CFLAGS.
# This used to set -fno-omit-frame-pointer.
CFLAGS=-O2
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV
# Avoid "too much defining" errors from HPUX compiler.
CC = cc -Wp,-H256000
# If "ar" in $PATH is GNU ar, the symbol table may need rebuilding.
# If it's HP/UX ar, this should be harmless.
RANLIB = ar ts
# Native cc can't bootstrap gcc with -g. Defining CFLAGS here loses (a)
# for non-gcc directories, (b) if we are compiling with gcc, not
# native cc. Neither (a) nor (b) has a trivial fix though.
CFLAGS =
# Define SYSV as -DSYSV if you are using a System V operating system.
CC = cc -Wp,-H256000
SYSV = -DSYSV
RANLIB = true
# Define SYSV as -DSYSV if you are using a System V operating system.
CC = cc -Wp,-H256000
SYSV = -DSYSV
RANLIB = true
# Makefile changes for SGI's running IRIX-4.x.
# Tell compiler to use K&R C. We can't compile under the SGI Ansi
# environment. Also bump switch table size so that cp-parse will
# compile. Bump string length limit so linker builds.
CC = cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192
SYSV = -DSYSV
# Makefile changes for SGI's running IRIX-5.x.
SYSV = -DSYSV
RANLIB = true
# Makefile changes for SGI's running IRIX-6.x.
SYSV = -DSYSV
RANLIB = true
# Specify the ABI, to ensure that all Irix 6 systems will behave the same.
# Also, using -32 avoids bugs that exist in the n32/n64 support in some
# versions of the SGI compiler.
CC = cc -32
# /bin/cc is less than useful for our purposes. Always use GCC
CC = /bin/gcc
# LynxOS running on the rs6000 doesn't have ranlib
RANLIB = true
# /bin/cc is less than useful for our purposes. Always use GCC
CC = /usr/cygnus/progressive/bin/gcc
# /bin/sh is too buggy, so use /bin/bash instead.
SHELL = /bin/bash
PICFLAG=-fpic
# 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 =
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV -DSVR4
RANLIB = true
# The l flag generates a warning from the SVR4 archiver, remove it.
AR_FLAGS = cq
# Host configuration file for an NCR 3000 (i486/SVR43) system.
# The MetaWare compiler will generate a copyright message unless you
# turn it off by adding the -Hnocopyr flag.
CC = cc -Hnocopyr
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV -DSVR4
RANLIB = true
# Host Makefile fragment for NEC MIPS SVR4.
# The C compiler on NEC MIPS SVR4 needs bigger tables.
CC = cc -ZXNd=5000 -ZXNg=1000
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV -DSVR4
RANLIB = true
# NEC -lX11 needs some other libraries.
X11_EXTRA_LIBS = -lsocket -lnsl
PICFLAG=-fPIC
PICFLAG=-fPIC
# This is for a MIPS running RISC/os 4.52C.
# This is needed for GDB, but needs to be in the top-level make because
# if a library is compiled with the bsd headers and gets linked with the
# sysv system libraries all hell can break loose (e.g. a jmp_buf might be
# a different size).
# ptrace(2) apparently has problems in the BSD environment. No workaround is
# known except to select the sysv environment. Could we use /proc instead?
# These "sysv environments" and "bsd environments" often end up being a pain.
#
# This is not part of CFLAGS because perhaps not all C compilers have this
# option.
CC= cc -systype sysv
RANLIB = true
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV
RANLIB = true
# You may need this if you don't have bison.
# BISON = yacc -Sm10400
# The native C compiler botches some simple uses of const. Unfortunately,
# it doesn't defined anything like "__sco__" for us to test for in ansidecl.h.
CC = cc -Dconst=
X11_EXTRA_LIBS = -lsocket -lm -lintl -lmalloc
# Makefile changes for Suns running Solaris 2
SYSV = -DSYSV
RANLIB = true
X11_EXTRA_LIBS = -lnsl -lsocket
# Sun's C compiler needs the -J flag to be able to compile cp-parse.c
# without overflowing the jump tables (-J says to use a 32 bit table)
CC = cc -J
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV
RANLIB = true
# Define SYSV as -DSYSV if you are using a System V operating system.
SYSV = -DSYSV -DSVR4
RANLIB = true
# C++ debugging is not yet supported under SVR4 (DWARF)
CXXFLAGS=-O
# The l flag generates a warning from the SVR4 archiver, remove it.
AR_FLAGS = cr
X11_EXTRA_LIBS = -lnsl
# The old BSD pcc isn't up to compiling parts of gdb so use gcc
CC = gcc
CC=cc
CFLAGS=
RANLIB=true
AR_FLAGS=
.PHONY: windows
windows: nmake.mak
@echo "Don't forget to setup setvars.mak!"
nmake.mak: to-be-built
@echo Building nmake files
@$(srcdir)/gdb/mswin/genmakes
to-be-built:
@echo Recording commands
@$(srcdir)/gdb/mswin/recordit
PICFLAG=-fpic
# This is an MPW makefile fragment.
# Since there are a multiplicity of Mac compilers and two different
# processors, this file is primarily a library of options for each
# compiler. Somebody else (such as a configure or build script) will
# make the actual choice.
# Compiler to use for compiling.
CC_MPW_C = C -d MPW_C -d ALMOST_STDC -d ANSI_PROTOTYPES -d MPW -mc68020 -model far -b -w
CC_SC = SC -d ALMOST_STDC -d ANSI_PROTOTYPES -d MPW -mc68020 -model far -b -i '' -i :
CC_MWC68K = MWC68K -d MPW -enum int -mpw_chars -sym on -w off -mc68020 -model far
CC_PPCC = PPCC -d powerc=1 -d pascal= -d ALMOST_STDC -d ANSI_PROTOTYPES -d MPW -w
CC_MRC = MrC -d powerc=1 -d pascal= -d ALMOST_STDC -d ANSI_PROTOTYPES -d MPW -i '' -i : -jm
CC_SMrC = SMrC -d MPW
# "-mpw_chars" is necessary because GNU sources often mix signed and
# unsigned casually.
# "-w off" is not a great idea, but CW7 is complaining about enum
# assignments.
# "-opt global,peep,l4,speed" is sometimes good, and sometimes bad.
# We must use {CIncludes} so that MPW tools will work; {MWCIncludes}
# defines stdout, islower, etc, in ways that are incompatible with MPW's
# runtime. However, this cannot be done via -i "{CIncludes}", since
# that does not affect how <>-type includes happen; instead, the variable
# MWCIncludes must be set to point at {CIncludes}.
CC_MWCPPC = MWCPPC -d MPW -enum int -mpw_chars -sym on -w off
# Note that GCC does *not* wire in a definition of "pascal", so that
# it can be handled in another way if desired.
CC_68K_GCC = gC -Dpascal= -DANSI_PROTOTYPES -DMPW
CC_PPC_GCC = gC -Dpowerc=1 -Dpascal= -DANSI_PROTOTYPES -DMPW
# Nothing for the default CFLAGS.
CFLAGS =
# Tool to use for making libraries/archives.
AR_LIB = Lib
AR_MWLINK68K = MWLink68K -xm library
AR_PPCLINK = PPCLink -xm library
AR_MWLINKPPC = MWLinkPPC -xm library
AR_AR = ar
AR_FLAGS = -o
RANLIB_NULL = null-command
RANLIB_RANLIB = ranlib
# Compiler and/or linker to use for linking.
CC_LD_LINK = Link -w -d -model far {CC_LD_TOOL_FLAGS}
CC_LD_MWLINK68K = MWLink68K -w {CC_LD_TOOL_FLAGS} -sym on -model far
CC_LD_PPCLINK = PPCLink -main __start -outputformat xcoff
CC_LD_MWLINKPPC = MWLinkPPC -w {CC_LD_TOOL_FLAGS} -sym on
CC_LD_GLD = gC
# Extension for linker output.
PROG_EXT_68K =
PROG_EXT_XCOFF = .xcoff
# Nothing for the default LDFLAGS.
LDFLAGS = -w
CC_LD_TOOL_FLAGS = -c 'MPS ' -t MPST
# Libraries to link against.
# It would appear that the math libraries are not
# needed except to provide a definition for scalb,
# which is called from ldexp, which is referenced
# in the m68k opcodes library.
EXTRALIBS_C = \Option-d
"{CLibraries}"StdClib.o \Option-d
"{CLibraries}"Math.o \Option-d
"{CLibraries}"CSANELib.o \Option-d
"{Libraries}"Stubs.o \Option-d
"{Libraries}"Runtime.o \Option-d
"{Libraries}"Interface.o \Option-d
"{Libraries}"ToolLibs.o
EXTRALIBS_MWC68K = \Option-d
"{CLibraries}"StdClib.o \Option-d
"{CLibraries}"Math.o \Option-d
"{CLibraries}"CSANELib.o \Option-d
"{Libraries}"Stubs.o \Option-d
"{Libraries}"Runtime.o \Option-d
"{Libraries}"Interface.o \Option-d
"{Libraries}"ToolLibs.o \Option-d
"{MW68KLibraries}MPW ANSI (4i) C.68K.Lib"
EXTRALIBS_PPC_XCOFF = \Option-d
"{PPCLibraries}"StdCRuntime.o \Option-d
"{PPCLibraries}"InterfaceLib.xcoff \Option-d
"{PPCLibraries}"MathLib.xcoff \Option-d
"{PPCLibraries}"StdCLib.xcoff \Option-d
"{PPCLibraries}"PPCToolLibs.o \Option-d
"{PPCLibraries}"PPCCRuntime.o \Option-d
"{GCCPPCLibraries}"libgcc.xcoff
EXTRALIBS_PPC = \Option-d
"{PPCLibraries}"StdCRuntime.o \Option-d
"{SharedLibraries}"InterfaceLib \Option-d
"{SharedLibraries}"MathLib \Option-d
"{SharedLibraries}"StdCLib \Option-d
"{PPCLibraries}"PPCToolLibs.o \Option-d
"{PPCLibraries}"PPCCRuntime.o \Option-d
"{GCCPPCLibraries}"libgcc.xcoff
EXTRALIBS_MWCPPC = \Option-d
"{MWPPCLibraries}"MWStdCRuntime.Lib \Option-d
"{MWPPCLibraries}"InterfaceLib \Option-d
"{MWPPCLibraries}"StdCLib \Option-d
"{MWPPCLibraries}"MathLib \Option-d
"{MWPPCLibraries}"PPCToolLibs.o
# Tool to make PEF with, if needed.
MAKEPEF_NULL = null-command
MAKEPEF_PPC = MakePEF
MAKEPEF_FLAGS = \Option-d
-l InterfaceLib.xcoff=InterfaceLib \Option-d
-l MathLib.xcoff=MathLib \Option-d
-l StdCLib.xcoff=StdCLib
MAKEPEF_TOOL_FLAGS = -ft MPST -fc 'MPS '
# Resource compiler to use.
REZ_68K = Rez
REZ_PPC = Rez -d WANT_CFRG
Tue Nov 26 12:34:12 1996 Stan Shebs <shebs@andros.cygnus.com>
* g-mpw-make.sed: Fix some comments.
Mon Sep 16 14:42:52 1996 Stan Shebs <shebs@andros.cygnus.com>
* g-mpw-make.sed (HLDENV): Edit out all references.
Thu Aug 15 19:49:23 1996 Stan Shebs <shebs@andros.cygnus.com>
* true: New script, identical to mpw-true.
* g-mpw-make.sed: Add @DASH_C_FLAG@ and @SEGMENT_FLAG()@
to the editors for compile commands.
Thu Aug 1 15:01:42 1996 Stan Shebs <shebs@andros.cygnus.com>
* mpw-true, mpw-touch, null-command: New scripts.
* README: Describe usage in more detail.
Tue Dec 12 14:51:51 1995 Stan Shebs <shebs@andros.cygnus.com>
* g-mpw-make.sed: Don't edit out "version=" occurrences.
Fri Dec 1 11:46:18 1995 Stan Shebs <shebs@andros.cygnus.com>
* g-mpw-make.sed (bindir, libdir): Edit the positions of
pathname separators to work with other pathnames better.
Tue Nov 7 15:08:07 1995 Stan Shebs <shebs@andros.cygnus.com>
* g-mpw-make.sed: Add comment about Duplicate vs Catenate,
add additional pattern for editing link-compile commands.
Tue Oct 24 14:28:51 1995 Stan Shebs <shebs@andros.cygnus.com>
* g-mpw-make.sed: Add handling for *.tab.[hc] files.
(CHILL_FOR_TARGET, CHILL_LIB): Edit out tricky definitions
of these.
Thu Sep 28 21:05:10 1995 Stan Shebs <shebs@andros.cygnus.com>
* g-mpw-make.sed: New file, generic sed commands to translate
Unix makefiles into MPW makefile syntax.
Fri Mar 17 11:51:20 1995 Stan Shebs <shebs@andros.cygnus.com>
* README: Clarify instructions.
* fi: Remove.
Wed Dec 21 15:45:53 1994 Stan Shebs <shebs@andros.cygnus.com>
* MoveIfChange, README, fi, forward-include, open-brace,
tr-7to8-src: New files.
# Rename a file only if it is different from a previously existing
# file of the same name. This is useful for keeping make from doing
# too much work if the contents of a file haven't changed.
# This is an MPW translation of the standard GNU sh script move-if-change.
Set exit 0
If "`exists -f "{2}"`"
Compare "{1}" "{2}" >dev:null
If {status} != 0
Rename -y "{1}" "{2}"
Else
Echo "{2}" is unchanged
Delete -i -y "{1}"
End
Else
Rename -y "{1}" "{2}"
End
This directory contains MPW scripts and related files that are needed to
build Cygnus GNU tools for MPW. The scripts should be somewhere on the
command path; our usual practice has been to have a separate directory
for the scripts, and put the tools (byacc, flex, and sed at least) there
also; then it's easier to drag the support bits around as a group, or to
upgrade MPW versions. The complete package of scripts and tool binaries
is usually available as pub/mac/buildtools.cpt.hqx on ftp.cygnus.com.
"tr-7to8-src" is actually the source to an MPW script that transforms
sequences like "\Option-d" into the actual 8-bit chars that MPW needs.
It's only the source because it can't itself include any 8-bit chars.
It *can* be processed into a genuine "tr-7to8" by using itself:
tr-7to8 tr-7to8-src | sed -e 's/Src//' >new-tr-7to8
Use this to verify:
compare tr-7to8 new-tr-7to8
If you don't have a working tr-7to8, then you will have to manually
replace all occurrences of "\Option-d" with real Option-d (which looks
like a delta), then do similarly with all the other "\Option-..."
strings, and then change "\SrcOption-d" into the string "\Option-d".
Echo '#include' ""{1}"" >"{2}".tem
MoveIfChange "{2}".tem "{2}"
# Sed commands to translate Unix makefiles into MPW makefiles.
# These are nominally generic, but work best on the makefiles used
# for GNU programs.
# Whack out any commented-out lines that are probably commands;
# they can only cause trouble later on.
/^# /d
# Change dependency char.
/:$/s/:/ \\Option-f/g
/^[^ :#][^:]*:/s/\([ ]*\):\([ ]*\)/ \\Option-f /g
# Change syntax of Makefile vars.
/\$/s/\${\([a-zA-Z0-9_-]*\)}/{\1}/g
/\$/s/\$(\([a-zA-Z0-9_-]*\))/{\1}/g
/ $@/s/ $@/ {Targ}/
# Double-$ are literals to Unix but not to MPW make.
/\$\$/s/\$\$/$/g
# Change pathname syntax.
/\//s,\.\./\/\.\./,:::,g
/\//s,\.\./,::,g
/\.\//s,\./,:,g
/\//s,/,:,g
# Undo excess changes.
/and/s,and:or$,and/or,
/and/s,and:or ,and/or ,
/want/s,want:need,want/need,
# Fixing up sed commands.
/-e/s_":\([^:]*\):d"_"/\1/d"_g
/-e/s_":\([^:]*\):,:\([^:]*\):d"_"/\1/,/\2/d"_g
/=/s/ = \.$/ = :/
# Make these go away so that later edits not confused.
/HLDENV/s/{HLDENV}//
# Comment out any explicit srcdir setting.
/srcdir/s/^srcdir/# srcdir/
/BASEDIR/s/^BASEDIR =.*$/BASEDIR = "{srcroot}"/
/{BASEDIR}:/s/{BASEDIR}:/{BASEDIR}/g
/{srcdir}:/s/{srcdir}:/"{srcdir}"/g
/"{srcdir}":/s/"{srcdir}":/"{srcdir}"/g
# Tweak some conventions that are backwards for the Mac.
/bindir/s/{exec_prefix}:bin/{exec_prefix}bin:/
/libdir/s/{exec_prefix}:lib/{exec_prefix}lib:/
# Comment out settings of anything set by mpw host config.
/CC/s/^CC *=/#CC =/
/CFLAGS/s/^CFLAGS *=/#CFLAGS =/
/AR/s/^AR *=/#AR =/
/AR_FLAGS/s/^AR_FLAGS *=/#AR_FLAGS =/
/RANLIB/s/^RANLIB *=/#RANLIB =/
/CC_LD/s/^CC_LD *=/#CC_LD =/
/LDFLAGS/s/^LDFLAGS *=/#LDFLAGS =/
# Change -I usages.
/-I/s/-I\./-i :/g
/-I/s/-I::bfd/-i ::bfd:/g
/-I/s/-I::include/-i ::include:/g
/-I/s/-I/-i /g
# Change -D usage.
/-D/s/\([ =]\)-D\([^ ]*\)/\1-d \2/g
# Change continuation char.
/\\$/s/\\$/\\Option-d/
# Change wildcard char.
/\*/s/\*/\\Option-x/g
# Change path of various types of source files. This rule does not allow
# for file names with multiple dots in the name.
/\.[chly]/s/\([ ><=]\)\([-a-zA-Z0-9_${}:"]*\)\.\([chly]\)/\1"{s}"\2.\3/g
/\.[chly]/s/^\([-a-zA-Z0-9_${}:"]*\)\.\([chly]\)/"{s}"\1.\2/
# Allow files named *.tab.[ch] as a special case.
/\.tab\.[ch]/s/\([ ><=]\)\([-a-zA-Z0-9_${}:"]*\.tab\)\.\([ch]\)/\1"{s}"\2.\3/g
/\.tab\.[ch]/s/^\([-a-zA-Z0-9_${}:"]*\.tab\)\.\([ch]\)/"{s}"\1.\2/
# Fix some overenthusiasms.
/{s}/s/"{s}""{srcdir}"/"{srcdir}"/g
/{s}/s/"{s}"{\([a-zA-Z0-9_]*\)dir}/"{\1dir}"/g
/{s}/s/"{s}"{\([a-zA-Z0-9_]*\)DIR}/"{\1DIR}"/g
/{s}/s/"{s}""{\([a-zA-Z0-9_]*\)dir}"/"{\1dir}"/g
/{s}/s/"{s}""{\([a-zA-Z0-9_]*\)DIR}"/"{\1DIR}"/g
/{s}/s/"{s}":/:/g
/{s}/s/^"{s}"//g
/{s}/s/"{s}""{s}"/"{s}"/g
/{s}/s/"{s}""{srcdir}"/"{s}"/g
/{s}/s/"{srcdir}""{s}"/"{s}"/g
# The .def files are also typically source files.
/\.def/s/\([ ><]\)\([-a-zA-Z0-9_${}:"]*\)\.def/\1"{s}"\2.def/g
/\.def/s/^\([-a-zA-Z0-9_${}:"]*\)\.def/"{s}"\1.def/g
# Change extension and path of objects.
/\.o/s/\([ =]\)\([-a-zA-Z0-9_${}:"]*\)\.o/\1"{o}"\2.c.o/g
/\.o/s/^\([-a-zA-Z0-9_${}:"]*\)\.o/"{o}"\1.c.o/
# Allow *.tab.o files as a special case of a 2-dot-name file.
/\.o/s/\([ =]\)\([-a-zA-Z0-9_${}:"]*\)\.tab\.o/\1"{o}"\2.tab.c.o/g
/\.o/s/^\([-a-zA-Z0-9_${}:"]*\)\.tab\.o/"{o}"\1.tab.c.o/
# Clean up.
/"{o}"/s/"{o}""{o}"/"{o}"/g
/"{o}"/s/^"{o}"\([a-zA-Z0-9_]*\)=/\1=/
# Change extension of libs.
/\.a/s/lib\([a-z]*\)\.a/lib\1.o/g
# Remove non-fail option.
/-/s/^\([ ]*\)-/\1/
# Fix overeagernesses - assumes no one-letter commands.
/^[ ]*[a-z] /s/^\([ ]*\)\([a-z]\) /\1-\2 /
# Remove non-echo option. (watch out for autoconf things)
/@/s/^\([ ]*\)@/\1/
# Change cp to Duplicate.
# Catenate is perhaps more accurate, but the pattern would have to
# identify the output file and add a '>' redirection into it.
/cp/s/^\([ ]*\)cp /\1Duplicate -d -y /
# Change mv to Rename.
/mv/s/^\([ ]*\)mv /\1Rename -y /
/Rename/s/^\([ ]*\)Rename -y -f/\1Rename -y/
# Change rm to Delete.
/rm -rf/s/^\([ ]*\)rm -rf /\1Delete -i -y /
/rm -f/s/^\([ ]*\)rm -f /\1Delete -i -y /
/rm/s/^\([ ]*\)rm /\1Delete -i -y /
# Note that we don't mess with ln - directory-specific scripts
# must decide what to do with symlinks.
# Change cat to Catenate.
/cat/s/^\([ ]*\)cat /\1Catenate /
# Change touch to mpw-touch.
/touch/s/^\([ ]*\)touch /\1mpw-touch /
# Change mkdir to NewFolder.
/mkdir/s/^\([ ]*\)mkdir /\1NewFolder /
# Change var setting to Set.
/=/s/^\([ ]*\)\([-a-zA-Z0-9_]*\)=\([^;]*\); \\Option-d/\1Set \2 \3/
# Change tests.
/if /s/if \[ *-f \([^ ]*\) ] *; *\\Option-d/If "`Exists "\1"`" != ""/
/if /s/if \[ *-f \([^ ]*\) ] *; *then *\\Option-d/If "`Exists "\1"`" != ""/
/if /s/if \[ ! *-f \([^ ]*\) ] *; *\\Option-d/If "`Exists "\1"`" == ""/
/if /s/if \[ ! *-f \([^ ]*\) ] *; *then \\Option-d/If "`Exists "\1"`" == ""/
/if /s/if \[ *-d \([^ ]*\) ] *; *\\Option-d/If "`Exists "\1"`" != ""/
/if /s/if \[ *-d \([^ ]*\) ] *; *then *\\Option-d/If "`Exists "\1"`" != ""/
/if /s/if \[ ! *-d \([^ ]*\) ] *; *\\Option-d/If "`Exists "\1"`" == ""/
/if /s/if \[ ! *-d \([^ ]*\) ] *; *then *\\Option-d/If "`Exists "\1"`" == ""/
/if /s/if \[ -d \([^ ]*\) ] *; then true *; else mkdir \([^ ;]*\) *; fi/If "`Exists "\1"`" != "" NewFolder \2 End If/
/if /s/if \[ \([^ ]*\) = \([^ ]*\) ] *; *\\Option-d/If "\1" == "\2"/
/if /s/if \[ \([^ ]*\) = \([^ ]*\) ] *; *then *\\Option-d/If "\1" == "\2"/
/if /s/if \[ \([^ ]*\) != \([^ ]*\) ] *; *\\Option-d/If "\1" != "\2"/
/if /s/if \[ \([^ ]*\) != \([^ ]*\) ] *; *then *\\Option-d/If "\1" != "\2"/
/if /s/if \[ \([^ ]*\) -eq \([^ ]*\) ] *; *\\Option-d/If "\1" != "\2"/
/if /s/if \[ \([^ ]*\) -eq \([^ ]*\) ] *; *then *\\Option-d/If "\1" != "\2"/
/^[ ]*else true$/c\
Else\
mpw-true\
/else/s/^\([ ]*\)else[ ]*$/\1Else/
/else/s/^\([ ]*\)else[; ]*\\Option-d$/\1Else/
/^[ ]*else[ ]*true[ ]*$/c\
Else\
mpw-true
/^[ ]*else[ ]*true[; ]*fi$/c\
Else\
mpw-true\
End If
/fi/s/^\([ ]*\)fi *$/\1End/
/fi/s/^\([ ]*\)fi *; *\\Option-d/\1End/
# Change looping.
/for/s/^\([ ]*\)for \([-a-zA-Z0-9_]*\) in \([^;]*\); *do *\\Option-d/\1For \2 In \3/
/^\([ ]*\)do *\\Option-d/d
/done/s/^\([ ]*\)done *; *\\Option-d/\1End/
/done/s/^\([ ]*\)done$/\1End/
# Trailing semicolons and continued lines are unneeded sh syntax.
/; \\Option-d/s/; \\Option-d//
# Change move-if-change to MoveIfChange.
/move-if-change/s/\([^ ]*\)move-if-change/MoveIfChange/g
# Change $(SHELL) to the script name by itself.
/SHELL/s/^\([ ]*\){SHELL} /\1/
# Change syntax of default rule dependency.
/^\.c\.o/s/^\.c\.o \\Option-f$/.c.o \\Option-f .c/
# Change default rule's action.
/{CC} -c/s/{CC} -c \(.*\) \$<$/{CC} @DASH_C_FLAG@ {DepDir}{Default}.c \1 @SEGMENT_FLAG({Default})@ -o {TargDir}{Default}.c.o/
# This is pretty disgusting, but I can't seem to detect empty rules.
/Option-f$/s/Option-f$/Option-f _oldest/g
# Remove -c from explicit compiler calls. (but should not if GCC)
# Handle the case of a source file that is "{xxx}"file.c.
/ -c /s/{\([A-Z_]*\)CC}\(.*\) -c \(.*\)"\([^"]*\)"\([-a-z_]*\)\.c/{\1CC}\2 @DASH_C_FLAG@ \3"\4"\5.c -o "{o}"\5.c.o/
# Handle the case of a source file that is "{xxx}"dir:file.c.
/ -c /s/{\([A-Z_]*\)CC}\(.*\) -c \(.*\)"\([^"]*\)"\([-a-z_]*\):\([-a-z_]*\)\.c/{\1CC}\2 @DASH_C_FLAG@ \3"\4"\5:\6.c -o "{o}"\6.c.o/
# Change linking cc to linking sequence.
/-o/s/^\([ ]*\){CC} \(.*\){\([A-Z_]*\)CFLAGS} \(.*\){LDFLAGS} \(.*\)-o \([^ ]*\) \(.*\)$/\1{CC_LD} \2 {\3CFLAGS} \4 {LDFLAGS} \5 -o \6{PROG_EXT} \7\
\1{MAKEPEF} \6{PROG_EXT} -o \6 {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\
\1{REZ} "{s}"\6.r -o \6 -append -d PROG_NAME='"'\6'"' -d VERSION_STRING='"'{version}'"'/
/-o/s/^\([ ]*\){CC} \(.*\){\([A-Z_]*\)CFLAGS} \(.*\)-o \([^ ]*\) \(.*\){LDFLAGS} \(.*\)$/\1{CC_LD} \2 {\3CFLAGS} \4 {LDFLAGS} \6 -o \5{PROG_EXT} \7\
\1{MAKEPEF} \5{PROG_EXT} -o \5 {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\
\1{REZ} "{s}"\5.r -o \5 -append -d PROG_NAME='"'\5'"' -d VERSION_STRING='"'{version}'"'/
/-o/s/^\([ ]*\){HOST_CC} \(.*\)-o \([^ ]*\) \(.*\)$/\1{HOST_CC_LD} \2 -o \3{PROG_EXT} \4\
\1{MAKEPEF} \3{PROG_EXT} -o \3 {MAKEPEF_TOOL_FLAGS} {MAKEPEF_FLAGS}\
\1{REZ} "{s}"\3.r -o \3 -append -d PROG_NAME='"'\3'"' -d VERSION_STRING='"'{version}'"'/
# Comment out .NOEXPORT rules.
/\.NOEXPORT/s/^\.NOEXPORT/#\.NOEXPORT/
# Comment out .PHONY rules.
/\.PHONY/s/^\.PHONY/#\.PHONY/
# Comment out .PRECIOUS rules.
/\.PRECIOUS/s/^\.PRECIOUS/#\.PRECIOUS/
# Comment out .SUFFIXES rules.
/\.SUFFIXES/s/^\.SUFFIXES/#\.SUFFIXES/
# Set the install program appropriately.
/INSTALL/s/^INSTALL *= *`.*`:install.sh -c/INSTALL = Duplicate -y/
# Don't try to decide whether to use the tree's own tools.
/bison/s/`.*bison:bison.*`/bison -y/
/byacc/s/`.*byacc:byacc.*`/byacc/
/flex/s/`.*flex:flex.*`/flex/
# Turn transformed C comments in echo commands back into comments.
/echo/s,echo '\(.*\):\\Option-x\(.*\)\\Option-x:\(.*\)',echo '\1/*\2*/\3',
# Whack out various clever expressions that search for tools, since
# the clever code is too /bin/sh specific.
/^AR_FOR_TARGET = `/,/`$/c\
AR_FOR_TARGET = ::binutils:ar\
/^RANLIB_FOR_TARGET = `/,/`$/c\
RANLIB_FOR_TARGET = ::binutils:ranlib\
/^RANLIB_TEST_FOR_TARGET = /,/ranlib ] )$/c\
RANLIB_TEST_FOR_TARGET = \
/^EXPECT = `/,/`$/c\
EXPECT = \
/^RUNTEST = `/,/`$/c\
RUNTEST = \
/^CC_FOR_TARGET = `/,/`$/c\
CC_FOR_TARGET = \
/^CXX_FOR_TARGET = `/,/`$/c\
CXX_FOR_TARGET = \
/^CHILL_FOR_TARGET = `/,/`$/c\
CHILL_FOR_TARGET = \
/^CHILL_LIB = `/,/`$/c\
CHILL_LIB = \
/sanit/s/{start-sanit...-[a-z0-9]*}//
/sanit/s/{end-sanit...-[a-z0-9]*}//
# Add standard defines and default rules.
/^# srcdir/a\
\
s = "{srcdir}"\
\
o = :\
\
"{o}" \\Option-f : "{s}"
# "Touch" command.
If "`Exists "{1}"`" != ""
SetFile -m . "{1}"
Else
Echo ' ' > "{1}"
End If
# This command does nothing.
# MPW makefiles seem not to have any way to get a literal open
# brace into a rule anywhere, so this does the job.
Echo '{'
StreamEdit -e \Option-d
'/\Option-x/ \Option-d
Replace /\Option-d\SrcOption-d/ "\Option-d\Option-d" -c \Option-5 ; \Option-d
Replace /\Option-d\SrcOption-f/ "\Option-d\Option-f" -c \Option-5 ; \Option-d
Replace /\Option-d\SrcOption-8/ "\Option-d\Option-8" -c \Option-5 ; \Option-d
Replace /\Option-d\SrcOption-5/ "\Option-d\Option-5" -c \Option-5 ; \Option-d
Replace /\Option-d\SrcOption-x/ "\Option-d\Option-x" -c \Option-5 ; \Option-d
Replace /\Option-d\SrcOption-r/ "\Option-d\Option-r" -c \Option-5' \Option-d
"{1}"
PICFLAG_FOR_TARGET=-fpic
GDB_NLM_DEPS = all-gcc all-ld
PICFLAG_FOR_TARGET=-fPIC
PICFLAG_FOR_TARGET=-fPIC
PICFLAG_FOR_TARGET=-fPIC
CC_FOR_TARGET = ca732 -ansi
AS_FOR_TARGET = as732
AR_FOR_TARGET = ar732
RANLIB_FOR_TARGET = true
PICFLAG_FOR_TARGET=-fpic
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
#
# Makefile.in for etc
#
prefix = @prefix@
exec_prefix = @exec_prefix@
srcdir = @srcdir@
VPATH = @srcdir@
bindir = @bindir@
libdir = @libdir@
tooldir = $(libdir)
datadir = @datadir@
mandir = @mandir@
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 = @infodir@
SHELL = /bin/sh
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
# Where to find texinfo.tex to format documentation with TeX.
TEXIDIR = $(srcdir)/../texinfo
#### Host, target, and site specific Makefile fragments come in here.
###
INFOFILES = standards.info
DVIFILES = standards.dvi
all:
install:
uninstall:
info: $(INFOFILES)
install-info: info
if test ! -f standards.info ; then cd $(srcdir); fi; \
for i in standards.info*; do \
$(INSTALL_DATA) $$i $(infodir)/$$i; \
done
dvi: $(DVIFILES)
standards.info: $(srcdir)/standards.texi
$(MAKEINFO) -I$(srcdir) -o standards.info $(srcdir)/standards.texi
standards.dvi: $(srcdir)/standards.texi
TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/standards.texi
clean:
rm -f *.aux *.cp *.cps *.dvi *.fn *.fns *.ky *.kys *.log
rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
mostlyclean: clean
distclean: clean
rm -f Makefile config.status config.cache
maintainer-clean realclean: distclean
rm -f *.info*
Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
$(SHELL) ./config.status
## these last targets are for standards.texi conformance
dist:
check:
installcheck:
TAGS:
This diff is collapsed. Click to expand it.
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.5)
AC_INIT(Makefile.in)
AC_PROG_INSTALL
AC_OUTPUT(Makefile)
This diff is collapsed. Click to expand it.
/* ANSI and traditional C compatability macros
Copyright 1991, 1992, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
/* ANSI and traditional C compatibility macros
ANSI C is assumed if __STDC__ is #defined.
Macro ANSI C definition Traditional C definition
----- ---- - ---------- ----------- - ----------
PTR `void *' `char *'
LONG_DOUBLE `long double' `double'
VOLATILE `volatile' `'
SIGNED `signed' `'
PTRCONST `void *const' `char *'
ANSI_PROTOTYPES 1 not defined
CONST is also defined, but is obsolete. Just use const.
obsolete -- DEFUN (name, arglist, args)
Defines function NAME.
ARGLIST lists the arguments, separated by commas and enclosed in
parentheses. ARGLIST becomes the argument list in traditional C.
ARGS list the arguments with their types. It becomes a prototype in
ANSI C, and the type declarations in traditional C. Arguments should
be separated with `AND'. For functions with a variable number of
arguments, the last thing listed should be `DOTS'.
obsolete -- DEFUN_VOID (name)
Defines a function NAME, which takes no arguments.
obsolete -- EXFUN (name, (prototype)) -- obsolete.
Replaced by PARAMS. Do not use; will disappear someday soon.
Was used in external function declarations.
In ANSI C it is `NAME PROTOTYPE' (so PROTOTYPE should be enclosed in
parentheses). In traditional C it is `NAME()'.
For a function that takes no arguments, PROTOTYPE should be `(void)'.
obsolete -- PROTO (type, name, (prototype) -- obsolete.
This one has also been replaced by PARAMS. Do not use.
PARAMS ((args))
We could use the EXFUN macro to handle prototype declarations, but
the name is misleading and the result is ugly. So we just define a
simple macro to handle the parameter lists, as in:
static int foo PARAMS ((int, char));
This produces: `static int foo();' or `static int foo (int, char);'
EXFUN would have done it like this:
static int EXFUN (foo, (int, char));
but the function is not external...and it's hard to visually parse
the function name out of the mess. EXFUN should be considered
obsolete; new code should be written to use PARAMS.
DOTS is also obsolete.
Examples:
extern int printf PARAMS ((const char *format, ...));
*/
#ifndef _ANSIDECL_H
#define _ANSIDECL_H 1
/* Every source file includes this file,
so they will all get the switch for lint. */
/* LINTLIBRARY */
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
/* All known AIX compilers implement these things (but don't always
define __STDC__). The RISC/OS MIPS compiler defines these things
in SVR4 mode, but does not define __STDC__. */
#define PTR void *
#define PTRCONST void *CONST
#define LONG_DOUBLE long double
#define AND ,
#define NOARGS void
#define VOLATILE volatile
#define SIGNED signed
#define PARAMS(paramlist) paramlist
#define ANSI_PROTOTYPES 1
#define VPARAMS(ARGS) ARGS
#define VA_START(va_list,var) va_start(va_list,var)
/* These are obsolete. Do not use. */
#define CONST const
#define DOTS , ...
#define PROTO(type, name, arglist) type name arglist
#define EXFUN(name, proto) name proto
#define DEFUN(name, arglist, args) name(args)
#define DEFUN_VOID(name) name(void)
#else /* Not ANSI C. */
#define PTR char *
#define PTRCONST PTR
#define LONG_DOUBLE double
#define AND ;
#define NOARGS
#ifndef const /* some systems define it in header files for non-ansi mode */
#define const
#endif
#define VOLATILE
#define SIGNED
#define PARAMS(paramlist) ()
#define VPARAMS(ARGS) (va_alist) va_dcl
#define VA_START(va_list,var) va_start(va_list)
/* These are obsolete. Do not use. */
#define CONST
#define DOTS
#define PROTO(type, name, arglist) type name ()
#define EXFUN(name, proto) name()
#define DEFUN(name, arglist, args) name arglist args;
#define DEFUN_VOID(name) name()
#endif /* ANSI C. */
#endif /* ansidecl.h */
/* Defs for interface to demanglers.
Copyright 1992, 1995, 1996 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#if !defined (DEMANGLE_H)
#define DEMANGLE_H
#ifdef IN_GCC
#include "gansidecl.h"
#define PARAMS(ARGS) PROTO(ARGS)
#else /* ! IN_GCC */
#include <ansidecl.h>
#endif /* IN_GCC */
/* Options passed to cplus_demangle (in 2nd parameter). */
#define DMGL_NO_OPTS 0 /* For readability... */
#define DMGL_PARAMS (1 << 0) /* Include function args */
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
#define DMGL_JAVA (1 << 2) /* Demangle as Java rather than C++. */
#define DMGL_AUTO (1 << 8)
#define DMGL_GNU (1 << 9)
#define DMGL_LUCID (1 << 10)
#define DMGL_ARM (1 << 11)
/* If none of these are set, use 'current_demangling_style' as the default. */
#define DMGL_STYLE_MASK (DMGL_AUTO|DMGL_GNU|DMGL_LUCID|DMGL_ARM)
/* Enumeration of possible demangling styles.
Lucid and ARM styles are still kept logically distinct, even though
they now both behave identically. The resulting style is actual the
union of both. I.E. either style recognizes both "__pt__" and "__rf__"
for operator "->", even though the first is lucid style and the second
is ARM style. (FIXME?) */
extern enum demangling_styles
{
unknown_demangling = 0,
auto_demangling = DMGL_AUTO,
gnu_demangling = DMGL_GNU,
lucid_demangling = DMGL_LUCID,
arm_demangling = DMGL_ARM
} current_demangling_style;
/* Define string names for the various demangling styles. */
#define AUTO_DEMANGLING_STYLE_STRING "auto"
#define GNU_DEMANGLING_STYLE_STRING "gnu"
#define LUCID_DEMANGLING_STYLE_STRING "lucid"
#define ARM_DEMANGLING_STYLE_STRING "arm"
/* Some macros to test what demangling style is active. */
#define CURRENT_DEMANGLING_STYLE current_demangling_style
#define AUTO_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_AUTO)
#define GNU_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_GNU)
#define LUCID_DEMANGLING (((int) CURRENT_DEMANGLING_STYLE) & DMGL_LUCID)
#define ARM_DEMANGLING (CURRENT_DEMANGLING_STYLE & DMGL_ARM)
extern char *
cplus_demangle PARAMS ((const char *mangled, int options));
extern int
cplus_demangle_opname PARAMS ((const char *opname, char *result, int options));
extern const char *
cplus_mangle_opname PARAMS ((const char *opname, int options));
/* Note: This sets global state. FIXME if you care about multi-threading. */
extern void
set_cplus_marker_for_demangling PARAMS ((int ch));
#endif /* DEMANGLE_H */
/* IEEE floating point support declarations, for GDB, the GNU Debugger.
Copyright (C) 1991 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if !defined (FLOATFORMAT_H)
#define FLOATFORMAT_H 1
#include "ansidecl.h"
/* A floatformat consists of a sign bit, an exponent and a mantissa. Once the
bytes are concatenated according to the byteorder flag, then each of those
fields is contiguous. We number the bits with 0 being the most significant
(i.e. BITS_BIG_ENDIAN type numbering), and specify which bits each field
contains with the *_start and *_len fields. */
/* What is the order of the bytes. */
enum floatformat_byteorders {
/* Standard little endian byte order.
EX: 1.2345678e10 => 00 00 80 c5 e0 fe 06 42 */
floatformat_little,
/* Standard big endian byte order.
EX: 1.2345678e10 => 42 06 fe e0 c5 80 00 00 */
floatformat_big,
/* Little endian byte order but big endian word order.
EX: 1.2345678e10 => e0 fe 06 42 00 00 80 c5 */
floatformat_littlebyte_bigword
};
enum floatformat_intbit { floatformat_intbit_yes, floatformat_intbit_no };
struct floatformat
{
enum floatformat_byteorders byteorder;
unsigned int totalsize; /* Total size of number in bits */
/* Sign bit is always one bit long. 1 means negative, 0 means positive. */
unsigned int sign_start;
unsigned int exp_start;
unsigned int exp_len;
/* Amount added to "true" exponent. 0x3fff for many IEEE extendeds. */
unsigned int exp_bias;
/* Exponent value which indicates NaN. This is the actual value stored in
the float, not adjusted by the exp_bias. This usually consists of all
one bits. */
unsigned int exp_nan;
unsigned int man_start;
unsigned int man_len;
/* Is the integer bit explicit or implicit? */
enum floatformat_intbit intbit;
};
/* floatformats for IEEE single and double, big and little endian. */
extern const struct floatformat floatformat_ieee_single_big;
extern const struct floatformat floatformat_ieee_single_little;
extern const struct floatformat floatformat_ieee_double_big;
extern const struct floatformat floatformat_ieee_double_little;
/* floatformat for ARM IEEE double, little endian bytes and big endian words */
extern const struct floatformat floatformat_ieee_double_littlebyte_bigword;
/* floatformats for various extendeds. */
extern const struct floatformat floatformat_i387_ext;
extern const struct floatformat floatformat_m68881_ext;
extern const struct floatformat floatformat_i960_ext;
extern const struct floatformat floatformat_m88110_ext;
extern const struct floatformat floatformat_arm_ext;
/* Convert from FMT to a double.
FROM is the address of the extended float.
Store the double in *TO. */
extern void
floatformat_to_double PARAMS ((const struct floatformat *, char *, double *));
/* The converse: convert the double *FROM to FMT
and store where TO points. */
extern void
floatformat_from_double PARAMS ((const struct floatformat *,
double *, char *));
#endif /* defined (FLOATFORMAT_H) */
/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef _FNMATCH_H
#define _FNMATCH_H 1
#ifdef __cplusplus
extern "C" {
#endif
#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
#undef __P
#define __P(args) args
#else /* Not C++ or ANSI C. */
#undef __P
#define __P(args) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
#undef FNM_PATHNAME
#undef FNM_NOESCAPE
#undef FNM_PERIOD
/* Bits set in the FLAGS argument to `fnmatch'. */
#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((const char *__pattern, const char *__string,
int __flags));
#ifdef __cplusplus
}
#endif
#endif /* fnmatch.h */
/* Declarations for getopt.
Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License
as published by the Free Software Foundation; either version 2, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _GETOPT_H
#define _GETOPT_H 1
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns EOF, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
#if __STDC__
const char *name;
#else
char *name;
#endif
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
#define no_argument 0
#define required_argument 1
#define optional_argument 2
#if __STDC__
#if defined(__GNU_LIBRARY__)
/* Many other libraries have conflicting prototypes for getopt, with
differences in the consts, in stdlib.h. To avoid compilation
errors, only prototype getopt for the GNU C library. */
extern int getopt (int argc, char *const *argv, const char *shortopts);
#else /* not __GNU_LIBRARY__ */
extern int getopt ();
#endif /* not __GNU_LIBRARY__ */
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
const struct option *longopts, int *longind);
extern int getopt_long_only (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind);
/* Internal only. Users should not call this directly. */
extern int _getopt_internal (int argc, char *const *argv,
const char *shortopts,
const struct option *longopts, int *longind,
int long_only);
#else /* not __STDC__ */
extern int getopt ();
extern int getopt_long ();
extern int getopt_long_only ();
extern int _getopt_internal ();
#endif /* not __STDC__ */
#ifdef __cplusplus
}
#endif
#endif /* _GETOPT_H */
/* Function declarations for libiberty.
Written by Cygnus Support, 1994.
The libiberty library provides a number of functions which are
missing on some operating systems. We do not declare those here,
to avoid conflicts with the system header files on operating
systems that do support those functions. In this file we only
declare those functions which are specific to libiberty. */
#ifndef LIBIBERTY_H
#define LIBIBERTY_H
#include "ansidecl.h"
/* Build an argument vector from a string. Allocates memory using
malloc. Use freeargv to free the vector. */
extern char **buildargv PARAMS ((char *));
/* Free a vector returned by buildargv. */
extern void freeargv PARAMS ((char **));
/* Return the last component of a path name. Note that we can't use a
prototype here because the parameter is declared inconsistently
across different systems, sometimes as "char *" and sometimes as
"const char *" */
#if defined(__GNU_LIBRARY__ ) || defined (__linux__)
extern char *basename PARAMS ((const char *));
#else
extern char *basename ();
#endif
/* Concatenate an arbitrary number of strings, up to (char *) NULL.
Allocates memory using xmalloc. */
extern char *concat PARAMS ((const char *, ...));
/* Check whether two file descriptors refer to the same file. */
extern int fdmatch PARAMS ((int fd1, int fd2));
/* Get the amount of time the process has run, in microseconds. */
extern long get_run_time PARAMS ((void));
/* Choose a temporary directory to use for scratch files. */
extern char *choose_temp_base PARAMS ((void));
/* Allocate memory filled with spaces. Allocates using malloc. */
extern const char *spaces PARAMS ((int count));
/* Return the maximum error number for which strerror will return a
string. */
extern int errno_max PARAMS ((void));
/* Return the name of an errno value (e.g., strerrno (EINVAL) returns
"EINVAL"). */
extern const char *strerrno PARAMS ((int));
/* Given the name of an errno value, return the value. */
extern int strtoerrno PARAMS ((const char *));
/* ANSI's strerror(), but more robust. */
extern char *xstrerror PARAMS ((int));
/* Return the maximum signal number for which strsignal will return a
string. */
extern int signo_max PARAMS ((void));
/* Return a signal message string for a signal number
(e.g., strsignal (SIGHUP) returns something like "Hangup"). */
/* This is commented out as it can conflict with one in system headers.
We still document its existence though. */
/*extern const char *strsignal PARAMS ((int));*/
/* Return the name of a signal number (e.g., strsigno (SIGHUP) returns
"SIGHUP"). */
extern const char *strsigno PARAMS ((int));
/* Given the name of a signal, return its number. */
extern int strtosigno PARAMS ((const char *));
/* Register a function to be run by xexit. Returns 0 on success. */
extern int xatexit PARAMS ((void (*fn) (void)));
/* Exit, calling all the functions registered with xatexit. */
#ifndef __GNUC__
extern void xexit PARAMS ((int status));
#else
typedef void libiberty_voidfn PARAMS ((int status));
__volatile__ libiberty_voidfn xexit;
#endif
/* Set the program name used by xmalloc. */
extern void xmalloc_set_program_name PARAMS ((const char *));
/* Allocate memory without fail. If malloc fails, this will print a
message to stderr (using the name set by xmalloc_set_program_name,
if any) and then call xexit. */
#ifdef ANSI_PROTOTYPES
/* Get a definition for size_t. */
#include <stddef.h>
#endif
extern PTR xmalloc PARAMS ((size_t));
/* Reallocate memory without fail. This works like xmalloc.
FIXME: We do not declare the parameter types for the same reason as
xmalloc. */
extern PTR xrealloc PARAMS ((PTR, size_t));
/* Copy a string into a memory buffer without fail. */
extern char *xstrdup PARAMS ((const char *));
/* hex character manipulation routines */
#define _hex_array_size 256
#define _hex_bad 99
extern char _hex_value[_hex_array_size];
extern void hex_init PARAMS ((void));
#define hex_p(c) (hex_value (c) != _hex_bad)
/* If you change this, note well: Some code relies on side effects in
the argument being performed exactly once. */
#define hex_value(c) (_hex_value[(unsigned char) (c)])
/* Definitions used by the pexecute routine. */
#define PEXECUTE_FIRST 1
#define PEXECUTE_LAST 2
#define PEXECUTE_ONE (PEXECUTE_FIRST + PEXECUTE_LAST)
#define PEXECUTE_SEARCH 4
#define PEXECUTE_VERBOSE 8
/* Execute a program. */
extern int pexecute PARAMS ((const char *, char * const *, const char *,
const char *, char **, char **, int));
/* Wait for pexecute to finish. */
extern int pwait PARAMS ((int, int *, int));
#endif /* ! defined (LIBIBERTY_H) */
/* objalloc.h -- routines to allocate memory for objects
Copyright 1997 Free Software Foundation, Inc.
Written by Ian Lance Taylor, Cygnus Solutions.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef OBJALLOC_H
#define OBJALLOC_H
#include "ansidecl.h"
/* These routines allocate space for an object. The assumption is
that the object will want to allocate space as it goes along, but
will never want to free any particular block. There is a function
to free a block, which also frees all more recently allocated
blocks. There is also a function to free all the allocated space.
This is essentially a specialization of obstacks. The main
difference is that a block may not be allocated a bit at a time.
Another difference is that these routines are always built on top
of malloc, and always pass an malloc failure back to the caller,
unlike more recent versions of obstacks. */
/* This is what an objalloc structure looks like. Callers should not
refer to these fields, nor should they allocate these structure
themselves. Instead, they should only create them via
objalloc_init, and only access them via the functions and macros
listed below. The structure is only defined here so that we can
access it via macros. */
struct objalloc
{
char *current_ptr;
unsigned int current_space;
PTR chunks;
};
/* Work out the required alignment. */
struct objalloc_align { char x; double d; };
#if defined (__STDC__) && __STDC__
#ifndef offsetof
#include <stddef.h>
#endif
#define OBJALLOC_ALIGN \
((ptrdiff_t) ((char *) &((struct objalloc_align *) 0)->d - (char *) 0))
#else
#define OBJALLOC_ALIGN \
((long) ((char *) &((struct objalloc_align *) 0)->d - (char *) 0))
#endif
/* Create an objalloc structure. Returns NULL if malloc fails. */
extern struct objalloc *objalloc_create PARAMS ((void));
/* Allocate space from an objalloc structure. Returns NULL if malloc
fails. */
extern PTR _objalloc_alloc PARAMS ((struct objalloc *, unsigned long));
/* The macro version of objalloc_alloc. We only define this if using
gcc, because otherwise we would have to evaluate the arguments
multiple times, or use a temporary field as obstack.h does. */
#if defined (__GNUC__) && defined (__STDC__) && __STDC__
/* NextStep 2.0 cc is really gcc 1.93 but it defines __GNUC__ = 2 and
does not implement __extension__. But that compiler doesn't define
__GNUC_MINOR__. */
#if __GNUC__ < 2 || (__NeXT__ && !__GNUC_MINOR__)
#define __extension__
#endif
#define objalloc_alloc(o, l) \
__extension__ \
({ struct objalloc *__o = (o); \
unsigned long __len = (l); \
if (__len == 0) \
__len = 1; \
__len = (__len + OBJALLOC_ALIGN - 1) &~ (OBJALLOC_ALIGN - 1); \
(__len <= __o->current_space \
? (__o->current_ptr += __len, \
__o->current_space -= __len, \
(PTR) (__o->current_ptr - __len)) \
: _objalloc_alloc (__o, __len)); })
#else /* ! __GNUC__ */
#define objalloc_alloc(o, l) _objalloc_alloc ((o), (l))
#endif /* ! __GNUC__ */
/* Free an entire objalloc structure. */
extern void objalloc_free PARAMS ((struct objalloc *));
/* Free a block allocated by objalloc_alloc. This also frees all more
recently allocated blocks. */
extern void objalloc_free_block PARAMS ((struct objalloc *, PTR));
#endif /* OBJALLOC_H */
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
# CYGNUS LOCAL: exeext variable
exeext=""
# END CYGNUS LOCAL
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
# CYGNUS LOCAL: -x option
-x=*) exeext=`echo $1 | sed 's/-x=//'`
shift
continue;;
-x) exeext=".exe"
shift
continue;;
# END CYGNUS LOCAL
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
chmodcmd=""
else
instcmd=mkdir
fi
else
# CYGNUS LOCAL noer
# Win32-based gcc automatically appends .exe to produced executables,
# whether asked for or not. This breaks installs. The following
# changes the value of $src to $src.exe if $src is missing
if [ -f $src ]
then
true
elif [ -f $src.exe ]
then
echo "install: $src does not exist, trying with .exe appended"
src="$src".exe
fi
# end CYGNUS LOCAL noer
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
# CYGNUS LOCAL: Use exeext
case "`basename $dst`" in
*.*) ;;
*) dst="$dst$exeext" ;;
esac
# END CYGNUS LOCAL
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0
This directory contains the -liberty library of free software.
It is a collection of subroutines used by various GNU programs.
Current members include:
getopt -- get options from command line
obstack -- stacks of arbitrarily-sized objects
strerror -- error message strings corresponding to errno
strtol -- string-to-long conversion
strtoul -- string-to-unsigned-long conversion
We expect many of the GNU subroutines that are floating around to
eventually arrive here.
To build the library, do:
./configure HOSTTYPE
make
Please report bugs and fixes to "bug-gnu-utils@prep.ai.mit.edu". Thank you.
ADDING A NEW FILE
=================
There are two sets of files: Those that are "required" will be
included in the library for all configurations, while those
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.
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.
ADDING A NEW CONFIGURATION
==========================
On most hosts you should be able to use the scheme for automatically
figuring out which files are needed. In that case, you probably
don't need a special Makefile stub for that configuration.
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.
/* 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__
#define alloca __builtin_alloca
#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__) */
/* Create and destroy argument vectors (argv's)
Copyright (C) 1992 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
Libiberty is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
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. */
/* Create and destroy argument vectors. An argument vector is simply an
array of string pointers, terminated by a NULL pointer. */
#include "ansidecl.h"
#include "libiberty.h"
#ifdef isspace
#undef isspace
#endif
#define isspace(ch) ((ch) == ' ' || (ch) == '\t')
/* Routines imported from standard C runtime libraries. */
#ifdef __STDC__
#include <stddef.h>
extern void *memcpy (void *s1, const void *s2, size_t n); /* 4.11.2.1 */
extern size_t strlen (const char *s); /* 4.11.6.3 */
extern void *malloc (size_t size); /* 4.10.3.3 */
extern void *realloc (void *ptr, size_t size); /* 4.10.3.4 */
extern void free (void *ptr); /* 4.10.3.2 */
extern char *strdup (const char *s); /* Non-ANSI */
#else /* !__STDC__ */
#if !defined _WIN32 || defined __GNUC__
extern char *memcpy (); /* Copy memory region */
extern int strlen (); /* Count length of string */
extern char *malloc (); /* Standard memory allocater */
extern char *realloc (); /* Standard memory reallocator */
extern void free (); /* Free malloc'd memory */
extern char *strdup (); /* Duplicate a string */
#endif
#endif /* __STDC__ */
#include "alloca-conf.h"
#ifndef NULL
#define NULL 0
#endif
#ifndef EOS
#define EOS '\0'
#endif
#define INITIAL_MAXARGC 8 /* Number of args + NULL in initial argv */
/*
NAME
freeargv -- free an argument vector
SYNOPSIS
void freeargv (vector)
char **vector;
DESCRIPTION
Free an argument vector that was built using buildargv. Simply scans
through the vector, freeing the memory for each argument until the
terminating NULL is found, and then frees the vector itself.
RETURNS
No value.
*/
void freeargv (vector)
char **vector;
{
register char **scan;
if (vector != NULL)
{
for (scan = vector; *scan != NULL; scan++)
{
free (*scan);
}
free (vector);
}
}
/*
NAME
buildargv -- build an argument vector from a string
SYNOPSIS
char **buildargv (sp)
char *sp;
DESCRIPTION
Given a pointer to a string, parse the string extracting fields
separated by whitespace and optionally enclosed within either single
or double quotes (which are stripped off), and build a vector of
pointers to copies of the string for each field. The input string
remains unchanged.
All of the memory for the pointer array and copies of the string
is obtained from malloc. All of the memory can be returned to the
system with the single function call freeargv, which takes the
returned result of buildargv, as it's argument.
The memory for the argv array is dynamically expanded as necessary.
RETURNS
Returns a pointer to the argument vector if successful. Returns NULL
if the input string pointer is NULL or if there is insufficient
memory to complete building the argument vector.
NOTES
In order to provide a working buffer for extracting arguments into,
with appropriate stripping of quotes and translation of backslash
sequences, we allocate a working buffer at least as long as the input
string. This ensures that we always have enough space in which to
work, since the extracted arg is never larger than the input string.
If the input is a null string (as opposed to a NULL pointer), then
buildarg returns an argv that has one arg, a null string.
Argv is always kept terminated with a NULL arg pointer, so it can
be passed to freeargv at any time, or returned, as appropriate.
*/
char **buildargv (input)
char *input;
{
char *arg;
char *copybuf;
int squote = 0;
int dquote = 0;
int bsquote = 0;
int argc = 0;
int maxargc = 0;
char **argv = NULL;
char **nargv;
if (input != NULL)
{
copybuf = alloca (strlen (input) + 1);
/* Is a do{}while to always execute the loop once. Always return an
argv, even for null strings. See NOTES above, test case below. */
do
{
/* Pick off argv[argc] */
while (isspace (*input))
{
input++;
}
if ((maxargc == 0) || (argc >= (maxargc - 1)))
{
/* argv needs initialization, or expansion */
if (argv == NULL)
{
maxargc = INITIAL_MAXARGC;
nargv = (char **) malloc (maxargc * sizeof (char *));
}
else
{
maxargc *= 2;
nargv = (char **) realloc (argv, maxargc * sizeof (char *));
}
if (nargv == NULL)
{
if (argv != NULL)
{
freeargv (argv);
argv = NULL;
}
break;
}
argv = nargv;
argv[argc] = NULL;
}
/* Begin scanning arg */
arg = copybuf;
while (*input != EOS)
{
if (isspace (*input) && !squote && !dquote && !bsquote)
{
break;
}
else
{
if (bsquote)
{
bsquote = 0;
*arg++ = *input;
}
else if (*input == '\\')
{
bsquote = 1;
}
else if (squote)
{
if (*input == '\'')
{
squote = 0;
}
else
{
*arg++ = *input;
}
}
else if (dquote)
{
if (*input == '"')
{
dquote = 0;
}
else
{
*arg++ = *input;
}
}
else
{
if (*input == '\'')
{
squote = 1;
}
else if (*input == '"')
{
dquote = 1;
}
else
{
*arg++ = *input;
}
}
input++;
}
}
*arg = EOS;
argv[argc] = strdup (copybuf);
if (argv[argc] == NULL)
{
freeargv (argv);
argv = NULL;
break;
}
argc++;
argv[argc] = NULL;
while (isspace (*input))
{
input++;
}
}
while (*input != EOS);
}
return (argv);
}
#ifdef MAIN
/* Simple little test driver. */
static char *tests[] =
{
"a simple command line",
"arg 'foo' is single quoted",
"arg \"bar\" is double quoted",
"arg \"foo bar\" has embedded whitespace",
"arg 'Jack said \\'hi\\'' has single quotes",
"arg 'Jack said \\\"hi\\\"' has double quotes",
"a b c d e f g h i j k l m n o p q r s t u v w x y z 1 2 3 4 5 6 7 8 9",
/* This should be expanded into only one argument. */
"trailing-whitespace ",
"",
NULL
};
main ()
{
char **argv;
char **test;
char **targs;
for (test = tests; *test != NULL; test++)
{
printf ("buildargv(\"%s\")\n", *test);
if ((argv = buildargv (*test)) == NULL)
{
printf ("failed!\n\n");
}
else
{
for (targs = argv; *targs != NULL; targs++)
{
printf ("\t\"%s\"\n", *targs);
}
printf ("\n");
}
freeargv (argv);
}
}
#endif /* MAIN */
/* 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
int
atexit(f)
void (*f)();
{
/* If the system doesn't provide a definition for atexit, use on_exit
if the system provides that. */
on_exit (f, 0);
return 0;
}
#endif
/* Return the basename of a pathname.
This file is in the public domain. */
/*
NAME
basename -- return pointer to last component of a pathname
SYNOPSIS
char *basename (const char *name)
DESCRIPTION
Given a pointer to a string containing a typical pathname
(/usr/src/cmd/ls/ls.c for example), returns a pointer to the
last component of the pathname ("ls.c" in this case).
BUGS
Presumes a UNIX style path with UNIX style separators.
*/
#include "ansidecl.h"
#include "libiberty.h"
#include "config.h"
#ifdef NEED_basename
char *
basename (name)
const char *name;
{
const char *base = name;
while (*name)
{
if (*name++ == '/')
{
base = name;
}
}
return (char *) base;
}
#endif
/* bcmp
This function is in the public domain. */
/*
NAME
bcmp -- compare two memory regions
SYNOPSIS
int bcmp (char *from, char *to, int count)
DESCRIPTION
Compare two memory regions and return zero if they are identical,
non-zero otherwise. If count is zero, return zero.
NOTES
No guarantee is made about the non-zero returned value. In
particular, the results may be signficantly different than
strcmp(), where the return value is guaranteed to be less than,
equal to, or greater than zero, according to lexicographical
sorting of the compared regions.
BUGS
*/
int
bcmp (from, to, count)
char *from, *to;
int count;
{
int rtnval = 0;
while (count-- > 0)
{
if (*from++ != *to++)
{
rtnval = 1;
break;
}
}
return (rtnval);
}
/* bcopy -- copy memory regions of arbitary length
NAME
bcopy -- copy memory regions of arbitrary length
SYNOPSIS
void bcopy (char *in, char *out, int length)
DESCRIPTION
Copy LENGTH bytes from memory region pointed to by IN to memory
region pointed to by OUT.
BUGS
Significant speed improvements can be made in some cases by
implementing copies of multiple bytes simultaneously, or unrolling
the copy loop.
*/
void
bcopy (src, dest, len)
register char *src, *dest;
int len;
{
if (dest < src)
while (len--)
*dest++ = *src++;
else
{
char *lasts = src + (len-1);
char *lastd = dest + (len-1);
while (len--)
*(char *)lastd-- = *(char *)lasts--;
}
}
/* Portable version of bzero for systems without it.
This function is in the public domain. */
/*
NAME
bzero -- zero the contents of a specified memory region
SYNOPSIS
void bzero (char *to, int count)
DESCRIPTION
Zero COUNT bytes of memory pointed to by TO.
BUGS
Significant speed enhancements may be made in some environments
by zeroing more than a single byte at a time, or by unrolling the
loop.
*/
void
bzero (to, count)
char *to;
int count;
{
while (count-- > 0)
{
*to++ = 0;
}
}
/* Utility to pick a temporary filename prefix.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
Libiberty is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
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. */
/* This file exports one function: choose_temp_base. */
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
#ifndef NO_SYS_FILE_H
#include <sys/types.h>
#include <sys/file.h> /* May get R_OK, etc. on some systems. */
#endif
#ifndef R_OK
#define R_OK 4
#define W_OK 2
#define X_OK 1
#endif
#include <stdio.h> /* May get P_tmpdir. */
#ifdef IN_GCC
#include "config.h"
#include "gansidecl.h"
extern char *xmalloc ();
#else
#include "ansidecl.h"
#include "libiberty.h"
#if defined (__MSDOS__) || defined (_WIN32)
#define DIR_SEPARATOR '\\'
#endif
#endif
#ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
#endif
/* On MSDOS, write temp files in current dir
because there's no place else we can expect to use. */
/* ??? Although the current directory is tried as a last resort,
this is left in so that on MSDOS it is prefered to /tmp on the
off chance that someone requires this, since that was the previous
behaviour. */
#ifdef __MSDOS__
#ifndef P_tmpdir
#define P_tmpdir "."
#endif
#endif
/* Name of temporary file.
mktemp requires 6 trailing X's. */
#define TEMP_FILE "ccXXXXXX"
/* Subroutine of choose_temp_base.
If BASE is non-NULL, returh it.
Otherwise it checks if DIR is a usable directory.
If success, DIR is returned.
Otherwise NULL is returned. */
static char *
try (dir, base)
char *dir, *base;
{
if (base != 0)
return base;
if (dir != 0
&& access (dir, R_OK | W_OK | X_OK) == 0)
return dir;
return 0;
}
/* Return a prefix for temporary file names or NULL if unable to find one.
The current directory is chosen if all else fails so the program is
exited if a temporary directory can't be found (mktemp fails).
The buffer for the result is obtained with xmalloc. */
char *
choose_temp_base ()
{
char *base = 0;
char *temp_filename;
int len;
static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };
static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
#ifndef MPW
base = try (getenv ("TMPDIR"), base);
base = try (getenv ("TMP"), base);
base = try (getenv ("TEMP"), base);
#ifdef P_tmpdir
base = try (P_tmpdir, base);
#endif
/* Try /usr/tmp, then /tmp. */
base = try (usrtmp, base);
base = try (tmp, base);
/* If all else fails, use the current directory! */
if (base == 0)
#ifdef VMS
base = "[";
#else
base = ".";
#endif
#else /* MPW */
base = ":";
#endif
len = strlen (base);
temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/
+ strlen (TEMP_FILE) + 1);
strcpy (temp_filename, base);
#ifndef MPW
if (len != 0
&& temp_filename[len-1] != '/'
&& temp_filename[len-1] != DIR_SEPARATOR)
temp_filename[len++] = DIR_SEPARATOR;
#else /* MPW */
if (temp_filename[len-1] != ':')
temp_filename[len++] = ':';
#endif /* MPW */
strcpy (temp_filename + len, TEMP_FILE);
mktemp (temp_filename);
if (strlen (temp_filename) == 0)
abort ();
return temp_filename;
}
/* ANSI-compatible clock function.
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
This file is part of the libiberty library. This library is free
software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option)
any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, if you link this library with files
compiled with a GNU compiler to produce an executable, this does not cause
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. */
#ifdef HAVE_GETRUSAGE
#include <sys/time.h>
#include <sys/resource.h>
#endif
#ifdef HAVE_TIMES
#ifndef NO_SYS_PARAM_H
#include <sys/param.h>
#endif
#include <sys/times.h>
#endif
/* FIXME: should be able to declare as clock_t. */
long
clock ()
{
#ifdef HAVE_GETRUSAGE
struct rusage rusage;
getrusage (0, &rusage);
return (rusage.ru_utime.tv_sec * 1000000 + rusage.ru_utime.tv_usec
+ rusage.ru_stime.tv_sec * 1000000 + rusage.ru_stime.tv_usec);
#else
#ifdef HAVE_TIMES
struct tms tms;
times (&tms);
return (tms.tms_utime + tms.tms_stime) * (1000000 / HZ);
#else
#ifdef VMS
struct
{
int proc_user_time;
int proc_system_time;
int child_user_time;
int child_system_time;
} vms_times;
times (&vms_times);
return (vms_times.proc_user_time + vms_times.proc_system_time) * 10000;
#else
/* A fallback, if nothing else available. */
return 0;
#endif /* VMS */
#endif /* HAVE_TIMES */
#endif /* HAVE_GETRUSAGE */
}
/* Concatenate variable number of strings.
Copyright (C) 1991, 1994 Free Software Foundation, Inc.
Written by Fred Fish @ Cygnus Support
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
Libiberty is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
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. */
/*
NAME
concat -- concatenate a variable number of strings
SYNOPSIS
#include <varargs.h>
char *concat (s1, s2, s3, ..., NULL)
DESCRIPTION
Concatenate a variable number of strings and return the result
in freshly malloc'd memory.
Returns NULL if insufficient memory is available. The argument
list is terminated by the first NULL pointer encountered. Pointers
to empty strings are ignored.
NOTES
This function uses xmalloc() which is expected to be a front end
function to malloc() that deals with low memory situations. In
typical use, if malloc() returns NULL then xmalloc() diverts to an
error handler routine which never returns, and thus xmalloc will
never return a NULL pointer. If the client application wishes to
deal with low memory situations itself, it should supply an xmalloc
that just directly invokes malloc and blindly returns whatever
malloc returns.
*/
#include "ansidecl.h"
#include "libiberty.h"
#ifdef ANSI_PROTOTYPES
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#ifdef __STDC__
#include <stddef.h>
extern size_t strlen (const char *s);
#else
extern int strlen ();
#endif
#define NULLP (char *)0
/* VARARGS */
#ifdef ANSI_PROTOTYPES
char *
concat (const char *first, ...)
#else
char *
concat (va_alist)
va_dcl
#endif
{
register int length;
register char *newstr;
register char *end;
register const char *arg;
va_list args;
#ifndef ANSI_PROTOTYPES
const char *first;
#endif
/* First compute the size of the result and get sufficient memory. */
#ifdef ANSI_PROTOTYPES
va_start (args, first);
#else
va_start (args);
first = va_arg (args, const char *);
#endif
if (first == NULLP)
length = 0;
else
{
length = strlen (first);
while ((arg = va_arg (args, const char *)) != NULLP)
{
length += strlen (arg);
}
}
newstr = (char *) xmalloc (length + 1);
va_end (args);
/* Now copy the individual pieces to the result string. */
if (newstr != NULLP)
{
#ifdef ANSI_PROTOTYPES
va_start (args, first);
#else
va_start (args);
first = va_arg (args, const char *);
#endif
end = newstr;
if (first != NULLP)
{
arg = first;
while (*arg)
{
*end++ = *arg++;
}
while ((arg = va_arg (args, const char *)) != NULLP)
{
while (*arg)
{
*end++ = *arg++;
}
}
}
*end = '\000';
va_end (args);
}
return (newstr);
}
#ifdef MAIN
/* Simple little test driver. */
#include <stdio.h>
int
main ()
{
printf ("\"\" = \"%s\"\n", concat (NULLP));
printf ("\"a\" = \"%s\"\n", concat ("a", NULLP));
printf ("\"ab\" = \"%s\"\n", concat ("a", "b", NULLP));
printf ("\"abc\" = \"%s\"\n", concat ("a", "b", "c", NULLP));
printf ("\"abcd\" = \"%s\"\n", concat ("ab", "cd", NULLP));
printf ("\"abcde\" = \"%s\"\n", concat ("ab", "c", "de", NULLP));
printf ("\"abcdef\" = \"%s\"\n", concat ("", "a", "", "bcd", "ef", NULLP));
return 0;
}
#endif
#ifndef NEED_strerror
#define NEED_strerror
#endif
#ifndef NEED_basename
#define NEED_basename
#endif
#ifndef NEED_psignal
#define NEED_psignal
#endif
#ifndef NEED_on_exit
#define NEED_on_exit
#endif
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 ;;
*-*-cxux7*) frag=mh-cxux7 ;;
*-*-cygwin32) frag=mh-cygwin32 ;;
*-*-dgux*) frag=mh-sysv ;;
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 5 needs special action, because the usual
# autoconfiguration scheme does not work.
frag=mt-vxworks5
;;
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
# If they didn't specify --enable-shared, don't generate shared libs.
case "${enable_shared}" in
yes) shared=yes ;;
no) shared=no ;;
*) shared=yes ;;
esac
if [ "${shared}" = "yes" ]; then
case "${host}" in
hppa*-*-*) frags="${frags} ../../config/mh-papic" ;;
i[3456]86-*-*) frags="${frags} ../../config/mh-x86pic" ;;
*-*-*) frags="${frags} ../../config/mh-${host_cpu}pic" ;;
esac
fi
echo "# Warning: this fragment is automatically generated" > temp-frag
for frag in ${frags}; do
frag=${srcdir}/${xsrcdir}config/$frag
if [ -f ${frag} ]; then
echo "Appending ${frag} to xhost-mkfrag"
echo "# Following fragment copied from ${frag}" >> temp-frag
cat ${frag} >> temp-frag
fi
done
frag=xhost-mkfrag
${config_shell} ${moveifchange} temp-frag xhost-mkfrag
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
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