aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2021-03-14 16:28:29 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2021-03-14 16:28:29 +0000
commit1b174d6cdff5276d6dad729c6fe9352d9ee5da7d (patch)
tree129de8d3f1a6ba009e959d0452fa70465531ddae
parent03282ad80e8e2b0d9bdf8f38ef7a433249b99a11 (diff)
downloadsrc-1b174d6cdff5276d6dad729c6fe9352d9ee5da7d.tar.gz
src-1b174d6cdff5276d6dad729c6fe9352d9ee5da7d.zip
Import 6.22.03-ceccc7fvendor/tcsh/6.22.03-ceccc7f
-rw-r--r--FAQ339
-rw-r--r--Fixes23
-rw-r--r--Imakefile14
-rw-r--r--Makefile.ADMIN24
-rw-r--r--Makefile.in11
-rw-r--r--Makefile.std2
-rw-r--r--Makefile.vms2
-rw-r--r--README.md9
-rw-r--r--aclocal.m41025
-rw-r--r--config/linux7
-rwxr-xr-xconfigure2449
-rw-r--r--configure.ac5
-rw-r--r--dot.login12
-rw-r--r--dot.tcshrc110
-rw-r--r--ed.chared.c18
-rw-r--r--ed.inputl.c2
-rw-r--r--ed.screen.c2
-rw-r--r--ed.xmap.c2
-rw-r--r--host.defs2
-rw-r--r--patchlevel.h6
-rw-r--r--sh.c17
-rw-r--r--sh.dir.c41
-rw-r--r--sh.dol.c132
-rw-r--r--sh.exp.c2
-rw-r--r--sh.func.c5
-rw-r--r--sh.glob.c11
-rw-r--r--sh.h6
-rw-r--r--sh.hist.c10
-rw-r--r--sh.lex.c47
-rw-r--r--sh.misc.c21
-rw-r--r--sh.set.c14
-rw-r--r--tc.alloc.c10
-rw-r--r--tc.disc.c4
-rw-r--r--tc.os.c2
-rw-r--r--tc.prompt.c2
-rw-r--r--tcsh.man21
-rw-r--r--tcsh.man.new64
-rw-r--r--tests/lexical.at107
-rw-r--r--tests/subst.at28
-rw-r--r--tests/variables.at26
-rw-r--r--tw.parse.c4
41 files changed, 3223 insertions, 1415 deletions
diff --git a/FAQ b/FAQ
index 92aadc726683..93773c52433a 100644
--- a/FAQ
+++ b/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/Fixes b/Fixes
index db401f23fad0..e539c8241a86 100644
--- a/Fixes
+++ b/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/Imakefile b/Imakefile
index be2bebe17ca9..bd1b43b1a24e 100644
--- a/Imakefile
+++ b/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/Makefile.ADMIN b/Makefile.ADMIN
new file mode 100644
index 000000000000..5ad3bb8fb3c5
--- /dev/null
+++ b/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/Makefile.in b/Makefile.in
index 210b7de72dfe..c6b5f2554cc0 100644
--- a/Makefile.in
+++ b/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/Makefile.std b/Makefile.std
index 3466d4ceac86..8c479fa1f213 100644
--- a/Makefile.std
+++ b/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/Makefile.vms b/Makefile.vms
index bc241147e253..2e3f4adbfed4 100644
--- a/Makefile.vms
+++ b/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/README.md b/README.md
index 58a30738daa6..df6671b0316e 100644
--- a/README.md
+++ b/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/aclocal.m4 b/aclocal.m4
index 7a946ee1d832..b0ff2e853c42 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -12,8 +12,654 @@
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
-# iconv.m4 serial 19 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2007-2014, 2016 Free Software Foundation, Inc.
+# host-cpu-c-abi.m4 serial 11
+dnl Copyright (C) 2002-2019 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible and Sam Steingold.
+
+dnl Sets the HOST_CPU variable to the canonical name of the CPU.
+dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
+dnl C language ABI (application binary interface).
+dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
+dnl config.h.
+dnl
+dnl This canonical name can be used to select a particular assembly language
+dnl source file that will interoperate with C code on the given host.
+dnl
+dnl For example:
+dnl * 'i386' and 'sparc' are different canonical names, because code for i386
+dnl will not run on SPARC CPUs and vice versa. They have different
+dnl instruction sets.
+dnl * 'sparc' and 'sparc64' are different canonical names, because code for
+dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
+dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
+dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
+dnl mode, but not both.
+dnl * 'mips' and 'mipsn32' are different canonical names, because they use
+dnl different argument passing and return conventions for C functions, and
+dnl although the instruction set of 'mips' is a large subset of the
+dnl instruction set of 'mipsn32'.
+dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
+dnl different sizes for the C types like 'int' and 'void *', and although
+dnl the instruction sets of 'mipsn32' and 'mips64' are the same.
+dnl * The same canonical name is used for different endiannesses. You can
+dnl determine the endianness through preprocessor symbols:
+dnl - 'arm': test __ARMEL__.
+dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
+dnl - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
+dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
+dnl - Instructions that do not exist on all of these CPUs (cmpxchg,
+dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
+dnl assembly language source files use such instructions, you will
+dnl need to make the distinction.
+dnl - Speed of execution of the common instruction set is reasonable across
+dnl the entire family of CPUs. If you have assembly language source files
+dnl that are optimized for particular CPU types (like GNU gmp has), you
+dnl will need to make the distinction.
+dnl See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
+AC_DEFUN([gl_HOST_CPU_C_ABI],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_REQUIRE([gl_C_ASM])
+ AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
+ [case "$host_cpu" in
+
+changequote(,)dnl
+ i[4567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=i386
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __ILP32__ || defined _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=x86_64-x32],
+ [gl_cv_host_cpu_c_abi=x86_64])],
+ [gl_cv_host_cpu_c_abi=i386])
+ ;;
+
+changequote(,)dnl
+ alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi=alpha
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __aarch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __ILP32__ || defined _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=arm64-ilp32],
+ [gl_cv_host_cpu_c_abi=arm64])],
+ [# Don't distinguish little-endian and big-endian arm, since they
+ # don't require different machine code for simple operations and
+ # since the user can distinguish them through the preprocessor
+ # defines __ARMEL__ vs. __ARMEB__.
+ # But distinguish arm which passes floating-point arguments and
+ # return values in integer registers (r0, r1, ...) - this is
+ # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
+ # passes them in float registers (s0, s1, ...) and double registers
+ # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
+ # sets the preprocessor defines __ARM_PCS (for the first case) and
+ # __ARM_PCS_VFP (for the second case), but older GCC does not.
+ echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
+ # Look for a reference to the register d0 in the .s file.
+ AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+ if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
+ gl_cv_host_cpu_c_abi=armhf
+ else
+ gl_cv_host_cpu_c_abi=arm
+ fi
+ rm -f conftest*
+ ])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=hppa64],
+ [gl_cv_host_cpu_c_abi=hppa])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=ia64-ilp32],
+ [gl_cv_host_cpu_c_abi=ia64])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=mips64],
+ [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
+ # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
+ # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
+ # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (_MIPS_SIM == _ABIN32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=mipsn32],
+ [gl_cv_host_cpu_c_abi=mips])])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [# On powerpc64, there are two ABIs on Linux: The AIX compatible
+ # one and the ELFv2 one. The latter defines _CALL_ELF=2.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _CALL_ELF && _CALL_ELF == 2
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
+ [gl_cv_host_cpu_c_abi=powerpc64])
+ ],
+ [gl_cv_host_cpu_c_abi=powerpc])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi=powerpc
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 2 architectures (with variants): rv32* and rv64*.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if __riscv_xlen == 64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [cpu=riscv64],
+ [cpu=riscv32])
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [main_abi=lp64],
+ [main_abi=ilp32])
+ # Float ABIs:
+ # __riscv_float_abi_double:
+ # 'float' and 'double' are passed in floating-point registers.
+ # __riscv_float_abi_single:
+ # 'float' are passed in floating-point registers.
+ # __riscv_float_abi_soft:
+ # No values are passed in floating-point registers.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __riscv_float_abi_double
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [float_abi=d],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __riscv_float_abi_single
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [float_abi=f],
+ [float_abi=''])
+ ])
+ gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=s390x],
+ [gl_cv_host_cpu_c_abi=s390])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi=sparc64],
+ [gl_cv_host_cpu_c_abi=sparc])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi="$host_cpu"
+ ;;
+ esac
+ ])
+
+ dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
+ HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
+ HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
+ AC_SUBST([HOST_CPU])
+ AC_SUBST([HOST_CPU_C_ABI])
+
+ # This was
+ # AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
+ # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
+ # earlier, but KAI C++ 3.2d doesn't like this.
+ sed -e 's/-/_/g' >> confdefs.h <<EOF
+#ifndef __${HOST_CPU}__
+#define __${HOST_CPU}__ 1
+#endif
+#ifndef __${HOST_CPU_C_ABI}__
+#define __${HOST_CPU_C_ABI}__ 1
+#endif
+EOF
+ AH_TOP([/* CPU and C ABI indicator */
+#ifndef __i386__
+#undef __i386__
+#endif
+#ifndef __x86_64_x32__
+#undef __x86_64_x32__
+#endif
+#ifndef __x86_64__
+#undef __x86_64__
+#endif
+#ifndef __alpha__
+#undef __alpha__
+#endif
+#ifndef __arm__
+#undef __arm__
+#endif
+#ifndef __armhf__
+#undef __armhf__
+#endif
+#ifndef __arm64_ilp32__
+#undef __arm64_ilp32__
+#endif
+#ifndef __arm64__
+#undef __arm64__
+#endif
+#ifndef __hppa__
+#undef __hppa__
+#endif
+#ifndef __hppa64__
+#undef __hppa64__
+#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
+#ifndef __ia64__
+#undef __ia64__
+#endif
+#ifndef __m68k__
+#undef __m68k__
+#endif
+#ifndef __mips__
+#undef __mips__
+#endif
+#ifndef __mipsn32__
+#undef __mipsn32__
+#endif
+#ifndef __mips64__
+#undef __mips64__
+#endif
+#ifndef __powerpc__
+#undef __powerpc__
+#endif
+#ifndef __powerpc64__
+#undef __powerpc64__
+#endif
+#ifndef __powerpc64_elfv2__
+#undef __powerpc64_elfv2__
+#endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
+#ifndef __s390__
+#undef __s390__
+#endif
+#ifndef __s390x__
+#undef __s390x__
+#endif
+#ifndef __sh__
+#undef __sh__
+#endif
+#ifndef __sparc__
+#undef __sparc__
+#endif
+#ifndef __sparc64__
+#undef __sparc64__
+#endif
+])
+
+])
+
+
+dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
+dnl (application binary interface) is a 32-bit one, or to 'no' otherwise.
+dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+ [if test -n "$gl_cv_host_cpu_c_abi"; then
+ case "$gl_cv_host_cpu_c_abi" in
+ i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+ gl_cv_host_cpu_c_abi_32bit=yes ;;
+ *)
+ gl_cv_host_cpu_c_abi_32bit=no ;;
+ esac
+ else
+ case "$host_cpu" in
+
+changequote(,)dnl
+ i[4567]86 )
+changequote([,])dnl
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ x86_64 )
+ # On x86_64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+ # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+ # with native Windows (mingw, MSVC).
+ # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if (defined __x86_64__ || defined __amd64__ \
+ || defined _M_X64 || defined _M_AMD64) \
+ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ arm* | aarch64 )
+ # Assume arm with EABI.
+ # On arm64 systems, the C compiler may be generating code in one of
+ # these ABIs:
+ # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+ # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+ # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+ # On hppa, the C compiler may be generating 32-bit code or 64-bit
+ # code. In the latter case, it defines _LP64 and __LP64__.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _ILP32
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=yes],
+ [gl_cv_host_cpu_c_abi_32bit=no])
+ ;;
+
+ mips* )
+ # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+ # at 32.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ powerpc* )
+ # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+ # No need to distinguish them here; the caller may distinguish
+ # them based on the OS.
+ # On powerpc64 systems, the C compiler may still be generating
+ # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+ # be generating 64-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ rs6000 )
+ gl_cv_host_cpu_c_abi_32bit=yes
+ ;;
+
+ riscv32 | riscv64 )
+ # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+ # Size of 'long' and 'void *':
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ s390* )
+ # On s390x, the C compiler may be generating 64-bit (= s390x) code
+ # or 31-bit (= s390) code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __LP64__ || defined __s390x__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ sparc | sparc64 )
+ # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+ # C compiler still generates 32-bit code.
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_host_cpu_c_abi_32bit=no],
+ [gl_cv_host_cpu_c_abi_32bit=yes])
+ ;;
+
+ *)
+ gl_cv_host_cpu_c_abi_32bit=no
+ ;;
+ esac
+ fi
+ ])
+
+ HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
+
+# iconv.m4 serial 21
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2019 Free Software Foundation,
+dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -181,15 +827,27 @@ AC_DEFUN([AM_ICONV_LINK],
#endif
/* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
provided. */
- if (/* Try standardized names. */
- iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
- /* Try IRIX, OSF/1 names. */
- && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
- /* Try AIX names. */
- && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
- /* Try HP-UX names. */
- && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
- result |= 16;
+ {
+ /* Try standardized names. */
+ iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+ /* Try IRIX, OSF/1 names. */
+ iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+ /* Try AIX names. */
+ iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+ /* Try HP-UX names. */
+ iconv_t cd4 = iconv_open ("utf8", "eucJP");
+ if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+ && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+ result |= 16;
+ if (cd1 != (iconv_t)(-1))
+ iconv_close (cd1);
+ if (cd2 != (iconv_t)(-1))
+ iconv_close (cd2);
+ if (cd3 != (iconv_t)(-1))
+ iconv_close (cd3);
+ if (cd4 != (iconv_t)(-1))
+ iconv_close (cd4);
+ }
return result;
]])],
[am_cv_func_iconv_works=yes], ,
@@ -272,20 +930,24 @@ size_t iconv();
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
AC_MSG_RESULT([
$am_cv_proto_iconv])
- AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
- [Define as const if the declaration of iconv() needs const.])
- dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
- m4_ifdef([gl_ICONV_H_DEFAULTS],
- [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
- if test -n "$am_cv_proto_iconv_arg1"; then
- ICONV_CONST="const"
- fi
- ])
+ else
+ dnl When compiling GNU libiconv on a system that does not have iconv yet,
+ dnl pick the POSIX compliant declaration without 'const'.
+ am_cv_proto_iconv_arg1=""
fi
+ AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
+ [Define as const if the declaration of iconv() needs const.])
+ dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+ m4_ifdef([gl_ICONV_H_DEFAULTS],
+ [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+ if test -n "$am_cv_proto_iconv_arg1"; then
+ ICONV_CONST="const"
+ fi
+ ])
])
-# lib-ld.m4 serial 6
-dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
+# lib-ld.m4 serial 9
+dnl Copyright (C) 1996-2003, 2009-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
@@ -333,86 +995,135 @@ if test "${PATH_SEPARATOR+set}" != set; then
}
fi
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
+if test -n "$LD"; then
+ AC_MSG_CHECKING([for ld])
+elif test "$GCC" = yes; then
AC_MSG_CHECKING([for ld used by $CC])
- 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
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
-AC_CACHE_VAL([acl_cv_path_LD],
-[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
- ;;
+if test -n "$LD"; then
+ # Let the user override the test with a path.
+ :
+else
+ AC_CACHE_VAL([acl_cv_path_LD],
+ [
+ acl_cv_path_LD= # Final result of this test
+ ac_prog=ld # Program to search in $PATH
+ if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $acl_output in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+ while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+ acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+ done
+ # Got the pathname. No search in PATH is needed.
+ acl_cv_path_LD="$acl_output"
+ ac_prog=
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
esac
fi
- done
- IFS="$acl_save_ifs"
-else
- acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
+ if test -n "$ac_prog"; then
+ # Search for $ac_prog in $PATH.
+ 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"
+ fi
+ case $host in
+ *-*-aix*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __powerpc64__ || defined _ARCH_PPC64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [# The compiler produces 64-bit code. Add option '-b64' so that the
+ # linker groks 64-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -b64 "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+ esac
+ ], [])
+ ;;
+ sparc64-*-netbsd*)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#if defined __sparcv9 || defined __arch64__
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [],
+ [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
+ # so that the linker groks 32-bit object files.
+ case "$acl_cv_path_LD " in
+ *" -m elf32_sparc "*) ;;
+ *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+ esac
+ ])
+ ;;
+ esac
+ ])
+ LD="$acl_cv_path_LD"
+fi
if test -n "$LD"; then
AC_MSG_RESULT([$LD])
else
AC_MSG_RESULT([no])
+ AC_MSG_ERROR([no acceptable ld found in \$PATH])
fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])
-# lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
+# lib-link.m4 serial 28
+dnl Copyright (C) 2001-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
-AC_PREREQ([2.54])
+AC_PREREQ([2.61])
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
@@ -530,8 +1241,8 @@ dnl acl_hardcode_direct,
dnl acl_hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
- dnl Tell automake >= 1.10 to complain if config.rpath is missing.
- m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+ dnl Complain if config.rpath is missing.
+ AC_REQUIRE_AUX_FILE([config.rpath])
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
@@ -593,17 +1304,15 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
- dnl Autoconf >= 2.61 supports dots in --with options.
- pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
- AC_ARG_WITH(P_A_C_K[-prefix],
-[[ --with-]]P_A_C_K[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
- --without-]]P_A_C_K[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
+ AC_ARG_WITH(PACK[-prefix],
+[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
+ --without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@@ -617,7 +1326,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
additional_includedir="$withval/include"
additional_libdir="$withval/$acl_libdirstem"
if test "$acl_libdirstem2" != "$acl_libdirstem" \
- && ! test -d "$withval/$acl_libdirstem"; then
+ && test ! -d "$withval/$acl_libdirstem"; then
additional_libdir="$withval/$acl_libdirstem2"
fi
fi
@@ -1076,7 +1785,6 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
done
fi
- popdef([P_A_C_K])
popdef([PACKLIBS])
popdef([PACKUP])
popdef([PACK])
@@ -1182,21 +1890,14 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
AC_SUBST([$1])
])
-# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 14
+dnl Copyright (C) 2001-2005, 2008-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
@@ -1216,9 +1917,9 @@ AC_DEFUN([AC_LIB_PREFIX],
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
- AC_LIB_ARG_WITH([lib-prefix],
-[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
- --without-lib-prefix don't search for libraries in includedir and libdir],
+ AC_ARG_WITH([lib-prefix],
+[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+ --without-lib-prefix don't search for libraries in includedir and libdir]],
[
if test "X$withval" = "Xno"; then
use_additional=no
@@ -1358,52 +2059,84 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
AC_REQUIRE([AC_CANONICAL_HOST])
- acl_libdirstem=lib
- acl_libdirstem2=
+ AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
+
case "$host_os" in
solaris*)
- dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
- dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
- dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
- dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
- dnl symlink is missing, so we set acl_libdirstem2 too.
AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
- [AC_EGREP_CPP([sixtyfour bits], [
-#ifdef _LP64
-sixtyfour bits
-#endif
- ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
- ])
- if test $gl_cv_solaris_64bit = yes; then
- acl_libdirstem=lib/64
- case "$host_cpu" in
- sparc*) acl_libdirstem2=lib/sparcv9 ;;
- i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
- esac
- fi
- ;;
- *)
- searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
- if test -n "$searchpath"; then
- acl_save_IFS="${IFS= }"; IFS=":"
- for searchdir in $searchpath; do
- if test -d "$searchdir"; then
- case "$searchdir" in
- */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
- */../ | */.. )
- # Better ignore directories of this form. They are misleading.
- ;;
- *) searchdir=`cd "$searchdir" && pwd`
- case "$searchdir" in
- */lib64 ) acl_libdirstem=lib64 ;;
- esac ;;
- esac
- fi
- done
- IFS="$acl_save_IFS"
- fi
- ;;
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[#ifdef _LP64
+ int ok;
+ #else
+ error fail
+ #endif
+ ]])],
+ [gl_cv_solaris_64bit=yes],
+ [gl_cv_solaris_64bit=no])
+ ]);;
esac
- test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+
+ dnl Allow the user to override the result by setting acl_cv_libdirstems.
+ AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
+ [acl_cv_libdirstems],
+ [acl_libdirstem=lib
+ acl_libdirstem2=
+ case "$host_os" in
+ solaris*)
+ dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+ dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
+ dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+ dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+ dnl symlink is missing, so we set acl_libdirstem2 too.
+ if test $gl_cv_solaris_64bit = yes; then
+ acl_libdirstem=lib/64
+ case "$host_cpu" in
+ sparc*) acl_libdirstem2=lib/sparcv9 ;;
+ i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
+ esac
+ fi
+ ;;
+ *)
+ dnl If $CC generates code for a 32-bit ABI, the libraries are
+ dnl surely under $prefix/lib, not $prefix/lib64.
+ if test "$HOST_CPU_C_ABI_32BIT" != yes; then
+ dnl The result is a property of the system. However, non-system
+ dnl compilers sometimes have odd library search paths. Therefore
+ dnl prefer asking /usr/bin/gcc, if available, rather than $CC.
+ searchpath=`(if test -f /usr/bin/gcc \
+ && LC_ALL=C /usr/bin/gcc -print-search-dirs >/dev/null 2>/dev/null; then \
+ LC_ALL=C /usr/bin/gcc -print-search-dirs; \
+ else \
+ LC_ALL=C $CC -print-search-dirs; \
+ fi) 2>/dev/null \
+ | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+ if test -n "$searchpath"; then
+ acl_save_IFS="${IFS= }"; IFS=":"
+ for searchdir in $searchpath; do
+ if test -d "$searchdir"; then
+ case "$searchdir" in
+ */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
+ *) searchdir=`cd "$searchdir" && pwd`
+ case "$searchdir" in
+ */lib64 ) acl_libdirstem=lib64 ;;
+ esac ;;
+ esac
+ fi
+ done
+ IFS="$acl_save_IFS"
+ fi
+ fi
+ ;;
+ esac
+ test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+ acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2"
+ ])
+ # Decompose acl_cv_libdirstems into acl_libdirstem and acl_libdirstem2.
+ acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+ acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e '/,/s/.*,//'`
])
diff --git a/config/linux b/config/linux
index cce57449c8bb..0863beb05cb2 100644
--- a/config/linux
+++ b/config/linux
@@ -83,9 +83,16 @@
*
* The more recent defaults for gcc (e.g. on Red Hat 7.0)
* also define _POSIX_C_SOURCE, which throws our code off.
+ *
+ * _BSD_SOURCE and _SVID_SOURCE have become deprecated
+ * aliases for _DEFAULT_SOURCE. _DEFAULT_SOURCE overrides
+ * __STRICT_ANSI__ also. [gcc 8.3.0 on Debian 10]
*/
#define __STRICT_ANSI__
+#ifndef _DEFAULT_SOURCE
+# define _DEFAULT_SOURCE
+#endif
#ifndef _BSD_SOURCE
# define _BSD_SOURCE
#endif
diff --git a/configure b/configure
index 4e724c2bfb80..27a6bec356a0 100755
--- a/configure
+++ b/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/configure.ac b/configure.ac
index 24b14f1c83b3..80a6801e5ad3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,7 @@ dnl
dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
AC_PREREQ([2.59])dnl Minimum Autoconf version required.
-AC_INIT([tcsh], [6.21.00], [https://bugs.astron.com/])
+AC_INIT([tcsh], [6.22.03], [https://bugs.astron.com/])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([tc.vers.c])
AC_CONFIG_HEADERS([config.h])
@@ -17,6 +17,8 @@ AC_CONFIG_TESTDIR([.], [.])
AC_PROG_INSTALL
AC_CANONICAL_HOST
+AM_ICONV
+
AC_MSG_CHECKING([cached host tuple])
if { test x"${ac_cv_host_system_type+set}" = x"set" &&
test x"$ac_cv_host_system_type" != x"$host"; }; then
@@ -321,7 +323,6 @@ AC_SEARCH_LIBS([tgetent], [termlib tinfo termcap curses ncurses], [], [
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(connect, socket)
AC_SEARCH_LIBS(catgets, catgets)
-AM_ICONV
dnl Checks for header files
AC_CHECK_HEADERS([auth.h crypt.h features.h inttypes.h paths.h] dnl
diff --git a/dot.login b/dot.login
new file mode 100644
index 000000000000..18d6f9c9d4d3
--- /dev/null
+++ b/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/dot.tcshrc b/dot.tcshrc
new file mode 100644
index 000000000000..a155ed56a932
--- /dev/null
+++ b/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/ed.chared.c b/ed.chared.c
index 0301e8fa043d..2b4a63c8ca6e 100644
--- a/ed.chared.c
+++ b/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/ed.inputl.c b/ed.inputl.c
index bd8cf7815f4b..8d4c341631b0 100644
--- a/ed.inputl.c
+++ b/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/ed.screen.c b/ed.screen.c
index 8d240c886a10..e8b351fe800d 100644
--- a/ed.screen.c
+++ b/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/ed.xmap.c b/ed.xmap.c
index d76ba46dc9f9..6473519726dd 100644
--- a/ed.xmap.c
+++ b/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/host.defs b/host.defs
index 40572cc24271..6e03537fa612 100644
--- a/host.defs
+++ b/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/patchlevel.h b/patchlevel.h
index adcc1027a0d5..3c71e48b78f3 100644
--- a/patchlevel.h
+++ b/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/sh.c b/sh.c
index dd871727d2aa..d888e8e91d21 100644
--- a/sh.c
+++ b/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/sh.dir.c b/sh.dir.c
index 4d6a1de25ab3..f57e9950af36 100644
--- a/sh.dir.c
+++ b/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/sh.dol.c b/sh.dol.c
index 8009d772b2df..28e8639be8b9 100644
--- a/sh.dol.c
+++ b/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/sh.exp.c b/sh.exp.c
index 9d85e0bd159c..f9e92c515382 100644
--- a/sh.exp.c
+++ b/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/sh.func.c b/sh.func.c
index 05f3f20df3bf..c978ffe844fe 100644
--- a/sh.func.c
+++ b/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/sh.glob.c b/sh.glob.c
index d19de2483b64..a57404013f88 100644
--- a/sh.glob.c
+++ b/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/sh.h b/sh.h
index 0bada305756b..94f4af236671 100644
--- a/sh.h
+++ b/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/sh.hist.c b/sh.hist.c
index 5be5c4fbde53..d061f40d8c0e 100644
--- a/sh.hist.c
+++ b/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/sh.lex.c b/sh.lex.c
index 2893768e9584..46cc96d0937c 100644
--- a/sh.lex.c
+++ b/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/sh.misc.c b/sh.misc.c
index 96c783b56408..bf6bcc994099 100644
--- a/sh.misc.c
+++ b/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/sh.set.c b/sh.set.c
index f15e41fcedaf..e51fdae11cc1 100644
--- a/sh.set.c
+++ b/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/tc.alloc.c b/tc.alloc.c
index 8914ba575d0c..cbe218f4c086 100644
--- a/tc.alloc.c
+++ b/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/tc.disc.c b/tc.disc.c
index dd47da56acb0..d18277506965 100644
--- a/tc.disc.c
+++ b/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/tc.os.c b/tc.os.c
index 3a3bb22d9230..3ec512245603 100644
--- a/tc.os.c
+++ b/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/tc.prompt.c b/tc.prompt.c
index 7f728710d148..f06b9596c138 100644
--- a/tc.prompt.c
+++ b/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/tcsh.man b/tcsh.man
index 3d06e5541e00..b01d07e0881a 100644
--- a/tcsh.man
+++ b/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/tcsh.man.new b/tcsh.man.new
index cb82955db317..dae20d6745db 100644
--- a/tcsh.man.new
+++ b/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/tests/lexical.at b/tests/lexical.at
index d3ad14905830..d42d3ea15aed 100644
--- a/tests/lexical.at
+++ b/tests/lexical.at
@@ -626,3 +626,110 @@ AT_CHECK([tcsh -f escape_echo.csh], 0,
])
AT_CLEANUP
+
+AT_SETUP([:gas work as described in the man pages])
+
+AT_DATA([gas.csh],
+[[set x=(aa bb aa bb)
+echo $x:gas/a/c/:gs/b/d/
+foreach i ( "$x:gas/a/c/:q" )
+ echo $i
+end
+echo $x:gas/a/q/:gs/b/w/:s/b/e/
+echo $x:gas/a/q/:gs/b/w/:s/b/e/:gas/q/Q/
+exit 0
+]])
+
+AT_CHECK([tcsh -f gas.csh], 0,
+[cc db cc db
+cc bb cc bb
+qq we qq wb
+QQ we QQ wb
+])
+
+AT_CLEANUP
+
+AT_SETUP([avoid infinite loop in :gas])
+
+AT_DATA([replace_all.csh],
+[[set x=aa
+echo $x:gas/a/ba/
+exit 0
+]])
+
+AT_CHECK([tcsh -f replace_all.csh], 0,
+[baba
+])
+
+AT_CLEANUP
+
+AT_SETUP([/a.b/c:r doesn't remove path elements])
+
+AT_DATA([colon_r_no_extension.csh],
+[[set x='/a.b/c'
+echo $x:r
+exit 0
+]])
+
+AT_CHECK([tcsh -f colon_r_no_extension.csh], 0,
+[/a.b/c
+])
+
+AT_CLEANUP
+
+AT_SETUP([$x:q:h does not cause out of memory crash and yields the full string])
+
+AT_DATA([x_colon_q_colon_h.csh],
+[[set x='a/b c/d.e'
+echo $x:q:h
+exit 0
+]])
+
+AT_CHECK([tcsh -f x_colon_q_colon_h.csh], 0,
+[a/b c/d.e
+])
+
+AT_CLEANUP
+
+AT_SETUP([$x:q:t does not cause out of memory crash and yields the full string])
+
+AT_DATA([x_colon_q_colon_h.csh],
+[[set x='a/b c/d.e'
+echo $x:q:t
+exit 0
+]])
+
+AT_CHECK([tcsh -f x_colon_q_colon_h.csh], 0,
+[a/b c/d.e
+])
+
+AT_CLEANUP
+
+AT_SETUP([$x:q:r yields the full string])
+
+AT_DATA([x_colon_q_colon_r.csh],
+[[set x='a/b c/d.e'
+echo $x:q:r
+exit 0
+]])
+
+AT_CHECK([tcsh -f x_colon_q_colon_r.csh], 0,
+[a/b c/d.e
+])
+
+AT_CLEANUP
+
+AT_SETUP([$x:q:e yields nothing])
+
+AT_DATA([x_colon_q_colon_e.csh],
+[[set x='a/b c/d.e'
+echo $x:q:e
+exit 0
+]])
+
+AT_CHECK([tcsh -f x_colon_q_colon_e.csh], 0,
+[
+])
+
+AT_CLEANUP
+
diff --git a/tests/subst.at b/tests/subst.at
index 48d9f2892a8f..40f5d85f1da2 100644
--- a/tests/subst.at
+++ b/tests/subst.at
@@ -50,12 +50,34 @@ nothing*
foo* ab{c,d} ^fo*
])
-AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }'); echo 'echo ~; echo "$HOME"' | tcsh -f | uniq | wc -l | tr -d ' \t'],
+AT_CHECK([
+case "$(uname -s)" in
+Darwin)
+ HOME=$(dscl . read "/Users/$USER" NFSHomeDirectory | awk '{ print $NF }')
+ ;;
+*)
+ HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
+ ;;
+esac;
+export HOME;
+echo 'echo ~; echo "$HOME"' | tcsh -f | uniq | wc -l | tr -d ' \t'
+],
, [1
])
-AT_CHECK([export HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }'); echo "echo ~$(id -un)/foo; echo \"\$HOME/foo\"" | tcsh -f | uniq dnl
- | wc -l | tr -d ' \t'], , [1
+AT_CHECK([
+case "$(uname -s)" in
+Darwin)
+ HOME=$(dscl . read "/Users/$USER" NFSHomeDirectory | awk '{ print $NF }')
+ ;;
+*)
+ HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
+ ;;
+esac;
+export HOME;
+echo "echo ~$(id -un)/foo; echo \"\$HOME/foo\"" | tcsh -f | uniq dnl
+ | wc -l | tr -d ' \t'
+], , [1
])
AT_CLEANUP
diff --git a/tests/variables.at b/tests/variables.at
index a1f098d42305..9db088665753 100644
--- a/tests/variables.at
+++ b/tests/variables.at
@@ -591,7 +591,18 @@ printenv HOME
setenv HOME /bar
echo $home
]])
-AT_CHECK([export HOME=$(getent passwd $(id -nu) | awk -F: '{ print $(NF - 1) }'); tcsh -f home.csh], ,
+AT_CHECK([
+case "$(uname -s)" in
+Darwin)
+ HOME=$(dscl . read "/Users/$USER" NFSHomeDirectory | awk '{ print $NF }')
+ ;;
+*)
+ HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
+ ;;
+esac;
+export HOME;
+tcsh -f home.csh
+], ,
[1
1
/foo
@@ -708,7 +719,18 @@ AT_CLEANUP
AT_SETUP([$ cdtohome])
-AT_CHECK([export HOME=$(getent passwd $(id -nu) | awk -F: '{ print $(NF - 1) }'); tcsh -f -c 'cd'], 0)
+AT_CHECK([
+case "$(uname -s)" in
+Darwin)
+ HOME=$(dscl . read "/Users/$USER" NFSHomeDirectory | awk '{ print $NF }')
+ ;;
+*)
+ HOME=$(getent passwd $(id -un) | awk -F: '{ print $(NF - 1) }')
+ ;;
+esac;
+export HOME;
+tcsh -f -c 'cd'
+], 0)
AT_CLEANUP
AT_SETUP([$ noimplicithome])
AT_CHECK([tcsh -f -c 'unset cdtohome; cd'], 1, , [cd: Too few arguments.
diff --git a/tw.parse.c b/tw.parse.c
index 4b492e20a408..ed019db5bd35 100644
--- a/tw.parse.c
+++ b/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);