aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2021-03-14 16:33:13 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2021-03-14 16:33:13 +0000
commit5224c2a3bc95b431f729f3692f264395248d8acc (patch)
tree14902c7a6404347d7fb998331b5fdd65f11626a9
parent9db44a8e5da9bf1ce6dd1c0f1468ddafed6d6c91 (diff)
parent1b174d6cdff5276d6dad729c6fe9352d9ee5da7d (diff)
downloadsrc-5224c2a3bc95b431f729f3692f264395248d8acc.tar.gz
src-5224c2a3bc95b431f729f3692f264395248d8acc.zip
Merge tcsh 6.22.03-ceccc7f
PR: 252663 MFC after: 1 week
-rw-r--r--contrib/tcsh/FAQ339
-rw-r--r--contrib/tcsh/Fixes23
-rw-r--r--contrib/tcsh/Imakefile14
-rw-r--r--contrib/tcsh/Makefile.ADMIN24
-rw-r--r--contrib/tcsh/Makefile.in11
-rw-r--r--contrib/tcsh/Makefile.std2
-rw-r--r--contrib/tcsh/Makefile.vms2
-rw-r--r--contrib/tcsh/README.md9
-rwxr-xr-xcontrib/tcsh/configure2449
-rw-r--r--contrib/tcsh/dot.login12
-rw-r--r--contrib/tcsh/dot.tcshrc110
-rw-r--r--contrib/tcsh/ed.chared.c18
-rw-r--r--contrib/tcsh/ed.inputl.c2
-rw-r--r--contrib/tcsh/ed.screen.c2
-rw-r--r--contrib/tcsh/ed.xmap.c2
-rw-r--r--contrib/tcsh/host.defs2
-rw-r--r--contrib/tcsh/patchlevel.h6
-rw-r--r--contrib/tcsh/sh.c17
-rw-r--r--contrib/tcsh/sh.dir.c41
-rw-r--r--contrib/tcsh/sh.dol.c132
-rw-r--r--contrib/tcsh/sh.exp.c2
-rw-r--r--contrib/tcsh/sh.func.c5
-rw-r--r--contrib/tcsh/sh.glob.c11
-rw-r--r--contrib/tcsh/sh.h6
-rw-r--r--contrib/tcsh/sh.hist.c10
-rw-r--r--contrib/tcsh/sh.lex.c47
-rw-r--r--contrib/tcsh/sh.misc.c21
-rw-r--r--contrib/tcsh/sh.set.c14
-rw-r--r--contrib/tcsh/tc.alloc.c10
-rw-r--r--contrib/tcsh/tc.disc.c4
-rw-r--r--contrib/tcsh/tc.os.c2
-rw-r--r--contrib/tcsh/tc.prompt.c2
-rw-r--r--contrib/tcsh/tcsh.man21
-rw-r--r--contrib/tcsh/tcsh.man.new64
-rw-r--r--contrib/tcsh/tw.parse.c4
35 files changed, 2178 insertions, 1262 deletions
diff --git a/contrib/tcsh/FAQ b/contrib/tcsh/FAQ
index 92aadc726683..93773c52433a 100644
--- a/contrib/tcsh/FAQ
+++ b/contrib/tcsh/FAQ
@@ -1,237 +1,190 @@
+ * Home
+ * FAQ
+ * Y2K
+ __________________________________________________________________
- [Home] FAQ
+FAQ
- Home | RecentChanges | Preferences
- _________________________________________________________________
+ For the people who do not read the manual!
- This is for people who do not read the manual!
+ Why is the meta key broken in tcsh-5.20 and up?
- So far people who don't read manuals don't read this either... I may
- call it README.*PLEASE* in the future, but then the same people won't
- be able to get ftp it... :-)
- _________________________________________________________________
-
- 1. Where can I find tcsh sources?
-
- See http://www.tcsh.org/MostRecentRelease for download locations.
- _________________________________________________________________
-
- 2. Why is the meta key broken in tcsh-5.20 and up?
-
- On some machines the tty is not set up to pass 8 bit characters by
- default. Tcsh 5.19 used to try to determine if pass8 should be set by
+ On some machines the tty is not set up to pass 8 bit characters by
+ default. Tcsh 5.19 used to try to determine if pass8 should be set by
looking at the terminal's meta key. Unfortunately there is no good way
- of determining if the terminal can really pass 8 characters or not.
- Consider if you are logged in through a modem line with 7 bits and
- parity and your terminal has a meta key. Then tcsh 5.19 would set
+ of determining if the terminal can really pass 8 characters or not.
+ Consider if you are logged in through a modem line with 7 bits and
+ parity and your terminal has a meta key. Then tcsh 5.19 would set
wrongly set pass8.
- If you did like the previous behavior you can add in /etc/csh.login,
- or in .login:
-
+ If you did like the previous behavior you can add in /etc/csh.login, or
+ in .login:
if ( $?tcsh && $?prompt ) then
if ( "`echotc meta`" == "yes" ) then
stty pass8
endif
endif
- If you don't have pass8, maybe one of these would work..
-
+ If you don't have pass8, maybe one of these would work:
stty -parity -evenp -oddp cs8 -istrip (rs6000)
stty -parenb -istrip cs8
- Finally, tcsh will bind all printable meta characters to the self
- insert command. If you don't want that to happen (i.e. use the
+ Finally, tcsh will bind all printable meta characters to the self
+ insert command. If you don't want that to happen (i.e. use the
printable meta characters for commands) setenv NOREBIND.
- _________________________________________________________________
- 3. I ran 'dbxtool &' and 'shelltool &' from tcsh, and they end up in
- cbreak and no echo mode?
-
- These programs are broken. Background jobs should not try to look at
- the tty. What happens is that dbxtool looks in stderr to inherit the
- tty setups, but tcsh sets up the tty in cbreak and -echo modes, so
- that it can do line editing. This cannot be fixed because tcsh cannot
- give away the tty. Pick one of the following as a workaround:
+ I ran dbxtool & and shelltool & from tcsh, and they end up in cbreak and no
+ echo mode?
+ These programs are broken. Background jobs should not try to look at
+ the tty. What happens is that dbxtool looks in stderr to inherit the
+ tty setups, but tcsh sets up the tty in cbreak and -echo modes, so that
+ it can do line editing. This cannot be fixed because tcsh cannot give
+ away the tty. Pick one of the following as a workaround:
dbxtool < /dev/null >& /dev/null &
/usr/etc/setsid dbxtool &
- If that does not work, for dbxtool at least you can add "sh stty sane"
- in your .dbxinit
- _________________________________________________________________
+ If that does not work, for dbxtool at least you can add sh stty sane in
+ your .dbxinit file.
- 4. I tried to compile tcsh and it cannot find <locale.h>?
+ I tried to compile tcsh and it cannot find <locale.h>?
- Your system does not support NLS. Undefine NLS in config_f.h and it
+ Your system does not support NLS. Undefine NLS in config_f.h and it
should work fine.
- _________________________________________________________________
-
- 5. Where can I get csh sources?
-
- Csh sources are now available with the 4.4BSD networking
- distributions. You don't need csh sources to compile tcsh-6.0x.
- _________________________________________________________________
-
- 6. I just made tcsh my login shell, and I cannot ftp any more?
-
- Newer versions of the ftp daemon check for the validity of the user's
- shell before they allow logins. The list of valid login shells is
- either hardcoded or it is usually in a file called /etc/shells. If it
- is hard-coded, then you are out of luck and your best bet is to get a
- newer version of ftpd. Otherwise add tcsh to the list of shells. [For
- AIX this file is called /etc/security/login.cfg.] Remember that the
- full path is required. If there is no /etc/shells, and you are
- creating one, remember to add /bin/csh, /bin/sh, and any other valid
- shells for your system, so that other people can ftp too :-)
- _________________________________________________________________
-
- 7. I am using SunView or OpenWindows and editing is screwed up. In
- particular my arrow keys and backspace don't work right. What am I
- doing wrong?
-
- Well, cmdtool tries to do its own command line editing and the effect
- you get is one of using an editor inside an editor. Both try to
- interpret the arrow key sequences and cmdtool wins since it gets them
- first. The solutions are in my order of preference:
- 1. Don't use suntools
- 2. Use shelltool instead of cmdtool.
- 3. Unset edit in tcsh.
- _________________________________________________________________
+ Where can I get csh sources?
+
+ Csh sources are now available with the 4.4BSD networking distributions.
+ You don't need csh sources to compile tcsh-6.0x.
+
+ I just made tcsh my login shell, and I cannot ftp any more?
+
+ Newer versions of the ftp daemon check for the validity of the user's
+ shell before they allow logins. The list of valid login shells is
+ either hardcoded or it is usually in a file called /etc/shells. If it
+ is hard-coded, then you are out of luck and your best bet is to get a
+ newer version of ftpd. Otherwise add tcsh to the list of shells. (For
+ AIX this file is called /etc/security/login.cfg.) Remember that the
+ full path is required. If there is no /etc/shells, and you are creating
+ one, remember to add /bin/csh, /bin/sh, and any other valid shells for
+ your system, so that other people can ftp too.
- 8. On a SPARCstation running Solaris 2.x and OpenWindows 3.1, inside a
- cmdtool, the short-cut key sequence to clear log (i.e. Meta-e or
- Diamond-e) doesn't work: it just echos 'e'; or
+ I am using SunView or OpenWindows and editing is screwed up. In particular my
+ arrow keys and backspace don't work right. What am I doing wrong?
+
+ Well, cmdtool tries to do its own command line editing and the effect
+ you get is one of using an editor inside an editor. Both try to
+ interpret the arrow key sequences and cmdtool wins since it gets them
+ first. The solutions are in my order of preference:
+ * Don't use suntools
+ * Use shelltool instead of cmdtool.
+ * Unset edit in tcsh.
+
+ On a SPARCstation running Solaris 2.x and OpenWindows 3.1, inside a cmdtool,
+ the short-cut key sequence to clear log (i.e. Meta-e or Diamond-e) doesn't
+ work: it just echos ‘e’; or
Unset edit in tcsh.
- _________________________________________________________________
- 9. On a SPARCstation running Solaris 2.x and OpenWindows 3.1, maketool
- (within SPARCworks) doesn't work: it just does a `cd' to the working
- directory then stops.
+ On a SPARCstation running Solaris 2.x and OpenWindows 3.1, maketool (within
+ SPARCworks) doesn't work: it just does a `cd’ to the working directory then
+ stops.
- Unset edit in tcsh. Using shelltool instead of cmdtool does not fix
+ Unset edit in tcsh. Using shelltool instead of cmdtool does not fix
this.
- _________________________________________________________________
- 10. I rlogin to another machine, and then no matter what I tell 'stty'
- I cannot get it to pass 8 bit characters?
+ I rlogin to another machine, and then no matter what I tell stty I cannot get
+ it to pass 8 bit characters?
- Maybe you need to use 'rlogin -8' to tell rlogin to pass 8 bit
+ Maybe you need to use rlogin -8 to tell rlogin to pass 8 bit
characters.
- _________________________________________________________________
- 11. Where do I get the public domain directory library?
+ Where do I get the public domain directory library?
- Anonymous ftp to prep.ai.mit.edu:/pub/gnu/dirent.tar.Z
- _________________________________________________________________
+ Anonymous ftp to ftp://prep.ai.mit.edu/pub/gnu/dirent.tar.Z
- 12. I compiled tcsh using gcc, and when I start up it says: tcsh:
- Warning no access to tty (Invalid Argument). Thus no job control in
- this shell
+ I compiled tcsh using gcc, and when I start up it says: tcsh: Warning no
+ access to tty (Invalid Argument). Thus no job control in this shell
- Your <sys/ioctl.h> file is not ansi compliant. You have one of 3
+ Your <sys/ioctl.h> file is not ansi compliant. You have one of 3
choices:
+ * Run fixincludes from the gcc distribution.
+ * Add -traditional to the gcc flags.
+ * Compile with cc.
- 1. Run fixincludes from the gcc distribution.
- 2. Add -traditional to the gcc flags.
- 3. Compile with cc.
- _________________________________________________________________
-
- 13. I compiled tcsh with the SunOS unbundled compiler and now things
- get echo'ed twice.
+ I compiled tcsh with the SunOS unbundled compiler and now things get echoed
+ twice.
It is a bug in the unbundled optimizer. Lower the optimization level.
- _________________________________________________________________
- 14. How can I use the arrow keys with hpterm?
+ How can I use the arrow keys with hpterm?
Hp terminals use the arrow keys internally. You can tell hpterm not to
do that, by sending it the termcap sequence smkx. Since this has to be
- done all the time, the easiest thing is to put it as an alias for
+ done all the time, the easiest thing is to put it as an alias for
precmd, or inside the prompt:
-
if ($term == "hp") then
set prompt="%{`echotc smkx`%}$prompt"
endif
- Note that by doing that you cannot use pgup and pgdn to scroll... Also
- if you are using termcap, replace "smkx" with "ks"...
- _________________________________________________________________
+ Note that by doing that you cannot use pgup and pgdn to scroll… Also if
+ you are using termcap, replace smkx with ks.
- 15. On POSIX machines ^C and ^Z will do not work when tcsh is a login
- shell?
+ On POSIX machines ^C and ^Z do not work when tcsh is a login shell?
Make sure that the interrupt character is set to ^C and suspend is set
- to ^Z; 'stty -a' will show you the current stty settings; 'stty intr
- ^C susp ^Z' will set them to ^C and ^Z respectively.
- _________________________________________________________________
+ to ^Z; stty -a will show you the current stty settings; stty intr ^C
+ susp ^Z will set them to ^C and ^Z respectively.
- 16. I am trying to compile tcsh and I am getting compile errors that
- look like:
+ I am trying to compile tcsh and I am getting compile errors that look like:
- >sh.c:???: `STR???' undeclared, outside of functions [gcc]
- >"sh.c", line ???: STR??? undefined [cc]
+ sh.c:???: `STR???' undeclared, outside of functions [gcc]
+ "sh.c", line ???: STR??? undefined [cc]
- You interrupted make, while it was making the automatically generated
- headers. Type 'make clean; make'
- _________________________________________________________________
+ You interrupted make, while it was making the automatically generated
+ headers. Type make clean; make
- 17. On the cray, sometimes the CR/LF mapping gets screwed up.
+ On the cray, sometimes the CR/LF mapping gets screwed up.
- You are probably logged in to the cray via telnet. Cray's telnetd
- implements line mode selection the telnet client you are using does
- not implement telnet line mode. This cause the Cray's telnetd to try
- to use KLUDGELINEMODE. You can turn off telnet line mode from the cray
- side by doing a "stty -extproc", or you can get the Cray AIC to build
- a telnetd without KLUDGELINEMODE, or you can compile a new telnet
- client (from the BSD net2 tape), or at least on the suns use: 'mode
- character'.
- _________________________________________________________________
+ You are probably logged in to the cray via telnet. Cray's telnetd
+ implements line mode selection the telnet client you are using does not
+ implement telnet line mode. This cause the Cray's telnetd to try to use
+ KLUDGELINEMODE. You can turn off telnet line mode from the cray side by
+ doing a stty -extproc, or you can get the Cray AIC to build a telnetd
+ without KLUDGELINEMODE, or you can compile a new telnet client (from
+ the BSD net2 tape), or at least on the suns use: mode character.
- 18. On AU/X, I made tcsh my startup shell, but the mac desktop is not
- starting up (no X11 or Finder), and I only get console emulation.
+ On AU/X, I made tcsh my startup shell, but the mac desktop is not starting up
+ (no X11 or Finder), and I only get console emulation.
- This is another manifestation of item 5. Just add the pathname to tcsh
- in /etc/shells and everything should work fine.
- _________________________________________________________________
+ Add the pathname to tcsh in /etc/shells and everything should work
+ fine.
- 19. On machines that use YP (NIS) tilde expansion might end up in
- /dev/null
+ On machines that use YP (NIS) tilde expansion might end up in /dev/null
- If this happens complain to your vendor, to get a new version of NIS.
+ If this happens complain to your vendor, to get a new version of NIS.
You can fix that in tcsh by defining YPBUGS in config.h
- _________________________________________________________________
- 20. Script on SGI 4.0.5 does not give us a tty, so we cannot have job
- control.
+ Script on SGI 4.0.5 does not give us a tty, so we cannot have job control.
Their csh does not have job control either. Try:
-
% script
% cat > /dev/tty
- _________________________________________________________________
- 21. I start tcsh and it takes a couple of minutes to get the prompt.
+ I start tcsh and it takes a couple of minutes to get the prompt.
- You have defined REMOTEHOST and your DNS is not responding. Either
+ You have defined REMOTEHOST and your DNS is not responding. Either
undefine REMOTEHOST and recompile or fix your DNS.
- _________________________________________________________________
-
- 22. If you need help generating your .cshrc file, check out:
- http://www.imada.sdu.dk/~blackie/dotfile/
+ If you need help generating your .cshrc file, check out:
- or
- http://www.dotfiles.com
- _________________________________________________________________
+ * https://github.com/tcsh-org/tcsh/blob/master/dot.tcshrc
+ * https://github.com/tcsh-org/tcsh/blob/master/dot.login
- 23. On POSIX systems the kernel will send hup signals to all the
- processes in the foreground process group if 'stty hupcl' is set.
+ On POSIX systems the kernel will send hup signals to all the processes in the
+ foreground process group if ‘stty hupcl’ is set.
For example
-
./tcsh
echo $$
591
@@ -240,65 +193,51 @@
Will kill everything, since hup will be sent to all tcsh processes. To
avoid that you can set stty -hupcl, but it is not recommended.
- _________________________________________________________________
- 24. When I rsh the meta key stops working on the remote machine.
+ When I rsh the meta key stops working on the remote machine.
- Try using rsh -8; this option is undocumented on some systems, but it
- works. If that does not work, get and use ssh/sshd. You'll be better
+ Try using rsh -8; this option is undocumented on some systems, but it
+ works. If that does not work, get and use ssh/sshd. You'll be better
off from a security point of view anyway.
- _________________________________________________________________
- 25. Tcsh compiled under hp/ux-10.x does not pass resource limits
- correctly when ran on hp/ux-11.x systems.
+ Tcsh compiled under hp/ux-10.x does not pass resource limits correctly when
+ ran on hp/ux-11.x systems.
- This is a problem with lack of ABI compatibility between the two
+ This is a problem with lack of ABI compatibility between the two
systems. The only solution is to recompile.
- _________________________________________________________________
- 26. Refreshing in command line editing can appear broken on some OS's
+ Refreshing in command line editing can appear broken on some OS's
- This is because the termcap/terminfo description lies about the
- ability of the terminal to use tabs. At least on Compaq/DEC Alpha
- OSF/1 3.x and 4.x systems, stty -tabs will cause problems.
- _________________________________________________________________
+ This is because the termcap/terminfo description lies about the ability
+ of the terminal to use tabs. At least on Compaq/DEC Alpha OSF/1 3.x and
+ 4.x systems, stty -tabs will cause problems.
- 27. Where can I learn the merits of tcsh vs. bash vs. csh vs. sh etc?
+ Where can I learn the merits of tcsh vs. bash vs. csh vs. sh etc?
- You can read the manual page section titled [NEW FEATURES] listing
+ You can read the manual page section titled [NEW FEATURES] listing
features that tcsh adds to csh.
- You can read Tom Christiansen's [Csh Programming Considered Harmful],
- a document advocating that csh (and by extension, tcsh) should not be
+ You can read Tom Christiansen's Csh Programming Considered Harmful, a
+ document advocating that csh (and by extension, tcsh) should not be
used for writing shell scripts.
- XXX: Need to find something about [bash], but bash is sh-compatible
- and has many of the same interactive features of tcsh (command
- completion does not appear to be as flexible, though).
-
- [Curtains up: introducing the Z shell] has a pretty good rundown on
- zsh. Aside from the arguments about csh being evil, tcsh appears to
- compare well with zsh [zsh]. Zsh is sh and ksh compatible, with many
- of the interactive features of tcsh.
- _________________________________________________________________
-
- 28. Why does FreeBSD's tcsh do history browsing differently than I
- expect?
+ XXX: Need to find something about bash, but bash is sh-compatible and
+ has many of the same interactive features of tcsh (command completion
+ does not appear to be as flexible, though).
- On FreeBSD, by default, the up arrow is set to
- "history-search-backward", rather than the default "up-history". As a
- result, if you type (part of) a word and press up arrow, you'll see
- previous commands that match the prefix. Pretty useful, actually,
- although it takes some getting used to. You can use bindkey to see
- your settings, and to rebind up & down differently if desired.
- _________________________________________________________________
+ Curtains up: introducing the Z shell has a pretty good rundown on zsh.
+ Aside from the arguments about csh being evil, tcsh appears to compare
+ well with zsh. Zsh is sh and ksh compatible, with many of the
+ interactive features of tcsh.
- Everything else is a bug :-(
+ Why does FreeBSD's tcsh do history browsing differently than I expect?
- Christos
- _________________________________________________________________
+ On FreeBSD, by default, the up arrow is set to history-search-backward,
+ rather than the default up-history. As a result, if you type (part of)
+ a word and press up arrow, you'll see previous commands that match the
+ prefix. Pretty useful, actually, although it takes some getting used
+ to. You can use bindkey to see your settings, and to rebind up & down
+ differently if desired.
+ __________________________________________________________________
- Home | RecentChanges | Preferences
- Edit text of this page | View other revisions
- Last edited April 29, 2004 15:02 (diff)
- Search: ____________________
+ Page content last updated on 2019-12-31
diff --git a/contrib/tcsh/Fixes b/contrib/tcsh/Fixes
index db401f23fad0..e539c8241a86 100644
--- a/contrib/tcsh/Fixes
+++ b/contrib/tcsh/Fixes
@@ -1,3 +1,25 @@
+ 14. Don't crash with 'bindkey "^0" clear-screen' (Karl Jeacle)
+ 13. Fix $x:q:h and $x:q:t return the whole string for strings not containing /
+ 12. V6.22.03 - 20201118
+ 11. Fix $x:q:h and $x:q:t to not crash (alzwded) with strings containing /
+ 10. Block SIGHUP while writing history/directory stack (Brett Frankenberger)
+ 9. Fixed reversed test that broke history merging (Brett Frankenberger)
+ 8. Prevent recursive entry for writing history (Brett Frankenberger)
+ 7. alxwded@github, keep track of the :g and :a modifiers per modifier they
+ affect.
+ 6. alzwded@github, fix infinite loop with :gas variable modifier
+ 5. PR/88: Add a Q: modifier that preserves empty arguments leaving :q
+ alone.
+ 4. V6.22.02 - 20191204
+ 3. Fix version in configure.ac
+ 2. V6.22.01 - 20191201
+ 1. undo PR/88: Preserve empty arguments in :q, since it breaks
+ $ set x=""
+ $ alias test "echo "\""$x:q"\"" is working."
+ $ alias test
+ echo "
+
+ 6. V6.22.00 - 20191128
5. PR/113: Sobomax: avoid infinite loops for -c commands when stdout is
not a tty.
4. Avoid infinite loops during history loads when merging, print a better
@@ -6,6 +28,7 @@
2. PR/94: Small apple issues (SAVESIGVEC, HOSTTYPE)
1. PR/81: Fix range matching issue where we were comparing with the
range character instead of the start of range. [l-z]* would match foo
+
12. V6.21.00 - 20190508
11. Abort history loading on words and lines too long
https://bugzilla.redhat.com/show_bug.cgi?id=1598502
diff --git a/contrib/tcsh/Imakefile b/contrib/tcsh/Imakefile
index be2bebe17ca9..bd1b43b1a24e 100644
--- a/contrib/tcsh/Imakefile
+++ b/contrib/tcsh/Imakefile
@@ -492,14 +492,15 @@ SHSRCS= sh.c sh.dir.c sh.dol.c sh.err.c sh.exec.c \
sh.char.c sh.exp.c sh.file.c sh.func.c \
sh.glob.c sh.hist.c sh.init.c sh.lex.c \
sh.misc.c sh.parse.c sh.print.c sh.proc.c \
- sh.sem.c sh.set.c sh.time.c glob.c \
+ sh.sem.c sh.set.c sh.time.c dotlock.c dotlock.h glob.c \
sh.char.h sh.dir.h sh.proc.h sh.h \
sh.decls.h glob.h ${SYSSRCS}
SHOBJS= sh.${SUF} sh.dir.${SUF} sh.dol.${SUF} sh.err.${SUF} sh.exec.${SUF} \
sh.char.${SUF} sh.exp.${SUF} sh.file.${SUF} sh.func.${SUF} \
sh.glob.${SUF} sh.hist.${SUF} sh.init.${SUF} sh.lex.${SUF} \
sh.misc.${SUF} sh.parse.${SUF} sh.print.${SUF} sh.proc.${SUF} \
- sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} glob.${SUF} ${SYSOBJS}
+ sh.sem.${SUF} sh.set.${SUF} sh.time.${SUF} dotlock.${SUF} glob.${SUF} \
+ ${SYSOBJS}
TWSRCS= tw.decls.h tw.h tw.help.c tw.init.c tw.parse.c tw.spell.c \
tw.comp.c tw.color.c
@@ -512,9 +513,10 @@ EDOBJS= ed.chared.${SUF} ed.refresh.${SUF} ed.screen.${SUF} ed.init.${SUF} \
ed.inputl.${SUF} ed.defns.${SUF} ed.xmap.${SUF} ed.term.${SUF}
TCSRCS= tc.alloc.c tc.bind.c tc.const.c tc.decls.h tc.disc.c \
- tc.func.c tc.os.c tc.os.h tc.printf.c tc.prompt.c \
- tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h tc.vers.c tc.wait.h \
- tc.who.c tc.h
+ tc.func.c tc.nls.c tc.nls.h tc.os.c tc.os.h tc.printf.c tc.prompt.c \
+ tc.disc.${SUF} tc.func.${SUF} tc.nls.${SUF} tc.os.${SUF} \
+ tc.printf.${SUF} tc.sched.c tc.sig.c tc.sig.h tc.str.c sh.types.h \
+ tc.vers.c tc.wait.h tc.who.c tc.h
TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
tc.disc.${SUF} tc.func.${SUF} tc.os.${SUF} tc.printf.${SUF} \
tc.prompt.${SUF} tc.sched.${SUF} tc.sig.${SUF} tc.str.${SUF} \
@@ -524,7 +526,7 @@ MISCF = Makefile.std BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md \
FAQ WishList config_f.h eight-bit.me glob.3 patchlevel.h pathnames.h \
tcsh.man Ported src.desc Imakefile imake.config complete.tcsh \
Makefile.vms termcap.vms snames.h host.defs gethost.c tcsh.man2html \
- Makefile.in configure.ac Makefile.win32 aclocal.m4
+ Makefile.in configure.ac Makefile.win32 aclocal.m4 dot.login dot.tcshrc
CONFSRCS=config/[a-z]*
diff --git a/contrib/tcsh/Makefile.ADMIN b/contrib/tcsh/Makefile.ADMIN
new file mode 100644
index 000000000000..5ad3bb8fb3c5
--- /dev/null
+++ b/contrib/tcsh/Makefile.ADMIN
@@ -0,0 +1,24 @@
+#
+# Makefile.ADMIN
+#
+# Maintenance tasks
+#
+# You can refetch files from the website, then run "git diff" to
+# sanity check any changes before committing.
+#
+
+LYNX= lynx -dump -nolist
+TRIM= expand | sed -e 's/^ *$$//' | cat -s
+WEB= https://www.tcsh.org
+
+PAGES= FAQ
+
+all: ${PAGES}
+
+.for i in ${PAGES}
+$i: force
+ ${LYNX} ${WEB}/${i:tl}/ | ${TRIM} > ${.TARGET}
+.endfor
+
+.DUMMY: force
+force:
diff --git a/contrib/tcsh/Makefile.in b/contrib/tcsh/Makefile.in
index 210b7de72dfe..c6b5f2554cc0 100644
--- a/contrib/tcsh/Makefile.in
+++ b/contrib/tcsh/Makefile.in
@@ -6,6 +6,7 @@
# things; Paul Placeway, CIS Dept., Ohio State University
#
SHELL=/bin/sh
+ENVCMD=/usr/bin/env
VERSION=@PACKAGE_VERSION@
BUILD=tcsh$(EXEEXT)
VPATH=@srcdir@
@@ -410,7 +411,7 @@ AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \
pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \
gethost.c tcsh.man2html configure.ac configure config.h.in \
- tests/testsuite.at aclocal.m4
+ tests/testsuite.at aclocal.m4 dot.login dot.tcshrc
TESTFILES= tests/aliases.at tests/arguments.at tests/commands.at \
tests/expr.at tests/lexical.at tests/mb-eucjp.at \
tests/mb-utf8.at tests/noexec.at tests/parenthesis.at tests/syntax.at \
@@ -634,6 +635,8 @@ veryclean: clean
${RM} -f Makefile config.h config_p.h
${RM} -f config.status config.cache config.log tcsh.ps
${RM} -f missing
+ ${RM} -f testsuite.log
+ ${RM} -rf testsuite.dir
${RM} -rf autom4te.cache
${RM} -f *~ #*
@@ -735,8 +738,10 @@ $(srcdir)/stamp-h.in: $(srcdir)/configure.ac
cd $(srcdir) && autoheader
@echo timestamp > $(srcdir)/stamp-h.in
-check: atconfig $(srcdir)/tests/testsuite
- $(SHELL) $(srcdir)/tests/testsuite
+check test: atconfig $(srcdir)/tests/testsuite
+ $(ENVCMD) - \
+ USER="$(USER)" \
+ $(SHELL) $(srcdir)/tests/testsuite
#
# Dependencies
diff --git a/contrib/tcsh/Makefile.std b/contrib/tcsh/Makefile.std
index 3466d4ceac86..8c479fa1f213 100644
--- a/contrib/tcsh/Makefile.std
+++ b/contrib/tcsh/Makefile.std
@@ -320,7 +320,7 @@ AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \
pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \
gethost.c tcsh.man2html configure.ac configure config.h.in \
- aclocal.m4
+ aclocal.m4 dot.login dot.tcshrc
VHSRCS=${PVSRCS} ${AVSRCS}
diff --git a/contrib/tcsh/Makefile.vms b/contrib/tcsh/Makefile.vms
index bc241147e253..2e3f4adbfed4 100644
--- a/contrib/tcsh/Makefile.vms
+++ b/contrib/tcsh/Makefile.vms
@@ -297,7 +297,7 @@ AVSRCS= BUILDING Fixes MAKEDIFFS MAKESHAR NewThings README.md FAQ \
WishList config_f.h eight-bit.me glob.3 patchlevel.h \
pathnames.h tcsh.man Ported src.desc Imakefile imake.config \
complete.tcsh vmsreadme.txt termcap.vms snames.h host.defs \
- gethost.c tcsh.man2html configure.ac aclocal.m4
+ gethost.c tcsh.man2html configure.ac aclocal.m4 dot.login dot.tcshrc
VHSRCS=${PVSRCS} ${AVSRCS}
diff --git a/contrib/tcsh/README.md b/contrib/tcsh/README.md
index 58a30738daa6..df6671b0316e 100644
--- a/contrib/tcsh/README.md
+++ b/contrib/tcsh/README.md
@@ -5,7 +5,7 @@
The Tcsh source code is available on GitHub as a read-only repo
mirror at:
-> http://github.com/tcsh-org/tcsh
+> https://github.com/tcsh-org/tcsh
Instructions for compiling Tcsh can be found in [BUILDING].
@@ -20,7 +20,10 @@ the tcsh mailing list:
> https://mailman.astron.com/mailman/listinfo/tcsh
[![Build Status][status]][travis]
+[![Coverity Scan][badge]][coverity]
[BUILDING]: BUILDING
-[status]: https://travis-ci.org/tcsh-org/tcsh.svg?branch=master
-[travis]: https://travis-ci.org/tcsh-org/tcsh
+[badge]: https://scan.coverity.com/projects/20307/badge.svg
+[coverity]: https://scan.coverity.com/projects/tcsh-org-tcsh
+[status]: https://travis-ci.com/tcsh-org/tcsh.svg?branch=master
+[travis]: https://travis-ci.com/tcsh-org/tcsh
diff --git a/contrib/tcsh/configure b/contrib/tcsh/configure
index 4e724c2bfb80..27a6bec356a0 100755
--- a/contrib/tcsh/configure
+++ b/contrib/tcsh/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for tcsh 6.21.00.
+# Generated by GNU Autoconf 2.69 for tcsh 6.22.03.
#
# Report bugs to <https://bugs.astron.com/>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='tcsh'
PACKAGE_TARNAME='tcsh'
-PACKAGE_VERSION='6.21.00'
-PACKAGE_STRING='tcsh 6.21.00'
+PACKAGE_VERSION='6.22.03'
+PACKAGE_STRING='tcsh 6.22.03'
PACKAGE_BUGREPORT='https://bugs.astron.com/'
PACKAGE_URL=''
@@ -628,10 +628,10 @@ BUILD_CATALOGS
HESLIB
HESDEF
DFLAGS
-LTLIBICONV
-LIBICONV
CC_FOR_GETHOST
GENCAT
+LTLIBICONV
+LIBICONV
EGREP
GREP
CPP
@@ -1250,7 +1250,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures tcsh 6.21.00 to adapt to many kinds of systems.
+\`configure' configures tcsh 6.22.03 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1315,7 +1315,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tcsh 6.21.00:";;
+ short | recursive ) echo "Configuration of tcsh 6.22.03:";;
esac
cat <<\_ACEOF
@@ -1411,7 +1411,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-tcsh configure 6.21.00
+tcsh configure 6.22.03
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2174,7 +2174,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tcsh $as_me 6.21.00, which was
+It was created by tcsh $as_me 6.22.03, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2723,269 +2723,21 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking cached host tuple" >&5
-$as_echo_n "checking cached host tuple... " >&6; }
-if { test x"${ac_cv_host_system_type+set}" = x"set" &&
- test x"$ac_cv_host_system_type" != x"$host"; }; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: different" >&5
-$as_echo "different" >&6; }
- as_fn_error $? "remove config.cache and re-run configure" "$LINENO" 5
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
-$as_echo "ok" >&6; }
-fi
-ac_cv_host_system_type="$host"
-
-
-
-case "${host}" in
-
- ## Alpha (DEC) machines.
- alpha*-dec-osf* )
- tcsh_config_file=decosf1
- ;;
-
- ## Ultrix
- *-dec-ultrix* )
- tcsh_config_file=ultrix
- ;;
-
- ## DGUX
- *-dg-dguxR4* )
- tcsh_config_file=dgux5.4
- ;;
- m88k-dg-dgux5.4R* )
- tcsh_config_file=dgux5.4
- ;;
-
- ## HP/UX
- *-hp-hpux7* )
- tcsh_config_file=hpux7
- ;;
- *-hp-hpux[89]* )
- tcsh_config_file=hpux8
- ;;
- *-hp-hpux1[0-9]* )
- tcsh_config_file=hpux11
- ;;
-
- ## IBM AIX systems
- *-ibm-aix*)
- tcsh_config_file=aix
- ;;
-
- ## SX-4
- sx4-nec-*)
- CC='cc -h0,ansi,novector,float0'
- LDFLAGS='-Gsmall'
- tcsh_config_file=superux8
- ;;
-
- ## IBM OS/390 systems
- *-ibm-os390*)
- CC='c89'
- tcsh_config_file=os390
- ;;
-
- ## Android
- *-*-android*)
- tcsh_config_file=android
- ;;
-
- ## Linux
- *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
- tcsh_config_file=linux
- ;;
-
- ## Motorola systems
- m68k-motorola-sysv* )
- tcsh_config_file=sysV68
- ;;
- m88k-motorola-sysv3* )
- tcsh_config_file=sysV88
- ;;
-
- ## Minix systems
- *-*-minix*)
- tcsh_config_file=minix
- ;;
-
- ## NetBSD systems
- *-*-netbsd*)
- tcsh_config_file=bsd4.4
- ;;
-
- ## FreeBSD systems
- *-*-freebsd*)
- tcsh_config_file=bsd4.4
- ;;
-
- ## MidnightBSD systems
- *-*-midnightbsd*)
- tcsh_config_file=bsd4.4
- ;;
-
- ## DragonFlyBSD systems
- *-*-dragonfly*)
- tcsh_config_file=bsd4.4
- ;;
-
- ## MirBSD systems
- *-*-mirbsd*)
- tcsh_config_file=bsd4.4
- ;;
-
- ## OpenBSD systems
- *-*-openbsd*)
- tcsh_config_file=bsd4.4
- ;;
-
- ## BSDI systems
- *-*-bsdi*)
- tcsh_config_file=bsd4.4
- ;;
-
- ## Mac OS X Server
- *-*-rhapsody* )
- tcsh_config_file=bsd4.4
- ;;
-
- ## Mac OS X Server
- *-*-darwin* )
- tcsh_config_file=bsd4.4
- ;;
-
- ## DragonFly systems
- *-*-dragonfly*)
- tcsh_config_file=bsd4.4
- ;;
-
- ## Silicon Graphics machines
- *-sgi-iri* )
- tcsh_config_file=irix
- case "${host_os}" in
- irix[34]*) # Irix-3.x - Irix 4.x
- NON_GNU_DFLAGS='-D__STDC__'
- LIBS='-lsun -lbsd -lc_s'
- ;;
- irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
- LIBS='-lbsd'
- ;;
- irix6.[2-9]*) # Irix 6.2 and later
- tcsh_config_file=irix62
- ;;
- esac
- ;;
-
- ## Suns
- *-sun-sunos3* )
- tcsh_config_file=sunos35
- ;;
- *-sun-sunos4.0* )
- tcsh_config_file=sunos40
- ;;
- *-sun-sunos4.1.[12]* )
- tcsh_config_file=sunos41
- ;;
- *-sun-sunos4.1.[3456]* )
- tcsh_config_file=sunos413
- ;;
- *-*-solaris2.[01] ) # Should handle sparc or x86
- tcsh_config_file=sol2
- ;;
- *-sun-solaris2.2 ) # Sparc only release
- tcsh_config_file=sol22
- ;;
- *-sun-solaris2.3 ) # Sparc only release
- tcsh_config_file=sol23
- ;;
- *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
- tcsh_config_file=sol24
- ;;
- *-*-solaris2.[678] ) # Should handle sparc, x86 and powerpc
- tcsh_config_file=sol26
- ;;
- *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
- tcsh_config_file=sol29
- ;;
-
- ## Dell SVR4
- *-dell-sysv4* )
- tcsh_config_file=sysv4
- DFLAGS="$DFLAGS -DDELL"
- ;;
-
- ## SVR4 (Generic and otherwise)
- *-*-sysv4* )
- tcsh_config_file=sysv4
- ;;
-
- ## Tektronix systems
- m68k-tektronix-bsd* )
- tcsh_config_file=bsd
- NON_GNU_DFLAGS='-DBSD -DUTek'
- ;;
- m88k-tektronix-sysv3* )
- tcsh_config_file=tekXD88
- ;;
-
- ## SCO
- *-sco3.2v5*)
- tcsh_config_file=sco32v5
- ;;
- *-sco3.2v4*)
- tcsh_config_file=sco32v4
- ;;
- *-sco3.2v2*)
- tcsh_config_file=sco32v2
- ;;
-
- ## Siemens BS2000 Mainframe
- bs2000-siemens-*)
- tcsh_config_file=bs2000
- ;;
-
- ## Convex
- *-convex*)
- tcsh_config_file=convex
- ;;
-
- ## Cray
- *-cray-unicos*)
- tcsh_config_file=cray
- ;;
-
- ## Red Hat Cygwin
- *-cygwin)
- tcsh_config_file=cygwin
- ;;
-
- ## mips-compaq-nonstopux
- *-*-nonstopux)
- tcsh_config_file=sysv4
- ;;
-
- ## Apollo Domain/OS
- *-apollo-*)
- tcsh_config_file=apollo
- ;;
-
- ## QNX6
- *-qnx6*)
- tcsh_config_file=qnx6
- ;;
-
- * )
- as_fn_error $? "Tcsh can't guess the configuration file name
-for \`${host}' systems.
-Check tcsh's \`Ported' file for manual configuration instructions." "$LINENO" 5
- ;;
-
-esac
-
-echo "Tcsh will use configuration file \`$tcsh_config_file'."
-cp ${srcdir}/config/${tcsh_config_file} config_p.h
+ if test "X$prefix" = "XNONE"; then
+ acl_final_prefix="$ac_default_prefix"
+ else
+ acl_final_prefix="$prefix"
+ fi
+ if test "X$exec_prefix" = "XNONE"; then
+ acl_final_exec_prefix='${prefix}'
+ else
+ acl_final_exec_prefix="$exec_prefix"
+ fi
+ acl_save_prefix="$prefix"
+ prefix="$acl_final_prefix"
+ eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+ prefix="$acl_save_prefix"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -3776,6 +3528,160 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+ withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+ # contains only /bin. Note that ksh looks also at the FPATH variable,
+ # so we have to set that as well for the test.
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+ || PATH_SEPARATOR=';'
+ }
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
+ while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${acl_cv_path_LD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -z "$LD"; then
+ acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$acl_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ acl_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_ifs"
+else
+ acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${acl_cv_prog_gnu_ld+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ acl_cv_prog_gnu_ld=yes
+ ;;
+*)
+ acl_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
+$as_echo "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
+
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
+$as_echo_n "checking for shared library run path origin... " >&6; }
+if ${acl_cv_rpath+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+ . ./conftest.sh
+ rm -f ./conftest.sh
+ acl_cv_rpath=done
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
+$as_echo "$acl_cv_rpath" >&6; }
+ wl="$acl_cv_wl"
+ acl_libext="$acl_cv_libext"
+ acl_shlibext="$acl_cv_shlibext"
+ acl_libname_spec="$acl_cv_libname_spec"
+ acl_library_names_spec="$acl_cv_library_names_spec"
+ acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+ acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+ acl_hardcode_direct="$acl_cv_hardcode_direct"
+ acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+ # Check whether --enable-rpath was given.
+if test "${enable_rpath+set}" = set; then :
+ enableval=$enable_rpath; :
+else
+ enable_rpath=yes
+fi
+
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3914,7 +3820,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
if ${ac_cv_path_GREP+:} false; then :
@@ -4045,618 +3950,6 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
-if test $ac_cv_c_compiler_gnu = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
-$as_echo_n "checking whether $CC needs -traditional... " >&6; }
-if ${ac_cv_prog_gcc_traditional+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_pattern="Autoconf.*'x'"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sgtty.h>
-Autoconf TIOCGETP
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "$ac_pattern" >/dev/null 2>&1; then :
- ac_cv_prog_gcc_traditional=yes
-else
- ac_cv_prog_gcc_traditional=no
-fi
-rm -f conftest*
-
-
- if test $ac_cv_prog_gcc_traditional = no; then
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <termio.h>
-Autoconf TCGETA
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "$ac_pattern" >/dev/null 2>&1; then :
- ac_cv_prog_gcc_traditional=yes
-fi
-rm -f conftest*
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
-$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
- if test $ac_cv_prog_gcc_traditional = yes; then
- CC="$CC -traditional"
- fi
-fi
-
-
-# Extract the first word of "gencat", so it can be a program name with args.
-set dummy gencat; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_GENCAT+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- case $GENCAT in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_GENCAT="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-GENCAT=$ac_cv_path_GENCAT
-if test -n "$GENCAT"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENCAT" >&5
-$as_echo "$GENCAT" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-if test "x${cross_compiling}" = xyes ; then
- CC_FOR_GETHOST="cc"
-else
- CC_FOR_GETHOST="\$(CC)"
-fi
-
-
-if test "x$GCC" != xyes ; then
- DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
- CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
-fi
-
-case "${host}" in
- *-*-android*)
- CFLAGS="${CFLAGS} -fPIE"
- LDFLAGS="${LDFLAGS} -pie"
- ;;
-esac
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
-$as_echo_n "checking for library containing crypt... " >&6; }
-if ${ac_cv_search_crypt+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char crypt ();
-int
-main ()
-{
-return crypt ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' crypt; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_crypt=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_crypt+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_crypt+:} false; then :
-
-else
- ac_cv_search_crypt=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
-$as_echo "$ac_cv_search_crypt" >&6; }
-ac_res=$ac_cv_search_crypt
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getspnam" >&5
-$as_echo_n "checking for library containing getspnam... " >&6; }
-if ${ac_cv_search_getspnam+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char getspnam ();
-int
-main ()
-{
-return getspnam ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' sec; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_getspnam=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_getspnam+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_getspnam+:} false; then :
-
-else
- ac_cv_search_getspnam=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getspnam" >&5
-$as_echo "$ac_cv_search_getspnam" >&6; }
-ac_res=$ac_cv_search_getspnam
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
-$as_echo_n "checking for library containing tgetent... " >&6; }
-if ${ac_cv_search_tgetent+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char tgetent ();
-int
-main ()
-{
-return tgetent ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' termlib tinfo termcap curses ncurses; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_tgetent=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_tgetent+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_tgetent+:} false; then :
-
-else
- ac_cv_search_tgetent=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5
-$as_echo "$ac_cv_search_tgetent" >&6; }
-ac_res=$ac_cv_search_tgetent
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-else
-
- as_fn_error $? "unable to find the tgetent() function" "$LINENO" 5
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
-$as_echo_n "checking for library containing gethostbyname... " >&6; }
-if ${ac_cv_search_gethostbyname+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname ();
-int
-main ()
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' nsl; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_gethostbyname=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_gethostbyname+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_gethostbyname+:} false; then :
-
-else
- ac_cv_search_gethostbyname=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
-$as_echo "$ac_cv_search_gethostbyname" >&6; }
-ac_res=$ac_cv_search_gethostbyname
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing connect" >&5
-$as_echo_n "checking for library containing connect... " >&6; }
-if ${ac_cv_search_connect+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char connect ();
-int
-main ()
-{
-return connect ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' socket; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_connect=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_connect+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_connect+:} false; then :
-
-else
- ac_cv_search_connect=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_connect" >&5
-$as_echo "$ac_cv_search_connect" >&6; }
-ac_res=$ac_cv_search_connect
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing catgets" >&5
-$as_echo_n "checking for library containing catgets... " >&6; }
-if ${ac_cv_search_catgets+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char catgets ();
-int
-main ()
-{
-return catgets ();
- ;
- return 0;
-}
-_ACEOF
-for ac_lib in '' catgets; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_search_catgets=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext
- if ${ac_cv_search_catgets+:} false; then :
- break
-fi
-done
-if ${ac_cv_search_catgets+:} false; then :
-
-else
- ac_cv_search_catgets=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_catgets" >&5
-$as_echo "$ac_cv_search_catgets" >&6; }
-ac_res=$ac_cv_search_catgets
-if test "$ac_res" != no; then :
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
-
- if test "X$prefix" = "XNONE"; then
- acl_final_prefix="$ac_default_prefix"
- else
- acl_final_prefix="$prefix"
- fi
- if test "X$exec_prefix" = "XNONE"; then
- acl_final_exec_prefix='${prefix}'
- else
- acl_final_exec_prefix="$exec_prefix"
- fi
- acl_save_prefix="$prefix"
- prefix="$acl_final_prefix"
- eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
- prefix="$acl_save_prefix"
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
- with_gnu_ld=no
-fi
-
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
- # contains only /bin. Note that ksh looks also at the FPATH variable,
- # so we have to set that as well for the test.
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
- && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
- || PATH_SEPARATOR=';'
- }
-fi
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [\\/]* | ?:[\\/]*)
- re_direlt='/[^/][^/]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
- while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${acl_cv_path_LD+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$LD"; then
- acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$acl_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- acl_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$acl_save_ifs"
-else
- acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
-
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${acl_cv_prog_gnu_ld+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- acl_cv_prog_gnu_ld=yes
- ;;
-*)
- acl_cv_prog_gnu_ld=no
- ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
-$as_echo "$acl_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$acl_cv_prog_gnu_ld
-
-
-
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
-$as_echo_n "checking for shared library run path origin... " >&6; }
-if ${acl_cv_rpath+:} false; then :
- $as_echo_n "(cached) " >&6
-else
-
- CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
- ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
- . ./conftest.sh
- rm -f ./conftest.sh
- acl_cv_rpath=done
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
-$as_echo "$acl_cv_rpath" >&6; }
- wl="$acl_cv_wl"
- acl_libext="$acl_cv_libext"
- acl_shlibext="$acl_cv_shlibext"
- acl_libname_spec="$acl_cv_libname_spec"
- acl_library_names_spec="$acl_cv_library_names_spec"
- acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
- acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
- acl_hardcode_direct="$acl_cv_hardcode_direct"
- acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
- # Check whether --enable-rpath was given.
-if test "${enable_rpath+set}" = set; then :
- enableval=$enable_rpath; :
-else
- enable_rpath=yes
-fi
-
-
acl_libdirstem=lib
@@ -5498,6 +4791,1390 @@ _ACEOF
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking cached host tuple" >&5
+$as_echo_n "checking cached host tuple... " >&6; }
+if { test x"${ac_cv_host_system_type+set}" = x"set" &&
+ test x"$ac_cv_host_system_type" != x"$host"; }; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: different" >&5
+$as_echo "different" >&6; }
+ as_fn_error $? "remove config.cache and re-run configure" "$LINENO" 5
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+ac_cv_host_system_type="$host"
+
+
+
+case "${host}" in
+
+ ## Alpha (DEC) machines.
+ alpha*-dec-osf* )
+ tcsh_config_file=decosf1
+ ;;
+
+ ## Ultrix
+ *-dec-ultrix* )
+ tcsh_config_file=ultrix
+ ;;
+
+ ## DGUX
+ *-dg-dguxR4* )
+ tcsh_config_file=dgux5.4
+ ;;
+ m88k-dg-dgux5.4R* )
+ tcsh_config_file=dgux5.4
+ ;;
+
+ ## HP/UX
+ *-hp-hpux7* )
+ tcsh_config_file=hpux7
+ ;;
+ *-hp-hpux[89]* )
+ tcsh_config_file=hpux8
+ ;;
+ *-hp-hpux1[0-9]* )
+ tcsh_config_file=hpux11
+ ;;
+
+ ## IBM AIX systems
+ *-ibm-aix*)
+ tcsh_config_file=aix
+ ;;
+
+ ## SX-4
+ sx4-nec-*)
+ CC='cc -h0,ansi,novector,float0'
+ LDFLAGS='-Gsmall'
+ tcsh_config_file=superux8
+ ;;
+
+ ## IBM OS/390 systems
+ *-ibm-os390*)
+ CC='c89'
+ tcsh_config_file=os390
+ ;;
+
+ ## Android
+ *-*-android*)
+ tcsh_config_file=android
+ ;;
+
+ ## Linux
+ *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
+ tcsh_config_file=linux
+ ;;
+
+ ## Motorola systems
+ m68k-motorola-sysv* )
+ tcsh_config_file=sysV68
+ ;;
+ m88k-motorola-sysv3* )
+ tcsh_config_file=sysV88
+ ;;
+
+ ## Minix systems
+ *-*-minix*)
+ tcsh_config_file=minix
+ ;;
+
+ ## NetBSD systems
+ *-*-netbsd*)
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## FreeBSD systems
+ *-*-freebsd*)
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## MidnightBSD systems
+ *-*-midnightbsd*)
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## DragonFlyBSD systems
+ *-*-dragonfly*)
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## MirBSD systems
+ *-*-mirbsd*)
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## OpenBSD systems
+ *-*-openbsd*)
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## BSDI systems
+ *-*-bsdi*)
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## Mac OS X Server
+ *-*-rhapsody* )
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## Mac OS X Server
+ *-*-darwin* )
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## DragonFly systems
+ *-*-dragonfly*)
+ tcsh_config_file=bsd4.4
+ ;;
+
+ ## Silicon Graphics machines
+ *-sgi-iri* )
+ tcsh_config_file=irix
+ case "${host_os}" in
+ irix[34]*) # Irix-3.x - Irix 4.x
+ NON_GNU_DFLAGS='-D__STDC__'
+ LIBS='-lsun -lbsd -lc_s'
+ ;;
+ irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
+ LIBS='-lbsd'
+ ;;
+ irix6.[2-9]*) # Irix 6.2 and later
+ tcsh_config_file=irix62
+ ;;
+ esac
+ ;;
+
+ ## Suns
+ *-sun-sunos3* )
+ tcsh_config_file=sunos35
+ ;;
+ *-sun-sunos4.0* )
+ tcsh_config_file=sunos40
+ ;;
+ *-sun-sunos4.1.[12]* )
+ tcsh_config_file=sunos41
+ ;;
+ *-sun-sunos4.1.[3456]* )
+ tcsh_config_file=sunos413
+ ;;
+ *-*-solaris2.[01] ) # Should handle sparc or x86
+ tcsh_config_file=sol2
+ ;;
+ *-sun-solaris2.2 ) # Sparc only release
+ tcsh_config_file=sol22
+ ;;
+ *-sun-solaris2.3 ) # Sparc only release
+ tcsh_config_file=sol23
+ ;;
+ *-*-solaris2.[45] ) # Should handle sparc, x86 and powerpc
+ tcsh_config_file=sol24
+ ;;
+ *-*-solaris2.[678] ) # Should handle sparc, x86 and powerpc
+ tcsh_config_file=sol26
+ ;;
+ *-*-solaris2.* ) # Should handle sparc, x86 and powerpc
+ tcsh_config_file=sol29
+ ;;
+
+ ## Dell SVR4
+ *-dell-sysv4* )
+ tcsh_config_file=sysv4
+ DFLAGS="$DFLAGS -DDELL"
+ ;;
+
+ ## SVR4 (Generic and otherwise)
+ *-*-sysv4* )
+ tcsh_config_file=sysv4
+ ;;
+
+ ## Tektronix systems
+ m68k-tektronix-bsd* )
+ tcsh_config_file=bsd
+ NON_GNU_DFLAGS='-DBSD -DUTek'
+ ;;
+ m88k-tektronix-sysv3* )
+ tcsh_config_file=tekXD88
+ ;;
+
+ ## SCO
+ *-sco3.2v5*)
+ tcsh_config_file=sco32v5
+ ;;
+ *-sco3.2v4*)
+ tcsh_config_file=sco32v4
+ ;;
+ *-sco3.2v2*)
+ tcsh_config_file=sco32v2
+ ;;
+
+ ## Siemens BS2000 Mainframe
+ bs2000-siemens-*)
+ tcsh_config_file=bs2000
+ ;;
+
+ ## Convex
+ *-convex*)
+ tcsh_config_file=convex
+ ;;
+
+ ## Cray
+ *-cray-unicos*)
+ tcsh_config_file=cray
+ ;;
+
+ ## Red Hat Cygwin
+ *-cygwin)
+ tcsh_config_file=cygwin
+ ;;
+
+ ## mips-compaq-nonstopux
+ *-*-nonstopux)
+ tcsh_config_file=sysv4
+ ;;
+
+ ## Apollo Domain/OS
+ *-apollo-*)
+ tcsh_config_file=apollo
+ ;;
+
+ ## QNX6
+ *-qnx6*)
+ tcsh_config_file=qnx6
+ ;;
+
+ * )
+ as_fn_error $? "Tcsh can't guess the configuration file name
+for \`${host}' systems.
+Check tcsh's \`Ported' file for manual configuration instructions." "$LINENO" 5
+ ;;
+
+esac
+
+echo "Tcsh will use configuration file \`$tcsh_config_file'."
+cp ${srcdir}/config/${tcsh_config_file} config_p.h
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ fi
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl.exe
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl.exe
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+ test -n "$ac_ct_CC" && break
+done
+
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+ { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ sed '10a\
+... rest of stderr output deleted ...
+ 10q' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ fi
+ rm -f conftest.er1 conftest.err
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_compiler_gnu=yes
+else
+ ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+ GCC=yes
+else
+ GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+else
+ CFLAGS=""
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c89"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if ${ac_cv_prog_CPP+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+ # Broken: success on invalid input.
+continue
+else
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+if test $ac_cv_c_compiler_gnu = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if ${ac_cv_prog_gcc_traditional+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_pattern="Autoconf.*'x'"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sgtty.h>
+Autoconf TIOCGETP
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+else
+ ac_cv_prog_gcc_traditional=no
+fi
+rm -f conftest*
+
+
+ if test $ac_cv_prog_gcc_traditional = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <termio.h>
+Autoconf TCGETA
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "$ac_pattern" >/dev/null 2>&1; then :
+ ac_cv_prog_gcc_traditional=yes
+fi
+rm -f conftest*
+
+ fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+ if test $ac_cv_prog_gcc_traditional = yes; then
+ CC="$CC -traditional"
+ fi
+fi
+
+
+# Extract the first word of "gencat", so it can be a program name with args.
+set dummy gencat; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_GENCAT+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $GENCAT in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_GENCAT="$GENCAT" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_GENCAT="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+GENCAT=$ac_cv_path_GENCAT
+if test -n "$GENCAT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GENCAT" >&5
+$as_echo "$GENCAT" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+if test "x${cross_compiling}" = xyes ; then
+ CC_FOR_GETHOST="cc"
+else
+ CC_FOR_GETHOST="\$(CC)"
+fi
+
+
+if test "x$GCC" != xyes ; then
+ DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
+ CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
+fi
+
+case "${host}" in
+ *-*-android*)
+ CFLAGS="${CFLAGS} -fPIE"
+ LDFLAGS="${LDFLAGS} -pie"
+ ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
+$as_echo_n "checking for library containing crypt... " >&6; }
+if ${ac_cv_search_crypt+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char crypt ();
+int
+main ()
+{
+return crypt ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' crypt; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_crypt=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_crypt+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_crypt+:} false; then :
+
+else
+ ac_cv_search_crypt=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
+$as_echo "$ac_cv_search_crypt" >&6; }
+ac_res=$ac_cv_search_crypt
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getspnam" >&5
+$as_echo_n "checking for library containing getspnam... " >&6; }
+if ${ac_cv_search_getspnam+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char getspnam ();
+int
+main ()
+{
+return getspnam ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' sec; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_getspnam=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_getspnam+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_getspnam+:} false; then :
+
+else
+ ac_cv_search_getspnam=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getspnam" >&5
+$as_echo "$ac_cv_search_getspnam" >&6; }
+ac_res=$ac_cv_search_getspnam
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5
+$as_echo_n "checking for library containing tgetent... " >&6; }
+if ${ac_cv_search_tgetent+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char tgetent ();
+int
+main ()
+{
+return tgetent ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' termlib tinfo termcap curses ncurses; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_tgetent=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_tgetent+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_tgetent+:} false; then :
+
+else
+ ac_cv_search_tgetent=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5
+$as_echo "$ac_cv_search_tgetent" >&6; }
+ac_res=$ac_cv_search_tgetent
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else
+
+ as_fn_error $? "unable to find the tgetent() function" "$LINENO" 5
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname" >&5
+$as_echo_n "checking for library containing gethostbyname... " >&6; }
+if ${ac_cv_search_gethostbyname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname ();
+int
+main ()
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' nsl; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_gethostbyname=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_gethostbyname+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_gethostbyname+:} false; then :
+
+else
+ ac_cv_search_gethostbyname=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname" >&5
+$as_echo "$ac_cv_search_gethostbyname" >&6; }
+ac_res=$ac_cv_search_gethostbyname
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing connect" >&5
+$as_echo_n "checking for library containing connect... " >&6; }
+if ${ac_cv_search_connect+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char connect ();
+int
+main ()
+{
+return connect ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' socket; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_connect=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_connect+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_connect+:} false; then :
+
+else
+ ac_cv_search_connect=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_connect" >&5
+$as_echo "$ac_cv_search_connect" >&6; }
+ac_res=$ac_cv_search_connect
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing catgets" >&5
+$as_echo_n "checking for library containing catgets... " >&6; }
+if ${ac_cv_search_catgets+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char catgets ();
+int
+main ()
+{
+return catgets ();
+ ;
+ return 0;
+}
+_ACEOF
+for ac_lib in '' catgets; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+ ac_res=-l$ac_lib
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ fi
+ if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_search_catgets=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext
+ if ${ac_cv_search_catgets+:} false; then :
+ break
+fi
+done
+if ${ac_cv_search_catgets+:} false; then :
+
+else
+ ac_cv_search_catgets=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_catgets" >&5
+$as_echo "$ac_cv_search_catgets" >&6; }
+ac_res=$ac_cv_search_catgets
+if test "$ac_res" != no; then :
+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
@@ -7350,7 +8027,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by tcsh $as_me 6.21.00, which was
+This file was extended by tcsh $as_me 6.22.03, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7416,7 +8093,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-tcsh config.status 6.21.00
+tcsh config.status 6.22.03
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/contrib/tcsh/dot.login b/contrib/tcsh/dot.login
new file mode 100644
index 000000000000..18d6f9c9d4d3
--- /dev/null
+++ b/contrib/tcsh/dot.login
@@ -0,0 +1,12 @@
+#
+# ~/.login - Setup user login shell environment
+#
+# See also tcsh(1), environ(7).
+#
+
+setenv EDITOR vi
+setenv PAGER less
+
+# umask 077
+
+# set path=( ~/.local/bin $path:q )
diff --git a/contrib/tcsh/dot.tcshrc b/contrib/tcsh/dot.tcshrc
new file mode 100644
index 000000000000..a155ed56a932
--- /dev/null
+++ b/contrib/tcsh/dot.tcshrc
@@ -0,0 +1,110 @@
+#
+# ~/.tcshrc - Setup user shell environment
+#
+# See also tcsh(1), environ(7).
+#
+
+unalias *
+
+alias h 'history \!* 20'
+alias j 'jobs -l'
+alias ll 'ls -lAF'
+alias md mkdir
+alias rd rmdir
+
+#
+# The following commands are only for interactive shells.
+#
+
+if ( $?prompt ) then
+ set \
+ autocorrect \
+ autoexpand \
+ autolist=ambiguous \
+ correct=cmd \
+ ellipsis \
+ filec \
+ history=1000 \
+ killdup=erase \
+ listjobs=long \
+ listlinks \
+ listmax=100 \
+ nobeep \
+ prompt='%N@%m:%B%c02%b%# ' \
+ rmstar \
+ savehist=(1000 merge) \
+
+ unset promptchars
+
+ if ( $?tcsh ) then
+ bindkey -e
+
+ bindkey " " magic-space
+ bindkey ^W backward-delete-word
+ bindkey ^Z run-fg-editor
+ bindkey ^[^W kill-region
+
+ #
+ # Setup $hosts from ~/.hosts, ~/.rhosts, ~/.ssh/known_hosts
+ #
+
+ if ( ! $?hosts ) then
+ set hosts=()
+ foreach f ( ~/.{,r,ssh/known_}hosts )
+ if ( -r "$f" ) then
+ set hosts=( \
+ $hosts \
+ `sed \
+ -e 's/#.*//' \
+ -e '/^|/d' \
+ -e '/^[+-]@/d' \
+ -e 's/^[+-]//' \
+ -e 's/[[:space:]].*$//' \
+ -e 's/,/\n/g' \
+ "$f" \
+ | sed \
+ -e 's/:[[:digit:]]*$//' \
+ -e 's/^\[\([^]]*\)\]$/\1/' \
+ -e '/^[.:[:xdigit:][:space:]]*$/d' \
+ ` \
+ )
+ endif
+ end
+ unset f
+ endif
+
+ uncomplete *
+
+ #
+ # Copy from complete.tcsh
+ #
+ if ( -r ~/.complete ) source ~/.complete
+
+ uncomplete rcp rsh
+ endif
+
+ #
+ # Set status to ^G in order to keep using ^T for transpose-char.
+ #
+
+ switch ( "$OSTYPE" )
+ case bsd44:
+ case darwin:
+ case FreeBSD:
+ case NetBSD:
+ stty status ^G
+ if ( $?tcsh ) bindkey ^G stuff-char
+ breaksw
+ endsw
+
+ #
+ # We don't want to create a root-owned files in our home.
+ #
+
+ if ( $uid == 0 ) then
+ unset savehist
+ setenv LESSHISTFILE -
+ setenv VIMINIT ':set viminfo='
+ endif
+
+endif
diff --git a/contrib/tcsh/ed.chared.c b/contrib/tcsh/ed.chared.c
index 0301e8fa043d..2b4a63c8ca6e 100644
--- a/contrib/tcsh/ed.chared.c
+++ b/contrib/tcsh/ed.chared.c
@@ -257,7 +257,7 @@ c_preword(Char *p, Char *low, int n, Char *delim)
Char *new;
while (prev < p) { /* Skip initial non-word chars */
- if (!Strchr(delim, *prev) || *(prev-1) == (Char)'\\')
+ if (!Strchr(delim, *prev) || (prev > low && prev[-1] == (Char)'\\'))
break;
prev++;
}
@@ -269,7 +269,7 @@ c_preword(Char *p, Char *low, int n, Char *delim)
new = c_endword(prev-1, p, 1, delim); /* Skip to next non-word char */
new++; /* Step away from end of word */
while (new <= p) { /* Skip trailing non-word chars */
- if (!Strchr(delim, *new) || *(new-1) == (Char)'\\')
+ if (!Strchr(delim, *new) || new > prev && new[-1] == (Char)'\\')
break;
new++;
}
@@ -795,19 +795,19 @@ c_endword(Char *p, Char *high, int n, Char *delim)
while (n--) {
while (p < high) { /* Skip non-word chars */
- if (!Strchr(delim, *p) || *(p-1) == (Char)'\\')
+ if (!Strchr(delim, *p) || p[-1] == (Char)'\\')
break;
p++;
}
while (p < high) { /* Skip string */
if ((*p == (Char)'\'' || *p == (Char)'"')) { /* Quotation marks? */
- if (inquote || *(p-1) != (Char)'\\') { /* Should it be honored? */
+ if (inquote || p[-1] != (Char)'\\') { /* Should it be honored? */
if (inquote == 0) inquote = *p;
else if (inquote == *p) inquote = 0;
}
}
/* Break if unquoted non-word char */
- if (!inquote && Strchr(delim, *p) && *(p-1) != (Char)'\\')
+ if (!inquote && Strchr(delim, *p) && p[-1] != (Char)'\\')
break;
p++;
}
@@ -1472,8 +1472,8 @@ e_insert(Char c)
else {
if (inputmode != MODE_INSERT) {
int i;
- for(i = 0; i < Argument; i++)
- UndoBuf[UndoSize++] = *(Cursor + i);
+ for (i = 0; i < Argument; i++)
+ UndoBuf[UndoSize++] = Cursor[i];
UndoBuf[UndoSize] = '\0';
c_delafter(Argument); /* Do NOT use the saving ONE */
@@ -2923,7 +2923,7 @@ v_csearch_fwd(Char ch, int count, int tflag)
cp = Cursor;
while (count--) {
- if(*cp == ch)
+ if (*cp == ch)
cp++;
while (cp < LastChar && *cp != ch)
cp++;
@@ -3771,7 +3771,7 @@ v_undo(Char c)
size = (int)(Cursor-LastChar); /* NOT NSL independant */
if (size < UndoSize)
size = UndoSize;
- for(loop = 0; loop < size; loop++) {
+ for (loop = 0; loop < size; loop++) {
temp = *kp;
*kp++ = *cp;
*cp++ = temp;
diff --git a/contrib/tcsh/ed.inputl.c b/contrib/tcsh/ed.inputl.c
index bd8cf7815f4b..8d4c341631b0 100644
--- a/contrib/tcsh/ed.inputl.c
+++ b/contrib/tcsh/ed.inputl.c
@@ -862,7 +862,7 @@ SpellLine(int cmdonly)
/*
* This hack avoids correcting drive letter changes
*/
- if((Cursor - InputBuf) != 2 || (char)InputBuf[1] != ':')
+ if ((Cursor - InputBuf) != 2 || (char)InputBuf[1] != ':')
#endif /* WINNT_NATIVE */
{
#ifdef HASH_SPELL_CHECK
diff --git a/contrib/tcsh/ed.screen.c b/contrib/tcsh/ed.screen.c
index 8d240c886a10..e8b351fe800d 100644
--- a/contrib/tcsh/ed.screen.c
+++ b/contrib/tcsh/ed.screen.c
@@ -1217,7 +1217,7 @@ so_write(Char *cp, int n)
Char xc;
if ((xc = Display[CursorV][CursorH]) != '\0') {
so_write(&xc, 1);
- while(Display[CursorV][CursorH] == CHAR_DBWIDTH)
+ while (Display[CursorV][CursorH] == CHAR_DBWIDTH)
CursorH++;
}
else {
diff --git a/contrib/tcsh/ed.xmap.c b/contrib/tcsh/ed.xmap.c
index d76ba46dc9f9..6473519726dd 100644
--- a/contrib/tcsh/ed.xmap.c
+++ b/contrib/tcsh/ed.xmap.c
@@ -698,7 +698,7 @@ parseescape(const Char **ptr)
#endif
}
else
- c = *p;
+ c = *p & CHAR;
*ptr = p;
return (c);
}
diff --git a/contrib/tcsh/host.defs b/contrib/tcsh/host.defs
index 40572cc24271..6e03537fa612 100644
--- a/contrib/tcsh/host.defs
+++ b/contrib/tcsh/host.defs
@@ -851,7 +851,7 @@ machtype: defined(sparc) : "sparc"
enddef :
-newdef : defined(APPLE) && defined(MACH)
+newdef : defined(APPLE)
comment : OS X
vendor : : "apple"
hosttype: defined(i386) : "intel-mac"
diff --git a/contrib/tcsh/patchlevel.h b/contrib/tcsh/patchlevel.h
index adcc1027a0d5..3c71e48b78f3 100644
--- a/contrib/tcsh/patchlevel.h
+++ b/contrib/tcsh/patchlevel.h
@@ -6,8 +6,8 @@
#define ORIGIN "Astron"
#define REV 6
-#define VERS 21
-#define PATCHLEVEL 00
-#define DATE "2019-05-08"
+#define VERS 22
+#define PATCHLEVEL 03
+#define DATE "2020-11-18"
#endif /* _h_patchlevel */
diff --git a/contrib/tcsh/sh.c b/contrib/tcsh/sh.c
index dd871727d2aa..d888e8e91d21 100644
--- a/contrib/tcsh/sh.c
+++ b/contrib/tcsh/sh.c
@@ -179,7 +179,7 @@ add_localedir_to_nlspath(const char *path)
if (path == NULL)
return;
- (void) xsnprintf(trypath, sizeof(trypath), "%s/en/LC_MESSAGES/tcsh.cat",
+ (void) xsnprintf(trypath, sizeof(trypath), "%s/C/LC_MESSAGES/tcsh.cat",
path);
if (stat(trypath, &st) == -1)
return;
@@ -1249,7 +1249,7 @@ main(int argc, char **argv)
* was a session leader .
*/
else if (shpgrp != mygetpgrp()) {
- if(setpgid(0, shpgrp) == -1) {
+ if (setpgid(0, shpgrp) == -1) {
xprintf("setpgid:");
goto notty;
}
@@ -1839,6 +1839,10 @@ exitstat(void)
void
phup(void)
{
+ static int again = 0;
+ if (again++)
+ return;
+
if (loginsh) {
setcopy(STRlogout, STRhangup, VAR_READWRITE);
#ifdef _PATH_DOTLOGOUT
@@ -2516,11 +2520,20 @@ defaultpath(void)
static void
record(void)
{
+ static int again = 0;
+ int ophup_disabled;
+
+ if (again++)
+ return;
+
+ ophup_disabled = phup_disabled;
+ phup_disabled = 1;
if (!fast) {
recdirs(NULL, adrof(STRsavedirs) != NULL);
rechist(NULL, adrof(STRsavehist) != NULL);
}
displayHistStats("Exiting"); /* no-op unless DEBUG_HIST */
+ phup_disabled = ophup_disabled;
}
/*
diff --git a/contrib/tcsh/sh.dir.c b/contrib/tcsh/sh.dir.c
index 4d6a1de25ab3..f57e9950af36 100644
--- a/contrib/tcsh/sh.dir.c
+++ b/contrib/tcsh/sh.dir.c
@@ -48,6 +48,7 @@ static void dextract (struct directory *);
static int skipargs (Char ***, const char *,
const char *);
static void dgetstack (void);
+static Char *dcanon_internal(Char *, Char *);
static struct directory dhead INIT_ZERO_STRUCT; /* "head" of loop */
static int printd; /* force name to be printed */
@@ -148,16 +149,10 @@ dinit(Char *hp)
cleanup_push(tcp, xfree);
}
}
- cleanup_push(tcp, xfree);
cp = dcanon(tcp, STRNULL);
- cleanup_ignore(tcp);
- cleanup_until(tcp);
}
#else /* S_IFLNK */
- cleanup_push(tcp, xfree);
cp = dcanon(tcp, STRNULL);
- cleanup_ignore(tcp);
- cleanup_until(tcp);
#endif /* S_IFLNK */
}
@@ -313,7 +308,7 @@ dtilde(void)
do {
if (d == &dhead)
continue;
- d->di_name = dcanon(d->di_name, STRNULL);
+ d->di_name = dcanon_internal(d->di_name, STRNULL);
} while ((d = d->di_prev) != dcwd);
dset(dcwd->di_name);
@@ -571,16 +566,10 @@ dgoto(Char *cp)
if (ABSOLUTEP(cp) && cp[1] == ':') { /* Only DOS paths are treated that way */
return agetcwd();
} else {
- cleanup_push(cp, xfree);
ret = dcanon(cp, dp);
- cleanup_ignore(cp);
- cleanup_until(cp);
}
#else /* !WINNT_NATIVE */
- cleanup_push(cp, xfree);
ret = dcanon(cp, dp);
- cleanup_ignore(cp);
- cleanup_until(cp);
#endif /* WINNT_NATIVE */
return ret;
}
@@ -868,12 +857,26 @@ dfree(struct directory *dp)
}
/*
- * dcanon - canonicalize the pathname, removing excess ./ and ../ etc.
+ * dcanon - a safe version of dcanon_internal that arranges for cleanup
+ */
+Char *
+dcanon(Char *cp, Char *p)
+{
+ cleanup_push(cp, xfree);
+ p = dcanon_internal(cp, p);
+ // coverity[use_after_free] we use the pointer as a marker
+ cleanup_ignore(cp);
+ cleanup_until(cp);
+ return p;
+}
+
+/*
+ * dcanon_internal - canonicalize the pathname, removing excess ./ and ../ etc.
* we are of course assuming that the file system is standardly
* constructed (always have ..'s, directories have links)
*/
-Char *
-dcanon(Char *cp, Char *p)
+static Char *
+dcanon_internal(Char *cp, Char *p)
{
Char *sp;
Char *p1, *p2; /* general purpose */
@@ -1356,7 +1359,7 @@ loaddirs(Char *fname)
void
recdirs(Char *fname, int def)
{
- int fp, ftmp, oldidfds;
+ int fp, ftmp, oldidfds, ophup_disabled;
int cdflag = 0;
struct directory *dp;
unsigned int num;
@@ -1366,6 +1369,8 @@ recdirs(Char *fname, int def)
if (fname == NULL && !def)
return;
+ ophup_disabled = phup_disabled;
+ phup_disabled = 1;
if (fname == NULL) {
if ((fname = varval(STRdirsfile)) == STRNULL)
fname = Strspl(varval(STRhome), &STRtildotdirs[1]);
@@ -1378,6 +1383,7 @@ recdirs(Char *fname, int def)
if ((fp = xcreat(short2str(fname), 0600)) == -1) {
cleanup_until(fname);
+ phup_disabled = ophup_disabled;
return;
}
@@ -1413,4 +1419,5 @@ recdirs(Char *fname, int def)
SHOUT = ftmp;
didfds = oldidfds;
cleanup_until(fname);
+ phup_disabled = ophup_disabled;
}
diff --git a/contrib/tcsh/sh.dol.c b/contrib/tcsh/sh.dol.c
index 8009d772b2df..28e8639be8b9 100644
--- a/contrib/tcsh/sh.dol.c
+++ b/contrib/tcsh/sh.dol.c
@@ -64,8 +64,10 @@ static Char *dolp; /* Remaining chars from this word */
static Char **dolnxt; /* Further words */
static int dolcnt; /* Count of further words */
static struct Strbuf dolmod; /* = Strbuf_INIT; : modifier characters */
-static int dolmcnt; /* :gx -> INT_MAX, else 1 */
-static int dol_flag_a; /* :ax -> 1, else 0 */
+
+static int ndolflags; /* keep track of mod counts for each modifier */
+static int *dolmcnts; /* :gx -> INT_MAX, else 1 */
+static int *dolaflags; /* :ax -> 1, else 0 */
static Char **Dfix2 (Char *const *);
static int Dpack (struct Strbuf *);
@@ -378,7 +380,7 @@ Dgetdol(void)
static Char *dolbang = NULL;
cleanup_push(name, Strbuf_free);
- dolmod.len = dolmcnt = dol_flag_a = 0;
+ dolmod.len = ndolflags = 0;
c = sc = DgetC(0);
if (c == DEOF) {
stderror(ERR_SYNTAX);
@@ -718,21 +720,27 @@ fixDolMod(void)
c = DgetC(0);
if (c == ':') {
+ ndolflags = 0;
do {
- c = DgetC(0), dolmcnt = 1, dol_flag_a = 0;
+ ++ndolflags;
+ dolmcnts = xrealloc(dolmcnts, ndolflags * sizeof(int));
+ dolaflags = xrealloc(dolaflags, ndolflags * sizeof(int));
+ c = DgetC(0), dolmcnts[ndolflags - 1] = 1, dolaflags[ndolflags - 1] = 0;
if (c == 'g' || c == 'a') {
- if (c == 'g')
- dolmcnt = INT_MAX;
- else
- dol_flag_a = 1;
+ if (c == 'g') {
+ dolmcnts[ndolflags - 1] = INT_MAX;
+ } else {
+ dolaflags[ndolflags - 1] = 1;
+ }
c = DgetC(0);
}
- if ((c == 'g' && dolmcnt != INT_MAX) ||
- (c == 'a' && dol_flag_a == 0)) {
- if (c == 'g')
- dolmcnt = INT_MAX;
- else
- dol_flag_a = 1;
+ if ((c == 'g' && dolmcnts[ndolflags - 1] != INT_MAX) ||
+ (c == 'a' && dolaflags[ndolflags - 1] == 0)) {
+ if (c == 'g') {
+ dolmcnts[ndolflags - 1] = INT_MAX;
+ } else {
+ dolaflags[ndolflags - 1] = 1;
+ }
c = DgetC(0);
}
@@ -749,20 +757,21 @@ fixDolMod(void)
}
while ((c = DgetC(0)) != DEOF) {
Strbuf_append1(&dolmod, (Char) c);
- if(c == delim) delimcnt--;
- if(!delimcnt) break;
+ if (c == delim) delimcnt--;
+ if (!delimcnt) break;
}
- if(delimcnt) {
+ if (delimcnt) {
seterror(ERR_BADSUBST);
break;
}
continue;
}
- if (!any("luhtrqxes", c))
+ if (!any(TCSH_MODIFIERS, c))
stderror(ERR_BADMOD, (int)c);
Strbuf_append1(&dolmod, (Char) c);
- if (c == 'q')
- dolmcnt = INT_MAX;
+ if (c == 'q') {
+ dolmcnts[ndolflags - 1] = INT_MAX;
+ }
}
while ((c = DgetC(0)) == ':');
unDredc(c);
@@ -771,13 +780,25 @@ fixDolMod(void)
unDredc(c);
}
+static int
+all_dolmcnts_are_0()
+{
+ int i = 0;
+ for (; i < ndolflags; ++i) {
+ if (dolmcnts[i] != 0)
+ return 0;
+ }
+ return 1;
+}
+
static void
setDolp(Char *cp)
{
Char *dp;
size_t i;
+ int nthMod = 0;
- if (dolmod.len == 0 || dolmcnt == 0) {
+ if (dolmod.len == 0 || all_dolmcnts_are_0()) {
dolp = cp;
return;
}
@@ -786,10 +807,12 @@ setDolp(Char *cp)
int didmod = 0;
/* handle s// [eichin:19910926.0510EST] */
- if(dolmod.s[i] == 's') {
+ if (dolmod.s[i] == 's') {
Char delim;
Char *lhsub, *rhsub, *np;
size_t lhlen = 0, rhlen = 0;
+ /* keep track of where the last :a match hit */
+ ptrdiff_t last_match = 0;
delim = dolmod.s[++i];
if (!delim || letter(delim)
@@ -798,47 +821,50 @@ setDolp(Char *cp)
break;
}
lhsub = &dolmod.s[++i];
- while(dolmod.s[i] != delim && dolmod.s[++i]) {
+ while (dolmod.s[i] != delim && dolmod.s[++i]) {
lhlen++;
}
dolmod.s[i] = 0;
rhsub = &dolmod.s[++i];
- while(dolmod.s[i] != delim && dolmod.s[++i]) {
+ while (dolmod.s[i] != delim && dolmod.s[++i]) {
rhlen++;
}
dolmod.s[i] = 0;
strip(lhsub);
strip(rhsub);
- strip(cp);
- dp = cp;
- do {
- dp = Strstr(dp, lhsub);
- if (dp) {
- ptrdiff_t diff = dp - cp;
- size_t len = (Strlen(cp) + 1 - lhlen + rhlen);
- np = xmalloc(len * sizeof(Char));
- (void) Strncpy(np, cp, diff);
- (void) Strcpy(np + diff, rhsub);
- (void) Strcpy(np + diff + rhlen, dp + lhlen);
-
- xfree(cp);
- dp = cp = np;
- cp[--len] = '\0';
- didmod = 1;
- if (diff >= (ssize_t)len)
- break;
- } else {
- /* should this do a seterror? */
- break;
- }
- }
- while (dol_flag_a != 0);
+ if (dolmcnts[nthMod] != 0) {
+ strip(cp);
+ dp = cp;
+ do {
+ dp = Strstr(dp + last_match, lhsub);
+ if (dp) {
+ ptrdiff_t diff = dp - cp;
+ size_t len = (Strlen(cp) + 1 - lhlen + rhlen);
+ np = xmalloc(len * sizeof(Char));
+ (void) Strncpy(np, cp, diff);
+ (void) Strcpy(np + diff, rhsub);
+ (void) Strcpy(np + diff + rhlen, dp + lhlen);
+ last_match = diff + rhlen;
+
+ xfree(cp);
+ dp = cp = np;
+ cp[--len] = '\0';
+ didmod = 1;
+ if (diff >= (ssize_t)len)
+ break;
+ } else {
+ /* should this do a seterror? */
+ break;
+ }
+ }
+ while (dolaflags[nthMod] != 0);
+ }
/*
* restore dolmod for additional words
*/
dolmod.s[i] = rhsub[-1] = (Char) delim;
- } else {
+ } else if (dolmcnts[nthMod] != 0) {
do {
if ((dp = domod(cp, dolmod.s[i])) != NULL) {
@@ -856,14 +882,16 @@ setDolp(Char *cp)
else
break;
}
- while (dol_flag_a != 0);
+ while (dolaflags[nthMod] != 0);
}
- if (didmod && dolmcnt != INT_MAX)
- dolmcnt--;
+ if (didmod && dolmcnts[nthMod] != INT_MAX)
+ dolmcnts[nthMod]--;
#ifdef notdef
else
break;
#endif
+
+ ++nthMod;
}
addla(cp);
diff --git a/contrib/tcsh/sh.exp.c b/contrib/tcsh/sh.exp.c
index 9d85e0bd159c..f9e92c515382 100644
--- a/contrib/tcsh/sh.exp.c
+++ b/contrib/tcsh/sh.exp.c
@@ -634,7 +634,7 @@ filetest(Char *cp, Char ***vp, int ignore)
struct passwd *pw;
struct group *gr;
- while(any(FILETESTS, *++ft))
+ while (any(FILETESTS, *++ft))
continue;
if (!*ft && *(ft - 1) == 'L')
diff --git a/contrib/tcsh/sh.func.c b/contrib/tcsh/sh.func.c
index 05f3f20df3bf..c978ffe844fe 100644
--- a/contrib/tcsh/sh.func.c
+++ b/contrib/tcsh/sh.func.c
@@ -1423,7 +1423,7 @@ dosetenv(Char **v, struct command *c)
/* dspkanji/dspmbyte autosetting */
/* PATCH IDEA FROM Issei.Suzuki VERY THANKS */
#if defined(DSPMBYTE)
- if(eq(vp, STRLANG) && !adrof(CHECK_MBYTEVAR)) {
+ if (eq(vp, STRLANG) && !adrof(CHECK_MBYTEVAR)) {
autoset_dspmbyte(lp);
}
#endif
@@ -1517,9 +1517,8 @@ dosetenv(Char **v, struct command *c)
/*
* convert to canonical pathname (possibly resolving symlinks)
*/
- canon = dcanon(lp, lp);
cleanup_ignore(lp);
- cleanup_until(lp);
+ canon = dcanon(lp, lp);
cleanup_push(canon, xfree);
setv(STRhome, quote(canon), VAR_READWRITE); /* lp memory used here */
cleanup_ignore(canon);
diff --git a/contrib/tcsh/sh.glob.c b/contrib/tcsh/sh.glob.c
index d19de2483b64..a57404013f88 100644
--- a/contrib/tcsh/sh.glob.c
+++ b/contrib/tcsh/sh.glob.c
@@ -75,8 +75,13 @@ globtilde(Char *s)
Char *name, *u, *home, *res;
u = s;
+
+ if (s[1] == '~')
+ return Strsave(s);
+
for (s++; *s && *s != '/' && *s != ':'; s++)
continue;
+
name = Strnsave(u + 1, s - (u + 1));
cleanup_push(name, xfree);
home = gethdir(name);
@@ -513,14 +518,16 @@ globone(Char *str, int action)
}
result:
if (vl && vl[0] == NULL) {
- xfree(vl);
+ if (vl != v)
+ xfree(vl);
return (Strsave(STRNULL));
}
if (vl && vl[1])
return (handleone(str, vl, action));
else {
str = strip(*vl);
- xfree(vl);
+ if (vl != v)
+ xfree(vl);
return (str);
}
}
diff --git a/contrib/tcsh/sh.h b/contrib/tcsh/sh.h
index 0bada305756b..94f4af236671 100644
--- a/contrib/tcsh/sh.h
+++ b/contrib/tcsh/sh.h
@@ -685,10 +685,6 @@ EXTERN int OLDSTD IZERO; /* Old standard input (def for cmds) */
typedef struct { const char *f; size_t l; sigjmp_buf j; } jmp_buf_t;
# define tcsh_setjmp() sigsetjmp(reslab.j, 1)
# define tcsh_longjmp() siglongjmp(reslab.j, 1)
-# define setexit() (reslab.f = __func__, \
- reslab.l = __LINE__, \
- sigsetjmp(reslab.j, 1))
-# define _reset() siglongjmp(reslab.j, 1)
#else
typedef struct { const char *f; size_t l; jmp_buf j; } jmp_buf_t;
# define tcsh_setjmp() setjmp(reslab.j)
@@ -1160,6 +1156,8 @@ EXTERN Char PRCHROOT; /* Prompt symbol for root */
#define Strstr(a, b) s_strstr(a, b)
#endif
+#define TCSH_MODIFIERS "ehlqrstuxQ"
+
/*
* setname is a macro to save space (see sh.err.c)
*/
diff --git a/contrib/tcsh/sh.hist.c b/contrib/tcsh/sh.hist.c
index 5be5c4fbde53..d061f40d8c0e 100644
--- a/contrib/tcsh/sh.hist.c
+++ b/contrib/tcsh/sh.hist.c
@@ -1219,7 +1219,7 @@ void
rechist(Char *fname, int ref)
{
Char *snum, *rs;
- int fp, ftmp, oldidfds;
+ int fp, ftmp, oldidfds, ophup_disabled;
struct varent *shist;
char path[MAXPATHLEN];
struct stat st;
@@ -1227,6 +1227,10 @@ rechist(Char *fname, int ref)
if (fname == NULL && !ref)
return;
+
+ ophup_disabled = phup_disabled;
+ phup_disabled = 1;
+
/*
* If $savehist is just set, we use the value of $history
* else we use the value in $savehist
@@ -1292,7 +1296,7 @@ rechist(Char *fname, int ref)
#endif
}
getexit(osetexit);
- if (setexit())
+ if (setexit() == 0)
loadhist(fname, 1);
resexit(osetexit);
}
@@ -1305,6 +1309,7 @@ rechist(Char *fname, int ref)
if (fp == -1) {
didfds = oldidfds;
cleanup_until(fname);
+ phup_disabled = ophup_disabled;
return;
}
/* Try to preserve ownership and permissions of the original history file */
@@ -1329,6 +1334,7 @@ rechist(Char *fname, int ref)
(void)ReplaceFile( short2str(fname),path,NULL,0,NULL,NULL);
#endif
cleanup_until(fname);
+ phup_disabled = ophup_disabled;
}
diff --git a/contrib/tcsh/sh.lex.c b/contrib/tcsh/sh.lex.c
index 2893768e9584..46cc96d0937c 100644
--- a/contrib/tcsh/sh.lex.c
+++ b/contrib/tcsh/sh.lex.c
@@ -182,8 +182,9 @@ lex(struct wordent *hp)
wdp = new;
wdp->word = word(parsehtime);
parsehtime = 0;
- if (enterhist && toolong++ > 10 * 1024)
+ if (enterhist && toolong++ > 10 * 1024) {
stderror(ERR_LTOOLONG);
+ }
} while (wdp->word[0] != '\n');
cleanup_ignore(hp);
cleanup_until(hp);
@@ -300,8 +301,9 @@ word(int parsehtime)
cleanup_push(&wbuf, Strbuf_cleanup);
loop:
- if (enterhist && toolong++ > 256 * 1024)
- seterror(ERR_WTOOLONG);
+ if (enterhist && toolong++ > 256 * 1024) {
+ stderror(ERR_WTOOLONG);
+ }
while ((c = getC(DOALL)) == ' ' || c == '\t')
continue;
if (cmap(c, _META | _ESC))
@@ -360,8 +362,9 @@ loop:
c1 = 0;
dolflg = DOALL;
for (;;) {
- if (enterhist && toolong++ > 256 * 1024)
- seterror(ERR_WTOOLONG);
+ if (enterhist && toolong++ > 256 * 1024) {
+ stderror(ERR_WTOOLONG);
+ }
if (c1) {
if (c == c1) {
c1 = 0;
@@ -596,7 +599,7 @@ getdol(void)
int gmodflag = 0, amodflag = 0;
do {
- Strbuf_append1(&name, c), c = getC(DOEXCL);
+ Strbuf_append1(&name, c), c = getC(DOEXCL), gmodflag = 0, amodflag = 0;
if (c == 'g' || c == 'a') {
if (c == 'g')
gmodflag++;
@@ -625,16 +628,16 @@ getdol(void)
}
while ((c = getC(0)) != CHAR_ERR) {
Strbuf_append1(&name, c);
- if(c == delim) delimcnt--;
- if(!delimcnt) break;
+ if (c == delim) delimcnt--;
+ if (!delimcnt) break;
}
- if(delimcnt) {
+ if (delimcnt) {
seterror(ERR_BADSUBST);
break;
}
c = 's';
}
- if (!any("htrqxesul", c)) {
+ if (!any(TCSH_MODIFIERS, c)) {
if ((amodflag || gmodflag) && c == '\n')
stderror(ERR_VARSYN); /* strike */
seterror(ERR_BADMOD, c);
@@ -1019,14 +1022,15 @@ domod(Char *cp, Char type)
int c;
switch (type) {
-
+ case 'Q':
+ if (*cp == '\0')
+ return Strsave(STRQNULL);
+ /*FALLTHROUGH*/
case 'q':
case 'x':
- if (*cp == '\0')
- return Strsave(STRQNULL);
wp = Strsave(cp);
for (xp = wp; (c = *xp) != 0; xp++)
- if ((c != ' ' && c != '\t') || type == 'q')
+ if ((c != ' ' && c != '\t') || type == 'q' || type == 'Q')
*xp |= QUOTE;
return (wp);
@@ -1040,13 +1044,13 @@ domod(Char *cp, Char type)
case 'h':
case 't':
- if (!any(short2str(cp), '/'))
- return (type == 't' ? Strsave(cp) : 0);
wp = Strrchr(cp, '/');
- if (type == 'h')
- xp = Strnsave(cp, wp - cp);
- else
+ if (wp == NULL)
+ return NULL;
+ if (type == 't')
xp = Strsave(wp + 1);
+ else
+ xp = Strnsave(cp, wp - cp);
return (xp);
case 'e':
@@ -1061,6 +1065,7 @@ domod(Char *cp, Char type)
return (xp);
}
return (Strsave(type == 'e' ? STRNULL : cp));
+
default:
break;
}
@@ -1654,7 +1659,7 @@ bgetc(void)
do {
ch = fbuf[0][fseekp - fbobp];
fseekp++;
- } while(ch == '\r');
+ } while (ch == '\r');
#endif /* !WINNT_NATIVE && !__CYGWIN__ */
return (ch);
}
@@ -1707,7 +1712,7 @@ bgetc(void)
do {
ch = fbuf[(int) fseekp / BUFSIZE][(int) fseekp % BUFSIZE];
fseekp++;
- } while(ch == '\r');
+ } while (ch == '\r');
#endif /* !WINNT_NATIVE && !__CYGWIN__ */
return (ch);
}
diff --git a/contrib/tcsh/sh.misc.c b/contrib/tcsh/sh.misc.c
index 96c783b56408..bf6bcc994099 100644
--- a/contrib/tcsh/sh.misc.c
+++ b/contrib/tcsh/sh.misc.c
@@ -288,7 +288,7 @@ closem(void)
{
xclose(f);
#ifdef NISPLUS
- if(f < 3)
+ if (f < 3)
(void) xopen(_PATH_DEVNULL, O_RDONLY|O_LARGEFILE);
#endif /* NISPLUS */
}
@@ -531,6 +531,25 @@ areadlink(const char *path)
char *buf;
size_t size;
ssize_t res;
+#ifdef __IBMC__
+ /*
+ * Prevent infinite recursion. Someone should tell me how to expand
+ * these...
+ */
+ size_t i;
+ static const char *vars[] = {
+ "/$VERSION",
+ "/$SYSNAME",
+ "/$SYSSYMR",
+ "/$SYSSYMA",
+ };
+ for (i = 0; i < sizeof(vars) / sizeof(vars[0]); i++) {
+ if (strcmp(vars[i], path) == 0) {
+ return NULL;
+ }
+ }
+#endif
+
size = MAXPATHLEN + 1;
buf = xmalloc(size);
diff --git a/contrib/tcsh/sh.set.c b/contrib/tcsh/sh.set.c
index f15e41fcedaf..e51fdae11cc1 100644
--- a/contrib/tcsh/sh.set.c
+++ b/contrib/tcsh/sh.set.c
@@ -146,14 +146,10 @@ update_vars(Char *vp)
Char *cp, *canon;
cp = Strsave(varval(vp)); /* get the old value back */
- cleanup_push(cp, xfree);
-
/*
* convert to cononical pathname (possibly resolving symlinks)
*/
canon = dcanon(cp, cp);
- cleanup_ignore(cp);
- cleanup_until(cp);
cleanup_push(canon, xfree);
setcopy(vp, canon, VAR_READWRITE); /* have to save the new val */
@@ -223,7 +219,7 @@ update_vars(Char *vp)
}
#endif /* COLOR_LS_F */
#if defined(KANJI) && defined(SHORT_STRINGS) && defined(DSPMBYTE)
- else if(eq(vp, CHECK_MBYTEVAR) || eq(vp, STRnokanji)) {
+ else if (eq(vp, CHECK_MBYTEVAR) || eq(vp, STRnokanji)) {
update_dspmbyte_vars();
}
#endif
@@ -276,7 +272,7 @@ doset(Char **v, struct command *c)
v++;
changed = 1;
}
- } while(changed);
+ } while (changed);
p = *v++;
if (p == 0) {
plist(&shvhed, flags);
@@ -660,7 +656,7 @@ set1(const Char *var, Char **vec, struct varent *head, int flags)
gflag = tglob(oldv);
if (gflag) {
vec = globall(oldv, gflag);
- if (vec == 0) {
+ if (vec == NULL) {
blkfree(oldv);
stderror(ERR_NAME | ERR_NOMATCH);
}
@@ -677,7 +673,7 @@ set1(const Char *var, Char **vec, struct varent *head, int flags)
* Delete all duplicate words leaving "holes" in the word array (vec).
* Then remove the "holes", keeping the order of the words unchanged.
*/
- if (vec && vec[0] && vec[1]) { /* more than one word ? */
+ if (vec[0] && vec[1]) { /* more than one word ? */
int i, j;
int num_items;
@@ -1162,7 +1158,7 @@ update_dspmbyte_vars(void)
if ((vp = adrof(CHECK_MBYTEVAR)) && !adrof(STRnokanji)) {
_enable_mbdisp = 1;
dstr1 = vp->vec[0];
- if(eq (dstr1, STRsjis))
+ if (eq (dstr1, STRsjis))
iskcode = 1;
else if (eq(dstr1, STReuc))
iskcode = 2;
diff --git a/contrib/tcsh/tc.alloc.c b/contrib/tcsh/tc.alloc.c
index 8914ba575d0c..cbe218f4c086 100644
--- a/contrib/tcsh/tc.alloc.c
+++ b/contrib/tcsh/tc.alloc.c
@@ -655,3 +655,13 @@ showall(Char **v, struct command *c)
USE(c);
USE(v);
}
+
+#ifndef SYSMALLOC
+/* jemalloc defines these */
+void _malloc_prefork(void);
+void _malloc_postfork(void);
+void _malloc_postfork_child(void);
+void _malloc_prefork(void) {}
+void _malloc_postfork(void) {}
+void _malloc_postfork_child(void) {}
+#endif
diff --git a/contrib/tcsh/tc.disc.c b/contrib/tcsh/tc.disc.c
index dd47da56acb0..d18277506965 100644
--- a/contrib/tcsh/tc.disc.c
+++ b/contrib/tcsh/tc.disc.c
@@ -53,6 +53,10 @@ static struct termios otermiob;
char strPOSIX[] = "posix";
#endif /* _IBMR2 */
+#ifdef __IBMC__
+# define HAVE_DISC /* Z/OS TIOCGETD returns no such device */
+#endif /* __IBMC__ */
+
#if !defined(HAVE_DISC) && defined(TIOCGETD) && defined(NTTYDISC)
static int oldisc;
#endif /* !HAVE_DISC && TIOCGETD && NTTYDISC */
diff --git a/contrib/tcsh/tc.os.c b/contrib/tcsh/tc.os.c
index 3a3bb22d9230..3ec512245603 100644
--- a/contrib/tcsh/tc.os.c
+++ b/contrib/tcsh/tc.os.c
@@ -831,7 +831,7 @@ dobs2cmd(Char **v, struct command *c)
xexit(bs2cmdlist(cmd));
}
cleanup_until(&pvec[1]);
- for(;;) {
+ for (;;) {
int old_pintr_disabled;
if (setintr)
diff --git a/contrib/tcsh/tc.prompt.c b/contrib/tcsh/tc.prompt.c
index 7f728710d148..f06b9596c138 100644
--- a/contrib/tcsh/tc.prompt.c
+++ b/contrib/tcsh/tc.prompt.c
@@ -379,7 +379,7 @@ tprintf(int what, const Char *fmt, const char *str, time_t tim, ptr_t info)
Strbuf_append1(&buf, attributes | *z++);
do {
Strbuf_append1(&buf, attributes | *z++);
- } while(*z != '/');
+ } while (*z != '/');
}
#endif /* WINNT_NATIVE */
q = z;
diff --git a/contrib/tcsh/tcsh.man b/contrib/tcsh/tcsh.man
index 3d06e5541e00..b01d07e0881a 100644
--- a/contrib/tcsh/tcsh.man
+++ b/contrib/tcsh/tcsh.man
@@ -77,7 +77,7 @@
.\" used here if you can. In particular, please don't use nroff commands
.\" which aren't already used herein.
.\"
-.TH TCSH 1 "8 May 2019" "Astron 6.21.00"
+.TH TCSH 1 "11 Nov 2020" "Astron 6.22.03"
.SH NAME
tcsh \- C shell with file name completion and command line editing
.SH SYNOPSIS
@@ -928,6 +928,10 @@ Saved commands are numbered sequentially from 1 and stamped with the time.
It is not usually necessary to use event numbers, but the current event number
can be made part of the prompt by placing an `!' in the \fBprompt\fR shell variable.
.PP
+By default history entries are displayed by printing each parsed token
+separated by space; thus the redirection operator `>&!' will be displayed as
+`> & !'.
+.PP
The shell actually saves history in expanded and literal (unexpanded) forms.
If the \fBhistlit\fR shell variable is set, commands that display and store
history use the literal form.
@@ -1133,6 +1137,18 @@ Print the new command line but do not execute it.
q
Quote the substituted words, preventing further substitutions.
.TP 8
+Q
+Same as q
+but in addition preserve empty variables as a string containing a NUL.
+This is useful to preserve positional arguments for example:
+.IP "" 12
+> set args=('arg 1' '' 'arg 3')
+.br
+> tcsh -f -c 'echo ${#argv}' $args:gQ
+.br
+3
+.br
+.TP 8
x
Like q, but break into words at blanks, tabs and newlines.
.PD
@@ -3754,6 +3770,7 @@ in login and superuser shells, but not if the shell thinks it is running
under a window system (i.e., the \fBDISPLAY\fR environment variable is set),
the tty is a pseudo-tty (pty) or the shell was not so compiled (see the
\fBversion\fR shell variable).
+Unset or set to `0' to disable automatic logout.
See also the \fBafsuser\fR and \fBlogout\fR shell variables.
.TP 8
.B autorehash \fR(+)
@@ -5338,7 +5355,7 @@ pipe(2), setrlimit(2), sigvec(2), stat(2), umask(2), vfork(2), wait(2),
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
termio(7), Introduction to the C Shell
.SH VERSION
-This manual documents tcsh 6.21.00 (Astron) 2019-05-08.
+This manual documents tcsh 6.22.03 (Astron) 2020-11-18.
.SH AUTHORS
.PD 0
.TP 2
diff --git a/contrib/tcsh/tcsh.man.new b/contrib/tcsh/tcsh.man.new
index cb82955db317..dae20d6745db 100644
--- a/contrib/tcsh/tcsh.man.new
+++ b/contrib/tcsh/tcsh.man.new
@@ -64,9 +64,9 @@
.\" used here if you can. In particular, please don't use nroff commands
.\" which aren't already used herein.
.\"
-.Dd May 8, 2019
+.Dd Noverber 18, 2020
.Dt TCSH 1
-.Os Astron 6.21.00
+.Os Astron 6.22.02
.Sh NAME
.Nm tcsh
.Nd C shell with file name completion and command line editing
@@ -1494,6 +1494,11 @@ in the
.Va prompt
shell variable.
.Pp
+By default history entries are displayed by printing each parsed token
+separated by space; thus the redirection operator
+.Sq >\&&\&!
+will be displayed as
+.Sq >\0\&&\0\&! .
The shell actually saves history in expanded and literal (unexpanded) forms.
If the
.Va histlit
@@ -1849,6 +1854,16 @@ substituted, not patterns that contain any substitution result.
Print the new command line but do not execute it.
.It Ar q
Quote the substituted words, preventing further substitutions.
+.It Ar Q
+Same as
+.Ar q
+but in addition preserve empty variables as a string containing a NUL.
+This is useful to preserve positional arguments for example:
+.Bd -literal -offset indent -compact
+> set args=('arg 1' '' 'arg 3')
+> tcsh -f -c 'echo ${#argv}' $args:gQ
+3
+.Ed
.It Ar x
Like
.Ar q ,
@@ -3358,17 +3373,15 @@ by an unambiguous prefix of the string typed in to start it:
.Sq %ex
would
normally restart a suspended
-.Va ex
-(1) job, if there were only one suspended
+.Xr ex 1
+job, if there were only one suspended
job whose name began with the string
-.Sq ex
+.Sq ex .
It is also possible to say
-`%?
-.Va string
-' to specify a job whose text contains
-.Va string
-, if there
-is only one such job.
+.Va %?string
+to specify a job whose text contains
+.Va string ,
+if there is only one such job.
.Pp
The shell maintains a notion of the current and previous jobs.
In output
@@ -3855,7 +3868,7 @@ are optional.
Components of
.Va expr
must be separated by spaces.
-.It Ar alias[name[wordlist]]
+.It Ar alias [name [wordlist]]
Without arguments, prints all aliases.
With
.Va name
@@ -3884,26 +3897,21 @@ memory.
With an argument shows the number of free and used blocks in each size
category.
The categories start at size 8 and double at each step.
-This
-command's output may vary across system types, because systems other than the VAX
-may use a different memory allocator.
-.TP 8
-.It Ar bg[%job...]
+This command's output may vary across system types, because systems other
+than the VAX may use a different memory allocator.
+.It Ar bg [%job...]
Puts the specified jobs (or, without arguments, the current job)
into the background, continuing each if it is stopped.
.Va job
may be a number, a string,
-.Sq
-,
-.Sq %
-,
-.Sq +
+.Sq \&, ,
+.Sq % ,
+.Sq + ,
or
-.Sq \-
+.Sq \&-
as described
under
-.Va Jobs
-.Pp
+.Va Jobs .
.It Ar bindkey Oo Fl l Ns | Ns Fl d Ns | Ns Fl e Ns | Ns Fl v Ns | Ns Fl u Oc (+)
.It Ar bindkey Oo Fl a Oc Oo Fl b Oc Oo Fl k Oc Oo Fl r Oc Oo Fl Fl Oc Ar key (+)
.It Ar bindkey Oo Fl a Oc Oo Fl b Oc Oo Fl k Oc Oo Fl c Ns | Ns Fl s Oc Oo Fl Fl Oc Ar key command (+)
@@ -6810,6 +6818,10 @@ environment variable is set),
the tty is a pseudo-tty (pty) or the shell was not so compiled (see the
.Va version
shell variable).
+Unset
+.Va autologout or set it to
+.Dv 0
+to disable automatic logout.
See also the
.Va afsuser
and
@@ -9518,7 +9530,7 @@ pipe(2), setrlimit(2), sigvec(2), stat(2), umask(2), vfork(2), wait(2),
malloc(3), setlocale(3), tty(4), a.out(5), termcap(5), environ(7),
termio(7), Introduction to the C Shell
.Sh VERSION
-This manual documents tcsh 6.21.00 (Astron) 2019-05-08.
+This manual documents tcsh 6.22.03 (Astron) 2020-11-18.
.Sh AUTHORS
.PD 0
.TP 2
diff --git a/contrib/tcsh/tw.parse.c b/contrib/tcsh/tw.parse.c
index 4b492e20a408..ed019db5bd35 100644
--- a/contrib/tcsh/tw.parse.c
+++ b/contrib/tcsh/tw.parse.c
@@ -2350,7 +2350,7 @@ choose_scroll_tab(struct Strbuf *exp_name, int cnt)
ptr = xmalloc(sizeof(Char *) * cnt);
cleanup_push(ptr, xfree);
- for(loop = scroll_tab; loop && (tmp >= 0); loop = loop->next)
+ for (loop = scroll_tab; loop && (tmp >= 0); loop = loop->next)
ptr[--tmp] = loop->element;
qsort(ptr, cnt, sizeof(Char *), fcompare);
@@ -2366,7 +2366,7 @@ free_scroll_tab(void)
{
struct scroll_tab_list *loop;
- while(scroll_tab) {
+ while (scroll_tab) {
loop = scroll_tab;
scroll_tab = scroll_tab->next;
xfree(loop->element);