1
0
Fork 0

Adding upstream version 5.2.37.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
This commit is contained in:
Daniel Baumann 2025-06-21 06:49:21 +02:00
parent cf91100bce
commit fa1b3d3922
Signed by: daniel.baumann
GPG key ID: BCC918A2ABD66424
1435 changed files with 757174 additions and 0 deletions

90
support/Makefile.in Normal file
View file

@ -0,0 +1,90 @@
#
# Simple Makefile for the support programs.
#
# documentation support: man2html
# testing support: printenv recho zecho xcase
#
# bashbug.sh lives here (created by configure), but bashbug is created by
# the top-level makefile
#
# Currently only man2html is built
#
# Copyright (C) 1998-2021 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
# Boilerplate
#
topdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
BUILD_DIR = @BUILD_DIR@
RM = rm -f
SHELL = @MAKE_SHELL@
CC = @CC@
CC_FOR_BUILD = @CC_FOR_BUILD@
EXEEXT = @EXEEXT@
#
# Compiler options:
#
PROFILE_FLAGS = @PROFILE_FLAGS@
CFLAGS = @CFLAGS@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
BASE_CFLAGS_FOR_BUILD = @BASE_CFLAGS_FOR_BUILD@
CPPFLAGS = @CPPFLAGS@
CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
STYLE_CFLAGS = @STYLE_CFLAGS@
DEFS = @DEFS@
LOCAL_DEFS = @LOCAL_DEFS@
LIBS = @LIBS@
LIBS_FOR_BUILD = ${LIBS} # XXX
LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS)
LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD)
INCLUDES = -I${BUILD_DIR} -I${topdir}
BASE_CCFLAGS = ${PROFILE_FLAGS} $(DEFS) $(LOCAL_DEFS) $(SYSTEM_FLAGS) \
${INCLUDES} $(STYLE_CFLAGS) $(LOCAL_CFLAGS)
CCFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS)
CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
SRC1 = man2html.c
OBJ1 = man2html.o
.c.o:
$(RM) $@
$(CC_FOR_BUILD) -c $(CCFLAGS_FOR_BUILD) $<
all: man2html$(EXEEXT)
man2html$(EXEEXT): $(OBJ1)
$(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(OBJ1) -o $@ ${LIBS_FOR_BUILD}
clean:
$(RM) man2html$(EXEEXT) $(OBJ1)
distclean maintainer-clean mostlyclean: clean
$(RM) bash.pc bashbug.sh
man2html.o: man2html.c

18
support/SYMLINKS Normal file
View file

@ -0,0 +1,18 @@
#
# symlink map for bash source tree
#
# link name link target
#
lib/readline/tilde.c ../tilde/tilde.c
lib/readline/tilde.h ../tilde/tilde.h
#
lib/readline/ansi_stdlib.h ../../include/ansi_stdlib.h
lib/readline/posixdir.h ../../include/posixdir.h
lib/readline/posixjmp.h ../../include/posixjmp.h
lib/readline/posixselect.h ../../include/posixselect.h
lib/readline/posixstat.h ../../include/posixstat.h
#lib/readline/rlstdc.h ../../include/stdc.h
#lib/readline/xmalloc.c ../malloc/xmalloc.c
#
#lib/tilde/memalloc.h ../../include/memalloc.h
#

28
support/bash.pc.in Normal file
View file

@ -0,0 +1,28 @@
# bash.pc.in
prefix=@prefix@
exec_prefix=@exec_prefix@
includedir=@includedir@
libdir=@libdir@
loadablesdir=@loadablesdir@
headersdir=${includedir}/@PACKAGE_NAME@
LOCAL_CFLAGS = @LOCAL_CFLAGS@
LOCAL_DEFS = @LOCAL_DEFS@
CCFLAGS = ${LOCAL_DEFS} ${LOCAL_CFLAGS}
CC = @CC@
SHOBJ_CC = @SHOBJ_CC@
SHOBJ_CFLAGS = @SHOBJ_CFLAGS@
SHOBJ_LD = @SHOBJ_LD@
SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@
SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@
SHOBJ_LIBS = @SHOBJ_LIBS@
Name: @PACKAGE_NAME@
Description: Bash headers for bash loadable builtins
Version: @PACKAGE_VERSION@
Url: @PACKAGE_URL@
Libs: ${SHOBJ_LIBS}
Cflags: ${SHOBJ_CFLAGS} ${CCFLAGS} -I${headersdir} -I${headersdir}/builtins -I${headersdir}/include

60
support/bash.xbm Normal file
View file

@ -0,0 +1,60 @@
From: Simon Marshall <sm2@sequent.cc.hull.ac.uk>
Date: Wed, 8 May 91 17:15:58 +0100
To: bug-bash@ai.mit.edu
Subject: X bitmap for bash
Since other GNU software comes with its very own X bitmap, I
thought it was about time bash had one too & here it is! To use,
stick the stuff after my signature in a file <path>/bash.xbm. If
using a twm window manager, insert the lines:
IconDirectory "<path>"
Icons {
"<xterm title>" "bash.xbm"
}
in your ~/.twmrc file. The <xterm title> can be a prefix, so if
you have titles "bash@machine", the prefix "bash" will do. I'm not
familiar enough with other window managers, but they should be
similar.
If you like it, you're welcome to it...
Simon.
Copyright (C) 1992 Simon Marshall
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define bash_width 64
#define bash_height 48
static char bash_bits[] = {
0x00, 0x60, 0x06, 0x30, 0x04, 0x00, 0x00, 0x00, 0x60, 0x98, 0x01, 0x40,
0x03, 0x00, 0x00, 0x00, 0x19, 0x00, 0xa0, 0x80, 0x80, 0xff, 0x00, 0x00,
0x06, 0x00, 0x1c, 0x03, 0xe1, 0x5f, 0x03, 0x00, 0x02, 0x00, 0x22, 0x0c,
0x5d, 0xf4, 0x0e, 0x00, 0xe1, 0x02, 0x09, 0x19, 0x17, 0x91, 0x3d, 0x00,
0xf8, 0x87, 0x40, 0x90, 0x88, 0x88, 0x6e, 0x00, 0x8e, 0x9b, 0x04, 0x62,
0x22, 0x22, 0xd6, 0x00, 0x02, 0xee, 0x4c, 0x68, 0x44, 0x44, 0x6c, 0x01,
0x02, 0xf8, 0xa1, 0x4a, 0x11, 0x11, 0xb1, 0x02, 0x05, 0xa0, 0x22, 0xe0,
0x88, 0x88, 0x68, 0x03, 0x42, 0x50, 0x5d, 0x40, 0x22, 0x22, 0xa2, 0x05,
0x11, 0x81, 0x00, 0x44, 0x44, 0x44, 0x44, 0x07, 0x02, 0x20, 0x84, 0x60,
0x11, 0x11, 0xd1, 0x0d, 0x02, 0x0a, 0x02, 0xc0, 0x88, 0x88, 0x48, 0x0b,
0x44, 0x40, 0x00, 0x42, 0x22, 0x22, 0xa2, 0x1d, 0x24, 0x08, 0x02, 0x64,
0x44, 0x44, 0xc4, 0x1a, 0x08, 0x00, 0x20, 0x20, 0x11, 0x11, 0x91, 0x15,
0x88, 0x00, 0x00, 0xe1, 0xff, 0xff, 0xff, 0x1a, 0x10, 0x08, 0x22, 0x10,
0x00, 0x00, 0xc0, 0x15, 0x31, 0x40, 0x00, 0xf2, 0x03, 0xc0, 0xc1, 0x1a,
0x41, 0x24, 0x48, 0x6c, 0x06, 0x80, 0xc1, 0x15, 0x82, 0x01, 0x00, 0x66,
0x06, 0x80, 0xc1, 0x1a, 0x04, 0x22, 0x12, 0x67, 0x06, 0x80, 0xc1, 0x15,
0x0a, 0x04, 0xe0, 0x66, 0xe6, 0xb8, 0xc7, 0x1a, 0x09, 0xf0, 0x17, 0xee,
0xb3, 0xa5, 0xcf, 0x15, 0x30, 0x00, 0x00, 0x6e, 0x86, 0x8d, 0xcd, 0x1a,
0x00, 0x01, 0x80, 0x67, 0xe6, 0xbd, 0xcd, 0x15, 0x00, 0x46, 0x40, 0x66,
0xb6, 0xb1, 0xcd, 0x1a, 0x00, 0x38, 0x3c, 0x66, 0xb6, 0xa5, 0xcd, 0x15,
0x00, 0x00, 0x02, 0xf6, 0xe3, 0x9d, 0xdd, 0x1a, 0x00, 0x04, 0x60, 0x06,
0x00, 0x00, 0xc0, 0x15, 0x00, 0x04, 0x40, 0xfe, 0xff, 0xff, 0xff, 0x1a,
0x00, 0x02, 0x80, 0x12, 0x11, 0x11, 0x91, 0x15, 0x00, 0x00, 0x00, 0x8a,
0x88, 0x88, 0x88, 0x1a, 0x00, 0x00, 0x00, 0x22, 0x22, 0x22, 0xa2, 0x15,
0x00, 0x00, 0x00, 0x46, 0x44, 0x44, 0xc4, 0x9a, 0x00, 0x00, 0x00, 0x12,
0x11, 0x11, 0x91, 0xb5, 0x00, 0x00, 0x10, 0x8a, 0x88, 0x88, 0x88, 0xba,
0x00, 0x00, 0x10, 0x22, 0x22, 0x22, 0xa2, 0xd5, 0x00, 0x00, 0x30, 0xc6,
0x44, 0x44, 0xcc, 0xdf, 0x00, 0x20, 0x39, 0x96, 0x15, 0x51, 0x99, 0xf5,
0x80, 0xf2, 0x56, 0x8b, 0x9a, 0xea, 0x9b, 0xff, 0xc1, 0xad, 0x5e, 0xaf,
0xbb, 0xfa, 0xba, 0xdf, 0x22, 0x9b, 0xae, 0xd7, 0x54, 0x5d, 0xd7, 0xbf,
0x3b, 0x32, 0xce, 0xff, 0xff, 0xff, 0xff, 0xab, 0xae, 0x2b, 0x59, 0xaf,
0xd4, 0xae, 0x2e, 0xc3, 0xdd, 0x43, 0xa9, 0xd1, 0xba, 0xae, 0x2c, 0xcd};

274
support/bashbug.sh Normal file
View file

@ -0,0 +1,274 @@
#!/bin/sh -
#
# 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 `devel', `alpha', `beta', or `rc' mail bug reports to
# chet@cwru.edu and, optionally, to bash-testers@cwru.edu.
# Other versions send mail to bug-bash@gnu.org.
#
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
# configuration section:
# these variables are filled in by the make target in Makefile
#
MACHINE="!MACHINE!"
OS="!OS!"
CC="!CC!"
CFLAGS="!CFLAGS!"
RELEASE="!RELEASE!"
PATCHLEVEL="!PATCHLEVEL!"
RELSTATUS="!RELSTATUS!"
MACHTYPE="!MACHTYPE!"
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH
# Check if TMPDIR is set, default to /tmp
: ${TMPDIR:=/tmp}
#Securely create a temporary directory for the temporary files
TEMPDIR=$TMPDIR/bbug.$$
(umask 077 && mkdir "$TEMPDIR") || {
echo "$0: could not create temporary directory" >&2
exit 1
}
TEMPFILE1=$TEMPDIR/bbug1
TEMPFILE2=$TEMPDIR/bbug2
USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]"
VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}"
do_help= do_version=
while [ $# -gt 0 ]; do
case "$1" in
--help) shift ; do_help=y ;;
--version) shift ; do_version=y ;;
--) shift ; break ;;
-*) echo "bashbug: ${1}: invalid option" >&2
echo "$USAGE" >&2
exit 2 ;;
*) break ;;
esac
done
if [ -n "$do_version" ]; then
echo "${VERSTR}"
exit 0
fi
if [ -n "$do_help" ]; then
echo "${VERSTR}"
echo "${USAGE}"
echo
cat << HERE_EOF
Bashbug is used to send mail to the Bash maintainers
for when Bash doesn't behave like you'd like, or expect.
Bashbug will start up your editor (as defined by the shell's
EDITOR environment variable) with a preformatted bug report
template for you to fill in. The report will be mailed to the
bug-bash mailing list by default. See the manual for details.
If you invoke bashbug by accident, just quit your editor without
saving any changes to the template, and no bug report will be sent.
HERE_EOF
exit 0
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
BASHTESTERS="bash-testers@cwru.edu"
case "$RELSTATUS" in
alpha*|beta*|devel*|rc*) BUGBASH=chet@cwru.edu ;;
*) BUGBASH=bug-bash@gnu.org ;;
esac
case "$RELSTATUS" in
alpha*|beta*|devel*|rc*)
echo "$0: This is a testing release. Would you like your bug report"
echo "$0: to be sent to the bash-testers mailing list?"
echo $n "$0: Send to bash-testers? $c"
read ans
case "$ans" in
y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;;
esac ;;
esac
BUGADDR="${1-$BUGBASH}"
if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then
if [ -x /usr/bin/editor ]; then
DEFEDITOR=editor
elif [ -x /usr/local/bin/ce ]; then
DEFEDITOR=ce
elif [ -x /usr/local/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/contrib/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/bin/xemacs ]; then
DEFEDITOR=xemacs
elif [ -x /usr/bin/nano ]; then
DEFEDITOR=nano
elif [ -x /usr/contrib/bin/jove ]; then
DEFEDITOR=jove
elif [ -x /usr/local/bin/jove ]; then
DEFEDITOR=jove
elif [ -x /usr/bin/vi ]; then
DEFEDITOR=vi
else
echo "$0: No default editor found: attempting to use vi" >&2
DEFEDITOR=vi
fi
fi
: ${EDITOR=$DEFEDITOR}
: ${USER=${LOGNAME-`whoami`}}
trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15
trap 'rm -rf "$TEMPDIR"' 0
UN=
if (uname) >/dev/null 2>&1; then
UN=`uname -a`
fi
if [ -f /usr/lib/sendmail ] ; then
RMAIL="/usr/lib/sendmail"
SMARGS="-i -t"
elif [ -f /usr/sbin/sendmail ] ; then
RMAIL="/usr/sbin/sendmail"
SMARGS="-i -t"
else
RMAIL=rmail
SMARGS="$BUGADDR"
fi
INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]'
cat > "$TEMPFILE1" <<EOF
From: ${USER}
To: ${BUGADDR}
Subject: ${INITIAL_SUBJECT}
Configuration Information [Automatically generated, do not change]:
Machine: $MACHINE
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.]
Repeat-By:
[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.]
EOF
cp "$TEMPFILE1" "$TEMPFILE2"
chmod u+w "$TEMPFILE1"
trap '' 2 # ignore interrupts while in editor
edstat=1
while [ $edstat -ne 0 ]; do
$EDITOR "$TEMPFILE1"
edstat=$?
if [ $edstat -ne 0 ]; then
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
continue
fi
# find the subject from the temp file and see if it's been changed
CURR_SUB=`grep '^Subject: ' "$TEMPFILE1" | sed 's|^Subject:[ ]*||' | sed 1q`
case "$CURR_SUB" in
"${INITIAL_SUBJECT}")
echo
echo "$0: You have not changed the subject from the default."
echo "$0: Please use a more descriptive subject header."
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
echo "$0: The editor will be restarted in five seconds."
sleep 5
edstat=1
;;
esac
done
trap 'rm -rf "$TEMPDIR"; exit 1' 2 # restore trap on SIGINT
if cmp -s "$TEMPFILE1" "$TEMPFILE2"
then
echo "File not changed, no bug report submitted."
exit
fi
echo $n "Send bug report to ${BUGADDR}? [y/n] $c"
read ans
case "$ans" in
[Nn]*) exit 0 ;;
esac
${RMAIL} $SMARGS < "$TEMPFILE1" || {
cat "$TEMPFILE1" >> $HOME/dead.bashbug
echo "$0: mail to ${BUGADDR} failed: report saved in $HOME/dead.bashbug" >&2
echo "$0: please send it manually to ${BUGADDR}" >&2
}
exit 0

278
support/bashbug.sh.in Normal file
View file

@ -0,0 +1,278 @@
#!/bin/sh -
#
# 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 `devel', `alpha', `beta', or `rc' mail bug reports to
# chet.ramey@case.edu and, optionally, to bash-testers@cwru.edu.
# Other versions send mail to bug-bash@gnu.org.
#
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
# configuration section:
# these variables are filled in by the make target in Makefile
#
MACHINE="@host_cpu@"
OS="@host_os@"
CC="@CC@"
CFLAGS="@CFLAGS@"
RELEASE="@BASHVERS@"
PATCHLEVEL="!PATCHLEVEL!"
RELSTATUS="@RELSTATUS@"
MACHTYPE="@host@"
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH
# Check if TMPDIR is set, default to /tmp
: ${TMPDIR:=/tmp}
#Securely create a temporary directory for the temporary files
TEMPDIR=$TMPDIR/bbug.$$
(umask 077 && mkdir "$TEMPDIR") || {
echo "$0: could not create temporary directory" >&2
exit 1
}
TEMPFILE1=$TEMPDIR/bbug1
TEMPFILE2=$TEMPDIR/bbug2
USAGE="Usage: $0 [--help] [--version] [bug-report-email-address]"
VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}"
do_help= do_version=
while [ $# -gt 0 ]; do
case "$1" in
--help) shift ; do_help=y ;;
--version) shift ; do_version=y ;;
--) shift ; break ;;
-*) echo "bashbug: ${1}: invalid option" >&2
echo "$USAGE" >&2
exit 2 ;;
*) break ;;
esac
done
if [ -n "$do_version" ]; then
echo "${VERSTR}"
exit 0
fi
if [ -n "$do_help" ]; then
echo "${VERSTR}"
echo "${USAGE}"
echo
cat << HERE_EOF
Bashbug is used to send mail to the Bash maintainers
for when Bash doesn't behave like you'd like, or expect.
Bashbug will start up your editor (as defined by the shell's
EDITOR environment variable) with a preformatted bug report
template for you to fill in. The report will be mailed to the
bug-bash mailing list by default. See the manual for details.
If you invoke bashbug by accident, just quit your editor without
saving any changes to the template, and no bug report will be sent.
HERE_EOF
exit 0
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
BASHTESTERS="bash-testers@cwru.edu"
case "$RELSTATUS" in
alpha*|beta*|devel*|rc*) BUGBASH=chet.ramey@case.edu ;;
*) BUGBASH=bug-bash@gnu.org ;;
esac
case "$RELSTATUS" in
alpha*|beta*|devel*|rc*)
echo "$0: This is a testing release. Would you like your bug report"
echo "$0: to be sent to the bash-testers mailing list?"
echo $n "$0: Send to bash-testers? $c"
read ans
case "$ans" in
y*|Y*) BUGBASH="${BUGBASH},${BASHTESTERS}" ;;
esac ;;
esac
BUGADDR="${1-$BUGBASH}"
if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then
if [ -x /usr/bin/editor ]; then
DEFEDITOR=editor
elif [ -x /usr/local/bin/ce ]; then
DEFEDITOR=ce
elif [ -x /usr/local/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/contrib/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/bin/emacs ]; then
DEFEDITOR=emacs
elif [ -x /usr/bin/xemacs ]; then
DEFEDITOR=xemacs
elif [ -x /usr/bin/vim; then
DEFEDITOR=vim
elif [ -x /usr/bin/gvim; then
DEFEDITOR=gvim
elif [ -x /usr/bin/nano ]; then
DEFEDITOR=nano
elif [ -x /usr/contrib/bin/jove ]; then
DEFEDITOR=jove
elif [ -x /usr/local/bin/jove ]; then
DEFEDITOR=jove
elif [ -x /usr/bin/vi ]; then
DEFEDITOR=vi
else
echo "$0: No default editor found: attempting to use vi" >&2
DEFEDITOR=vi
fi
fi
: ${EDITOR=$DEFEDITOR}
: ${USER=${LOGNAME-`whoami`}}
trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15
trap 'rm -rf "$TEMPDIR"' 0
UN=
if (uname) >/dev/null 2>&1; then
UN=`uname -a`
fi
if [ -f /usr/lib/sendmail ] ; then
RMAIL="/usr/lib/sendmail"
SMARGS="-i -t"
elif [ -f /usr/sbin/sendmail ] ; then
RMAIL="/usr/sbin/sendmail"
SMARGS="-i -t"
else
RMAIL=rmail
SMARGS="$BUGADDR"
fi
INITIAL_SUBJECT='[50 character or so descriptive subject here (for reference)]'
cat > "$TEMPFILE1" <<EOF
From: ${USER}
To: ${BUGADDR}
Subject: ${INITIAL_SUBJECT}
Configuration Information [Automatically generated, do not change]:
Machine: $MACHINE
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.]
Repeat-By:
[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.]
EOF
cp "$TEMPFILE1" "$TEMPFILE2"
chmod u+w "$TEMPFILE1"
trap '' 2 # ignore interrupts while in editor
edstat=1
while [ $edstat -ne 0 ]; do
$EDITOR "$TEMPFILE1"
edstat=$?
if [ $edstat -ne 0 ]; then
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
continue
fi
# find the subject from the temp file and see if it's been changed
CURR_SUB=`grep '^Subject: ' "$TEMPFILE1" | sed 's|^Subject:[ ]*||' | sed 1q`
case "$CURR_SUB" in
"${INITIAL_SUBJECT}")
echo
echo "$0: You have not changed the subject from the default."
echo "$0: Please use a more descriptive subject header."
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
echo "$0: The editor will be restarted in five seconds."
sleep 5
edstat=1
;;
esac
done
trap 'rm -rf "$TEMPDIR"; exit 1' 2 # restore trap on SIGINT
if cmp -s "$TEMPFILE1" "$TEMPFILE2"
then
echo "File not changed, no bug report submitted."
exit
fi
echo $n "Send bug report to ${BUGADDR}? [y/n] $c"
read ans
case "$ans" in
[Nn]*) exit 0 ;;
esac
${RMAIL} $SMARGS < "$TEMPFILE1" || {
cat "$TEMPFILE1" >> $HOME/dead.bashbug
echo "$0: mail to ${BUGADDR} failed: report saved in $HOME/dead.bashbug" >&2
echo "$0: please send it manually to ${BUGADDR}" >&2
}
exit 0

148
support/bashversion.c Normal file
View file

@ -0,0 +1,148 @@
/* bashversion.c -- Display bash version information. */
/* Copyright (C) 2001-2021 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "stdc.h"
#include <stdio.h>
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#endif
#include "bashansi.h"
#include "version.h"
#include "conftypes.h"
#define RFLAG 0x0001
#define VFLAG 0x0002
#define MFLAG 0x0004
#define PFLAG 0x0008
#define SFLAG 0x0010
#define LFLAG 0x0020
#define XFLAG 0x0040
extern int optind;
extern char *optarg;
extern char *dist_version;
extern int patch_level;
extern char *shell_version_string PARAMS((void));
extern void show_shell_version PARAMS((int));
char *shell_name = "bash";
char *progname;
static void
usage()
{
fprintf(stderr, "%s: usage: %s [-hrvpmlsx]\n", progname, progname);
}
int
main (argc, argv)
int argc;
char **argv;
{
int opt, oflags;
char dv[128], *rv;
if (progname = strrchr (argv[0], '/'))
progname++;
else
progname = argv[0];
oflags = 0;
while ((opt = getopt(argc, argv, "hrvmpslx")) != EOF)
{
switch (opt)
{
case 'h':
usage ();
exit (0);
case 'r':
oflags |= RFLAG; /* release */
break;
case 'v':
oflags |= VFLAG; /* version */
break;
case 'm':
oflags |= MFLAG; /* machtype */
break;
case 'p':
oflags |= PFLAG; /* patchlevel */
break;
case 's': /* short version string */
oflags |= SFLAG;
break;
case 'l': /* long version string */
oflags |= LFLAG;
break;
case 'x': /* extended version information */
oflags |= XFLAG;
break;
default:
usage ();
exit (2);
}
}
argc -= optind;
argv += optind;
if (argc > 0)
{
usage ();
exit (2);
}
/* default behavior */
if (oflags == 0)
oflags = SFLAG;
if (oflags & (RFLAG|VFLAG))
{
strcpy (dv, dist_version);
rv = strchr (dv, '.');
if (rv)
*rv++ = '\0';
else
rv = "00";
}
if (oflags & RFLAG)
printf ("%s\n", dv);
else if (oflags & VFLAG)
printf ("%s\n", rv);
else if (oflags & MFLAG)
printf ("%s\n", MACHTYPE);
else if (oflags & PFLAG)
printf ("%d\n", patch_level);
else if (oflags & SFLAG)
printf ("%s\n", shell_version_string ());
else if (oflags & LFLAG)
show_shell_version (0);
else if (oflags & XFLAG)
show_shell_version (1);
exit (0);
}

170
support/checkbashisms Executable file
View file

@ -0,0 +1,170 @@
#! /usr/bin/perl -w
# This script is essentially copied from /usr/share/lintian/checks/scripts,
# which is:
# Copyright (C) 1998 Richard Braakman
# Copyright (C) 2002 Josip Rodin
# This version is
# Copyright (C) 2003 Julian Gilbey
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
use strict;
(my $progname = $0) =~ s|.*/||;
my $usage = <<"EOF";
Usage: $progname [-n] script ...
or: $progname --help
or: $progname --version
This script performs basic checks for the presence of bashisms
in /bin/sh scripts.
EOF
my $version = <<"EOF";
This is $progname, from the Debian devscripts package, version 2.10.7ubuntu5
This code is copyright 2003 by Julian Gilbey <jdg\@debian.org>,
based on original code which is copyright 1998 by Richard Braakman
and copyright 2002 by Josip Rodin.
This program comes with ABSOLUTELY NO WARRANTY.
You are free to redistribute this code under the terms of the
GNU General Public License, version 3, or (at your option) any later version.
EOF
my $opt_echo = 0;
##
## handle command-line options
##
if (int(@ARGV) == 0 or $ARGV[0] =~ /^(--help|-h)$/) { print $usage; exit 0; }
if (@ARGV and $ARGV[0] =~ /^(--version|-v)$/) { print $version; exit 0; }
if (@ARGV and $ARGV[0] =~ /^(--newline|-n)$/) { $opt_echo = 1; }
my $status = 0;
foreach my $filename (@ARGV) {
if ($filename eq '-n' or $filename eq '--newline') {
next;
}
unless (open C, "$filename") {
warn "cannot open script $filename for reading: $!\n";
$status |= 2;
next;
}
my $cat_string = "";
while (<C>) {
if ($. == 1) { # This should be an interpreter line
if (m,^\#!\s*(\S+),) {
my $interpreter = $1;
if ($interpreter =~ m,/bash$,) {
warn "script $filename is already a bash script; skipping\n";
$status |= 2;
last; # end this file
}
elsif ($interpreter !~ m,/(sh|ash|dash)$,) {
warn "script $filename does not appear to be a /bin/sh script; skipping\n";
$status |= 2;
last;
}
} else {
warn "script $filename does not appear to have a \#! interpreter line;\nyou may get strange results\n";
}
}
next if m,^\s*\#,; # skip comment lines
chomp;
my $orig_line = $_;
s/(?<!\\)\#.*$//; # eat comments
if (m/(?:^|\s+)cat\s*\<\<\s*(\w+)/) {
$cat_string = $1;
}
elsif ($cat_string ne "" and m/^$cat_string/) {
$cat_string = "";
}
my $within_another_shell = 0;
if (m,(^|\s+)((/usr)?/bin/)?((b|d)?a|k|z|t?c)sh\s+-c\s*.+,) {
$within_another_shell = 1;
}
# if cat_string is set, we are in a HERE document and need not
# check for things
if ($cat_string eq "" and !$within_another_shell) {
my $found = 0;
my $match = '';
my $explanation = '';
my %bashisms = (
'(?:^|\s+)function\s+\w+' => q<'function' is useless>,
'(?:^|\s+)select\s+\w+' => q<'select' is not POSIX>,
'(?:^|\s+)source\s+(?:\.\/|\/|\$)[^\s]+' =>
q<should be '.', not 'source'>,
'(\[|test|-o|-a)\s*[^\s]+\s+==\s' =>
q<should be 'b = a'>,
'\s\|\&' => q<pipelining is not POSIX>,
'\$\[\w+\]' => q<arithmetic not allowed>,
'\$\{\w+\:\d+(?::\d+)?\}' => q<${foo:3[:1]}>,
'\$\{!\w+[@*]\}' => q<${!prefix[*|@]>,
'\$\{!\w+\}' => q<${!name}>,
'\$\{\w+(/.+?){1,2}\}' => q<${parm/?/pat[/str]}>,
'[^\\\]\{([^\s]+?,)+[^\\\}\s]+\}' =>
q<brace expansion>,
'(?:^|\s+)\w+\[\d+\]=' => q<bash arrays, H[0]>,
'\$\{\#?\w+\[[0-9\*\@]+\]\}' => q<bash arrays, ${name[0|*|@]}>,
'(?:^|\s+)(read\s*(?:;|$))' => q<read without variable>,
'\$\(\([A-Za-z]' => q<cnt=$((cnt + 1)) does not work in dash>,
'echo\s+-[e]' => q<echo -e>,
'exec\s+-[acl]' => q<exec -c/-l/-a name>,
'\blet\s' => q<let ...>,
'\$RANDOM\b' => q<$RANDOM>,
'(?<!\$)\(\(' => q<'((' should be '$(('>,
);
if ($opt_echo) {
$bashisms{'echo\s+-[n]'} = 'q<echo -n>';
}
while (my ($re,$expl) = each %bashisms) {
if (m/($re)/) {
$found = 1;
$match = $1;
$explanation = $expl;
last;
}
}
# since this test is ugly, I have to do it by itself
# detect source (.) trying to pass args to the command it runs
if (not $found and m/^\s*(\.\s+[^\s]+\s+([^\s]+))/) {
if ($2 eq '&&' || $2 eq '||') {
# everything is ok
;
} else {
$found = 1;
$match = $1;
}
}
unless ($found == 0) {
warn "possible bashism in $filename line $. ($explanation):\n$orig_line\n";
$status |= 1;
}
}
}
close C;
}
exit $status;

1754
support/config.guess vendored Normal file

File diff suppressed because it is too large Load diff

684
support/config.rpath Executable file
View file

@ -0,0 +1,684 @@
#! /bin/sh
# Output a system dependent set of variables, describing how to set the
# run time search path of shared libraries in an executable.
#
# Copyright 1996-2018 Free Software Foundation, Inc.
# Taken from GNU libtool, 2001
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
# This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# The first argument passed to this file is the canonical host specification,
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
# should be set by the caller.
#
# The set of defined variables is at the end of this script.
# Known limitations:
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
# than 256 bytes, otherwise the compiler driver will dump core. The only
# known workaround is to choose shorter directory names for the build
# directory and/or the installation directory.
# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
shrext=.so
host="$1"
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
# Code taken from libtool.m4's _LT_CC_BASENAME.
for cc_temp in $CC""; do
case $cc_temp in
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
\-*) ;;
*) break;;
esac
done
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
# Code taken from libtool.m4's _LT_COMPILER_PIC.
wl=
if test "$GCC" = yes; then
wl='-Wl,'
else
case "$host_os" in
aix*)
wl='-Wl,'
;;
mingw* | cygwin* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
;;
irix5* | irix6* | nonstopux*)
wl='-Wl,'
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
case $cc_basename in
ecc*)
wl='-Wl,'
;;
icc* | ifort*)
wl='-Wl,'
;;
lf95*)
wl='-Wl,'
;;
nagfor*)
wl='-Wl,-Wl,,'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
wl='-Wl,'
;;
ccc*)
wl='-Wl,'
;;
xl* | bgxl* | bgf* | mpixl*)
wl='-Wl,'
;;
como)
wl='-lopt='
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ F* | *Sun*Fortran*)
wl=
;;
*Sun\ C*)
wl='-Wl,'
;;
esac
;;
esac
;;
newsos6)
;;
*nto* | *qnx*)
;;
osf3* | osf4* | osf5*)
wl='-Wl,'
;;
rdos*)
;;
solaris*)
case $cc_basename in
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
wl='-Qoption ld '
;;
*)
wl='-Wl,'
;;
esac
;;
sunos4*)
wl='-Qoption ld '
;;
sysv4 | sysv4.2uw2* | sysv4.3*)
wl='-Wl,'
;;
sysv4*MP*)
;;
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
wl='-Wl,'
;;
unicos*)
wl='-Wl,'
;;
uts4*)
;;
esac
fi
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
hardcode_libdir_flag_spec=
hardcode_libdir_separator=
hardcode_direct=no
hardcode_minus_L=no
case "$host_os" in
cygwin* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
if test "$GCC" != yes; then
with_gnu_ld=no
fi
;;
interix*)
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
openbsd*)
with_gnu_ld=no
;;
esac
ld_shlibs=yes
if test "$with_gnu_ld" = yes; then
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
# Unlike libtool, we use -rpath here, not --rpath, since the documented
# option of GNU ld is called -rpath, not --rpath.
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
case "$host_os" in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
if test "$host_cpu" != ia64; then
ld_shlibs=no
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
beos*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
cygwin* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
haiku*)
;;
interix[3-9]*)
hardcode_direct=no
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
netbsd*)
;;
solaris*)
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
ld_shlibs=no
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
case `$LD -v 2>&1` in
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
ld_shlibs=no
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
else
ld_shlibs=no
fi
;;
esac
;;
sunos4*)
hardcode_direct=yes
;;
*)
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
:
else
ld_shlibs=no
fi
;;
esac
if test "$ld_shlibs" = no; then
hardcode_libdir_flag_spec=
fi
else
case "$host_os" in
aix3*)
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
if test "$GCC" = yes; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
fi
;;
aix[4-9]*)
if test "$host_cpu" = ia64; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
# need to do runtime linking.
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
aix_use_runtimelinking=yes
break
fi
done
;;
esac
fi
hardcode_direct=yes
hardcode_libdir_separator=':'
if test "$GCC" = yes; then
case $host_os in aix4.[012]|aix4.[012].*)
collect2name=`${CC} -print-prog-name=collect2`
if test -f "$collect2name" && \
strings "$collect2name" | grep resolve_lib_name >/dev/null
then
# We have reworked collect2
:
else
# We have old collect2
hardcode_direct=unsupported
hardcode_minus_L=yes
hardcode_libdir_flag_spec='-L$libdir'
hardcode_libdir_separator=
fi
;;
esac
fi
# Begin _LT_AC_SYS_LIBPATH_AIX.
echo 'int main () { return 0; }' > conftest.c
${CC} ${LDFLAGS} conftest.c -o conftest
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
if test -z "$aix_libpath"; then
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
}'`
fi
if test -z "$aix_libpath"; then
aix_libpath="/usr/lib:/lib"
fi
rm -f conftest.c conftest
# End _LT_AC_SYS_LIBPATH_AIX.
if test "$aix_use_runtimelinking" = yes; then
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
else
if test "$host_cpu" = ia64; then
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
else
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
fi
fi
;;
amigaos*)
case "$host_cpu" in
powerpc)
;;
m68k)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
esac
;;
bsdi[45]*)
;;
cygwin* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec=' '
libext=lib
;;
darwin* | rhapsody*)
hardcode_direct=no
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
:
else
ld_shlibs=no
fi
;;
dgux*)
hardcode_libdir_flag_spec='-L$libdir'
;;
freebsd2.[01]*)
hardcode_direct=yes
hardcode_minus_L=yes
;;
freebsd* | dragonfly*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
hpux9*)
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
hpux10*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
fi
;;
hpux11*)
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
hardcode_libdir_separator=:
case $host_cpu in
hppa*64*|ia64*)
hardcode_direct=no
;;
*)
hardcode_direct=yes
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
;;
esac
fi
;;
irix5* | irix6* | nonstopux*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
netbsd*)
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
;;
newsos6)
hardcode_direct=yes
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
*nto* | *qnx*)
;;
openbsd*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
else
case "$host_os" in
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
hardcode_libdir_flag_spec='-R$libdir'
;;
*)
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
;;
esac
fi
else
ld_shlibs=no
fi
;;
os2*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
;;
osf3*)
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*)
if test "$GCC" = yes; then
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
# Both cc and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
fi
hardcode_libdir_separator=:
;;
solaris*)
hardcode_libdir_flag_spec='-R$libdir'
;;
sunos4*)
hardcode_libdir_flag_spec='-L$libdir'
hardcode_direct=yes
hardcode_minus_L=yes
;;
sysv4)
case $host_vendor in
sni)
hardcode_direct=yes # is this really true???
;;
siemens)
hardcode_direct=no
;;
motorola)
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
;;
esac
;;
sysv4.3*)
;;
sysv4*MP*)
if test -d /usr/nec; then
ld_shlibs=yes
fi
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
;;
sysv5* | sco3.2v5* | sco5v6*)
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
hardcode_libdir_separator=':'
;;
uts4*)
hardcode_libdir_flag_spec='-L$libdir'
;;
*)
ld_shlibs=no
;;
esac
fi
# Check dynamic linker characteristics
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
# only about the one the linker finds when passed -lNAME. This is the last
# element of library_names_spec in libtool.m4, or possibly two of them if the
# linker has special search rules.
library_names_spec= # the last element of library_names_spec in libtool.m4
libname_spec='lib$name'
case "$host_os" in
aix3*)
library_names_spec='$libname.a'
;;
aix[4-9]*)
library_names_spec='$libname$shrext'
;;
amigaos*)
case "$host_cpu" in
powerpc*)
library_names_spec='$libname$shrext' ;;
m68k)
library_names_spec='$libname.a' ;;
esac
;;
beos*)
library_names_spec='$libname$shrext'
;;
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
cygwin* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
shrext=.dylib
library_names_spec='$libname$shrext'
;;
dgux*)
library_names_spec='$libname$shrext'
;;
freebsd[23].*)
library_names_spec='$libname$shrext$versuffix'
;;
freebsd* | dragonfly*)
library_names_spec='$libname$shrext'
;;
gnu*)
library_names_spec='$libname$shrext'
;;
haiku*)
library_names_spec='$libname$shrext'
;;
hpux9* | hpux10* | hpux11*)
case $host_cpu in
ia64*)
shrext=.so
;;
hppa*64*)
shrext=.sl
;;
*)
shrext=.sl
;;
esac
library_names_spec='$libname$shrext'
;;
interix[3-9]*)
library_names_spec='$libname$shrext'
;;
irix5* | irix6* | nonstopux*)
library_names_spec='$libname$shrext'
case "$host_os" in
irix5* | nonstopux*)
libsuff= shlibsuff=
;;
*)
case $LD in
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
*) libsuff= shlibsuff= ;;
esac
;;
esac
;;
linux*oldld* | linux*aout* | linux*coff*)
;;
linux* | k*bsd*-gnu | kopensolaris*-gnu)
library_names_spec='$libname$shrext'
;;
knetbsd*-gnu)
library_names_spec='$libname$shrext'
;;
netbsd*)
library_names_spec='$libname$shrext'
;;
newsos6)
library_names_spec='$libname$shrext'
;;
*nto* | *qnx*)
library_names_spec='$libname$shrext'
;;
openbsd*)
library_names_spec='$libname$shrext$versuffix'
;;
os2*)
libname_spec='$name'
shrext=.dll
library_names_spec='$libname.a'
;;
osf3* | osf4* | osf5*)
library_names_spec='$libname$shrext'
;;
rdos*)
;;
solaris*)
library_names_spec='$libname$shrext'
;;
sunos4*)
library_names_spec='$libname$shrext$versuffix'
;;
sysv4 | sysv4.3*)
library_names_spec='$libname$shrext'
;;
sysv4*MP*)
library_names_spec='$libname$shrext'
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
library_names_spec='$libname$shrext'
;;
tpf*)
library_names_spec='$libname$shrext'
;;
uts4*)
library_names_spec='$libname$shrext'
;;
esac
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
# How to pass a linker flag through the compiler.
wl="$escaped_wl"
# Static library suffix (normally "a").
libext="$libext"
# Shared library suffix (normally "so").
shlibext="$shlibext"
# Format of library name prefix.
libname_spec="$escaped_libname_spec"
# Library names that the linker finds when passed -lNAME.
library_names_spec="$escaped_library_names_spec"
# Flag to hardcode \$libdir into a binary during linking.
# This must work even if \$libdir does not exist.
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
# Whether we need a single -rpath flag with a separated argument.
hardcode_libdir_separator="$hardcode_libdir_separator"
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
# resulting binary.
hardcode_direct="$hardcode_direct"
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
# resulting binary.
hardcode_minus_L="$hardcode_minus_L"
EOF

1890
support/config.sub vendored Normal file

File diff suppressed because it is too large Load diff

89
support/fixlinks Executable file
View file

@ -0,0 +1,89 @@
#! /bin/sh
#
# fixlinks - make symlinks in the bash source tree so that there is
# exactly one version of any given source file.
#
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
SRCDIR=.
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 [-hu] [-s srcdir] [linkmap]" 1>&2
exit 1;;
*) break ;;
esac
shift
done
if [ ! -d $SRCDIR/builtins ]; then
echo "$0: must be run with valid -s argument or from source directory" 1>&2
exit 1
fi
if [ $# -eq 0 ]; then
linkfile=$SRCDIR/support/SYMLINKS
else
linkfile=$1
fi
if [ ! -f "$linkfile" ]; then
echo "$0: symlink map file \`$linkfile' does not exist"
exit 1
fi
rm_ltmp=false
LINKTEMP=`mktemp -t linktmp.XXXXXXXX 2>/dev/null`
if [ -z "$LINKTEMP" ]; then
: ${TMPDIR:=/tmp}
LINKTEMP=${TMPDIR}/linktmp.$$
rm_ltmp=true
fi
$rm_ltmp && rm -f ${LINKTEMP}
# 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 ${LINKTEMP}) >/dev/null 2>&1; then
LN="ln -s"
else
LN=ln
fi
rm -f ${LINKTEMP}
while read name target
do
case "$name" in
\#*) continue;;
esac
rm -f $name
case "$unfix" in
yes) dirname=`expr "$name" ':' '^\(.*\)/[^/]*'`
[ -z "$dirname" ] && dirname=.
cp $dirname/$target $name
echo $target copied to $name ;;
*) $LN $target $name ; echo "$name -> $target" ;;
esac
done < $linkfile
exit 0

247
support/install.sh Executable file
View file

@ -0,0 +1,247 @@
#!/bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5.
#
# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
#
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
tranformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

4088
support/man2html.c Normal file

File diff suppressed because it is too large Load diff

187
support/missing Executable file
View file

@ -0,0 +1,187 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing - GNU libit 0.0"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`configure.in'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`configure.in'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`configure.in'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in`
if test -z "$files"; then
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in`
test -z "$files" || files="$files.in"
else
files=`echo "$files" | sed -e 's/:/ /g'`
fi
test -z "$files" && files="config.h.in"
touch $files
;;
automake)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print \
| sed 's/^\(.*\).am$/touch \1.in/' \
| sh
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
makeinfo)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0

122
support/mkclone Executable file
View file

@ -0,0 +1,122 @@
#! /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
#
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
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_ltmp=false
LINKTEMP=`mktemp -t linktmp.XXXXXXXX 2>/dev/null`
if [ -z "$LINKTEMP" ]; then
: ${TMPDIR:=/tmp}
LINKTEMP=${TMPDIR}/linktmp.$$
rm_ltmp=true
fi
$rm_ltmp && rm -f ${LINKTEMP}
# 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 ${LINKTEMP}) >/dev/null 2>&1; then
LN="ln -s"
else
LN=ln
fi
rm -f ${LINKTEMP}
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
exit 0

79
support/mkconffiles Executable file
View file

@ -0,0 +1,79 @@
#! /bin/sh
#
# mkconffiles - create _distribution and _patchlevel files in preparation
# for recreating `configure' from `configure.ac'
#
# options:
# -s srcdir directory where `configure' resides (defaults to `.')
# -d outdir directory where the files should be written (defaults
# to "$srcdir")
# -v verbose
# -n nocreate - don't create the output files
#
# Chet Ramey
# chet@po.cwru.edu
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
PROG=`basename $0`
# defaults
srcdir=.
distname="_distribution"
patchname="_patchlevel"
while [ $# -gt 0 ]; do
case "$1" in
-s) shift; srcdir="$1"; shift;;
-d) shift; outdir="$1"; shift;;
-v) shift; verbose=yes ;;
-n) shift; nocreate=yes;;
--) shift; break;;
*) echo "${PROG}: usage: ${PROG} [-s srcdir] [-d outdir] [-nv]" >&2; exit 2;;
esac
done
if [ ! -f ${srcdir}/configure ]; then
echo "${PROG}: ${srcdir}/configure not found" >&2
exit 1
fi
# default output directory to source directory
if [ -z "$outdir" ]; then
outdir=${srcdir}
fi
DISTRIB=`grep '^BASHVERS' ${srcdir}/configure | sed 's:.*=::'`
PATCH=`grep '^BASHPATCH' ${srcdir}/configure | sed 's:.*=::'`
if [ -n "$verbose" ]; then
echo "${PROG}: creating new distribution files for bash-${DISTRIB}.${PATCH} in ${outdir}"
fi
distout=${outdir}/${distname}
patchout=${outdir}/${patchname}
if [ -z "$nocreate" ]; then
echo "$DISTRIB" > $distout
echo "$PATCH" > $patchout
fi
if [ -n "$verbose" ]; then
echo "${PROG}: created $distout and $patchout"
fi
exit 0

47
support/mkdirs Executable file
View file

@ -0,0 +1,47 @@
#! /bin/sh
#
# mkdirs - a work-alike for `mkdir -p'
#
# Chet Ramey
# chet@po.cwru.edu
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
for dir
do
test -d "$dir" && continue
tomake=$dir
while test -n "$dir" ; do
# dir=${dir%/*}
# dir=`expr "$dir" ':' '\(/.*\)/[^/]*'`
if dir=`expr "$dir" ':' '\(.*\)/[^/]*'`; then
tomake="$dir $tomake"
else
dir=
fi
done
for d in $tomake
do
test -d "$d" && continue
echo mkdir "$d"
mkdir "$d"
done
done
exit 0

111
support/mkinstalldirs Executable file
View file

@ -0,0 +1,111 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
# Public domain
errstatus=0
dirmode=""
usage="\
Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
# process command line arguments
while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage" 1>&2
exit 0
;;
-m) # -m PERM arg
shift
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
dirmode=$1
shift
;;
--) # stop option processing
shift
break
;;
-*) # unknown option
echo "$usage" 1>&2
exit 1
;;
*) # first non-opt arg
break
;;
esac
done
for file
do
if test -d "$file"; then
shift
else
break
fi
done
case $# in
0) exit 0 ;;
esac
case $dirmode in
'')
if mkdir -p -- . 2>/dev/null; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
fi
;;
*)
if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
fi
;;
esac
for file
do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
for d
do
pathcomp="$pathcomp$d"
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
echo "mkdir $pathcomp"
mkdir "$pathcomp" || lasterr=$?
if test ! -d "$pathcomp"; then
errstatus=$lasterr
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
lasterr=""
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
errstatus=$lasterr
fi
fi
fi
fi
pathcomp="$pathcomp/"
done
done
exit $errstatus
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# End:
# mkinstalldirs ends here

111
support/mksignames.c Normal file
View file

@ -0,0 +1,111 @@
/* mksignames.c -- Create and write `signames.h', which contains an array of
signal names. */
/* Copyright (C) 1992-2020 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#if defined (HAVE_STDLIB_H)
# include <stdlib.h>
#else
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
/* Duplicated from signames.c */
#if !defined (NSIG)
# define NSIG 64
#endif
#define LASTSIG NSIG+2
/* Imported from signames.c */
extern void initialize_signames ();
extern char *signal_names[];
char *progname;
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");
#if defined (CROSS_COMPILING)
fprintf (stream, "extern char *signal_names[];\n\n");
fprintf (stream, "extern void initialize_signames PARAMS((void));\n\n");
#else
fprintf (stream, "char *signal_names[NSIG + 4] = {\n");
for (i = 0; i <= LASTSIG; i++)
fprintf (stream, " \"%s\",\n", signal_names[i]);
fprintf (stream, " (char *)0x0\n");
fprintf (stream, "};\n\n");
fprintf (stream, "#define initialize_signames()\n\n");
#endif
}
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);
}
#if !defined (CROSS_COMPILING)
initialize_signames ();
#endif
write_signames (stream);
exit (0);
}

168
support/mkversion.sh Executable file
View file

@ -0,0 +1,168 @@
#! /bin/sh
# 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. This creates a file named by the -o option,
# otherwise everything is echoed to the standard output.
# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
PROGNAME=`basename $0`
USAGE="$PROGNAME [-b] [-S srcdir] -d version -p patchlevel [-s status] [-o outfile]"
source_dir="."
while [ $# -gt 0 ]; do
case "$1" in
-o) shift; OUTFILE=$1; shift ;;
-b) shift; inc_build=yes ;;
-s) shift; rel_status=$1; shift ;;
-p) shift; patch_level=$1; shift ;;
-d) shift; dist_version=$1; shift ;;
-S) shift; source_dir="$1"; shift ;;
*) echo "$PROGNAME: usage: $USAGE" >&2 ; exit 2 ;;
esac
done
# Required arguments
if [ -z "$dist_version" ]; then
echo "${PROGNAME}: required argument -d missing" >&2
echo "$PROGNAME: usage: $USAGE" >&2
exit 1
fi
#if [ -z "$patch_level" ]; then
# echo "${PROGNAME}: required argument -p missing" >&2
# echo "$PROGNAME: usage: $USAGE" >&2
# exit 1
#fi
# Defaults
if [ -z "$rel_status" ]; then
rel_status="release"
fi
build_ver=
if [ -r .build ]; then
build_ver=`cat .build`
fi
if [ -z "$build_ver" ]; then
build_ver=0
fi
# increment the build version if that's what's required
if [ -n "$inc_build" ]; then
build_ver=`expr 1 + $build_ver`
fi
# what's the patch level?
if [ -z "$patch_level" ]; then
patchlevel_h=$source_dir/patchlevel.h
if [ -s $patchlevel_h ]; then
patch_level=`cat $patchlevel_h | grep '^#define[ ]*PATCHLEVEL' | awk '{print $NF}'`
fi
fi
if [ -z "$patch_level" ]; then
patch_level=0
fi
# If we have an output file specified, make it the standard output
if [ -n "$OUTFILE" ]; then
if exec >$OUTFILE; then
:
else
echo "${PROGNAME}: cannot redirect standard output to $OUTFILE" >&2
exit 1
fi
fi
# Output the leading comment.
echo "/* Version control for the shell. This file gets changed when you say"
echo " \`make version.h' to the Makefile. It is created by mkversion. */"
# Output the distribution version. Single numbers are converted to x.00.
# Allow, as a special case, `[:digit:].[:digit:][:alpha:]' for
# intermediate versions (e.g., `2.5a').
# Any characters other than digits and `.' are invalid.
case "$dist_version" in
[0-9].[0-9][a-z]) ;; # special case
*[!0-9.]*) echo "mkversion.sh: ${dist_version}: bad distribution version" >&2
exit 1 ;;
*.*) ;;
*) dist_version=${dist_version}.00 ;;
esac
dist_major=`echo $dist_version | sed 's:\..*$::'`
[ -z "${dist_major}" ] && dist_major=0
dist_minor=`echo $dist_version | sed 's:^.*\.::'`
case "$dist_minor" in
"") dist_minor=0 ;;
[a-z]) dist_minor=0${dist_minor} ;;
?) dist_minor=${dist_minor} ;;
*) ;;
esac
#float_dist=`echo $dist_version | awk '{printf "%.2f\n", $1}'`
float_dist=${dist_major}.${dist_minor}
echo
echo "/* The distribution version number of this shell. */"
echo "#define DISTVERSION \"${float_dist}\""
# Output the patch level
#echo
#echo "/* The patch level of this version of the shell. */"
#echo "#define PATCHLEVEL ${patch_level}"
# Output the build version
echo
echo "/* The last built version of this shell. */"
echo "#define BUILDVERSION ${build_ver}"
# Output the release status
echo
echo "/* The release status of this shell. */"
echo "#define RELSTATUS \"${rel_status}\""
echo
echo "/* The default shell compatibility-level (the current version) */"
echo "#define DEFAULT_COMPAT_LEVEL ${dist_major}${dist_minor}"
# Output the SCCS version string
sccs_string="${float_dist}.${patch_level}(${build_ver}) ${rel_status} GNU"
echo
echo "/* A version string for use by sccs and the what command. */"
echo "#define SCCSVERSION \"@(#)Bash version ${sccs_string}\""
# extern function declarations
#echo
#echo '/* Functions from version.c. */'
#echo 'extern char *shell_version_string PARAMS((void));'
#echo 'extern void show_shell_version PARAMS((int));'
if [ -n "$inc_build" ]; then
# Make sure we can write to .build
if [ -f .build ] && [ ! -w .build ]; then
echo "$PROGNAME: cannot write to .build, not incrementing build version" >&2
else
echo "$build_ver" > .build
fi
fi
exit 0

72
support/printenv.c Normal file
View file

@ -0,0 +1,72 @@
/* printenv -- minimal clone of BSD printenv(1).
usage: printenv [varname]
Chet Ramey
chet@po.cwru.edu
*/
/* Copyright (C) 1997-2002 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
*/
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include "bashansi.h"
#include <stdio.h> /* puts */
extern char **environ;
int
main (argc, argv)
int argc;
char **argv;
{
register char **envp, *eval;
int len;
argv++;
argc--;
/* printenv */
if (argc == 0)
{
for (envp = environ; *envp; envp++)
puts (*envp);
exit (0);
}
/* printenv varname */
len = strlen (*argv);
for (envp = environ; *envp; envp++)
{
if (**argv == **envp && strncmp (*envp, *argv, len) == 0)
{
eval = *envp + len;
/* If the environment variable doesn't have an `=', ignore it. */
if (*eval == '=')
{
puts (eval + 1);
exit (0);
}
}
}
exit (1);
}

27
support/printenv.sh Executable file
View file

@ -0,0 +1,27 @@
#! /bin/sh -
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
if [ $# -eq 0 ]; then
env
exit
elif eval [ "\${$1-unset}" = "unset" ]; then
exit 1
else
eval echo \$$1
exit 0
fi

67
support/recho.c Normal file
View file

@ -0,0 +1,67 @@
/*
recho -- really echo args, bracketed with <> and with invisible chars
made visible.
Chet Ramey
chet@po.cwru.edu
*/
/* Copyright (C) 2002-2005 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
*/
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include "bashansi.h"
#include <stdio.h>
void strprint();
int
main(argc, argv)
int argc;
char **argv;
{
register int i;
for (i = 1; i < argc; i++) {
printf("argv[%d] = <", i);
strprint(argv[i]);
printf(">\n");
}
exit(0);
}
void
strprint(str)
char *str;
{
register unsigned char *s;
for (s = (unsigned char *)str; s && *s; s++) {
if (*s < ' ') {
putchar('^');
putchar(*s+64);
} else if (*s == 127) {
putchar('^');
putchar('?');
} else
putchar(*s);
}
}

113
support/rlvers.sh Executable file
View file

@ -0,0 +1,113 @@
#! /bin/sh
#
# rlvers.sh -- run a program that prints out the readline version number
# using locally-installed readline libraries
#
# Copyright (C) 1996-2002 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
PROGNAME=`basename $0`
: ${TMPDIR:=/tmp}
TDIR=$TMPDIR/rlvers
# defaults
CC=cc
RL_LIBDIR=/usr/local/lib
RL_INCDIR=/usr/local/include
TERMCAP_LIB="-ltermcap"
# cannot rely on the presence of getopts
while [ $# -gt 0 ]; do
case "$1" in
-C) shift ; CC="$1"; shift ;;
-I) shift ; RL_INCDIR="$1" ; shift ;;
-L) shift ; RL_LIBDIR="$1" ; shift ;;
-T) shift ; TERMCAP_LIB="$1" ; shift ;;
-v) shift ; verbose=y ;;
--) shift ; break ;;
*) echo "${PROGNAME}: usage: $PROGNAME [-C compiler] [-L libdir] [-v]" >&2 ; exit 2;;
esac
done
# if someone happened to install examples/rlversion, use it (it's not
# installed by default)
if test -f ${RL_LIBDIR}/rlversion ; then
if [ -n "$verbose" ]; then
echo "${PROGNAME}: using installed rlversion from ${RL_LIBDIR}/rlversion"
fi
v=`${RL_LIBDIR}/rlversion 2>/dev/null`
case "$v" in
unknown | "") echo 0 ;;
*) echo "$v" ;;
esac
exit 0
fi
if [ -n "$verbose" ]; then
echo "${PROGNAME}: using ${RL_LIBDIR} to find libreadline"
echo "${PROGNAME}: attempting program compilation"
fi
# make $TDIR mode 0700
mkdir $TDIR || {
echo "${PROGNAME}: ${TDIR}: file exists" >&2
echo 0
exit 1
}
chmod 700 $TDIR
trap 'rm -f $TDIR/rlvers $TDIR/rlvers.? ; rmdir $TDIR' 0 1 2 3 6 15
cat > $TDIR/rlvers.c << EOF
#include <stdio.h>
extern char *rl_library_version;
main()
{
printf("%s\n", rl_library_version ? rl_library_version : "0");
exit(0);
}
EOF
opwd=`pwd`
cd $TDIR || {
echo "${PROGNAME}: cannot cd to $TDIR" >&2
echo 0
exit 1
}
if eval ${CC} -L${RL_LIBDIR} -I${RL_INCDIR} -o $TDIR/rlvers $TDIR/rlvers.c -lreadline ${TERMCAP_LIB};
then
v=`$TDIR/rlvers`
else
if [ -n "$verbose" ] ; then
echo "${PROGNAME}: compilation failed: status $?"
echo "${PROGNAME}: using version 0"
fi
v=0
fi
case "$v" in
unknown | "") echo 0 ;;
*) echo "$v" ;;
esac
cd $opwd
exit 0

553
support/shobj-conf Executable file
View file

@ -0,0 +1,553 @@
#! /bin/sh
#
# shobj-conf -- output a series of variable assignments to be substituted
# into a Makefile by configure which specify system-dependent
# information for creating shared objects that may be loaded
# into bash with `enable -f'
#
# usage: shobj-conf [-C compiler] -c host_cpu -o host_os -v host_vendor
#
# Chet Ramey
# chet@po.cwru.edu
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
#
# This file is part of GNU Bash, the Bourne Again SHell.
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
#
#
# defaults
#
SHOBJ_STATUS=supported
SHLIB_STATUS=supported
SHOBJ_CC=cc
SHOBJ_CFLAGS=
SHOBJ_LD=
SHOBJ_LDFLAGS=
SHOBJ_XLDFLAGS=
SHOBJ_LIBS=
SHLIB_XLDFLAGS=
SHLIB_LIBS=
SHLIB_DOT='.'
SHLIB_LIBPREF='lib'
SHLIB_LIBSUFF='so'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF)'
SHLIB_DLLVERSION='$(SHLIB_MAJOR)'
PROGNAME=`basename $0`
USAGE="$PROGNAME [-C compiler] -c host_cpu -o host_os -v host_vendor"
while [ $# -gt 0 ]; do
case "$1" in
-C) shift; SHOBJ_CC="$1"; shift ;;
-c) shift; host_cpu="$1"; shift ;;
-o) shift; host_os="$1"; shift ;;
-v) shift; host_vendor="$1"; shift ;;
*) echo "$USAGE" >&2 ; exit 2;;
esac
done
case "${host_os}-${SHOBJ_CC}-${host_vendor}" in
nsk-cc-tandem|nsk-c99-tandem)
SHOBJ_CFLAGS=-Wglobalized
case `uname -m` in
NSR*)
SHOBJ_CFLAGS="${SHOBJ_CFLAGS} -Wcall_shared" # default on TNS/E, needed on TNS/R
SHOBJ_LD=/usr/bin/ld # for TNS/R
;;
NSE*|NEO*)
SHOBJ_LD=/usr/bin/eld
;;
esac
SHOBJ_LDFLAGS='-shared -bglobalized -unres_symbols ignore'
;;
sunos4*-*gcc*)
SHOBJ_CFLAGS=-fpic
SHOBJ_LD=/usr/bin/ld
SHOBJ_LDFLAGS='-assert pure-text'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;
sunos4*)
SHOBJ_CFLAGS=-pic
SHOBJ_LD=/usr/bin/ld
SHOBJ_LDFLAGS='-assert pure-text'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;
sunos5*-*gcc*|solaris2*-*gcc*)
SHOBJ_LD='${CC}'
ld_used=`gcc -print-prog-name=ld`
if ${ld_used} -V 2>&1 | grep GNU >/dev/null 2>&1; then
# This line works for the GNU ld
SHOBJ_LDFLAGS='-shared -Wl,-h,$@'
# http://sourceware.org/ml/binutils/2001-08/msg00361.html
SHOBJ_CFLAGS=-fPIC
else
# This line works for the Solaris linker in /usr/ccs/bin/ld
SHOBJ_LDFLAGS='-shared -Wl,-i -Wl,-h,$@'
SHOBJ_CFLAGS=-fpic
fi
# SHLIB_XLDFLAGS='-R $(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sunos5*|solaris2*)
SHOBJ_CFLAGS='-K pic'
SHOBJ_LD=/usr/ccs/bin/ld
SHOBJ_LDFLAGS='-G -dy -z text -i -h $@'
# SHLIB_XLDFLAGS='-R $(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
# All versions of Linux (including Gentoo/FreeBSD) or the semi-mythical GNU Hurd.
linux*-*|gnu*-*|k*bsd*-gnu-*|midnightbsd*|freebsd*|dragonfly*)
SHOBJ_CFLAGS=-fPIC
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;
# Darwin/MacOS X
darwin*)
# Common definitions for all darwin/mac os x versions
SHOBJ_CFLAGS='-fno-common'
SHOBJ_LD='${CC}'
SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
SHLIB_LIBSUFF='dylib'
# unused at this time
SHLIB_SONAME='$(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF)'
case "${host_os}" in
# Darwin versions 1, 5, 6, 7 correspond to Mac OS X 10.0, 10.1, 10.2,
# and 10.3, respectively.
darwin[1-7].*)
SHOBJ_STATUS=unsupported
SHOBJ_LDFLAGS='-dynamic'
SHLIB_XLDFLAGS='-install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -v'
;;
# Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
*)
case "${host_os}" in
darwin[89]*|darwin1[012]*)
SHOBJ_ARCHFLAGS=
;;
*) # Mac OS X 10.9 (Mavericks) and later
SHOBJ_ARCHFLAGS=
# for 32 and 64bit universal library
#SHOBJ_ARCHFLAGS='-arch i386 -arch x86_64'
#SHOBJ_CFLAGS=${SHOBJ_CFLAGS}' -arch i386 -arch x86_64'
;;
esac
SHOBJ_LDFLAGS="-dynamiclib -dynamic -undefined dynamic_lookup ${SHOBJ_ARCHFLAGS}"
SHLIB_XLDFLAGS="-dynamiclib ${SHOBJ_ARCHFLAGS}"' -install_name $(libdir)/`echo $@ | sed "s:\\..*::"`.$(SHLIB_MAJOR).$(SHLIB_LIBSUFF) -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -v'
;;
esac
SHLIB_LIBS='-lncurses' # see if -lcurses works on MacOS X 10.1
;;
openbsd*|netbsd*|mirbsd*)
SHOBJ_CFLAGS=-fPIC
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared'
SHLIB_XLDFLAGS='-R$(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;
bsdi2*)
SHOBJ_CC=shlicc2
SHOBJ_CFLAGS=
SHOBJ_LD=ld
SHOBJ_LDFLAGS=-r
SHOBJ_LIBS=-lc_s.2.1.0
# BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
# the ass -- they require changing {/usr/lib,etc}/shlib.map on
# each system, and the library creation process is byzantine
SHLIB_STATUS=unsupported
;;
bsdi3*)
SHOBJ_CC=shlicc2
SHOBJ_CFLAGS=
SHOBJ_LD=ld
SHOBJ_LDFLAGS=-r
SHOBJ_LIBS=-lc_s.3.0.0
# BSD/OS 2.x and 3.x `shared libraries' are too much of a pain in
# the ass -- they require changing {/usr/lib,etc}/shlib.map on
# each system, and the library creation process is byzantine
SHLIB_STATUS=unsupported
;;
bsdi4*)
# BSD/OS 4.x now supports ELF and SunOS-style dynamically-linked
# shared libraries. gcc 2.x is the standard compiler, and the
# `normal' gcc options should work as they do in Linux.
SHOBJ_CFLAGS=-fPIC
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
;;
osf*-*gcc*)
# Fix to use gcc linker driver from bfischer@TechFak.Uni-Bielefeld.DE
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
SHLIB_XLDFLAGS='-rpath $(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
osf*)
SHOBJ_LD=ld
SHOBJ_LDFLAGS='-shared -soname $@ -expect_unresolved "*"'
SHLIB_XLDFLAGS='-rpath $(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
aix4.[2-9]*-*gcc*|aix[5-9].*-*gcc*) # lightly tested by jik@cisco.com
SHOBJ_CFLAGS=-fpic
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-Wl,-bdynamic -Wl,-bnoentry -Wl,-bexpall'
SHOBJ_XLDFLAGS='-G'
SHLIB_XLDFLAGS='-bM:SRE'
SHLIB_LIBS='-lcurses -lc'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
aix4.[2-9]*|aix[5-9].*)
SHOBJ_CFLAGS=-K
SHOBJ_LD='ld'
SHOBJ_LDFLAGS='-bdynamic -bnoentry -bexpall'
SHOBJ_XLDFLAGS='-G'
SHLIB_XLDFLAGS='-bM:SRE'
SHLIB_LIBS='-lcurses -lc'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
#
# THE FOLLOWING ARE UNTESTED -- and some may not support the dlopen interface
#
irix[56]*-*gcc*)
SHOBJ_CFLAGS='-fpic'
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
irix[56]*)
SHOBJ_CFLAGS='-K PIC'
SHOBJ_LD=ld
# SHOBJ_LDFLAGS='-call_shared -hidden_symbol -no_unresolved -soname $@'
# Change from David Kaelbling <drk@sgi.com>. If you have problems,
# remove the `-no_unresolved'
SHOBJ_LDFLAGS='-shared -no_unresolved -soname $@'
SHLIB_XLDFLAGS='-rpath $(libdir)'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
hpux9*-*gcc*)
# must use gcc; the bundled cc cannot compile PIC code
SHOBJ_CFLAGS='-fpic'
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,+s'
SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
SHLIB_LIBSUFF='sl'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
hpux9*)
SHOBJ_STATUS=unsupported
SHLIB_STATUS=unsupported
# If you are using the HP ANSI C compiler, you can uncomment and use
# this code (I have not tested it)
# SHOBJ_STATUS=supported
# SHLIB_STATUS=supported
#
# SHOBJ_CFLAGS='+z'
# SHOBJ_LD='ld'
# SHOBJ_LDFLAGS='-b +s'
#
# SHLIB_XLDFLAGS='+b $(libdir)'
# SHLIB_LIBSUFF='sl'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
hpux10*-*gcc*)
# must use gcc; the bundled cc cannot compile PIC code
SHOBJ_CFLAGS='-fpic'
SHOBJ_LD='${CC}'
# if you have problems linking here, moving the `-Wl,+h,$@' from
# SHLIB_XLDFLAGS to SHOBJ_LDFLAGS has been reported to work
SHOBJ_LDFLAGS='-shared -fpic -Wl,-b -Wl,+s'
SHLIB_XLDFLAGS='-Wl,+h,$@ -Wl,+b,$(libdir)'
SHLIB_LIBSUFF='sl'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
hpux10*)
SHOBJ_STATUS=unsupported
SHLIB_STATUS=unsupported
# If you are using the HP ANSI C compiler, you can uncomment and use
# this code (I have not tested it)
# SHOBJ_STATUS=supported
# SHLIB_STATUS=supported
#
# SHOBJ_CFLAGS='+z'
# SHOBJ_LD='ld'
# SHOBJ_LDFLAGS='-b +s +h $@'
#
# SHLIB_XLDFLAGS='+b $(libdir)'
# SHLIB_LIBSUFF='sl'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
hpux11*-*gcc*)
# must use gcc; the bundled cc cannot compile PIC code
SHOBJ_CFLAGS='-fpic'
SHOBJ_LD='${CC}'
# SHOBJ_LDFLAGS='-shared -Wl,-b -Wl,-B,symbolic -Wl,+s -Wl,+std -Wl,+h,$@'
SHOBJ_LDFLAGS='-shared -fpic -Wl,-b -Wl,+s -Wl,+h,$@'
SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
SHLIB_LIBSUFF='sl'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
hpux11*)
SHOBJ_STATUS=unsupported
SHLIB_STATUS=unsupported
# If you are using the HP ANSI C compiler, you can uncomment and use
# this code from michael.osipov@siemens.com (I have not tested it)
# SHOBJ_CFLAGS='+z'
# SHOBJ_LD='$(CC)'
# SHOBJ_LDFLAGS='-b -Wl,+s -Wl,+h,$@'
#
# SHLIB_XLDFLAGS='-Wl,+b,$(libdir)'
# SHLIB_LIBSUFF='so'
# SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
# SHLIB_LIBS='$(TERMCAP_LIB)'
;;
sysv4*-*gcc*)
SHOBJ_CFLAGS=-shared
SHOBJ_LDFLAGS='-shared -h $@'
SHOBJ_LD='${CC}'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sysv4*)
SHOBJ_CFLAGS='-K PIC'
SHOBJ_LD=ld
SHOBJ_LDFLAGS='-dy -z text -G -h $@'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sco3.2v5*-*gcc*)
SHOBJ_CFLAGS='-fpic' # DEFAULTS TO ELF
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sco3.2v5*)
SHOBJ_CFLAGS='-K pic -b elf'
SHOBJ_LD=ld
SHOBJ_LDFLAGS='-G -b elf -dy -z text -h $@'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sysv5uw7*-*gcc*)
SHOBJ_CFLAGS='-fpic'
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sysv5uw7*)
SHOBJ_CFLAGS='-K PIC'
SHOBJ_LD=ld
SHOBJ_LDFLAGS='-G -dy -z text -h $@'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sysv5UnixWare*-*gcc*)
SHOBJ_CFLAGS=-fpic
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sysv5UnixWare*)
SHOBJ_CFLAGS='-K PIC'
SHOBJ_LD=ld
SHOBJ_LDFLAGS='-G -dy -z text -h $@'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sysv5OpenUNIX*-*gcc*)
SHOBJ_CFLAGS=-fpic
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
sysv5OpenUNIX*)
SHOBJ_CFLAGS='-K PIC'
SHOBJ_LD=ld
SHOBJ_LDFLAGS='-G -dy -z text -h $@'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
dgux*-*gcc*)
SHOBJ_CFLAGS=-fpic
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
dgux*)
SHOBJ_CFLAGS='-K pic'
SHOBJ_LD=ld
SHOBJ_LDFLAGS='-G -dy -h $@'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
msdos*)
SHOBJ_STATUS=unsupported
SHLIB_STATUS=unsupported
;;
cygwin*)
SHOBJ_LD='$(CC)'
SHOBJ_LDFLAGS='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
SHLIB_LIBPREF='cyg'
SHLIB_LIBSUFF='dll'
SHLIB_LIBVERSION='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
SHLIB_LIBS='$(TERMCAP_LIB)'
SHLIB_DOT=
# For official cygwin releases, DLLVERSION will be defined in the
# environment of configure, and will be incremented any time the API
# changes in a non-backwards compatible manner. Otherwise, it is just
# SHLIB_MAJOR.
if [ -n "$DLLVERSION" ] ; then
SHLIB_DLLVERSION="$DLLVERSION"
fi
;;
mingw*)
SHOBJ_LD='$(CC)'
SHOBJ_LDFLAGS='-shared -Wl,--enable-auto-import -Wl,--enable-auto-image-base -Wl,--export-all -Wl,--out-implib=$(@).a'
SHLIB_LIBSUFF='dll'
SHLIB_LIBVERSION='$(SHLIB_DLLVERSION).$(SHLIB_LIBSUFF)'
SHLIB_LIBS='$(TERMCAP_LIB)'
SHLIB_DOT=
# For official cygwin releases, DLLVERSION will be defined in the
# environment of configure, and will be incremented any time the API
# changes in a non-backwards compatible manner. Otherwise, it is just
# SHLIB_MAJOR.
if [ -n "$DLLVERSION" ] ; then
SHLIB_DLLVERSION="$DLLVERSION"
fi
;;
#
# Rely on correct gcc configuration for everything else
#
*-*gcc*)
SHOBJ_CFLAGS=-fpic
SHOBJ_LD='${CC}'
SHOBJ_LDFLAGS='-shared'
SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)'
;;
*)
SHOBJ_STATUS=unsupported
SHLIB_STATUS=unsupported
;;
esac
echo SHOBJ_CC=\'"$SHOBJ_CC"\'
echo SHOBJ_CFLAGS=\'"$SHOBJ_CFLAGS"\'
echo SHOBJ_LD=\'"$SHOBJ_LD"\'
echo SHOBJ_LDFLAGS=\'"$SHOBJ_LDFLAGS"\'
echo SHOBJ_XLDFLAGS=\'"$SHOBJ_XLDFLAGS"\'
echo SHOBJ_LIBS=\'"$SHOBJ_LIBS"\'
echo SHLIB_XLDFLAGS=\'"$SHLIB_XLDFLAGS"\'
echo SHLIB_LIBS=\'"$SHLIB_LIBS"\'
echo SHLIB_DOT=\'"$SHLIB_DOT"\'
echo SHLIB_LIBPREF=\'"$SHLIB_LIBPREF"\'
echo SHLIB_LIBSUFF=\'"$SHLIB_LIBSUFF"\'
echo SHLIB_LIBVERSION=\'"$SHLIB_LIBVERSION"\'
echo SHLIB_DLLVERSION=\'"$SHLIB_DLLVERSION"\'
echo SHOBJ_STATUS=\'"$SHOBJ_STATUS"\'
echo SHLIB_STATUS=\'"$SHLIB_STATUS"\'
exit 0

446
support/signames.c Normal file
View file

@ -0,0 +1,446 @@
/* signames.c -- Create an array of signal names. */
/* Copyright (C) 2006-2021 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#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
/*
* Special traps:
* EXIT == 0
* DEBUG == NSIG
* ERR == NSIG+1
* RETURN == NSIG+2
*/
#define LASTSIG NSIG+2
char *signal_names[2 * (LASTSIG)];
#define signal_names_size (sizeof(signal_names)/sizeof(signal_names[0]))
/* AIX 4.3 defines SIGRTMIN and SIGRTMAX as 888 and 999 respectively.
I don't want to allocate so much unused space for the intervening signal
numbers, so we just punt if SIGRTMAX is past the bounds of the
signal_names array (handled in configure). */
#if defined (SIGRTMAX) && defined (UNUSABLE_RT_SIGNALS)
# undef SIGRTMAX
# undef SIGRTMIN
#endif
#if defined (SIGRTMAX) || defined (SIGRTMIN)
# define RTLEN 14
# define RTLIM 256
#endif
#if defined (BUILDTOOL)
extern char *progname;
#endif
void
initialize_signames ()
{
register int i;
#if defined (SIGRTMAX) || defined (SIGRTMIN)
int rtmin, rtmax, rtcnt;
#endif
for (i = 1; i < signal_names_size; 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) SIGABRT to overwrite SIGLOST. */
/* POSIX 1003.1b-1993 real time signals, but take care of incomplete
implementations. According to the standard, both SIGRTMIN and
SIGRTMAX must be defined, SIGRTMIN must be strictly less than
SIGRTMAX, and the difference must be at least 7; that is, there
must be at least eight distinct real time signals. */
/* The generated signal names are SIGRTMIN, SIGRTMIN+1, ...,
SIGRTMIN+x, SIGRTMAX-x, ..., SIGRTMAX-1, SIGRTMAX. If the number
of RT signals is odd, there is an extra SIGRTMIN+(x+1).
These names are the ones used by ksh and /usr/xpg4/bin/sh on SunOS5. */
#if defined (SIGRTMIN)
rtmin = SIGRTMIN;
signal_names[rtmin] = "SIGRTMIN";
#endif
#if defined (SIGRTMAX)
rtmax = SIGRTMAX;
signal_names[rtmax] = "SIGRTMAX";
#endif
#if defined (SIGRTMAX) && defined (SIGRTMIN)
if (rtmax > rtmin)
{
rtcnt = (rtmax - rtmin - 1) / 2;
/* croak if there are too many RT signals */
if (rtcnt >= RTLIM/2)
{
rtcnt = RTLIM/2-1;
#ifdef BUILDTOOL
fprintf(stderr, "%s: error: more than %d real time signals, fix `%s'\n",
progname, RTLIM, progname);
#endif
}
for (i = 1; i <= rtcnt; i++)
{
signal_names[rtmin+i] = (char *)malloc(RTLEN);
if (signal_names[rtmin+i])
sprintf (signal_names[rtmin+i], "SIGRTMIN+%d", i);
signal_names[rtmax-i] = (char *)malloc(RTLEN);
if (signal_names[rtmax-i])
sprintf (signal_names[rtmax-i], "SIGRTMAX-%d", i);
}
if (rtcnt < RTLIM/2-1 && rtcnt != (rtmax-rtmin)/2)
{
/* Need an extra RTMIN signal */
signal_names[rtmin+rtcnt+1] = (char *)malloc(RTLEN);
if (signal_names[rtmin+rtcnt+1])
sprintf (signal_names[rtmin+rtcnt+1], "SIGRTMIN+%d", rtcnt+1);
}
}
#endif /* SIGRTMIN && SIGRTMAX */
#if defined (SIGLOST) /* resource lost (eg, record-lock lost) */
signal_names[SIGLOST] = "SIGLOST";
#endif
/* AIX */
#if defined (SIGMSG) /* HFT input data pending */
signal_names[SIGMSG] = "SIGMSG";
#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 (SIGPHONE) /* Phone interrupt */
signal_names[SIGPHONE] = "SIGPHONE";
#endif
#if defined (SIGVIRT) /* AIX virtual time alarm */
signal_names[SIGVIRT] = "SIGVIRT";
#endif
#if defined (SIGTINT) /* Interrupt */
signal_names[SIGTINT] = "SIGTINT";
#endif
#if defined (SIGALRM1) /* m:n condition variables */
signal_names[SIGALRM1] = "SIGALRM1";
#endif
#if defined (SIGWAITING) /* m:n scheduling */
signal_names[SIGWAITING] = "SIGWAITING";
#endif
#if defined (SIGGRANT) /* HFT monitor mode granted */
signal_names[SIGGRANT] = "SIGGRANT";
#endif
#if defined (SIGKAP) /* keep alive poll from native keyboard */
signal_names[SIGKAP] = "SIGKAP";
#endif
#if defined (SIGRETRACT) /* HFT monitor mode retracted */
signal_names[SIGRETRACT] = "SIGRETRACT";
#endif
#if defined (SIGSOUND) /* HFT sound sequence has completed */
signal_names[SIGSOUND] = "SIGSOUND";
#endif
#if defined (SIGSAK) /* Secure Attention Key */
signal_names[SIGSAK] = "SIGSAK";
#endif
#if defined (SIGCPUFAIL) /* Predictive processor deconfiguration */
signal_names[SIGCPUFAIL] = "SIGCPUFAIL";
#endif
#if defined (SIGAIO) /* Asynchronous I/O */
signal_names[SIGAIO] = "SIGAIO";
#endif
#if defined (SIGLAB) /* Security label changed */
signal_names[SIGLAB] = "SIGLAB";
#endif
/* SunOS5 */
#if defined (SIGLWP) /* Solaris: special signal used by thread library */
signal_names[SIGLWP] = "SIGLWP";
#endif
#if defined (SIGFREEZE) /* Solaris: special signal used by CPR */
signal_names[SIGFREEZE] = "SIGFREEZE";
#endif
#if defined (SIGTHAW) /* Solaris: special signal used by CPR */
signal_names[SIGTHAW] = "SIGTHAW";
#endif
#if defined (SIGCANCEL) /* Solaris: thread cancellation signal used by libthread */
signal_names[SIGCANCEL] = "SIGCANCEL";
#endif
#if defined (SIGXRES) /* Solaris: resource control exceeded */
signal_names[SIGXRES] = "SIGXRES";
#endif
#if defined (SIGJVM1) /* Solaris: Java Virtual Machine 1 */
signal_names[SIGJVM1] = "SIGJVM1";
#endif
#if defined (SIGJVM2) /* Solaris: Java Virtual Machine 2 */
signal_names[SIGJVM2] = "SIGJVM2";
#endif
#if defined (SIGDGTIMER1)
signal_names[SIGDGTIMER1] = "SIGDGTIMER1";
#endif
#if defined (SIGDGTIMER2)
signal_names[SIGDGTIMER2] = "SIGDGTIMER2";
#endif
#if defined (SIGDGTIMER3)
signal_names[SIGDGTIMER3] = "SIGDGTIMER3";
#endif
#if defined (SIGDGTIMER4)
signal_names[SIGDGTIMER4] = "SIGDGTIMER4";
#endif
#if defined (SIGDGNOTIFY)
signal_names[SIGDGNOTIFY] = "SIGDGNOTIFY";
#endif
/* Apollo */
#if defined (SIGAPOLLO)
signal_names[SIGAPOLLO] = "SIGAPOLLO";
#endif
/* HP-UX */
#if defined (SIGDIL) /* DIL signal (?) */
signal_names[SIGDIL] = "SIGDIL";
#endif
/* System V */
#if defined (SIGCLD) /* Like SIGCHLD. */
signal_names[SIGCLD] = "SIGCLD";
#endif
#if defined (SIGPWR) /* power state indication */
signal_names[SIGPWR] = "SIGPWR";
#endif
#if defined (SIGPOLL) /* Pollable event (for streams) */
signal_names[SIGPOLL] = "SIGPOLL";
#endif
/* Unknown */
#if defined (SIGWINDOW)
signal_names[SIGWINDOW] = "SIGWINDOW";
#endif
/* Linux */
#if defined (SIGSTKFLT)
signal_names[SIGSTKFLT] = "SIGSTKFLT";
#endif
/* FreeBSD */
#if defined (SIGTHR) /* thread interrupt */
signal_names[SIGTHR] = "SIGTHR";
#endif
/* Common */
#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 (SIGIOT) /* IOT instruction */
signal_names[SIGIOT] = "SIGIOT";
#endif
#if defined (SIGABRT) /* Cause current process to dump core. */
signal_names[SIGABRT] = "SIGABRT";
#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 (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
/* 4.4 BSD */
#if defined (SIGINFO) && !defined (_SEQUENT_) /* information request */
signal_names[SIGINFO] = "SIGINFO";
#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 (SIGKILLTHR) /* BeOS: Kill Thread */
signal_names[SIGKILLTHR] = "SIGKILLTHR";
#endif
for (i = 0; i < NSIG; i++)
if (signal_names[i] == (char *)NULL)
{
signal_names[i] = (char *)malloc (18);
if (signal_names[i])
sprintf (signal_names[i], "SIGJUNK(%d)", i);
}
signal_names[NSIG] = "DEBUG";
signal_names[NSIG+1] = "ERR";
signal_names[NSIG+2] = "RETURN";
}

1996
support/texi2dvi Executable file

File diff suppressed because it is too large Load diff

5428
support/texi2html Executable file

File diff suppressed because it is too large Load diff

98
support/xcase.c Normal file
View file

@ -0,0 +1,98 @@
/* xcase - change uppercase characters to lowercase or vice versa. */
/* Copyright (C) 2008,2009 Free Software Foundation, Inc.
This file is part of GNU Bash.
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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <ctype.h>
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "bashansi.h"
#include <errno.h>
#ifndef errno
extern int errno;
#endif
extern int optind;
#define LOWER 1
#define UPPER 2
int
main(ac, av)
int ac;
char **av;
{
int c, x;
int op;
FILE *inf;
op = 0;
while ((c = getopt(ac, av, "lnu")) != EOF) {
switch (c) {
case 'n':
setbuf (stdout, (char *)NULL);
break;
case 'u':
op = UPPER;
break;
case 'l':
op = LOWER;
break;
default:
fprintf(stderr, "casemod: usage: casemod [-lnu] [file]\n");
exit(2);
}
}
av += optind;
ac -= optind;
if (av[0] && (av[0][0] != '-' || av[0][1])) {
inf = fopen(av[0], "r");
if (inf == 0) {
fprintf(stderr, "casemod: %s: cannot open: %s\n", av[0], strerror(errno));
exit(1);
}
} else
inf = stdin;
while ((c = getc(inf)) != EOF) {
switch (op) {
case UPPER:
x = islower(c) ? toupper(c) : c;
break;
case LOWER:
x = isupper(c) ? tolower(c) : c;
break;
default:
x = c;
break;
}
putchar(x);
}
exit(0);
}

84
support/xenix-link.sh Executable file
View file

@ -0,0 +1,84 @@
:
# link bash for Xenix under SCO Unix
#
# For xenix 2.2:
# CC="cc -xenix -lx" ./configure
# edit config.h:
# comment out the define for HAVE_DIRENT_H
# enable the define for HAVE_SYS_NDIR_H to 1
# make
# CC="cc -xenix -lx" ./link.sh
#
# For xenix 2.3:
# CC="cc -x2.3" ./configure
# make
# CC="cc -x2.3" ./link.sh
# Copyright (C) 1989-2002 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
#
set -x
rm -f bash
if [ -z "$CC" ]
then
if [ -f /unix ] && [ ! -f /xenix ]
then
CC="cc -xenix"
else
CC=gcc
fi
fi
try_dir=no
try_23=no
try_x=yes
case "$CC" in
*-ldir*) try_dir=yes ;;
esac
case "$CC" in
*-lx*) try_23=no ; try_x=yes ;;
esac
case "$CC" in
*-x2.3*|*-l2.3*) try_23=yes ; try_dir=yes ;;
esac
libs=
try="socket"
if [ $try_dir = yes ] ; then try="$try dir" ; fi
if [ $try_23 = yes ] ; then try="$try 2.3" ; fi
if [ $try_x = yes ] ; then try="$try x" ; fi
for name in $try
do
if [ -r "/lib/386/Slib${name}.a" ] ; then libs="$libs -l$name" ; fi
done
$CC -o bash shell.o eval.o y.tab.o \
general.o make_cmd.o print_cmd.o dispose_cmd.o execute_cmd.o variables.o \
copy_cmd.o error.o expr.o flags.o nojobs.o subst.o hashcmd.o hashlib.o \
mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o \
version.o alias.o array.o braces.o bracecomp.o bashhist.o bashline.o \
getcwd.o siglist.o vprint.o oslib.o list.o stringlib.o locale.o \
xmalloc.o builtins/libbuiltins.a \
lib/readline/libreadline.a lib/readline/libhistory.a \
-ltermcap lib/glob/libglob.a lib/tilde/libtilde.a lib/malloc/libmalloc.a \
$libs
ls -l bash

43
support/zecho.c Normal file
View file

@ -0,0 +1,43 @@
/* zecho - bare-bones echo */
/* Copyright (C) 1996-2002 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 3 of the License, 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. If not, see <http://www.gnu.org/licenses/>.
*/
#if defined (HAVE_CONFIG_H)
# include <config.h>
#endif
#include "bashansi.h"
#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);
}