Imported from ../bash-2.0.tar.gz.

This commit is contained in:
Jari Aalto
2009-09-12 16:46:49 +00:00
parent 726f63884d
commit ccc6cda312
502 changed files with 91975 additions and 69110 deletions
-22
View File
@@ -1,22 +0,0 @@
if _mkfifo cannot be found, add "-DMKFIFO_MISSING" to SYSDEP_CFLAGS in
your machine's entry in machines.h.
If bash compiles, but hangs when executing a non-builtin, there is a
problem with the defines in your /usr/include/sys/wait.h. If you
don't have one, there is a problem in our defines. At any rate,
perhaps you have a partially POSIX system, instead of a fully
operational one. Try defining _POSIX_SOURCE just before the inclusion
of <sys/wait.h> in jobs.h, and then undefining it immediately after
the inclusion.
Finding out if your system has something (like setpgid, for example)
You can always do "nm -o /lib/*.a | grep setpgid". If an entry for
the function appears, you have it, and you might have to link with
that library by adding "#defined REQUIRED_LIBRARIES -lfoo" to the
entry in machines.h.
If you seem to be going around in circles, and they are related to
job control and posixness, try #undef HAVE_UNISTD_H in the entry for
your machine in machines.h. This can work by keeping unistd.h from
defining _POSIX_VERSION, which in turn prevents bash from assuming
full Posix semantics.
+3 -6
View File
@@ -3,19 +3,16 @@
#
# link name link target
#
lib/readline/doc/texindex.c ../../doc-support/texindex.c
#
lib/readline/tilde.c ../tilde/tilde.c
lib/readline/tilde.h ../tilde/tilde.h
lib/readline/posixdir.h ../posixheaders/posixdir.h
lib/readline/posixstat.h ../posixheaders/posixstat.h
lib/readline/ansi_stdlib.h ../posixheaders/ansi_stdlib.h
lib/readline/memalloc.h ../posixheaders/memalloc.h
lib/readline/xmalloc.c ../malloc/xmalloc.c
#
lib/tilde/memalloc.h ../posixheaders/memalloc.h
#
lib/doc-support/getopt.h ../../builtins/getopt.h
#lib/tilde/memalloc.h ../posixheaders/memalloc.h
#
posixdir.h lib/posixheaders/posixdir.h
posixstat.h lib/posixheaders/posixstat.h
ansi_stdlib.h lib/posixheaders/ansi_stdlib.h
stdc.h lib/posixheaders/stdc.h
+61 -25
View File
@@ -1,26 +1,39 @@
#!/bin/sh -
#
# bashbug - create a bug report and mail it to bug-bash@prep.ai.mit.edu
# bashbug - create a bug report and mail it to the bug address
#
# The bug address depends on the release status of the shell. Versions
# with status `alpha' or `beta' mail bug reports to chet@po.cwru.edu.
# Other versions send mail to bug-bash@prep.ai.mit.edu.
#
# configuration section:
# these variables are filled in by the make target in cpp-Makefile
#
MACHINE="@MACHINE@"
OS="@OS@"
CC="@CC@"
CFLAGS="@CFLAGS@"
RELEASE="@RELEASE@"
PATCHLEVEL="@PATCHLEVEL@"
MACHINE="!MACHINE!"
OS="!OS!"
CC="!CC!"
CFLAGS="!CFLAGS!"
RELEASE="!RELEASE!"
PATCHLEVEL="!PATCHLEVEL!"
RELSTATUS="!RELSTATUS!"
MACHTYPE="!MACHTYPE!"
PATH=/bin:/usr/bin:usr/local/bin:$PATH
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH
TEMP=/tmp/bashbug.$$
BUGADDR=${1-bug-bash@prep.ai.mit.edu}
case "$RELSTATUS" in
alpha*|beta*) BUGBASH=chet@po.cwru.edu ;;
*) BUGBASH=bug-bash@prep.ai.mit.edu ;;
esac
BUGADDR=${1-$BUGBASH}
: ${EDITOR=emacs}
: ${USER=${LOGNAME-`whoami`}}
trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
trap 'rm -f $TEMP $TEMP.x' 0
@@ -48,37 +61,60 @@ OS: $OS
Compiler: $CC
Compilation CFLAGS: $CFLAGS
uname output: $UN
Machine Type: $MACHTYPE
Bash Version: $RELEASE
Patch Level: $PATCHLEVEL
Release Status: $RELSTATUS
Description:
[Detailed description of the problem, suggestion, or complaint.]
[Detailed description of the problem, suggestion, or complaint.]
Repeat-By:
[Describe the sequence of events that causes the problem
to occur.]
[Describe the sequence of events that causes the problem
to occur.]
Fix:
[Description of how to fix the problem. If you don't know a
fix for the problem, don't include this section.]
[Description of how to fix the problem. If you don't know a
fix for the problem, don't include this section.]
EOF
chmod u+w $TEMP
cp $TEMP $TEMP.x
if $EDITOR $TEMP
then
if cmp -s $TEMP $TEMP.x
then
echo "File not changed, no bug report submitted."
exit
fi
# Figure out how to echo a string without a trailing newline
N=`echo 'hi there\c'`
case "$N" in
*c) n=-n c= ;;
*) n= c='\c' ;;
esac
${RMAIL} $BUGADDR < $TEMP || {
cat $TEMP >> $HOME/dead.bashbug
echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2
}
trap '' 2 # ignore interrupts while in editor
until $EDITOR $TEMP; do
echo "$0: editor \`$EDITOR' exited with nonzero status."
echo "$0: Perhaps it was interrupted."
echo "$0: Type `y' to give up, and lose your bug report;"
echo "$0: type `n' to re-enter the editor."
echo $n "$0: Do you want to give up? $c"
read ans
case "$ans" in
Yy]*) exit 1 ;;
esac
done
trap 'rm -f $TEMP $TEMP.x; exit 1' 2 # restore trap on SIGINT
if cmp -s $TEMP $TEMP.x
then
echo "File not changed, no bug report submitted."
exit
fi
${RMAIL} $BUGADDR < $TEMP || {
cat $TEMP >> $HOME/dead.bashbug
echo "$0: mail failed: report saved in $HOME/dead.bashbug" >&2
}
exit 0
-16
View File
@@ -1,16 +0,0 @@
# This awk script is called from within Makefile to strip multiple blank
# lines from stdin.
BEGIN { newlines = 0 }
{
if (NF == 0)
newlines = 1;
else
{
if (newlines)
{
printf "\n";
newlines = 0;
}
print $0;
}
}
-95
View File
@@ -1,95 +0,0 @@
#! /bin/sh
#
#
src=src
case "$1" in
-s) shift; src=$1; shift ;;
esac
if [ ! -d $1 ]; then
mkdir $1
fi
prog=`basename $0`
echo "${prog}: creating clone of bash source tree (from $src) in $1"
case $src in
/*) abs=yes ;;
esac
d=${PWD-`pwd`}
cd $1 || { echo "$0: cannot cd to $1" ; exit 1; }
d=$d/$1
SUBDIRS="CWRU builtins documentation examples support tests"
LIBDIRS="malloc termcap glob readline tilde malloclib posixheaders doc-support"
CWRUDIRS="misc"
mkdir $SUBDIRS
for i in $SUBDIRS
do
cd $i
case "$abs" in
yes) ln -s $src/$i/* . ;;
*) ln -s ../../$src/$i/* . ;;
esac
echo -n $i..
cd ..
done
cd $d
cd CWRU
for i in $CWRUDIRS
do
rm -f $i
mkdir $i
cd $i
case "$abs" in
yes) ln -s $src/CWRU/$i/* . ;;
*) ln -s ../../../$src/CWRU/$i/* . ;;
esac
echo -n "CWRU/$i.."
cd ..
done
cd $d
if [ ! -d lib ] ; then
mkdir lib
fi
cd lib
mkdir $LIBDIRS
for i in $LIBDIRS
do
cd $i
case "$abs" in
yes) ln -s $src/lib/$i/* . ;;
*) ln -s ../../../$src/lib/$i/* . ;;
esac
echo -n "lib/$i.."
cd ..
done
cd $d
case "$abs" in
yes) ln -s $src/.[a-z]* . ; ln -s $src/* . 2>&1 | grep -v exists ;;
*) ln -s ../$src/.[a-z]* . ; ln -s ../$src/* . 2>&1 | grep -v exists ;;
esac
echo -n src..
SPECIAL="parser-built y.tab.h y.tab.c"
for x in $SPECIAL
do
rm -f $x
cp ../$src/$x .
done
echo special
exit 0
Vendored Executable
+904
View File
@@ -0,0 +1,904 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
#
# This file 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.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# The master version of this file is at the FSF in /home/gd/gnu/lib.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 8/24/94.)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
elif (test -f /usr/5bin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/usr/5bin
fi
UNAME=`(uname) 2>/dev/null` || UNAME=unknown # SunOS
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown # sun4m
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown # 4.1.2
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown # SunOS
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # 13
RELEASE=`expr "$UNAME_RELEASE" : '[^0-9]*\([0-9]*\)'` # 4
case "$RELEASE" in
"") RELEASE=0 ;;
*) RELEASE=`expr "$RELEASE" + 0` ;;
esac
REL_LEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.\([0-9]*\)'` # 1
REL_SUBLEVEL=`expr "$UNAME_RELEASE" : '[^0-9]*[0-9]*.[0-9]*.\([0-9]*\)'` # 2
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
# Some versions of i386 SVR4.2 make `uname' equivalent to `uname -n', which
# is contrary to all other versions of uname
if [ -n "$UNAME" ] && [ "$UNAME_S" != "$UNAME" ] && [ "$UNAME_S" = UNIX_SV ]; then
UNAME=UNIX_SV
fi
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:V*:*)
# After 1.2, OSF1 uses "V1.3" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
exit 0 ;;
alpha:OSF1:*:*)
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
i[3456]86:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
alpha:NetBSD:*:*)
echo alpha-dec-netbsd${UNAME_RELEASE}
exit 0 ;;
sparc:NetBSD:*:*)
echo sparc-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:NetBSD:*:*)
echo m68k-sun-netbsd${UNAME_RELEASE}
exit 0 ;;
atari*:NetBSD:*:*)
echo m68k-atari-netbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:NetBSD:*:*)
echo m68k-apple-netbsd${UNAME_RELEASE}
exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
amiga:NetBSD:*:*)
echo m68k-cbm-netbsd${UNAME_RELEASE}
exit 0 ;;
vax:NetBSD:*:*)
echo vax-dec-netbsd${UNAME_RELEASE}
exit 0 ;;
i[3456]86:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
alpha:OpenBSD:*:*)
echo alpha-dec-openbsd${UNAME_RELEASE}
exit 0 ;;
sparc:OpenBSD:*:*)
echo sparc-sun-openbsd${UNAME_RELEASE}
exit 0 ;;
sun3*:OpenBSD:*:*)
echo m68k-sun-openbsd${UNAME_RELEASE}
exit 0 ;;
atari*:OpenBSD:*:*)
echo m68k-atari-openbsd${UNAME_RELEASE}
exit 0 ;;
mac68k:OpenBSD:*:*)
echo m68k-apple-openbsd${UNAME_RELEASE}
exit 0 ;;
hp3[0-9][05]:OpenBSD:*:*)
echo m68k-hp-openbsd${UNAME_RELEASE}
exit 0 ;;
amiga:OpenBSD:*:*)
echo m68k-cbm-openbsd${UNAME_RELEASE}
exit 0 ;;
vax:OpenBSD:*:*)
echo vax-dec-openbsd${UNAME_RELEASE}
exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
mac68k:machten:*:*)
echo mac68k-apple-machten${UNAME_RELEASE}
exit 0 ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit 0 ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit 0 ;;
Amiga*:UNIX_System_V:4.*:*)
echo m68k-cbm-sysv${UNAME_RELEASE}
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit 0 ;;
NILE:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
concurrent*:*:*:*)
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo concurrent-concurrent-sysv3
else
echo concurrent-concurrent-bsd
fi
exit 0 ;;
ppc*:SunOS:5.*:*)
echo ppc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
i86pc:SunOS:5.*:*)
echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
sparc:UNIX_SV:4.*:*)
echo sparc-unknown-sysv${UNAME_RELEASE}
exit 0 ;;
mips:UNIX_SV:4.*:*)
echo mips-mips-sysv${UNAME_RELEASE}
exit 0 ;;
mips:OSF*1:*:*)
echo mips-mips-osf1
exit 0 ;;
mips:4.4BSD:*:*)
echo mips-mips-bsd4.4
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
sed 's/^ //' << EOF >dummy.c
int main (argc, argv) int argc; char **argv; {
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
${CC-cc} dummy.c -o dummy \
&& ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
&& rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
MIServer-S:SMP_DC.OSx:*:dcosx)
echo mips-pyramid-sysv4
exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
news*:NEWS*:*:*)
echo mips-sony-newsos${UNAME_RELEASE}
exit 0 ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`uname -p`
if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else echo i586-dg-dgux${UNAME_RELEASE}
fi
exit 0 ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit 0 ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit 0 ;;
i?86:NEXTSTEP:*:*)
echo i386-next-nextstep${RELEASE}
exit 0 ;;
*680?0:NEXTSTEP:*:*)
echo m68k-next-nextstep${RELEASE}
exit 0 ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit 0 ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i?86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
*370:AIX:*:*)
echo ibm370-ibm-aix
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
sed 's/^ //' << EOF >dummy.c
#include <sys/systemcfg.h>
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit 0 ;;
*:AIX:*:4)
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
elif grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
IBM_REV=4.1
elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
IBM_REV=4.1.1
else
IBM_REV=4.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit 0 ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit 0 ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/[3478]??:HP-UX:*:*)
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/7?? | 9000/8?[679] ) HP_ARCH=hppa1.1 ;;
9000/8?? ) HP_ARCH=hppa1.0 ;;
esac
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit 0 ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit 0 ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit 0 ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit 0 ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
CRAY*X-MP:*:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
exit 0 ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE}
exit 0 ;;
CRAY-2:*:*:*)
echo cray2-cray-unicos
exit 0 ;;
F300:UNIX_System_V:*:*)
FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
F301:UNIX_System_V:*:*)
echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
exit 0 ;;
i?86:BSD/386:*:* | *:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
*:FreeBSD:*:*)
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit 0 ;;
*:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
*:OpenBSD:*:*)
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
exit 0 ;;
i*:CYGWIN*:*)
echo i386-pc-cygwin32
exit 0 ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin32
exit 0 ;;
*:GNU:*:*)
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit 0 ;;
*:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us.
ld_help_string=`ld --help 2>&1`
if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then
echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
elif test "${UNAME_MACHINE}" = "alpha" ; then
echo alpha-unknown-linux ; exit 0
elif test "${UNAME_MACHINE}" = "sparc" ; then
echo sparc-unknown-linux ; exit 0
else
# Either a pre-BFD a.out linker (linuxoldld) or one that does not give us
# useful --help. Gcc wants to distinguish between linuxoldld and linuxaout.
test ! -d /usr/lib/ldscripts/. \
&& echo "${UNAME_MACHINE}-unknown-linuxoldld" && exit 0
# Determine whether the default compiler is a.out or elf
cat >dummy.c <<EOF
main(argc, argv)
int argc;
char *argv[];
{
#ifdef __ELF__
printf ("%s-unknown-linux\n", argv[1]);
#else
printf ("%s-unknown-linuxaout\n", argv[1]);
#endif
return 0;
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
fi ;;
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
# are messed up and put the nodename in both sysname and nodename.
i?86:DYNIX/ptx:4*:*)
echo i386-sequent-sysv4
exit 0 ;;
i?86:OSF1:*:*)
echo i386-unknown-osf1
exit 0 ;;
i?86:*:4.*:* | i?86:SYSTEM_V:4.*:* | i[34]86:UNIX_SV:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i?86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-unknown-sysv32
fi
exit 0 ;;
Intel:Mach:3*:*)
echo i386-unknown-mach3
exit 0 ;;
paragon:*:*:*)
echo i860-intel-osf1
exit 0 ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit 0 ;;
ksr1:OSF*1:*:*)
echo ksr1-ksr-osf1
exit 0 ;;
esa:OSF*1:*:* | ESA:OSF*:*:*)
echo esa-ibm-osf1
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
m68*:LynxOS:2.*:*)
echo m68k-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
i?86:LynxOS:2.*:*)
echo i386-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
echo rs6000-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
*:LynxOS:*:*)
echo ${UNAME_MACHINE}-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit 0 ;;
DNP*:DNIX:*:*)
echo m68k-dnix-sysv
exit 0 ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit 0 ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit 0 ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit 0 ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit 0 ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit 0 ;;
R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
exit 0 ;;
*3b2*:*:*:*)
echo we32k-att-sysv3
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
# include <sys/utsname.h>
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include <sys/param.h>
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp9000) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3");
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-unknown-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
#if !defined (ultrix)
printf ("vax-dec-bsd\n"); exit (0);
#else
printf ("vax-dec-ultrix\n"); exit (0);
#endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
#if defined (tahoe)
printf ("tahoe-cci-bsd\n"); exit (0);
#endif
#if defined (nec_ews)
# if defined (SYSTYPE_SYSV)
printf ("ews4800-nec-sysv4\n"); exit 0;
# else
printf ("ews4800-nec-bsd\n"); exit (0);
# endif
#endif
#if defined (sony)
# if defined (SYSTYPE_SYSV)
printf ("mips-sony-sysv4\n"); exit 0;
# else
printf ("mips-sony-bsd\n"); exit (0);
# endif
#endif
#if defined (ardent)
printf ("titan-ardent-bsd\n"); exit (0);
#endif
#if defined (stardent)
printf ("stardent-stardent-sysv\n"); exit (0);
#endif
#if defined (ibm032)
printf ("ibmrt-ibm-bsd4.3\n"); exit (0);
#endif
#if defined (sequent) && defined (i386)
printf ("i386-sequent-bsd\n"); exit (0);
#endif
#if defined (qnx) && defined (i386)
printf ("i386-unknown-qnx\n"); exit (0);
#endif
#if defined (gould)
printf ("gould-gould-bsd\n"); exit (0);
#endif
#if defined (unixpc)
printf ("unixpc-att-sysv\n"); exit (0);
#endif
#if defined (att386)
printf ("i386-att-sysv3\n"); exit (0);
#endif
#if defined (__m88k) && defined (__UMAXV__)
printf ("m88k-encore-sysv3\n"); exit (0);
#endif
#if defined (drs6000)
printf ("drs6000-icl-sysv4.2\n"); exit (0);
#endif
#if defined (clipper)
printf ("clipper-orion-bsd\n"); exit (0);
#endif
#if defined (is68k)
printf ("m68k-isi-bsd\n"); exit (0);
#endif
#if defined (luna88k)
printf ("luna88k-omron-bsd\n"); exit (0);
#endif
#if defined (butterfly) && defined (BFLY1)
printf ("butterfly-bbn-mach\n"); exit (0);
#endif
#if defined (tower32)
printf ("tower32-ncr-sysv4\n"); exit (0);
#endif
#if defined (MagicStation)
printf ("magicstation-unknown-bsd\n"); exit (0);
#endif
#if defined (scs)
printf ("symmetric-scs-bsd4.2\n"); exit (0);
#endif
#if defined (tandem)
printf ("tandem-tandem-sysv\n"); exit (0);
#endif
#if defined (cadmus)
printf ("cadmus-pcs-sysv\n"); exit (0);
#endif
#if defined (masscomp)
printf ("masscomp-masscomp-sysv3\n"); exit (0);
#endif
#if defined (hbullx20)
printf ("hbullx20-bull-sysv3\n"); exit (0);
#endif
exit (1);
}
EOF
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit 0 ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit 0 ;;
c34*)
echo c34-convex-bsd
exit 0 ;;
c38*)
echo c38-convex-bsd
exit 0 ;;
c4*)
echo c4-convex-bsd
exit 0 ;;
esac
fi
case "$UNAME" in
uts) echo uts-amdahl-sysv${UNAME_RELEASE}; exit 0 ;;
esac
if [ -d /usr/amiga ]; then
echo m68k-cbm-sysv${UNAME_RELEASE}; exit 0;
fi
if [ -f /bin/fxc.info ]; then
echo fxc-alliant-concentrix
exit 0
fi
#echo '(Unable to guess system type)' 1>&2
exit 1
Vendored Executable
+903
View File
@@ -0,0 +1,903 @@
#! /bin/sh
# Configuration validation subroutine script, version 1.1.
# Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can.
#
# This file 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.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
if [ x$1 = x ]
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
# First pass through any local machine types.
case $1 in
*local*)
echo $1
exit 0
;;
*)
;;
esac
# Separate what the user gave into CPU-COMPANY and OS (if any).
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
os=
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco5)
os=sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
tahoe | i[3456]86 | i860 | m68k | m68000 | m88k | ns32k | arm \
| arme[lb] | pyramid \
| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
| alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
| powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
| pdp11 | mips64el | mips64orion | mips64orionel \
| sparc)
basic_machine=$basic_machine-unknown
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
| sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
| hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
| c90-* | t90-* \
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* | butterfly-bbn* \
| cadmus-* | ews*-nec | ibmrt-ibm* | masscomp-masscomp \
| tandem-* | symmetric-* | drs6000-icl | *-*ardent | gould-gould \
| concurrent-* | ksr1-* | esa-ibm | fxc-alliant | *370-amdahl \
| *-convex)
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc*)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-cbm
;;
amigados)
basic_machine=m68k-cbm
os=-amigados
;;
amigaunix | amix)
basic_machine=m68k-cbm
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
cray | ymp)
basic_machine=ymp-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
crds | unos)
basic_machine=m68k-crds
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2* | dpx2*-bull)
basic_machine=m68k-bull
os=-sysv3
;;
hbullx20-bull)
basic_machine=m68k-bull
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax | multimax)
basic_machine=ns32k-encore
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
ibm032-*)
basic_machine=ibmrt-ibm
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
os=-mvs
;;
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
i[3456]86v32)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv32
;;
i[3456]86v4*)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv4
;;
i[3456]86v)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-sysv
;;
i[3456]86sol2)
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
os=-solaris2
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
luna88k-omron* | m88k-omron*)
basic_machine=m88k-omron
;;
magicstation*)
basic_machine=magicstation-unknown
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
miniframe)
basic_machine=m68000-convergent
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
next | m*-next )
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
np1)
basic_machine=np1-gould
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5)
basic_machine=i586-intel
;;
pentiumpro | p6)
basic_machine=i686-intel
;;
pentium-* | p5-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
k5)
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
basic_machine=i586-amd
;;
nexen)
# We don't have specific support for Nexgen yet, so just call it a Pentium
basic_machine=i586-nexgen
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=rs6000-ibm
;;
ppc) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
sequent)
basic_machine=i386-sequent
;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
mips)
basic_machine=mips-mips
;;
romp)
basic_machine=romp-ibm
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sparc)
basic_machine=sparc-sun
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
*)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# -solaris* is a basic system type, with this one exception.
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-unixware* | svr4*)
os=-sysv4
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux|'`
;;
# First accept the basic system types.
# The portable systems comes first.
# Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[3456]* \
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
| -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
| -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
| -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -qnx*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-sunos5*)
os=`echo $os | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo $os | sed -e 's|sunos6|solaris3|'`
;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-ctix* | -uts*)
os=-sysv
;;
-ns2 )
os=-nextstep2
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-xenix)
os=-xenix
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
*-acorn)
os=-riscix1.2
;;
arm*-semi)
os=-aout
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
# This also exists in the configure program, but was not the
# default.
# os=-sunos4
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
*-ibm)
os=-aix
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigados
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next )
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-next)
os=-nextstep3
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-lynxos*)
vendor=lynx
;;
-aix*)
vendor=ibm
;;
-hpux*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-vxworks*)
vendor=wrs
;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
echo $basic_machine$os
-51
View File
@@ -1,51 +0,0 @@
#!/bin/sh
# Return a full cpp specification, complete with system dependent flags.
#
# Syntax: cppmagic [ program-to-generate-flags [ guessed-cpp ]]
#
# If only one arg is present it is the name of a program to invoke
# which should generate -Dfoo defines.
#
# If two args are present the second arg is the name of the C
# preprocessor to use.
#
# Invoked with no args, provides a C preprocessor name and
# -traditional flag if that is appropriate.
#
# ../Makefile calls this file thusly: "cppmagic getcppsyms".
#
# Typical output:
#
# /lib/cpp -Dunix -Dm68k
#
Cpp=
if [ "$2" ]; then
Cpp=$2
else
for cpp in /lib/cpp /usr/lib/cpp /usr/ccs/lib/cpp; do
if [ -f $cpp ]; then
Cpp=$cpp
fi
done
if [ "$Cpp" = "" ]; then
Cpp=cpp
fi
fi
TRADITIONAL=
FLAGS=
# First flag might be `-traditional' if this is Gnu Cpp.
unknown_flag=`$Cpp -traditional /dev/null 2>&1 |
egrep 'known|recognized|valid|bad|legal'`
if [ "$unknown_flag" = "" ]; then
TRADITIONAL=-traditional
fi
if [ "$1" ]; then
FLAGS=`$1`
fi
echo $Cpp $TRADITIONAL $FLAGS
+8 -2
View File
@@ -10,8 +10,9 @@ while [ $# -gt 0 ]; do
case "$1" in
-s) shift; SRCDIR=$1 ;;
-u) unfix=yes ;;
-h) hardlinks=yes ;;
-*) echo "$0: $1: bad option" 1>&2
echo "$0: usage: $0 [-u] [-s srcdir] [linkmap]" 1>&2
echo "$0: usage: $0 [-hu] [-s srcdir] [linkmap]" 1>&2
exit 1;;
*) break ;;
esac
@@ -35,11 +36,16 @@ if [ ! -f "$linkfile" ]; then
fi
rm -f /tmp/z
if (ln -s /dev/null /tmp/z) >/dev/null 2>&1; then
# if the user specified hard links, then do that. otherwise, try to use
# symlinks if they're present
if [ -n "$hardlinks" ]; then
LN=ln
elif (ln -s /dev/null /tmp/z) >/dev/null 2>&1; then
LN="ln -s"
else
LN=ln
fi
rm -f /tmp/z
while read name target
do
-428
View File
@@ -1,428 +0,0 @@
/* getcppsyms.c - Find unique compiler symbols. */
/* Copyright (C) 1993 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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.
Bash 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 Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Some cpp's do not define any symbols, but instead let /bin/cc do it
for them. For such machines, running this file may prove useful. It
outputs the list of symbols which /bin/cc or /lib/cpp define and which
we had the foresight to guess at. */
#include <stdio.h>
main ()
{
#if defined (__BSD_4_4__)
printf ("-D__BSD_4_4__");
#endif /* __BSD_4_4__ */
#if defined (CMU)
printf (" -DCMU");
#endif /* CMU */
#if defined (_COFF)
printf (" -D_COFF");
#endif /* _COFF */
#if defined (DGUX)
printf (" -DDGUX");
#endif /* DGUX */
#if defined (GOULD_PN)
printf (" -DGOULD_PN");
#endif /* GOULD_PN */
#if defined (MACH)
printf (" -DMACH");
#endif /* MACH */
#if defined (MIPSEB)
printf (" -DMIPSEB");
#endif /* MIPSEB */
#if defined (MIPSEL)
printf (" -DMIPSEL");
#endif /* MIPSEL */
#if defined (MULTIMAX)
printf (" -DMULTIMAX");
#endif /* MULTIMAX */
#if defined (M_UNIX)
printf (" -DM_UNIX");
#endif /* M_UNIX */
#if defined (M_XENIX)
printf (" -DM_XENIX");
#endif /* M_XENIX */
#if defined (_M_XENIX)
printf (" -D_M_XENIX");
#endif /* _M_XENIX */
#if defined (NeXT)
printf (" -DNeXT");
#endif /* NeXT */
#if defined (__PARAGON__)
printf (" -D__PARAGON__");
#endif /* __PARAGON__ */
#if defined (_PGC_)
printf (" -D_PGC_");
#endif /* _PGC_ */
#if defined (__PGC__)
printf (" -D__PGC__");
#endif /* __PGC__ */
#if defined (RES)
printf (" -DRES");
#endif /* RES */
#if defined (RISC6000)
printf (" -DRISC6000");
#endif /* RISC6000 */
#if defined (RT)
printf (" -DRT");
#endif /* RT */
#if defined (SYSTYPE_BSD)
printf (" -DSYSTYPE_BSD");
#endif /* SYSTYPE_BSD */
#if defined (SYSTYPE_SYSV)
printf (" -DSYSTYPE_SYSV");
#endif /* SYSTYPE_SYSV */
#if defined (Sun386i)
printf (" -DSun386i");
#endif /* Sun386i */
#if defined (Tek4132)
printf (" -DTek4132");
#endif /* Tek4132 */
#if defined (Tek4300)
printf (" -DTek4300");
#endif /* Tek4300 */
#if defined (UMAXV)
printf (" -DUMAXV");
#endif /* UMAXV */
#if defined (USGr4)
printf (" -DUSGr4");
#endif /* USGr4 */
#if defined (USGr4_2)
printf (" -DUSGr4_2");
#endif /* USGr4_2 */
#if defined (__SVR4_2__)
printf (" -D__SVR4_2__");
#endif /* __SVR4_2__ */
#if defined (Xenix286)
printf (" -DXenix286");
#endif /* Xenix286 */
#if defined (_AIX)
printf (" -D_AIX");
#endif /* _AIX */
#if defined (_AIX370)
printf (" -D_AIX370");
#endif /* _AIX370 */
#if defined (_IBMESA)
printf (" -D_IBMESA");
#endif /* _IBMESA */
#if defined (__ibmesa)
printf (" -D__ibmesa");
#endif /* __ibmesa */
#if defined (_U370)
printf (" -D_U370");
#endif /* _U370 */
#if defined (_NLS)
printf (" -D_NLS");
#endif /* _NLS */
#if defined (_CX_UX)
printf (" -D_CX_UX");
#endif /* _CX_UX */
#if defined (_IBMR2)
printf (" -D_IBMR2");
#endif /* _IBMR2 */
#if defined (_M88K)
printf (" -D_M88K");
#endif /* _M88K */
#if defined (_M88KBCS_TARGET)
printf (" -D_M88KBCS_TARGET");
#endif /* _M88KBCS_TARGET */
#if defined (__DGUX__)
printf (" -D__DGUX__");
#endif /* __DGUX__ */
#if defined (__UMAXV__)
printf (" -D__UMAXV__");
#endif /* __UMAXV__ */
#if defined (__m88k)
printf (" -D__m88k");
#endif /* __m88k */
#if defined (__uxpm__)
printf (" -DUSGr4 -Du370 -D__uxpm__");
#endif /* __uxpm__ */
#if defined (__uxps__)
printf (" -D__svr4__ -D__uxps__");
#endif /* __uxps__ */
#if defined (alliant)
printf (" -Dalliant");
#endif /* alliant */
#if defined (alpha)
printf (" -Dalpha");
#endif /* alpha */
#if defined (__alpha)
printf (" -D__alpha");
#endif /* __alpha */
#if defined (aix)
printf (" -Daix");
#endif /* aix */
#if defined (aixpc)
printf (" -Daixpc");
#endif /* aixpc */
#if defined (apollo)
printf (" -Dapollo");
#endif /* apollo */
#if defined (ardent)
printf (" -Dardent");
#endif /* ardent */
#if defined (att386)
printf (" -Datt386");
#endif /* att386 */
#if defined (att3b)
printf (" -Datt3b");
#endif /* att3b */
#if defined (bsd4_2)
printf (" -Dbsd4_2");
#endif /* bsd4_2 */
#if defined (bsd4_3)
printf (" -Dbsd4_3");
#endif /* bsd4_3 */
#if defined (__bsdi__)
printf (" -D__bsdi__");
#endif /* __bsdi__ */
#if defined (bsdi)
printf (" -Dbsdi");
#endif /* bsdi */
#if defined (__386BSD__)
printf (" -D__386BSD__");
#endif /* __386BSD__ */
#if defined (cadmus)
printf (" -Dcadmus");
#endif /* cadmus */
#if defined (clipper)
printf (" -Dclipper");
#endif /* clipper */
#if defined (concurrent)
printf (" -Dconcurrent");
#endif /* concurrent */
#if defined (convex) || defined (__convex__) || defined (__convexc__)
# if !defined (__GNUC__)
printf (" -pcc");
# endif /* !__GNUC__ */
printf (" -Dconvex");
#endif /* convex */
#if defined (dmert)
printf (" -Ddmert");
#endif /* dmert */
#if defined (gcos)
printf (" -Dgcos");
#endif /* gcos */
#if defined (gcx)
printf (" -Dgcx");
#endif /* gcx */
#if defined (gould)
printf (" -Dgould");
#endif /* gould */
#if defined (hbullx20)
printf (" -Dhbullx20");
#endif /* hbullx20 */
#if defined (hcx)
printf (" -Dhcx");
#endif /* hcx */
#if defined (host_mips)
printf (" -Dhost_mips");
#endif /* host_mips */
#if defined (hp9000) || defined (__hp9000)
printf (" -Dhp9000");
#endif /* hp9000 || __hp9000 */
#if defined (hp9000s200) || defined (__hp9000s200)
printf (" -Dhp9000s200");
#endif /* hp9000s200 || __hp9000s200 */
#if defined (hp9000s300) || defined (__hp9000s300)
printf (" -Dhp9000s300");
#endif /* hp9000s300 || __hp9000s300 */
#if defined (hp9000s500) || defined (__hp9000s500)
printf (" -Dhp9000s500");
#endif /* hp9000s500 || __hp9000s500 */
#if defined (hp9000s700) || defined (__hp9000s700)
printf (" -Dhp9000s700");
#endif /* hp9000s700 || __hp9000s700 */
#if defined (hp9000s800) || defined (__hp9000s800)
printf (" -Dhp9000s800");
#endif /* hp9000s800 || __hp9000s800 */
#if defined (hppa) || defined (__hppa)
printf (" -Dhppa");
#endif /* hppa || __hppa */
#if defined (hpux) || defined (__hpux)
printf (" -Dhpux");
#endif /* hpux */
#if defined (__hp_osf)
printf (" -D__hp_osf");
#endif /* __hp_osf */
#if defined (i386)
printf (" -Di386");
#endif /* i386 */
#if defined (__i386__)
printf (" -D__i386__");
#endif
#if defined (__i860)
printf(" -D__i860");
#endif /* __i860 */
#if defined (__i860__)
printf(" -D__i860__");
#endif /* __i860__ */
#if defined (ibm)
printf (" -Dibm");
#endif /* ibm */
#if defined (ibm032)
printf (" -Dibm032");
#endif /* ibm032 */
#if defined (ibmrt)
printf (" -Dibmrt");
#endif /* ibmrt */
#if defined (interdata)
printf (" -Dinterdata");
#endif /* interdata */
#if defined (is68k)
printf (" -Dis68k");
#endif /* is68k */
#if defined (ksr1)
printf (" -Dksr1");
#endif /* ksr1 */
#if defined (__ksr1__)
printf (" -D__ksr1__");
#endif /* __ksr1__ */
#if defined (linux)
printf (" -Dlinux");
#endif /* linux */
#if defined (__linux__)
printf (" -D__linux__");
#endif /* __linux__ */
#if defined (luna88k)
printf (" -Dluna88k");
#endif /* luna88k */
#if defined (m68k)
printf (" -Dm68k");
#endif /* m68k */
#if defined (m88k)
printf (" -Dm88k");
#endif /* m88k */
#if defined (mc68010)
printf (" -Dmc68010");
#endif /* mc68010 */
#if defined (mc68020)
printf (" -Dmc68020");
#endif /* mc68020 */
#if defined (mc68030)
printf (" -Dmc68030");
#endif /* mc68030 */
#if defined (mc68040)
printf (" -Dmc68040");
#endif /* mc68040 */
#if defined (mc68k32)
printf (" -Dmc68k32");
#endif /* mc68k32 */
#if defined (mips)
printf (" -Dmips");
#endif /* mips */
#if defined (n16)
printf (" -Dn16");
#endif /* n16 */
#if defined __nonstopux
printf (" -D__nonstopux");
#endif
#if defined (ns32000)
printf (" -Dns32000");
#endif /* ns32000 */
#if defined (os)
printf (" -Dos");
#endif /* os */
#if defined (osf)
printf (" -Dosf");
#endif /* osf */
#if defined (__osf__)
printf (" -D__osf__");
#endif /* __osf__ */
#if defined (__OSF1__)
printf(" -D__OSF1__");
#endif /* __OSF1__ */
#if defined (pdp11)
printf (" -Dpdp11");
#endif /* pdp11 */
#if defined (plexus)
printf (" -Dplexus")
#endif /* plexus */
#if defined (pyr)
printf (" -Dpyr");
#endif /* pyr */
#if defined (scs)
printf (" -Dscs");
#endif /* scs */
#if defined (sequent)
printf (" -Dsequent");
#endif /* sequent */
#if defined (sgi)
printf (" -Dsgi");
#endif /* sgi */
#if defined (sony)
printf (" -Dsony");
#endif /* sony */
#if defined (sparc)
printf (" -Dsparc");
#endif /* sparc */
#if defined (stardent)
printf (" -Dstardent");
#endif /* stardent */
#if defined (sun)
printf (" -Dsun");
#endif /* sun */
#if defined (sun2)
printf (" -Dsun2");
#endif /* sun2 */
#if defined (sun3)
printf (" -Dsun3");
#endif /* sun3 */
#if defined (sun4)
printf (" -Dsun4");
#endif /* sun4 */
#if defined (__svr4__)
printf (" -D__svr4__");
#endif /* __svr4__ */
#if defined (tower32)
printf (" -Dtower32");
#endif /* tower32 */
#if defined (tss)
printf (" -Dtss");
#endif /* tss */
#if defined (u370)
printf (" -Du370");
#endif /* u370 */
#if defined (u3b)
printf (" -Du3b");
#endif /* u3b */
#if defined (u3b2)
printf (" -Du3b2");
#endif /* u3b2 */
#if defined (u3b20d)
printf (" -Du3b20d");
#endif /* u3b20d */
#if defined (u3b5)
printf (" -Du3b5");
#endif /* u3b5 */
#if defined (ultrix)
printf (" -Dultrix");
#endif /* ultrix */
#if defined (unix)
printf (" -Dunix");
#endif /* unix */
#if defined (vax)
printf (" -Dvax");
#endif /* vax */
printf ("\n");
exit (0);
}
-19
View File
@@ -1,19 +0,0 @@
#! /bin/sh
#
# Search $PATH for a file the same name as $1; return TRUE if found.
#
command=$1
[ -n "$command" ] || exit 1
set `echo $PATH | sed 's/^:/.:/
s/::/:.:/g
s/:$/:./
s/:/ /g'`
while [ $# -ne 0 ] ; do
[ -f $1/$command ] && exit 0 # test -x not universal
shift
done
exit 1
+102
View File
@@ -0,0 +1,102 @@
#! /bin/bash
#
# mkclone - symlink every file appearing in $src/MANIFEST to a corresponding
# file in the target directory ($1). Directories specified in
# MANIFEST are created in the target directory
#
prog=`basename $0`
SRCDIR=src
USAGE="usage: $prog [-m manifest] [-s srcdir] [-v] [-d] [-h] target"
while getopts dhm:s:v opt
do
case "$opt" in
m) MANIFEST=$OPTARG ;;
s) SRCDIR=$OPTARG ;;
v) verbose=y ;;
d) ECHO=echo debug=y ;;
h) hardlinks=y ;;
?) echo $USAGE >&2
exit 2;;
esac
done
: ${MANIFEST:=${SRCDIR}/MANIFEST}
[ -n "$debug" ] && verbose=
shift $(( $OPTIND - 1 ))
if [ $# -lt 1 ]; then
echo $USAGE >&2
exit 2
fi
if [ ! -f $MANIFEST ]; then
echo "$prog: $MANIFEST: no such file or directory" >&2
echo "$prog: must be run with valid -s argument or from source directory" >&2
exit 1
fi
rm -f /tmp/z
# if the user specified hard links, then do that. otherwise, try to use
# symlinks if they're present
if [ -n "$hardlinks" ]; then
LN=ln
elif (ln -s /dev/null /tmp/z) >/dev/null 2>&1; then
LN="ln -s"
else
LN=ln
fi
rm -f /tmp/z
TARGET=$1
if [ ! -d "$TARGET" ]; then
mkdir "$TARGET"
fi
echo "${prog}: creating clone of bash source tree (from $SRCDIR) in $TARGET"
cd "$TARGET" || { echo "${prog}: cannot cd to $TARGET" >&2 ; exit 1; }
while read fname type mode
do
[ -z "$fname" ] && continue
case "$fname" in
\#*) continue ;;
esac
case "$type" in
d) [ -n "$verbose" ] && echo mkdir $fname
$ECHO mkdir $fname ;; # already in $TARGET
f) fn=${fname##*/}
case "$fname" in
*/*) dn=${fname%/*} ;;
*) dn=. ;;
esac
if [ -n "$verbose" ] || [ -n "$debug" ]; then
echo "( cd $dn && $LN $SRCDIR/$fname $fn )"
fi
[ -z "$debug" ] && ( cd $dn && $LN $SRCDIR/$fname $fn )
;;
*) echo "${prog}: ${fname}: unknown file type $type" 1>&2 ;;
esac
done < $MANIFEST
# special
SPECIAL="parser-built y.tab.c y.tab.h"
rm -f $SPECIAL
for sf in $SPECIAL
do
[ -n "$verbose" ] && echo cp -p $SRCDIR/$sf $TARGET
$ECHO cp -p $SRCDIR/$sf $TARGET
done
$ECHO $LN $SRCDIR/.distribution .
$ECHO $LN $SRCDIR/.patchlevel .
exit 0
+11 -8
View File
@@ -8,21 +8,24 @@
for dir
do
[ -d "$dir" ] && continue
test -d "$dir" && continue
tomake=$dir
while [ "$dir" ]; do
while test -n "$dir" ; do
# dir=${dir%/*}
# dir=`expr "$dir" ':' '^\(/.*\)/[^/]*'`
dir=`expr "$dir" ':' '^\(.*\)/[^/]*'`
tomake="$dir $tomake"
# dir=`expr "$dir" ':' '\(/.*\)/[^/]*'`
if dir=`expr "$dir" ':' '\(.*\)/[^/]*'`; then
tomake="$dir $tomake"
else
dir=
fi
done
for d in $tomake
do
[ -d $d ] && continue
echo mkdir $d
mkdir $d
test -d "$d" && continue
echo mkdir "$d"
mkdir "$d"
done
done
-41
View File
@@ -1,41 +0,0 @@
# Yet another script which requires an already built Bash.
#
# This makes links in the current directory to the directory specified as
# the first argument.
#
topdir=$1
if [ ! "$topdir" ]; then
echo "No directory specified. Read the script $0."
exit 1
fi
function clone_files ()
{
local dir=$1;
local files;
files=$(cd $dir; echo *);
if [ ! "$files" ]; then
return 0;
fi
for filename in $files; do
if [ -d $dir/$filename ]; then
# If the file to clone is this directory, then skip it.
if [ $(cd $dir/$filename; pwd) = $(pwd) ]; then
continue;
fi
mkdir $filename;
(cd $filename; clone_files ../$dir/$filename)
else
ln -s $dir/$filename .;
fi
done
rm -f \#* *~ .*~ *.bak .*.bak *.tmp .*.tmp *.o core a.out;
}
clone_files $topdir
-279
View File
@@ -1,279 +0,0 @@
#!/bin/sh
# This script attempts to guess a canonical system name.
# Copyright (C) 1992, 1993 Free Software Foundation, Inc.
#
# This file 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# The plan is that this can be called by configure scripts if you
# don't specify an explicit system type (host/target name).
#
# Only a few systems have been added to this list; please add others
# (but try to keep the structure clean).
#
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
alpha:OSF1:1.*:*)
# 1.2 uses "1.2" for uname -r.
echo alpha-dec-osf${UNAME_RELEASE}
exit 0 ;;
alpha:OSF1:V1.*:*)
# 1.3 uses "V1.3" for uname -r.
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
exit 0 ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit 0;;
sun4*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
sun4*:SunOS:*:*)
echo sparc-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit 0 ;;
mips:*:5*:RISCos)
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit 0 ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit 0 ;;
AViiON:dgux:*:*)
echo m88k-dg-dgux${UNAME_RELEASE}
exit 0 ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit 0 ;;
*:IRIX:*:*)
echo mips-sgi-irix${UNAME_RELEASE}
exit 0 ;;
i[34]86:AIX:*:*)
echo i386-ibm-aix
exit 0 ;;
*:AIX:2:3)
echo rs6000-ibm-aix3.2
exit 0 ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit 0 ;;
*:BOSX:*:*)
echo rs6000-bull-bosx
exit 0 ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit 0 ;;
9000/31?:HP-UX:*:*)
echo m68000-hp-hpux
exit 0 ;;
9000/[34]??:HP-UX:*:*)
echo m68k-hp-hpux
exit 0 ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit 0 ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit 0 ;;
9000/7??:HP-UX:*:* | 9000/8?7:HP-UX:*:* )
echo hppa1.1-hp-hpux
exit 0 ;;
9000/8??:HP-UX:*:*)
echo hppa1.0-hp-hpux
exit 0 ;;
3050*:HI-UX:*:*)
sed 's/^ //' << EOF >dummy.c
#include <unistd.h>
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit 0 ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit 0 ;;
C1*:ConvexOS:*:*)
echo c1-convex-bsd
exit 0 ;;
C2*:ConvexOS:*:*)
echo c2-convex-bsd
exit 0 ;;
CRAY*X-MP:UNICOS:*:*)
echo xmp-cray-unicos
exit 0 ;;
CRAY*Y-MP:UNICOS:*:*)
echo ymp-cray-unicos
exit 0 ;;
CRAY-2:UNICOS:*:*)
echo cray2-cray-unicos
exit 0 ;;
hp3[0-9][05]:NetBSD:*:*)
echo m68k-hp-netbsd${UNAME_RELEASE}
exit 0 ;;
i[34]86:NetBSD:*:*)
echo ${UNAME_MACHINE}-unknown-netbsd${UNAME_RELEASE}
exit 0 ;;
i[34]86:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux
exit 0 ;;
i[34]86:UNIX_SV:4.*:*)
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
else
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
fi
exit 0 ;;
i[34]86:*:3.2:*)
if /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-unknown-sysv3.2
fi
exit 0 ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
M680[234]0:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
3[34]??:*:4.0:*)
uname -p 2>/dev/null | grep 86 >/dev/null \
&& echo i486-ncr-sysv4 && exit 0 ;;
m680[234]0:LynxOS:2.2*:*)
echo m68k-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
i[34]86:LynxOS:2.2*:*)
echo i386-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
TSUNAMI:LynxOS:2.2*:*)
echo sparc-lynx-lynxos${UNAME_RELEASE}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
cat >dummy.c <<EOF
main()
{
#if defined (sony)
#if defined (MIPSEB)
#else
printf("m68k-sony-newsos\n"); exit(0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf("arm-acorn-riscix"); exit (0);
#endif
#if defined(hp300) && !defined(hpux)
printf("m68k-hp-bsd\n"); exit(0);
#endif
#if defined(NeXT)
printf("m68k-next-bsd\n"); exit(0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf("ns32k-encore-sysv\n"); exit(0);
#else
#if defined (CMU)
printf("ns32k-encore-mach\n"); exit(0);
#else
printf("ns32k-encore-bsd\n"); exit(0);
#endif
#endif
#endif
#if defined(__386BSD__) || (defined(__bsdi__) && defined(__i386__))
printf("i386-unknown-bsd\n"); exit(0);
#endif
#if defined(sequent)
#if defined(i386)
printf("i386-sequent-dynix\n"); exit(0);
#endif
#if defined (ns32000)
printf("ns32k-sequent-dynix\n"); exit(0);
#endif
#endif
#if defined(_SEQUENT_)
printf("i386-sequent-ptx\n"); exit(0);
#endif
exit (1);
}
EOF
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
rm -f dummy.c dummy
#echo '(Unable to guess system type)' 1>&2
exit 1
+302
View File
@@ -0,0 +1,302 @@
/* signames.c -- Create and write `signames.h', which contains an array of
signal names. */
/* Copyright (C) 1992 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 1, or (at your option) any later
version.
Bash 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 Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <stdio.h>
#include <sys/types.h>
#include <signal.h>
#if defined (HAVE_STDLIB_H)
# include <stdlib.h>
#else
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
#if !defined (NSIG)
# define NSIG 64
#endif
char *signal_names[2 * NSIG];
char *progname;
void
initialize_signames ()
{
register int i;
for (i = 1; i < sizeof(signal_names)/sizeof(signal_names[0]); i++)
signal_names[i] = (char *)NULL;
/* `signal' 0 is what we do on exit. */
signal_names[0] = "EXIT";
/* Place signal names which can be aliases for more common signal
names first. This allows (for example) SIGEMT to overwrite SIGGRANT. */
#if defined (SIGGRANT) /* HFT monitor mode granted */
signal_names[SIGGRANT] = "SIGGRANT";
#endif
#if defined (SIGRETRACT) /* HFT monitor mode retracted */
signal_names[SIGRETRACT] = "SIGRETRACT";
#endif
#if defined (SIGHUP) /* hangup */
signal_names[SIGHUP] = "SIGHUP";
#endif
#if defined (SIGINT) /* interrupt */
signal_names[SIGINT] = "SIGINT";
#endif
#if defined (SIGQUIT) /* quit */
signal_names[SIGQUIT] = "SIGQUIT";
#endif
#if defined (SIGILL) /* illegal instruction (not reset when caught) */
signal_names[SIGILL] = "SIGILL";
#endif
#if defined (SIGTRAP) /* trace trap (not reset when caught) */
signal_names[SIGTRAP] = "SIGTRAP";
#endif
#if defined (SIGABRT) /* Cause current process to dump core. */
signal_names[SIGABRT] = "SIGABRT";
#endif
#if defined (SIGIOT) /* IOT instruction */
signal_names[SIGIOT] = "SIGIOT";
#endif
#if defined (SIGEMT) /* EMT instruction */
signal_names[SIGEMT] = "SIGEMT";
#endif
#if defined (SIGFPE) /* floating point exception */
signal_names[SIGFPE] = "SIGFPE";
#endif
#if defined (SIGKILL) /* kill (cannot be caught or ignored) */
signal_names[SIGKILL] = "SIGKILL";
#endif
#if defined (SIGBUS) /* bus error */
signal_names[SIGBUS] = "SIGBUS";
#endif
#if defined (SIGSEGV) /* segmentation violation */
signal_names[SIGSEGV] = "SIGSEGV";
#endif
#if defined (SIGSYS) /* bad argument to system call */
signal_names[SIGSYS] = "SIGSYS";
#endif
#if defined (SIGPIPE) /* write on a pipe with no one to read it */
signal_names[SIGPIPE] = "SIGPIPE";
#endif
#if defined (SIGALRM) /* alarm clock */
signal_names[SIGALRM] = "SIGALRM";
#endif
#if defined (SIGTERM) /* software termination signal from kill */
signal_names[SIGTERM] = "SIGTERM";
#endif
#if defined (SIGCLD) /* Like SIGCHLD. */
signal_names[SIGCLD] = "SIGCLD";
#endif
#if defined (SIGPWR) /* Magic thing for some machines. */
signal_names[SIGPWR] = "SIGPWR";
#endif
#if defined (SIGPOLL) /* For keyboard input? */
signal_names[SIGPOLL] = "SIGPOLL";
#endif
#if defined (SIGURG) /* urgent condition on IO channel */
signal_names[SIGURG] = "SIGURG";
#endif
#if defined (SIGSTOP) /* sendable stop signal not from tty */
signal_names[SIGSTOP] = "SIGSTOP";
#endif
#if defined (SIGTSTP) /* stop signal from tty */
signal_names[SIGTSTP] = "SIGTSTP";
#endif
#if defined (SIGCONT) /* continue a stopped process */
signal_names[SIGCONT] = "SIGCONT";
#endif
#if defined (SIGCHLD) /* to parent on child stop or exit */
signal_names[SIGCHLD] = "SIGCHLD";
#endif
#if defined (SIGTTIN) /* to readers pgrp upon background tty read */
signal_names[SIGTTIN] = "SIGTTIN";
#endif
#if defined (SIGTTOU) /* like TTIN for output if (tp->t_local&LTOSTOP) */
signal_names[SIGTTOU] = "SIGTTOU";
#endif
#if defined (SIGIO) /* input/output possible signal */
signal_names[SIGIO] = "SIGIO";
#endif
#if defined (SIGXCPU) /* exceeded CPU time limit */
signal_names[SIGXCPU] = "SIGXCPU";
#endif
#if defined (SIGXFSZ) /* exceeded file size limit */
signal_names[SIGXFSZ] = "SIGXFSZ";
#endif
#if defined (SIGVTALRM) /* virtual time alarm */
signal_names[SIGVTALRM] = "SIGVTALRM";
#endif
#if defined (SIGPROF) /* profiling time alarm */
signal_names[SIGPROF] = "SIGPROF";
#endif
#if defined (SIGWINCH) /* window changed */
signal_names[SIGWINCH] = "SIGWINCH";
#endif
#if defined (SIGLOST) /* resource lost (eg, record-lock lost) */
signal_names[SIGLOST] = "SIGLOST";
#endif
#if defined (SIGUSR1) /* user defined signal 1 */
signal_names[SIGUSR1] = "SIGUSR1";
#endif
#if defined (SIGUSR2) /* user defined signal 2 */
signal_names[SIGUSR2] = "SIGUSR2";
#endif
#if defined (SIGMSG) /* HFT input data pending */
signal_names[SIGMSG] = "SIGMSG";
#endif
#if defined (SIGPWR) /* power failure imminent (save your data) */
signal_names[SIGPWR] = "SIGPWR";
#endif
#if defined (SIGDANGER) /* system crash imminent */
signal_names[SIGDANGER] = "SIGDANGER";
#endif
#if defined (SIGMIGRATE) /* migrate process to another CPU */
signal_names[SIGMIGRATE] = "SIGMIGRATE";
#endif
#if defined (SIGPRE) /* programming error */
signal_names[SIGPRE] = "SIGPRE";
#endif
#if defined (SIGSOUND) /* HFT sound sequence has completed */
signal_names[SIGSOUND] = "SIGSOUND";
#endif
#if defined (SIGWINDOW)
signal_names[SIGWINDOW] = "SIGWINDOW";
#endif
#if defined (SIGDIL)
signal_names[SIGDIL] = "SIGDIL";
#endif
#if defined (SIGSAK) /* Secure Attention Key */
signal_names[SIGSAK] = "SIGSAK";
#endif
for (i = 0; i < NSIG; i++)
if (signal_names[i] == (char *)NULL)
{
signal_names[i] = (char *)malloc (18);
sprintf (signal_names[i], "SIGJUNK(%d)", i);
}
signal_names[NSIG] = "DEBUG";
}
void
write_signames (stream)
FILE *stream;
{
register int i;
fprintf (stream, "/* This file was automatically created by %s.\n",
progname);
fprintf (stream, " Do not edit. Edit support/mksignames.c instead. */\n\n");
fprintf (stream,
"/* A translation list so we can be polite to our users. */\n");
fprintf (stream, "char *signal_names[NSIG + 2] = {\n");
for (i = 0; i <= NSIG; i++)
fprintf (stream, " \"%s\",\n", signal_names[i]);
fprintf (stream, " (char *)0x0,\n");
fprintf (stream, "};\n");
}
int
main (argc, argv)
int argc;
char **argv;
{
char *stream_name;
FILE *stream;
progname = argv[0];
if (argc == 1)
{
stream_name = "stdout";
stream = stdout;
}
else if (argc == 2)
{
stream_name = argv[1];
stream = fopen (stream_name, "w");
}
else
{
fprintf (stderr, "Usage: %s [output-file]\n", progname);
exit (1);
}
if (!stream)
{
fprintf (stderr, "%s: %s: cannot open for writing\n",
progname, stream_name);
exit (2);
}
initialize_signames ();
write_signames (stream);
exit (0);
}
-497
View File
@@ -1,497 +0,0 @@
#!/bin/sh
#
# This file creates a file called "sysdefs.h" which contains CPP defines
# helping to describe the operating system features. We just take guesses
# by looking at random files.
# Removes any inherited definitions.
SYSDEF=
MAKE_ANSI=
while [ $# -gt 0 ]; do
case "$1" in
-s) shift; srcdir=$1; shift ;;
-i) shift; incdir="$1"; shift ;;
-A) shift; MAKE_ANSI=true ;;
*) break ;;
esac
done
if [ -n "$1" ]; then
sysdefs=$1
else
sysdefs=./sysdefs.h
fi
if [ -z "$srcdir" ]; then
srcdir=.
fi
rm -f $sysdefs
echo "/* sysdefs.h -- #defines for your system created by $0." >>$sysdefs
echo " Do NOT EDIT this file, since any changes will disappear." >>$sysdefs
echo " Instead, edit $0, or config.h, or machines.h. */" >>$sysdefs
echo "" >>$sysdefs
echo "#if !defined (_SYSDEFS_H_)" >>$sysdefs
echo "# define _SYSDEFS_H_" >>$sysdefs
# was if [ -f /usr/bin/uname ] || [ -f /bin/uname ]
if ( uname >/dev/null 2>&1 ) 2>/dev/null
then
UNAME=`uname`
UNAME_R=`uname -r 2>/dev/null`
UNAME_M=`uname -m 2>/dev/null`
UNAME_V=`uname -v 2>/dev/null`
UNAME_S=`uname -s 2>/dev/null`
RELEASE=`expr "$UNAME_R" : '[^0-9]*\([0-9]*\)'`
case "$RELEASE" in
"") RELEASE=0 ;;
*) RELEASE=`expr "$RELEASE" + 0` ;;
esac
LEVEL=`expr "$UNAME_R" : '[^0-9]*[0-9]*.\([0-9]*\)'`
fi
# check for versions of SunOS and BSD/OS
case "${UNAME}${RELEASE}" in
SunOS4*) SYSDEF=SunOS4 ;;
SunOS5*) SYSDEF=SunOS5 ;;
BSD/OS2*) SYSDEF=BSDI2 ;;
esac
# Test for NeXT
if [ -d /NextLibrary ]; then
MAKE_ANSI=true
fi
# Intel Paragon
case "$UNAME_M" in
paragon) MAKE_ANSI=true ;;
esac
# Test for shared libraries (this is pretty sVr4ish).
if [ -f /usr/ccs/lib/libc.so ]; then
SYSDEF=USGr4
fi
# Some versions of i386 SVR4.2 make `uname' equivalent to `uname -n', which
# is contrary to all other versions of uname
if [ -n "$UNAME" ] && [ "$UNAME_S" != "$UNAME" ] && [ "$UNAME_S" = UNIX_SV ]; then
UNAME=UNIX_SV
fi
# (sound of teeth grinding...)
if [ "$UNAME" = "UNIX_SV" ] && [ "$UNAME_R" != "4.2" ] && [ "$RELEASE"."$LEVEL" = "4.2" ]; then
UNAME_R="4.2"
fi
# another check for SVR4 on 386 or 486 machines
case "${UNAME_M}:${UNAME}:${UNAME_R}" in
i[34]86:UNIX_SV:4.*) SYSDEF=USGr4 ;;
esac
# A check for Mips RISCos
case "$UNAME_V" in
UMIPS|RISCos) SYSDEF=RISCos_${RELEASE}_${LEVEL} ;;
esac
# A check for Amdahl UTS
case "$UNAME" in
uts) SYSDEF=UTS ;;
esac
# Look for an error message when trying to exec bison. If we find
# what we're looking for, then we don't have it. If we get something
# else (like an error message about no grammar file), then we have
# it.
HAVE_BISON=
if ( cd /tmp ; bison /dev/null 2>&1 >/dev/null | grep 'no input grammar' >/dev/null 2>&1 ) 2>/dev/null
then
HAVE_BISON=yes
fi
# Try to locate ranlib. I think this is a bad idea.
if sh ${srcdir}/support/inpath ranlib; then
RANLIB_LOCATION=ranlib
elif [ -f /usr/bin/ranlib ]; then
RANLIB_LOCATION=/usr/bin/ranlib;
elif [ -f /bin/ranlib ]; then
RANLIB_LOCATION=/bin/ranlib;
elif [ -f /usr/local/bin/ranlib ]; then
RANLIB_LOCATION=/usr/local/bin/ranlib;
elif [ -f /usr/local/gnubin/ranlib ]; then
RANLIB_LOCATION=/usr/local/gnubin/ranlib;
else
RANLIB_LOCATION=: # XXX
fi
if [ -n "${RANLIB_LOCATION}" ]; then
echo "" >>$sysdefs
echo "#if !defined (RANLIB_LOCATION)" >>$sysdefs
echo "# define RANLIB_LOCATION ${RANLIB_LOCATION}" >>$sysdefs
echo "#endif /* RANLIB_LOCATION */" >>$sysdefs
fi
#
# Is this a Xenix system?
#
if [ -f /xenix ]; then
SYSDEF="Xenix"
case "`/bin/uname -p`" in
*286) SYSDEF="Xenix286" ;;
*386) SYSDEF="Xenix386" ;;
esac
# make sure that `i386' is defined for machines.h
if [ "$SYSDEF" = "Xenix386" ]; then
echo "" >>$sysdefs
echo "#if !defined (i386)" >>$sysdefs
echo "# define i386" >>$sysdefs
echo "#endif /* !i386 */" >>$sysdefs
fi
# Pass the release number of the OS through to the machine descriptions
# in machines.h.
if [ -f /etc/perms/soft ]; then
rel=`grep rel= /etc/perms/soft`
case "$rel" in
*2.2.*) XREL=XENIX_22 ;;
*2.3.*) XREL=XENIX_23 ;;
*3.2.*) XREL=XENIX_32 ;;
*) XREL= ;;
esac
if [ "$XREL" ]; then
echo "" >>$sysdefs
echo "#if !defined ($XREL)" >>$sysdefs
echo "# define $XREL" >>$sysdefs
echo "#endif /* !$XREL */" >>$sysdefs
fi
fi
fi
#
# Is this some kind of Sys Vish system?
#
if [ -f /unix ]; then
if [ -d /generic ]; then # This is an AIX system.
SYSDEF="aixpc"
MAKE_ANSI=true
elif [ -d /etc/conf/kconfig.d ] && [ -f /usr/include/sys/limits.h ]; then
SYSDEF="isc386" # This is a 386 running ISC?
ISCREL="ISC_$RELEASE"
echo "#if !defined ($ISCREL)" >>$sysdefs
echo "# define $ISCREL" >>$sysdefs
echo "#endif /* $ISCREL */" >>$sysdefs
elif [ -f /etc/xlc.cfg ]; then
if fgrep _IBMR2 /etc/xlc.cfg >/dev/null 2>&1; then
SYSDEF=RISC6000
MAKE_ANSI=true
fi
elif [ -f /bin/4d -a -f /bin/uname ]; then
case "$UNAME_R" in
3.*) SYSDEF="Irix3" ;;
4.*) SYSDEF="Irix4" ;;
5.*) SYSDEF="Irix5" ;;
6.*) SYSDEF="Irix6" ;;
*) SYSDEF="Irix3" ;;
esac
elif [ -d /usr/amiga ]; then
SYSDEF="amiga" # An Amiga running V.4.
elif [ -f /bin/fxc.info ]; then
SYSDEF="alliant"
fi
fi
# Is this a Unicos system?
if [ -f /unicos ]; then
MAKE_ANSI=true
UnicosMachine=
# Test for the variaous flavors of Cray machines.
if [ -x /bin/cray1 ] && /bin/cray1 2>/dev/null; then
UnicosMachine=Cray1
fi
if [ -x /bin/cray2 ] && /bin/cray2 2>/dev/null; then
UnicosMachine=Cray2
fi
if [ -x /bin/crayxmp ] && /bin/crayxmp 2>/dev/null; then
UnicosMachine=CrayXMP
fi
if [ -x /bin/crayymp ] && /bin/crayymp 2>/dev/null; then
UnicosMachine=CrayYMP
fi
if [ "$UnicosMachine" ]; then
echo "#if !defined ($UnicosMachine)" >>$sysdefs
echo "# define $UnicosMachine" >>$sysdefs
echo "#endif /* !$UnicosMachine */" >>$sysdefs
fi
fi
# Is this (and what kind of) a HPUX system?
if [ -f /hp-ux ]; then
SYSDEF=HPUX_${RELEASE}
if [ "$RELEASE" = 6 -a "$LEVEL" -lt 2 ]; then
SYSDEF=HPUX_USG
fi
fi
if [ "$SYSDEF" = "" ]; then
case "$UNAME_M" in
ESA) SYSDEF=AIXESA ;;
XD88*) SYSDEF=XD88 ;;
M88100) SYSDEF=M88100 ;; # Motorola Delta 88K
esac
fi
if [ "$SYSDEF" = "" ]; then
case "$UNAME_V" in
V[0-9]*L[0-9]*) SYSDEF=UXP ;; # Fujitsu DS/90
esac
fi
# What release of SCO Unix is this?
if [ "$SYSDEF" = "" -a -f /bin/uname ]; then
case `/bin/uname -X 2>/dev/null | grep '^Release' 2>/dev/null` in
*3.2v4.*) SYSDEF=SCOv4 ;;
*3.2v5.*) SYSDEF=SCOv5 ;;
*) SYSDEF=SCO ;;
esac
fi
#
# Default to cadmus for unknown SysVish systems
#
if [ -f /unix ] && [ "$SYSDEF" = "" ]; then
SYSDEF="cadmus"
fi
if [ "$SYSDEF" != "" ]; then
echo "" >>$sysdefs
echo "#if !defined ($SYSDEF)" >>$sysdefs
echo "# define $SYSDEF" >>$sysdefs
echo "#endif /* $SYSDEF */" >>$sysdefs
fi
# Now look for certain include files in a list of directories
# Poor substitute for autoconf
# Add any other directories where include files are found to this list or
# create another case
if [ -n "$incdir" ]; then
dirlist="$incdir"
else
case "$SYSDEF" in
RISCos*) dirlist="/bsd43/usr/include";;
*) dirlist="/usr/include /usr/include/bsd /usr/include/ansi" ;;
esac
fi
# Code fragment to be executed to find a particular include file. Make sure
# to set `file' to the pathname of the file you want, relative to /usr/include,
# before calling `eval $findf'.
findf="
found='';
for d in \$dirlist;
do
if test -f \$d/\$file;
then
found=yes;
break;
fi;
done
"
found=
file=sys/stream.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_SYS_STREAM_H)" >>$sysdefs
echo "# define HAVE_SYS_STREAM_H" >>$sysdefs
echo "#endif /* HAVE_SYS_STREAM_H */" >>$sysdefs
fi
found=
file=sys/ptem.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_SYS_PTEM_H)" >>$sysdefs
echo "# define HAVE_SYS_PTEM_H" >>$sysdefs
echo "#endif /* HAVE_SYS_PTEM_H */" >>$sysdefs
fi
file=sys/pte.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_SYS_PTE_H)" >>$sysdefs
echo "# define HAVE_SYS_PTE_H" >>$sysdefs
echo "#endif /* HAVE_SYS_PTE_H */" >>$sysdefs
fi
file=sys/wait.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_WAIT_H)" >>$sysdefs
echo "# define HAVE_WAIT_H" >>$sysdefs
echo "#endif /* HAVE_WAIT_H */" >>$sysdefs
fi
file=sys/resource.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_RESOURCE)" >>$sysdefs
echo "# define HAVE_RESOURCE" >>$sysdefs
echo "#endif /* HAVE_RESOURCE */" >>$sysdefs
fi
file=sys/param.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_SYS_PARAM)" >>$sysdefs
echo "# define HAVE_SYS_PARAM" >>$sysdefs
echo "#endif /* HAVE_SYS_PARAM */" >>$sysdefs
fi
file=unistd.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_UNISTD_H)" >>$sysdefs
echo "# define HAVE_UNISTD_H" >>$sysdefs
echo "#endif /* HAVE_UNISTD_H */" >>$sysdefs
fi
file=stdlib.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_STDLIB_H)" >>$sysdefs
echo "# define HAVE_STDLIB_H" >>$sysdefs
echo "#endif /* HAVE_STDLIB_H */" >>$sysdefs
fi
file=limits.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_LIMITS_H)" >>$sysdefs
echo "# define HAVE_LIMITS_H" >>$sysdefs
echo "#endif /* HAVE_LIMITS_H */" >>$sysdefs
fi
file=alloca.h
eval $findf
if [ -f /usr/include/alloca.h ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_ALLOCA_H)" >>$sysdefs
echo "# define HAVE_ALLOCA_H" >>$sysdefs
echo "#endif /* HAVE_ALLOCA_H */" >>$sysdefs
fi
file=dirent.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_DIRENT_H)" >>$sysdefs
echo "# define HAVE_DIRENT_H" >>$sysdefs
echo "#endif /* HAVE_DIRENT_H */" >>$sysdefs
fi
file=string.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_STRING_H)" >>$sysdefs
echo "# define HAVE_STRING_H" >>$sysdefs
echo "#endif /* HAVE_STRING_H */" >>$sysdefs
fi
file=varargs.h
eval $findf
if [ -n "$found" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_VARARGS_H)" >>$sysdefs
echo "# define HAVE_VARARGS_H" >>$sysdefs
echo "#endif /* HAVE_VARARGS_H */" >>$sysdefs
fi
# Does the system have a /dev/fd directory?
if [ -d /dev/fd ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_DEV_FD)" >>$sysdefs
echo "# define HAVE_DEV_FD" >>$sysdefs
echo "#endif /* HAVE_DEV_FD */" >>$sysdefs
fi
# Is this SVR4.2? It's subtly different from USGr4
if [ "$UNAME" = "UNIX_SV" ] && [ "$UNAME_R" = "4.2" ]; then
echo "" >>$sysdefs
echo "#if !defined (USGr4_2)" >>$sysdefs
echo "# define USGr4_2" >>$sysdefs
echo "#endif /* USGr4_2 */" >>$sysdefs
fi
# Is this AIX PS/2 1.3? Yuck.
if [ "$UNAME" = "AIX" ] && [ "$UNAME_V" = "1" ] && [ "$RELEASE" = "3" ]; then
case "$UNAME_M" in
i386|i486)
echo "" >>$sysdefs
echo "#if !defined (AIX_13)" >>$sysdefs
echo "# define AIX_13" >>$sysdefs
echo "#endif /* AIX_13 */" >>$sysdefs
;;
esac
fi
if [ -n "$HAVE_BISON" ]; then
echo "" >>$sysdefs
echo "#if !defined (HAVE_BISON)" >>$sysdefs
echo "# define HAVE_BISON" >>$sysdefs
echo "#endif /* HAVE_BISON */" >>$sysdefs
fi
# Functions to test for a la autoconf
# getwd
# getcwd
# strchr
# strcasecmp
# getgroups
# setlinebuf
# strerror
# vfprintf
# bcopy
# getdtablesize
# setdtablesize
# alloca
# gethostname
# memmove (missing)
# mkfifo (missing)
#
# Other things to test
# opendir robustness
# dup2 working
# void sighandler
# sys_siglist[]
# uid_t, gid_t
# have_getpw_decls
# reversed setvbuf args
# int getgroups
# If this system's cpp might not like `/**/#' in cpp-Makefile, make an
# alternate ansi-style cpp-Makefile.
if [ -n "$MAKE_ANSI" ]; then
grep -v '/\*\*/' ${srcdir}/cpp-Makefile >ansi-Makefile
fi
# These should be the last 2 lines in this file!
echo "" >>$sysdefs
echo "#endif /* _SYSDEFS_H_ */" >>$sysdefs
+305
View File
@@ -0,0 +1,305 @@
/* Simple program to make new version numbers for the shell.
Big deal, but it was getting out of hand to do everything
in the makefile. */
/* Copyright (C) 1989 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
Bash 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 1, or (at your option) any later
version.
Bash 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 Bash; see the file COPYING. If not, write to the Free Software
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "config.h"
#include <sys/types.h>
#include "posixstat.h"
#include <stdio.h>
#include "bashansi.h"
char *progname;
char *dir;
char *status;
FILE *must_open ();
main (argc, argv)
int argc;
char **argv;
{
FILE *file;
float distver = 0.0;
int buildver = 0, patchlevel = 0;
int dist = 0, build = 0, patch = 0;
int dist_inc = 0, build_inc = 0, patch_inc = 0;
int dot_dist_needs_making = 0;
int arg_index = 1;
struct stat sb;
progname = argv[0];
status = dir = (char *)0;
while (arg_index < argc && argv[arg_index][0] == '-')
{
if (strcmp (argv[arg_index], "-dist") == 0)
{
dist++;
dist_inc++;
}
else if (strcmp (argv[arg_index], "-build") == 0)
{
build++;
build_inc++;
}
else if (strcmp (argv[arg_index], "-patch") == 0)
{
patch++;
patch_inc++;
}
else if (strcmp (argv[arg_index], "-dir") == 0)
{
dir = argv[++arg_index];
if (dir == 0)
{
fprintf (stderr, "%s: `-dir' requires an argument\n", progname);
exit (1);
}
if (stat (dir, &sb) < 0)
{
fprintf (stderr, "%s: cannot stat %s\n", progname, dir);
exit (1);
}
if ((sb.st_mode & S_IFMT) != S_IFDIR)
{
fprintf (stderr, "%s: not a directory\n", progname);
exit (1);
}
}
else if (strcmp (argv[arg_index], "-status") == 0)
{
status = argv[++arg_index];
if (status == 0)
{
fprintf (stderr, "%s: `-status' requires an argument\n", progname);
exit (1);
}
}
else
{
fprintf (stderr, "%s: unknown option: %s\n", progname, argv[arg_index]);
fprintf (stderr, "usage: %s [-dist|-patch|-build] [-dir directory]\n", progname);
exit (1);
}
arg_index++;
}
if (get_float_from_file (".distribution", &distver, 1) == 0)
dot_dist_needs_making++;
if (get_int_from_file (".patchlevel", &patchlevel, 1) == 0)
{
patchlevel = 0;
patch_inc = 0;
}
if (get_int_from_file (".build", &buildver, 0) == 0)
buildver = 0;
/* Setting distribution version. */
if (dist && arg_index < argc)
if (sscanf (argv[arg_index], "%f", &distver) != 1)
{
fprintf (stderr, "%s: Bad input `%s'. Expected float value for -dist.\n",
progname, argv[arg_index]);
exit (1);
}
else
{
arg_index++;
dist_inc = 0;
}
/* Setting patchlevel via argument. */
if (patch && arg_index < argc)
if (sscanf (argv[arg_index], "%d", &patchlevel) != 1)
{
fprintf (stderr, "%s: Bad input `%s'. Expected int value for -patch.\n",
progname, argv[arg_index]);
exit (1);
}
else
{
arg_index++;
patch_inc = 0;
}
if (build && arg_index < argc)
if (sscanf (argv[arg_index], "%d", &buildver) != 1)
{
fprintf (stderr, "%s: Bad input `%s'. Expected int value for -build.\n",
progname, argv[arg_index]);
exit (1);
}
else
{
arg_index++;
build_inc = 0;
}
if (dot_dist_needs_making && !distver)
{
fprintf (stderr, "%s: There is no `.distribution' file to infer from.\n", progname);
exit (1);
}
if (dist_inc)
distver = distver + 0.01;
if (patch_inc)
patchlevel++;
if (build_inc)
buildver++;
file = must_open ("newversion.h", "w");
/* Output the leading comment. */
fprintf (file,
"/* Version control for the shell. This file gets changed when you say\n\
`make newversion' to the Makefile. It is created by mkversion. */\n");
fprintf (file, "\n/* The distribution version number of this shell. */\n");
fprintf (file, "#define DISTVERSION \"%.2f\"\n", distver);
fprintf (file, "\n/* The patch level of this version of the shell. */\n");
fprintf (file, "#define PATCHLEVEL %d\n", patchlevel);
fprintf (file, "\n/* The last built version of this shell. */\n");
fprintf (file, "#define BUILDVERSION %d\n", buildver);
if (status)
{
fprintf (file, "\n/* The release status of this shell. */\n");
fprintf (file, "#define RELSTATUS \"%s\"\n", status);
}
fprintf (file, "\n/* A version string for use by sccs and the what command. */\n\n");
if (status)
fprintf (file, "#define SCCSVERSION \"@(#)Bash version %.2f.%d(%d) %s GNU\"\n\n",
distver, patchlevel, buildver, status);
else
fprintf (file, "#define SCCSVERSION \"@(#)Bash version %.2f.%d(%d) GNU\"\n\n",
distver, patchlevel, buildver);
fclose (file);
file = must_open (".build", "w");
fprintf (file, "%d\n", buildver);
fclose (file);
/* Making a new distribution. */
if (dist)
{
file = must_open (".distribution", "w");
fprintf (file, "%.2f\n", distver);
fclose (file);
}
/* Releasing a new patch level. */
if (patch)
{
file = must_open (".patchlevel", "w");
fprintf (file, "%d\n", patchlevel);
fclose (file);
}
exit (0);
}
char *
makename (fn, from_srcdir)
char *fn;
{
char *ret;
int dlen;
dlen = (from_srcdir && dir) ? strlen (dir) + 1 : 0;
ret = (char *)malloc (dlen + strlen (fn) + 1);
if (ret == 0)
{
fprintf (stderr, "%s: malloc failed\n", progname);
exit (1);
}
if (from_srcdir && dir)
sprintf (ret, "%s/%s", dir, fn);
else
(void)strcpy (ret, fn);
return ret;
}
get_float_from_file (filename, var, from_srcdir)
char *filename;
float *var;
int from_srcdir;
{
FILE *stream;
int result;
char *name;
name = makename (filename, from_srcdir);
stream = fopen (name, "r");
free (name);
if (stream == (FILE *)NULL)
return (0);
result = fscanf (stream, "%f\n", var);
fclose (stream);
return (result == 1);
}
get_int_from_file (filename, var, from_srcdir)
char *filename;
int *var, from_srcdir;
{
FILE *stream;
int result;
char *name;
name = makename (filename, from_srcdir);
stream = fopen (name, "r");
free (name);
if (stream == (FILE *)NULL)
return (0);
result = fscanf (stream, "%d\n", var);
fclose (stream);
return (result == 1);
}
FILE *
must_open (name, mode)
char *name, *mode;
{
FILE *temp = fopen (name, mode);
if (!temp)
{
fprintf (stderr, "%s: Cannot open `%s' for mode `%s'.\n",
progname, name, mode);
fprintf
(stderr,
"Perhaps you don't have %s permission to the file or directory.\n",
(strcmp (mode, "w") == 0) ? "write" : "read");
exit (3);
}
return (temp);
}
+1
View File
@@ -29,4 +29,5 @@ char *str;
} else
putchar(*s);
}
return(0);
}
-13
View File
@@ -1,13 +0,0 @@
#! /bin/sh
#
# srcdir - print out the absolute pathname of the top of the bash source
# tree. Used for getting the right value to makes in subdirectories
#
case "$1" in
'.'|./) pwd ;;
./*|..*) echo `pwd`/"$1" ;;
*) echo "$1" ;;
esac
exit 0
+111 -99
View File
@@ -1,8 +1,10 @@
#!/bin/sh
# texi2dvi -- smartly produce DVI files from texinfo sources
#
# Copyright (C) 1992, 1993 Free Software Foundation.
#
#! /bin/sh
# texi2dvi --- smartly produce DVI files from texinfo sources
# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
# $Id: texi2dvi,v 0.5 1995/06/20 02:21:36 friedman Exp $
# 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)
@@ -15,110 +17,122 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, you can either send email to this
# program's author (see below) or write to:
#
# Free Software Foundation, Inc.
# 675 Mass Ave.
# Cambridge, MA 02139, USA.
#
# program's maintainer or write to: The Free Software Foundation,
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
# Commentary:
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Please send bug reports, etc. to bug-texinfo@prep.ai.mit.edu
# If possible, please send a copy of the output of the script called with
# the `--debug' option when making a bug report.
#
# Version 0.4
# Last modified 26-Mar-93
#
# the `--debug' option when making a bug report.
# Please note that in the interest of general portability, some common
# bourne shell constructs were avoided because they weren't guaranteed to
# be available in some earlier implementations. I've tried to make this as
# portable as possible.
# In the interest of general portability, some common bourne shell
# constructs were avoided because they weren't guaranteed to be available
# in some earlier implementations. I've tried to make this program as
# portable as possible. Welcome to unix, where the lowest common
# denominator is rapidly diminishing.
#
# Among the more interesting lossages I noticed with some bourne shells
# are:
# 1) Some don't have an `unset' builtin
# 2) In some implementations the `shift' builtin can't take a
# numerical argument.
# * No shell functions.
# * No `unset' builtin.
# * `shift' cannot take a numeric argument, and signals an error if
# there are no arguments to shift.
progname=`basename $0`
# Code:
usage="Usage: ${progname} {-D} {-h} [file1] {file2} {...}
{--debug} {--help}
# Name by which this script was invoked.
progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
Options in braces are optional. Those in brackets are required.
# This string is expanded by rcs automatically when this file is checked out.
rcs_revision='$Revision: 0.5 $'
version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later.
bq='`'
eq="'"
usage="Usage: $progname {options} [file1] {file2 {...}}
(version $version)
Options are:
-D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
-h, --help You're looking at it.
-v, --version Print version number.
Arguments in brackets are required. Those in braces are optional.
"
if test $# -eq 0 ; then
echo "${usage}" 1>&2;
exit 1
fi
backup_extension=".bak"
texindex="texindex"
tex="tex"
bq="\`" # To prevent hairy quoting and escaping later.
eq="'"
# Initialize variables.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
# Some of these, like TEX and TEXINDEX, may be inherited from the environment
backup_extension=.bak
debug=
orig_pwd="`pwd`"
if test "z${TEXINDEX}" != "z" ; then
texindex="${TEXINDEX}"
fi
if test "z${TEX}" != "z" ; then
tex="${TEX}"
fi
verbose=
texindex="${TEXINDEX-texindex}"
tex="${TEX-tex}"
# Save this so we can construct a new TEXINPUTS path for each file to be
# processed.
TEXINPUTS_orig="${TEXINPUTS}"
TEXINPUTS_orig="$TEXINPUTS"
export TEXINPUTS
# Parse command line options
# "unset" option variables to make sure they weren't accidentally
# exported
debug=""
# If you add new commands be sure to change the wildcards below to make
# sure they are unambiguous (i.e. only match one possible long option)
# Be sure to show at least one instance of the full long option name to
# document what the long option is canonically called.
while test $# -gt 0 ; do
case z$1 in
z-D | z--debug | z--d* )
debug="t"
shift
;;
z-h | z--help | z--h* )
echo "${usage}" 1>&2
exit 1
;;
z-- )
shift
break
;;
z-* )
echo "${progname}: ${bq}${1}${eq} is not a valid option." 1>&2
echo "" 1>&2
echo "${usage}" 1>&2
exit 1
;;
* )
break
;;
# Parse command line arguments.
# Make sure that all wildcarded options are long enough to be unambiguous.
# It's a good idea to document the full long option name in each case.
# Long options which take arguments will need a `*' appended to the
# canonical name to match the value appended after the `=' character.
while : ; do
case $# in 0) break ;; esac
case "$1" in
-D | --debug | --d* )
debug=t
shift
;;
-h | --help | --h* )
echo "$usage" 1>&2
exit 0
;;
-v | --version | --v* )
echo "texi2dvi version $version" 1>&2
exit 0
;;
-- ) # Stop option processing
shift
break
;;
-* )
case "$1" in
--*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
* ) arg="$1" ;;
esac
exec 1>&2
echo "$progname: unknown or ambiguous option $bq$arg$eq"
echo "$progname: Use $bq--help$eq for a list of options."
exit 1
;;
* )
break
;;
esac
done
# See if there are any command line args left (which will be interpreted as
# filename arguments)
if test $# -eq 0 ; then
echo "${progname}: at least one file name is required as an argument." 1>&2
echo "" 1>&2
echo "${usage}" 1>&2
exit 1
fi
case $# in
0 )
exec 1>&2
echo "$progname: at least one file name is required as an argument."
echo "$progname: Use $bq--help$eq for a description of command syntax."
exit 2
;;
esac
test "z${debug}" = "zt" && set -x
case "$debug" in t ) set -x ;; esac
# Texify files
for command_line_filename in ${1+"$@"} ; do
@@ -137,7 +151,7 @@ for command_line_filename in ${1+"$@"} ; do
# Source file might @include additional texinfo sources. Put `.' and
# directory where source file(s) reside in TEXINPUTS before anything
# else. `.' goes first to ensure that any old .aux, .cps, etc. files in
# ${directory} don't get used in preference to fresher files in `.'.
# ${directory} don't get used in preference to fresher files in `.'.
TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
# "Unset" variables that might have values from previous iterations and
@@ -150,7 +164,7 @@ for command_line_filename in ${1+"$@"} ; do
# able to find the right index files and so forth.
if test ! -r "${command_line_filename}" ; then
echo "${progname}: ${command_line_filename}: No such file or permission denied." 1>&2
continue;
continue;
fi
# Find all files having root filename with a two-letter extension,
@@ -159,7 +173,7 @@ for command_line_filename in ${1+"$@"} ; do
# that too.
possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
for this_file in ${possible_index_files} ; do
# If file is empty, forget it.
# If file is empty, forget it.
if test ! -s "${this_file}" ; then
continue;
fi
@@ -177,7 +191,7 @@ for command_line_filename in ${1+"$@"} ; do
s/^[ ]*//;s/[ ]*$//;'`"
# Now save copies of original index files so we have some means of
# comparison later.
# comparison later.
for index_file_to_save in ${orig_index_files} ; do
cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
done
@@ -213,20 +227,20 @@ for command_line_filename in ${1+"$@"} ; do
s/^[ ]*//;s/[ ]*$//;'`"
# If old and new list don't at least have the same file list, then one
# file or another has definitely changed.
# file or another has definitely changed.
if test "${orig_index_files}" != "${new_index_files}" ; then
index_files_changed_p=t
else
# File list is the same. We must compare each file until we find a
# difference.
# difference.
index_files_changed_p=""
for this_file in ${new_index_files} ; do
# cmp -s will return nonzero exit status if files differ.
# cmp -s will return nonzero exit status if files differ.
cmp -s "${this_file}" "${this_file}${backup_extension}"
if test $? -ne 0 ; then
# We only need to keep comparing until we find *one* that
# differs, because we'll have to run texindex & tex no
# matter what.
# matter what.
index_files_changed_p=t
break
fi
@@ -238,7 +252,7 @@ for command_line_filename in ${1+"$@"} ; do
if test "${index_files_changed_p}" ; then
retval=0
if test "${new_index_files_sans_aux}" ; then
${texindex} ${new_index_files_sans_aux}
${texindex} ${new_index_files_sans_aux}
retval=$?
fi
if test ${retval} -eq 0 ; then
@@ -248,7 +262,7 @@ for command_line_filename in ${1+"$@"} ; do
fi
# Generate list of files to delete, then call rm once with the entire
# list. This is significantly faster than multiple executions of rm.
# list. This is significantly faster than multiple executions of rm.
file_list=""
for file in ${orig_index_files} ; do
file_list="${file_list} ${file}${backup_extension}"
@@ -258,6 +272,4 @@ for command_line_filename in ${1+"$@"} ; do
fi
done
#
# eof
#
# texi2dvi ends here
+2021
View File
File diff suppressed because it is too large Load Diff
+20
View File
@@ -0,0 +1,20 @@
/* zecho - bare-bones echo */
#include <stdio.h>
int
main(argc, argv)
int argc;
char **argv;
{
argv++;
while (*argv) {
(void)printf("%s", *argv);
if (*++argv)
putchar(' ');
}
putchar('\n');
exit(0);
}