mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-08-05 17:52:30 +02:00
commit bash-20180524 snapshot
This commit is contained in:
@@ -195,11 +195,11 @@ kkk. Fixed a problem with arithmetic expressions containing array references
|
||||
lll. The `select' command and help builtin will use $COLUMNS before the window
|
||||
size returned from the kernel as the terminal width.
|
||||
|
||||
mmm. `read -n 0' and `read -N 0' now try a zero-length read to attempt to
|
||||
mmm. `read -n 0' and `read -N 0' now try a zero-length read in an attempt to
|
||||
detect file descriptor errors.
|
||||
|
||||
nnn. The `read' builtin now does a better job of acting on signals that don't
|
||||
interrrupt read(2).
|
||||
interrupt read(2).
|
||||
|
||||
ooo. Fixed some cases where `printf -v' did not return failure status on a
|
||||
variable assignment error.
|
||||
@@ -208,7 +208,7 @@ ppp. Fixed temporary environment propagation back to the current environment
|
||||
so that it doesn't happen for special builtins run by the `command'
|
||||
builtin.
|
||||
|
||||
qqq. Fixed a bug when searhing for the end of a here-document delimiter in a
|
||||
qqq. Fixed a bug when searching for the end of a here-document delimiter in a
|
||||
command substitution.
|
||||
|
||||
rrr. Fixed a bug that could cause `cd ${DIRSTACK[0]}' to fail.
|
||||
|
||||
+521
@@ -0,0 +1,521 @@
|
||||
This document details the changes between this version, bash-5.0-alpha, and
|
||||
the previous version, bash-4.4-release.
|
||||
|
||||
1. Changes to Bash
|
||||
|
||||
a. Fixed a bug that could cause traps in background jobs to give the terminal
|
||||
to the wrong process group.
|
||||
|
||||
b. Fixed a bug that caused `kill -l 0' to print an out-of-range error.
|
||||
|
||||
c. Fixed a problem that could result in here-documents being displayed in
|
||||
the wrong order.
|
||||
|
||||
d. Fixed a number of out-of-bounds and free memory read errors found via
|
||||
fuzzing.
|
||||
|
||||
e. Fixed a subshell inheritance problem that could cause a subshell to wait for
|
||||
the wrong process.
|
||||
|
||||
f. Fixed a bug that caused SHLVL to be incremented one too many times when
|
||||
creating subshells.
|
||||
|
||||
g. A job dying due to SIGINT can now interrupt sourcing a file in a shell with
|
||||
job control enabled.
|
||||
|
||||
h. Fixed a spurious warning about unterminated ${ or $( constructs during
|
||||
word completion.
|
||||
|
||||
i. The shell no longer runs traps if a signal arrives while reading command
|
||||
substitution output.
|
||||
|
||||
j. Fixed an arithmetic expansion error that could allow ++var++ as valid
|
||||
syntax.
|
||||
|
||||
k. Fixed an error that allowed out-of-bounds references to the directory stack.
|
||||
|
||||
l. The shell does a better job of saving multi-line history entries with
|
||||
embedded comments.
|
||||
|
||||
m. Fixed a bug that could cause quoted bracket expressions in regular expression
|
||||
arguments to `[[' to not match correctly.
|
||||
|
||||
n. Fixed a bug that could cause an IFS character in a word to result in an
|
||||
extra '\001' character in the expansion.
|
||||
|
||||
o. A trailing backslash in a glob pattern can match a trailing backslash in the
|
||||
string.
|
||||
|
||||
p. Fixed a memory leak in the process creation code path when job control is
|
||||
enabled.
|
||||
|
||||
q. Fixed a bug that caused `printf' to output broken surrogate pairs for
|
||||
Japanese locales.
|
||||
|
||||
r. Fixed a bug that caused a SIGINT generated from `kill' in a dot script to
|
||||
kill an interactive shell.
|
||||
|
||||
s. Fixed a bug that could cause the `read' builtin to not fully read a
|
||||
multibyte character.
|
||||
|
||||
t. Fixed a bug that could cause identifiers to be evaluated in conditional
|
||||
arithmetic expressions even when evaluation is suppressed.
|
||||
|
||||
u. Fixed a bug that could result in command substitution, when executed in a
|
||||
context where word splitting is not performed, to leave a stray '\001'
|
||||
character in the string.
|
||||
|
||||
v. Fixed a bug that could cause history expansion to be disabled in a non-
|
||||
interactive shell even if `-o histexpand' is supplied at startup.
|
||||
|
||||
w. Fixed a bug that caused `read -N' to strip leading whitespace IFS characters.
|
||||
|
||||
x. Fixed a bug that caused spurious tilde expansion in arithmetic expressions.
|
||||
|
||||
y. If indirect expansion attempts to indirectly reference through an unset
|
||||
variable, report an error.
|
||||
|
||||
z. Added a guard to prevent the shell from looping while receiving an endless
|
||||
stream of SIGTTIN at shell startup.
|
||||
|
||||
aa. Fixed a bug with parsing here documents inside a command substitution when
|
||||
looking for the closing delimiter.
|
||||
|
||||
bb. Fixed a bug that caused printf to not quote all <blank> characters in the
|
||||
current locale when using the `%q' format specifier.
|
||||
|
||||
cc. Fixed a bug with bash's internal buffered I/O system that caused the input
|
||||
pointer to not be reset when read(2) returned an EOF.
|
||||
|
||||
dd. Bash now installs its SIGWINCH signal handler with SA_RESTART, so it will
|
||||
not interrupt open/read/write system calls.
|
||||
|
||||
ee. The ERR trap now reports line numbers more reliably.
|
||||
|
||||
ff. The shell no longer tries to manipulate the terminal process group if a
|
||||
command or process substitution is killed by SIGTERM when job control is
|
||||
enabled.
|
||||
|
||||
gg. Fixed a bug that caused extglob patterns to match filenames beginning with
|
||||
a period.
|
||||
|
||||
hh. File descriptors open for writing to here documents are no longer available
|
||||
to subshells.
|
||||
|
||||
ii. Make sure word completion doesn't perform command or process substitution.
|
||||
|
||||
jj. Fixed a bug with parsing $$'...' inside a command substitution.
|
||||
|
||||
kk. Fixed a bug that caused bash to remove backslash-newline pairs from the
|
||||
body of a here-document with a quoted delimiter inside a command
|
||||
substitution.
|
||||
|
||||
ll. Fixed a bug that could cause the shell to hang when adding a pid to the
|
||||
table of background process exit statuses.
|
||||
|
||||
mm. Fixed a bug that could cause 0x01 characters to be doubled in the output
|
||||
of process substitution.
|
||||
|
||||
nn. Restricted shells now clear the hash table before making the PATH variable
|
||||
read-only.
|
||||
|
||||
oo. There are a number of changes to the expansion of $* and $@ in contexts
|
||||
where word splitting does not occur (quoted and unquoted), with IFS set
|
||||
to NULL or a non-standard value, mostly to deal with the consequences of
|
||||
the behavior defined in Posix interpretation 888.
|
||||
|
||||
pp. There are a number of changes to nameref variable handling to avoid
|
||||
creating variables with invalid names.
|
||||
|
||||
qq. A non-interactive posix mode shell no longer exits when an assignment
|
||||
statement fails if the assignment is utimately being performed by the
|
||||
`command' builtin.
|
||||
|
||||
rr. When using character class names for globbing, don't allow case
|
||||
insensitivity, even if nocaseglob is enabled.
|
||||
|
||||
ss. Fixed a bug that allowed some redirections to stay in place if a later
|
||||
redirection failed.
|
||||
|
||||
tt. Fixed a bug in how command and process substitutions are recognized within
|
||||
other parameter expansions.
|
||||
|
||||
uu. Fixed a bug that caused bash to loop under certain circumstances when
|
||||
performing arithmetic expansion on a variable whose value is an invalid
|
||||
expression.
|
||||
|
||||
vv. Fixed a bug that could cause bash to expand aliases inappropriately while
|
||||
parsing compound commands like `case'.
|
||||
|
||||
ww. Fixed a bug that could cause `read -N' to fail to read complete multibyte
|
||||
characters, even when the sequences are incomplete or invalid, with or
|
||||
without readline.
|
||||
|
||||
xx. Fixed a bug that could cause `case' to fail to match patterns containing
|
||||
0x01 characters.
|
||||
|
||||
yy. Fixed a bug that caused exported functions to contain stray 0x01 characters.
|
||||
|
||||
zz. Fixed some inconsistencies with how the history number is handled in the
|
||||
various prompt strings.
|
||||
|
||||
aaa. Fixed a bug that could cause a core dump if READLINE_LINE was unset
|
||||
inside a shell function bound to a key sequence with `bind -x'.
|
||||
|
||||
bbb. Fixed a bug that could cause bash to not read a token terminator correctly
|
||||
if a command substitution was used inside an arithmetic `for' command.
|
||||
|
||||
ccc. Fixed problems that could occur with a fatal arithmetic expansion error
|
||||
in a context (like prompt expansion) where you can't jump back to the
|
||||
top level.
|
||||
|
||||
ddd. Expression errors in arithmetic `for' commands are treated more like
|
||||
shell syntax errors.
|
||||
|
||||
eee. Fixed a parser synchronization error resulting from a syntax error
|
||||
followed immediately by an EOF.
|
||||
|
||||
fff. When executing a shell function, the first line in the function ($LINENO)
|
||||
is line 1 instead of line 0, as Posix requires.
|
||||
|
||||
ggg. In Posix mode, bash will canonicalize the value of PWD it inherits from
|
||||
the environment and use that to set its idea of the current directory.
|
||||
|
||||
hhh. If LINENO is exported, bash needs to regenerate its value each time it
|
||||
constructs the environment.
|
||||
|
||||
iii. Fixed a bug with restoring the SIGINT handler when using `wait -n'.
|
||||
|
||||
jjj. Make sure the `coproc' command returns an appropriate status if the NAME
|
||||
argument is invalid.
|
||||
|
||||
kkk. Fixed a problem with arithmetic expressions containing array references
|
||||
that contain arithmetic expressions with syntax errors.
|
||||
|
||||
lll. The `select' command and help builtin will use $COLUMNS before the window
|
||||
size returned from the kernel as the terminal width.
|
||||
|
||||
mmm. `read -n 0' and `read -N 0' now try a zero-length read in an attempt to
|
||||
detect file descriptor errors.
|
||||
|
||||
nnn. The `read' builtin now does a better job of acting on signals that don't
|
||||
interrupt read(2).
|
||||
|
||||
ooo. Fixed some cases where `printf -v' did not return failure status on a
|
||||
variable assignment error.
|
||||
|
||||
ppp. Fixed temporary environment propagation back to the current environment
|
||||
so that it doesn't happen for special builtins run by the `command'
|
||||
builtin.
|
||||
|
||||
qqq. Fixed a bug when searching for the end of a here-document delimiter in a
|
||||
command substitution.
|
||||
|
||||
rrr. Fixed a bug that could cause `cd ${DIRSTACK[0]}' to fail.
|
||||
|
||||
sss. Fixed a bug that could cause reserved words to not be recognized in a
|
||||
for statement without the `in' inside a command substitution.
|
||||
|
||||
ttt. Fixed a bug that could cause a double-free in a timed command with an
|
||||
expansion error.
|
||||
|
||||
uuu. Fixed a bug that could cause a core dump if a script switches from a UTF-8
|
||||
locale to a different locale after displaying a lone surrogate character.
|
||||
|
||||
vvv. Fixed cases where bash prematurely removed FIFOs attached to process
|
||||
substitutions.
|
||||
|
||||
www. Fixed a problem with calculating the size of the table that stores exit
|
||||
statuses from background processes when the child process resource limit
|
||||
is very large.
|
||||
|
||||
xxx. Fixed a memory leak with functions using `return' when using FIFOs for
|
||||
standard input.
|
||||
|
||||
yyy. `wait' without arguments attempts to wait for all active process
|
||||
substitution processes.
|
||||
|
||||
zzz. Fixed a bug where an indirect parameter was subjected to word splitting
|
||||
when trying to find the indirected variable name.
|
||||
|
||||
aaaa. Fixed a bug that could allow restricted shell users to add commands to
|
||||
the hash table.
|
||||
|
||||
bbbb. When using the `!(patlist)' extended globbing operator, a filename
|
||||
beginning with a `.' that doesn't match any of the patterns is not
|
||||
returned as a match if leading dots must be matched explicitly.
|
||||
|
||||
cccc. Fixed a bug that could cause line number and source file information for
|
||||
a function definition to be incorrect if there are multiple definitions.
|
||||
|
||||
dddd. Fixed a bug that could cause builtins like `readonly' to behave
|
||||
differently when applied to arrays and scalar variables within functions.
|
||||
|
||||
eeee. Fixed a bug that could cause alias expansion to add an extra space to
|
||||
a quoted string that begins outside the alias expansion.
|
||||
|
||||
ffff. Fixed a bug that could result in unwanted alias expansion after timing
|
||||
the null command.
|
||||
|
||||
gggg. Fixed a bug that could cause a core dump if a timestamp in a history
|
||||
file overflowed a time_t.
|
||||
|
||||
hhhh. Restricted shells can no longer redirect from /dev/tcp or /dev/udp, since
|
||||
the kernel calls make those file descriptors read-write.
|
||||
|
||||
iiii. Fixed a problem with splitting double-quoted words for programmable
|
||||
completion when the double quote immediately follows another word
|
||||
delimiter.
|
||||
|
||||
jjjj. Fixed a bug resulting in a use-after-free if two file descriptors share
|
||||
the same input buffer.
|
||||
|
||||
kkkk. The error message resulting from ${x:?} and ${x?} now differs depending
|
||||
on whether the variable is null or unset.
|
||||
|
||||
llll. In Posix mode, the shell exits if a variable assignment fails and precedes
|
||||
an empty simple command (after expansion).
|
||||
|
||||
mmmm. Fixed a timing problem with SIGALRM that could cause the read builtin to
|
||||
drop characters.
|
||||
|
||||
nnnn. Added code to deal with kill(2) failing to send the shell a fatal signal
|
||||
due to Linux pid namespace peculiarities.
|
||||
|
||||
oooo. Fixed a bug that made \C-@ (NUL) unusable in key sequences used for
|
||||
`bind -x' commands.
|
||||
|
||||
pppp. Fixed a bug that could cause SIGINT recursion when running an external
|
||||
command in a trap the shell takes after a command exits due to SIGINT.
|
||||
|
||||
qqqq. Make sure the shell turns off job control before running the command-
|
||||
not-found handle, so the command doesn't try to manipulate process
|
||||
groups.
|
||||
|
||||
rrrr. Fixed a problem with timing process substitutions that caused the shell
|
||||
to print timing information for the calling command.
|
||||
|
||||
ssss. Fixed a bug that caused backquotes in a here-document delimiter to mark
|
||||
the delimiter as quoted (inhibiting expansion of the here-document
|
||||
contents).
|
||||
|
||||
tttt. Fixed several problems with 0x01 and 0x177 in case pattern lists and
|
||||
conditional command pattern matches.
|
||||
|
||||
uuuu. Fixed a bug that could cause the pattern matching engine to not recognize
|
||||
locale-specific character classes.
|
||||
|
||||
vvvv. The auto-configuration now tests for /dev/stdin and /dev/fd independently.
|
||||
|
||||
wwww. The `globstar' code now skips over symbolic links to directories,
|
||||
preventing them from being scanned twice.
|
||||
|
||||
xxxx. When running `bind -x' commands, bash now sets READLINE_POINT based on
|
||||
the number of characters in the readline line buffer, not the number of
|
||||
bytes.
|
||||
|
||||
yyyy. Fixed a problem that could cause recursive trap evaluation of the RETURN
|
||||
trap when using `eval return'.
|
||||
|
||||
zzzz. Fixed a bug with expanding 0x01 in an unquoted here-document.
|
||||
|
||||
aaaaa. The process substitution code now closes and unlinks FIFOs when the
|
||||
process on the other side exits, in order to prevent SIGPIPE or
|
||||
waiting until a FIFO opened for read has a writer.
|
||||
|
||||
bbbbb. Fixed a bug with recursive calls to the parser overwriting the token in
|
||||
an {id}>foo construct.
|
||||
|
||||
ccccc. After a Posix discussion, the pattern matching engine just skips over
|
||||
invalid character classes in bracket expressions, instead of matching
|
||||
them like individual characters in the expression.
|
||||
|
||||
ddddd. Fixed a posix-mode problem with variable scoping when creating variables
|
||||
from assignment statements preceding special builtins.
|
||||
|
||||
eeeee. Fixed a bug that could cause patterns containing backslashes to not be
|
||||
run through the pattern matching engine.
|
||||
|
||||
fffff. Fixed a bug that could cause redirections to compound commands to not
|
||||
be `undone' if the file descriptor in the redirection was closed when
|
||||
the redirection was initially processed.
|
||||
|
||||
ggggg. Fixed a bug that could cause buffer corruption when using `bind -x' in
|
||||
a command execute as a result of a key binding installed by `bind -x'.
|
||||
|
||||
2. Changes to Readline
|
||||
|
||||
a. Added a guard to prevent nested macros from causing an infinite expansion
|
||||
loop.
|
||||
|
||||
b. Instead of allocating enough history list entries to hold the maximum list
|
||||
size, cap the number allocated initially.
|
||||
|
||||
c. Added a strategy to avoid allocating huge amounts of memory if a block of
|
||||
history entries without timestamps occurs after a block with timestamps.
|
||||
|
||||
d. Added support for keyboard timeouts when an ESC character is the last
|
||||
character in a macro.
|
||||
|
||||
e. There are several performance improvements when in a UTF-8 locale.
|
||||
|
||||
f. Readline does a better job of preserving the original set of blocked
|
||||
signals when using pselect() to wait for input.
|
||||
|
||||
g. Fixed a bug that caused multibyte characters in macros to be mishandled.
|
||||
|
||||
h. Fixed several bugs in the code that calculates line breaks when expanding
|
||||
prompts that span several lines, contain multibyte characters, and contain
|
||||
invisible character seqeuences.
|
||||
|
||||
i. Fixed several bugs in cursor positioning when displaying lines with prompts
|
||||
containing invisible characters and multibyte characters.
|
||||
|
||||
j. When performing case-insensitive completion, Readline no longer sorts the
|
||||
list of matches unless directed to do so.
|
||||
|
||||
k. Fixed a problem with key sequences ending with a backslash.
|
||||
|
||||
l. Fixed out-of-bounds and free memory read errors found via fuzzing.
|
||||
|
||||
m. Fixed several cases where the mark was set to an invalid value.
|
||||
|
||||
n. Fixed a problem with the case-changing operators in the case where the
|
||||
lower and upper case versions of a character do not have the same number
|
||||
of bytes.
|
||||
|
||||
o. Handle incremental and non-incremental search character reads returning EOF.
|
||||
|
||||
p. Handle the case where a failing readline command at the end of a multi-key
|
||||
sequence could be misinterpreted.
|
||||
|
||||
q. The history library now prints a meaningful error message if the history
|
||||
file isn't a regular file.
|
||||
|
||||
r. Fixed a problem with vi-mode redo (`.') on a command when trying to replace
|
||||
a multibyte character.
|
||||
|
||||
s. The key binding code now attempts to remove a keymap if a key unbinding
|
||||
leaves it empty.
|
||||
|
||||
t. Fixed a line-wrapping issue that caused problems for some terminal
|
||||
emulators.
|
||||
|
||||
u. If there is a key bound to the tty's VDISCARD special character, readline
|
||||
disables VDISCARD while it is active.
|
||||
|
||||
v. Fixed a problem with exiting bracketed paste mode on terminals that assume
|
||||
the bracketed paste mode character sequence contains visible characters.
|
||||
|
||||
w. Fixed a bug that could cause a key binding command to refer to an
|
||||
uninitialized variable.
|
||||
|
||||
3. New Features in Bash
|
||||
|
||||
a. The `wait' builtin can now wait for the last process substitution created.
|
||||
|
||||
b. There is an EPOCHSECONDS variable, which expands to the time in seconds
|
||||
since the Unix epoch.
|
||||
|
||||
c. There is an EPOCHREALTIME variable, which expands to the time in seconds
|
||||
since the Unix epoch with microsecond granularity.
|
||||
|
||||
d. New loadable builtins: rm, stat, fdflags.
|
||||
|
||||
e. BASH_ARGV0: a new variable that expands to $0 and sets $0 on assignment.
|
||||
|
||||
f. When supplied a numeric argument, the shell-expand-line bindable readline
|
||||
command does not perform quote removal and suppresses command and process
|
||||
substitution.
|
||||
|
||||
g. `history -d' understands negative arguments: negative arguments offset from
|
||||
the end of the history list.
|
||||
|
||||
h. The `name' argument to the `coproc' reserved word now undergoes word
|
||||
expansion, so unique coprocs can be created in loops.
|
||||
|
||||
i. A nameref name resolution loop in a function now resolves to a variable by
|
||||
that name in the global scope.
|
||||
|
||||
j. The `wait' builtin now has a `-f' option, which signfies to wait until the
|
||||
specified job or process terminates, instead of waiting until it changes
|
||||
state.
|
||||
|
||||
k. There is a define in config-top.h that allows the shell to use a static
|
||||
value for $PATH, overriding whatever is in the environment at startup, for
|
||||
use by the restricted shell.
|
||||
|
||||
l. Process substitution does not inherit the `v' option, like command
|
||||
substitution.
|
||||
|
||||
m. If a non-interactive shell with job control enabled detects that a foreground
|
||||
job died due to SIGINT, it acts as if it received the SIGINT.
|
||||
|
||||
n. The SIGCHLD trap is run once for each exiting child process even if job
|
||||
control is not enabled when the shell is in Posix mode.
|
||||
|
||||
o. A new shopt option: localvar_inherit; if set, a local variable inherits the
|
||||
value of a variable with the same name at the nearest preceding scope.
|
||||
|
||||
p. `bind -r' now checks whether a key sequence is bound before binding it to
|
||||
NULL, to avoid creating keymaps for a multi-key sequence.
|
||||
|
||||
q. A numeric argument to the line editing `operate-and-get-next' command
|
||||
specifies which history entry to use.
|
||||
|
||||
r. The positional parameters are now assigned before running the shell startup
|
||||
files, so startup files can use $@.
|
||||
|
||||
s. There is a compile-time option that forces the shell to disable the check
|
||||
for an inherited OLDPWD being a directory.
|
||||
|
||||
t. The `history' builtin can now delete ranges of history entries using
|
||||
`-d start-end'.
|
||||
|
||||
u. The `vi-edit-and-execute-command' bindable readline command now puts readline
|
||||
back in vi insertion mode after executing commands from the edited file.
|
||||
|
||||
v. The command completion code now matches aliases and shell function names
|
||||
case-insensitively if the readline completion-ignore-case variable is set.
|
||||
|
||||
w. There is a new `assoc_expand_once' shell option that attempts to expand
|
||||
associative array subscripts only once.
|
||||
|
||||
x. The shell only sets up BASH_ARGV and BASH_ARGC at startup if extended
|
||||
debugging mode is active. The old behavior of unconditionally setting them
|
||||
is available as part of the shell compatibility options.
|
||||
|
||||
y. The `umask' builtin now allows modes and masks greater than octal 777.
|
||||
|
||||
z. The `times' builtin now honors the current locale when printing a decimal
|
||||
point.
|
||||
|
||||
aa. There is a new (disabled by default, undocumented) shell option to enable
|
||||
and disable sending history to syslog at runtime.
|
||||
|
||||
4. New Features in Readline
|
||||
|
||||
a. Non-incremental vi-mode search (`N', `n') can search for a shell pattern, as
|
||||
Posix specifies (uses fnmatch(3) if available).
|
||||
|
||||
b. There are new `next-screen-line' and `previous-screen-line' bindable
|
||||
commands, which move the cursor to the same column in the next, or previous,
|
||||
physical line, respectively.
|
||||
|
||||
c. There are default key bindings for control-arrow-key key combinations.
|
||||
|
||||
d. A negative argument (-N) to `quoted-insert' means to insert the next N
|
||||
characters using quoted-insert.
|
||||
|
||||
e. New public function: rl_check_signals(), which allows applications to
|
||||
respond to signals that readline catches while waiting for input using
|
||||
a custom read function.
|
||||
|
||||
f. There is new support for conditionally testing the readline version in an
|
||||
inputrc file, with a full set of arithmetic comparison operators available.
|
||||
|
||||
g. There is a simple variable comparison facility available for use within an
|
||||
inputrc file. Allowable operators are equality and inequality; string
|
||||
variables may be compared to a value; boolean variables must be compared to
|
||||
either `on' or `off'; variable names are separated from the operator by
|
||||
whitespace.
|
||||
@@ -396,6 +396,10 @@ above.
|
||||
BASH_ARGC and BASH_ARGV is available at compatibility levels less than
|
||||
or equal to 44.
|
||||
|
||||
61. Bash-5.0 doesn't allow a `break' or `continue' in a subshell to attempt
|
||||
to break or continue loop execution inherited from the calling context.
|
||||
|
||||
|
||||
Shell Compatibility Level
|
||||
=========================
|
||||
|
||||
@@ -451,15 +455,18 @@ compat43 set
|
||||
(declare -a foo='(1 2)')
|
||||
- word expansion errors are considered non-fatal errors that cause the
|
||||
current command to fail, even in Posix mode
|
||||
- when executing a shell function, the loop state (while/until/etc.) is
|
||||
not reset, so `break' or `continue' in a shell function will break or
|
||||
continue loops in the calling context. Bash-4.4 and later reset the
|
||||
loop state to prevent this.
|
||||
- when executing a shell function, the loop state (while/until/etc.)
|
||||
is not reset, so `break' or `continue' in that function will break
|
||||
or continue loops in the calling context. Bash-4.4 and later reset
|
||||
the loop state to prevent this.
|
||||
|
||||
compat44 set
|
||||
- the shell sets up the values used by BASH_ARGV and BASH_ARGC so
|
||||
they can expand to the shell's positional parameters even if extended
|
||||
debug mode is not enabled
|
||||
- a subshell inherits loops from its parent contenxt, so `break'
|
||||
or `continue' will cause the subshell to exit
|
||||
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -15396,3 +15396,74 @@ execute_cmd.c
|
||||
- execute_in_subshell: subshells should set loop_level == 0, since
|
||||
they are no longer "enclosed" by the loop, according to posix.
|
||||
Report from Aeron.E. Wang <aeron.e.wang@gmail.com>
|
||||
|
||||
5/24
|
||||
----
|
||||
Makefile.in
|
||||
- pkgconfigdir: don't fail installing bash.pc if this directory doesn't
|
||||
exist or isn't writable -- there's no error in failing to install
|
||||
something nothing will use
|
||||
- install-headers-dirs: creat $(pkgconfigdir) if it doesn't exist
|
||||
|
||||
lib/sh/shmbchar.c
|
||||
- utf8_mblen: replace with version from gnulib
|
||||
- utf8_mbstrlen: reimplement using utf8_mblen so it handles invalid
|
||||
multibyte sequences in the same way as mbstrlen
|
||||
|
||||
lib/readline/mbutil.c
|
||||
- _rl_utf8_mblen: utf-8 specific version of mblen from gnulib
|
||||
|
||||
include/shmbutil.h
|
||||
- ADVANCE_CHAR,COPY_CHAR_P: do better job detecting end of string in
|
||||
UTF-8 locales (should not be called with an empty string, but to
|
||||
be safe)
|
||||
|
||||
5/25
|
||||
----
|
||||
lib/sh/utf8.c
|
||||
- new file, utf-8-specific functions collected from other files
|
||||
|
||||
externs.h
|
||||
- extern declarations moved around for utf8.c
|
||||
|
||||
include/shmbutil.h
|
||||
- SADD_MBCHAR, SADD_MBQCHAR_BODY, ADVANCE_CHAR_P: if the locale is a
|
||||
UTF-8 locale, don't bother with a call to mbrlen if the current
|
||||
character cannot start a multibyte character
|
||||
|
||||
variables.c
|
||||
- push_var_context: only merge the temporary environment in posix mode
|
||||
if we are executing a shell function (flags & VC_FUNCENV). Report
|
||||
from Martijn Dekker <martijn@inlv.org>
|
||||
|
||||
lib/readline/mbutil.c
|
||||
- _rl_get_char_len: don't call mbrlen if we are in a UTF-8 locale and
|
||||
the character cannot start a multibyte sequence
|
||||
|
||||
builtins/read.def
|
||||
- read_builtin: if mb_cur_max > 1, call read_mbchar only if we're not
|
||||
in a utf-8 locale or, if we are, the character we just read indicates
|
||||
the start of a multibyte sequence
|
||||
|
||||
subst.c
|
||||
- string_extract_verbatim: don't call MBRLEN if we're in a utf-8
|
||||
locale and the current character can't start a multibyte sequence
|
||||
- setifs: don't call MBRLEN if we're in a utf-8 locale and the first
|
||||
character of $IFS can't start a multibyte sequence
|
||||
|
||||
lib/readline/kill.c
|
||||
- rl_bracketed_paste_begin: make sure we return 0 here if rl_insert_text
|
||||
returns the right number of characters inserted to be consistent
|
||||
with other functions. Returns 1 otherwise. Report and fix from
|
||||
Gabe Krabbe <gabe@rtfs.de> back in March, 2018
|
||||
|
||||
lib/readline/readline.c
|
||||
- rl_subseq_result: make sure r is < 0 before checking map[ANYOTHERKEY]
|
||||
to see if we shadowed a key that should now be tried
|
||||
|
||||
5/27
|
||||
----
|
||||
variables.c
|
||||
- assign_aliasvar: perform same validity check on subscript assignment
|
||||
as alias builtin performs on name argument. Bug report from
|
||||
Mike Jonkmans <bashbug@jonkmans.nl>
|
||||
|
||||
@@ -453,6 +453,7 @@ lib/sh/tmpfile.c f
|
||||
lib/sh/uconvert.c f
|
||||
lib/sh/ufuncs.c f
|
||||
lib/sh/unicode.c f
|
||||
lib/sh/utf8.c f
|
||||
lib/sh/vprint.c f
|
||||
lib/sh/wcsdup.c f
|
||||
lib/sh/wcsnwidth.c f
|
||||
|
||||
+6
-5
@@ -1,4 +1,4 @@
|
||||
# Makefile for bash-5.0, version 4.25
|
||||
# Makefile for bash-5.0, version 4.27
|
||||
#
|
||||
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
||||
|
||||
@@ -41,6 +41,7 @@ infodir = @infodir@
|
||||
includedir = @includedir@
|
||||
datadir = @datadir@
|
||||
localedir = @localedir@
|
||||
pkgconfigdir = ${libdir}/pkgconfig
|
||||
|
||||
loadablesdir = @loadablesdir@
|
||||
headersdir = @headersdir@
|
||||
@@ -230,7 +231,7 @@ SHLIB_SOURCE = ${SH_LIBSRC}/clktck.c ${SH_LIBSRC}/getcwd.c \
|
||||
${SH_LIBSRC}/input_avail.c ${SH_LIBSRC}/mbscasecmp.c \
|
||||
${SH_LIBSRC}/fnxform.c ${SH_LIBSRC}/unicode.c \
|
||||
${SH_LIBSRC}/wcswidth.c ${SH_LIBSRC}/wcsnwidth.c \
|
||||
${SH_LIBSRC}/shmbchar.c
|
||||
${SH_LIBSRC}/shmbchar.c ${SH_LIBSRC}/utf8.c
|
||||
|
||||
SHLIB_LIB = -lsh
|
||||
SHLIB_LIBNAME = libsh.a
|
||||
@@ -834,7 +835,7 @@ install-headers-dirs:
|
||||
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(headersdir)
|
||||
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(headersdir)/builtins
|
||||
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(headersdir)/include
|
||||
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(libdir)/pkgconfig
|
||||
@${SHELL} $(SUPPORT_SRC)mkinstalldirs $(DESTDIR)$(pkgconfigdir)
|
||||
|
||||
install-headers: install-headers-dirs
|
||||
@for hf in $(INSTALLED_HEADERS) ; do \
|
||||
@@ -849,14 +850,14 @@ install-headers: install-headers-dirs
|
||||
@for hf in $(CREATED_HEADERS) ; do \
|
||||
${INSTALL_DATA} $(BUILD_DIR)/"$$hf" $(DESTDIR)$(headersdir)/$$hf; \
|
||||
done
|
||||
$(INSTALL_DATA) $(SDIR)/bash.pc $(DESTDIR)$(libdir)/pkgconfig/bash.pc
|
||||
-$(INSTALL_DATA) $(SDIR)/bash.pc $(DESTDIR)$(pkgconfigdir)/bash.pc
|
||||
|
||||
uninstall-headers:
|
||||
-( cd $(DESTDIR)$(headersdir) && $(RM) $(INSTALLED_HEADERS) )
|
||||
-( cd $(DESTDIR)$(headersdir)/include && $(RM) $(INSTALLED_INCFILES) )
|
||||
-( cd $(DESTDIR)$(headersdir)/builtins && $(RM) $(INSTALLED_BUILTINS_HEADERS) )
|
||||
-( cd $(DESTDIR)$(headersdir) && $(RM) $(CREATED_HEADERS) )
|
||||
-( $(RM) $(DESTDIR)$(libdir)/pkgconfig/bash.pc )
|
||||
-( $(RM) $(DESTDIR)$(pkgconfigdir)/bash.pc )
|
||||
|
||||
uninstall: .made
|
||||
$(RM) $(DESTDIR)$(bindir)/$(Program) $(DESTDIR)$(bindir)/bashbug
|
||||
|
||||
+1
-1
@@ -1564,7 +1564,7 @@ attempt_shell_completion (text, start, end)
|
||||
else if (start == end && start == s1 && e != 0 && e1 > end) /* beginning of command name, leading whitespace */
|
||||
foundcs = 0;
|
||||
else if (e == 0 && e == s && text[0] == '\0' && have_progcomps) /* beginning of empty line */
|
||||
prog_complete_matches = programmable_completions ("_EmptycmD_", text, s, e, &foundcs);
|
||||
prog_complete_matches = programmable_completions (EMPTYCMD, text, s, e, &foundcs);
|
||||
else if (start == end && text[0] == '\0' && s1 > start && whitespace (rl_line_buffer[start]))
|
||||
foundcs = 0; /* whitespace before command name */
|
||||
else if (e > s && was_assignment == 0 && e1 == end && rl_line_buffer[e] == 0 && whitespace (rl_line_buffer[e-1]) == 0)
|
||||
|
||||
@@ -435,7 +435,6 @@ parse_and_execute (string, from_file, flags)
|
||||
else
|
||||
last_result = execute_command_internal
|
||||
(command, 0, NO_PIPE, NO_PIPE, bitmap);
|
||||
|
||||
dispose_command (command);
|
||||
dispose_fd_bitmap (bitmap);
|
||||
discard_unwind_frame ("pe_dispose");
|
||||
|
||||
@@ -705,6 +705,7 @@ add_char:
|
||||
}
|
||||
else
|
||||
# endif
|
||||
if (locale_utf8locale == 0 || ((c & 0x80) != 0))
|
||||
i += read_mbchar (fd, input_string, i, c, unbuffered_read);
|
||||
}
|
||||
#endif
|
||||
|
||||
+5
-1
@@ -110,6 +110,7 @@ extern int enable_hostname_completion __P((int));
|
||||
|
||||
#if defined (PROGRAMMABLE_COMPLETION)
|
||||
extern int prog_completion_enabled;
|
||||
extern int progcomp_alias;
|
||||
#endif
|
||||
|
||||
#if defined (DEBUGGER)
|
||||
@@ -219,7 +220,7 @@ static struct {
|
||||
{ "lithist", &literal_history, (shopt_set_func_t *)NULL },
|
||||
#endif
|
||||
{ "localvar_inherit", &localvar_inherit, (shopt_set_func_t *)NULL },
|
||||
#if 0
|
||||
#if 0 /* bash-5.0-beta */
|
||||
{ "localvar_unset", &localvar_unset, (shopt_set_func_t *)NULL },
|
||||
#endif
|
||||
{ "login_shell", &shopt_login_shell, set_login_shell },
|
||||
@@ -232,6 +233,9 @@ static struct {
|
||||
{ "nullglob", &allow_null_glob_expansion, (shopt_set_func_t *)NULL },
|
||||
#if defined (PROGRAMMABLE_COMPLETION)
|
||||
{ "progcomp", &prog_completion_enabled, (shopt_set_func_t *)NULL },
|
||||
# if 0 /* bash-5.0-beta */
|
||||
{ "progcomp_alias", &progcomp_alias, (shopt_set_func_t *)NULL },
|
||||
# endif
|
||||
#endif
|
||||
{ "promptvars", &promptvars, (shopt_set_func_t *)NULL },
|
||||
#if defined (RESTRICTED_SHELL)
|
||||
|
||||
+5
-5
@@ -2079,7 +2079,7 @@ line editing.
|
||||
Similar to
|
||||
.SM
|
||||
.BR BASH_ENV ;
|
||||
used when the shell is invoked in POSIX mode.
|
||||
used when the shell is invoked in \fIposix mode\fP.
|
||||
.TP
|
||||
.B EXECIGNORE
|
||||
A colon-separated list of shell patterns (see \fBPattern Matching\fP)
|
||||
@@ -4828,7 +4828,7 @@ subshell environment. Changes made to the subshell environment
|
||||
cannot affect the shell's execution environment.
|
||||
.PP
|
||||
Subshells spawned to execute command substitutions inherit the value of
|
||||
the \fB\-e\fP option from the parent shell. When not in \fIposix\fP mode,
|
||||
the \fB\-e\fP option from the parent shell. When not in \fIposix mode\fP,
|
||||
\fBbash\fP clears the \fB\-e\fP option in such subshells.
|
||||
.PP
|
||||
If a command is followed by a \fB&\fP and job control is not active, the
|
||||
@@ -9278,7 +9278,7 @@ Without options, the name and value of each shell variable are displayed
|
||||
in a format that can be reused as input
|
||||
for setting or resetting the currently-set variables.
|
||||
Read-only variables cannot be reset.
|
||||
In \fIposix\fP mode, only shell variables are listed.
|
||||
In \fIposix mode\fP, only shell variables are listed.
|
||||
The output is sorted according to the current locale.
|
||||
When options are specified, they set or unset shell attributes.
|
||||
Any arguments remaining after option processing are treated
|
||||
@@ -9824,7 +9824,7 @@ interrupt; previous versions continue with the next command in the list.
|
||||
.B compat41
|
||||
If set,
|
||||
.BR bash ,
|
||||
when in \fIposix\fP mode, treats a single quote in a double-quoted
|
||||
when in \fIposix mode\fP, treats a single quote in a double-quoted
|
||||
parameter expansion as a special character. The single quotes must match
|
||||
(an even number) and the characters between the single quotes are considered
|
||||
quoted. This is the behavior of posix mode through version 4.1.
|
||||
@@ -10596,7 +10596,7 @@ which is in units of 512-byte blocks;
|
||||
and
|
||||
.BR \-u ,
|
||||
which are unscaled values;
|
||||
and, when in Posix mode,
|
||||
and, when in posix mode,
|
||||
.B \-c
|
||||
and
|
||||
.BR \-f ,
|
||||
|
||||
+1
-1
@@ -1524,7 +1524,7 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
|
||||
|
||||
/* And we're no longer in a loop. See Posix interp 842 (we are not in the
|
||||
"same execution environment"). */
|
||||
if (shell_compatibility_level > 43)
|
||||
if (shell_compatibility_level > 44)
|
||||
loop_level = 0;
|
||||
|
||||
if (user_subshell)
|
||||
|
||||
@@ -485,6 +485,14 @@ extern unsigned int fsleep __P((unsigned int, unsigned int));
|
||||
extern int u32cconv __P((unsigned long, char *));
|
||||
extern void u32reset __P((void));
|
||||
|
||||
/* declarations for functions defined in lib/sh/utf8.c */
|
||||
extern char *utf8_mbschr __P((const char *, int));
|
||||
extern int utf8_mbscmp __P((const char *, const char *));
|
||||
extern char *utf8_mbsmbchar __P((const char *));
|
||||
extern int utf8_mbsnlen __P((const char *, size_t, int));
|
||||
extern int utf8_mblen __P((const char *, size_t));
|
||||
extern size_t utf8_mbstrlen __P((const char *));
|
||||
|
||||
/* declarations for functions defined in lib/sh/wcsnwidth.c */
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
extern int wcsnwidth __P((const wchar_t *, size_t, int));
|
||||
|
||||
+15
-2
@@ -50,6 +50,10 @@ extern int locale_utf8locale; /* XXX */
|
||||
#define MBLEN(s, n) ((MB_CUR_MAX > 1) ? mblen ((s), (n)) : 1)
|
||||
#define MBRLEN(s, n, p) ((MB_CUR_MAX > 1) ? mbrlen ((s), (n), (p)) : 1)
|
||||
|
||||
#define UTF8_SINGLEBYTE(c) (((c) & 0x80) == 0)
|
||||
#define UTF8_MBFIRSTCHAR(c) (((c) & 0xc0) == 0xc0)
|
||||
#define UTF8_MBCHAR(c) (((c) & 0xc0) == 0x80)
|
||||
|
||||
#else /* !HANDLE_MULTIBYTE */
|
||||
|
||||
#undef MB_LEN_MAX
|
||||
@@ -75,6 +79,9 @@ extern int locale_utf8locale; /* XXX */
|
||||
# define wchar_t int
|
||||
#endif
|
||||
|
||||
#define UTF8_SINGLEBYTE(c) (1)
|
||||
#define UTF8_MBFIRSTCHAR(c) (0)
|
||||
|
||||
#endif /* !HANDLE_MULTIBYTE */
|
||||
|
||||
/* Declare and initialize a multibyte state. Call must be terminated
|
||||
@@ -111,7 +118,7 @@ extern int locale_utf8locale; /* XXX */
|
||||
if (_f) \
|
||||
mblength = 1; \
|
||||
else if (locale_utf8locale && (((_str)[_i] & 0x80) == 0)) \
|
||||
mblength = 1; \
|
||||
mblength = (_str)[_i] != 0; \
|
||||
else \
|
||||
{ \
|
||||
state_bak = state; \
|
||||
@@ -152,6 +159,8 @@ extern int locale_utf8locale; /* XXX */
|
||||
_f = is_basic (*(_str)); \
|
||||
if (_f) \
|
||||
mblength = 1; \
|
||||
else if (locale_utf8locale && ((*(_str) & 0x80) == 0)) \
|
||||
mblength = *(_str) != 0; \
|
||||
else \
|
||||
{ \
|
||||
state_bak = state; \
|
||||
@@ -271,7 +280,7 @@ extern int locale_utf8locale; /* XXX */
|
||||
if (_k) \
|
||||
mblength = 1; \
|
||||
else if (locale_utf8locale && ((*(_src) & 0x80) == 0)) \
|
||||
mblength = 1; \
|
||||
mblength = *(_src) != 0; \
|
||||
else \
|
||||
{ \
|
||||
state_bak = state; \
|
||||
@@ -445,6 +454,8 @@ extern int locale_utf8locale; /* XXX */
|
||||
i = is_basic (*((_src) + (_si))); \
|
||||
if (i) \
|
||||
mblength = 1; \
|
||||
else if (locale_utf8locale && (((_src)[_si] & 0x80) == 0)) \
|
||||
mblength = (_src)[_si] != 0; \
|
||||
else \
|
||||
{ \
|
||||
state_bak = state; \
|
||||
@@ -483,6 +494,8 @@ extern int locale_utf8locale; /* XXX */
|
||||
i = is_basic (*((_src) + (_si))); \
|
||||
if (i) \
|
||||
mblength = 1; \
|
||||
else if (locale_utf8locale && (((_src)[_si] & 0x80) == 0)) \
|
||||
mblength = (_src)[_si] != 0; \
|
||||
else \
|
||||
{ \
|
||||
state_bak = state; \
|
||||
|
||||
@@ -863,7 +863,7 @@ pshash_delindex (psi)
|
||||
*bucket = ps->bucket_next; /* deleting chain head in hash table */
|
||||
}
|
||||
|
||||
/* clear out this cell, just in case */
|
||||
/* clear out this cell, in case it gets reused. */
|
||||
ps->pid = NO_PID;
|
||||
ps->bucket_next = ps->bucket_prev = NO_PIDSTAT;
|
||||
}
|
||||
|
||||
@@ -1352,7 +1352,7 @@ This function is intended to be bound to the "bracketed paste" escape
|
||||
sequence sent by some terminals, and such a binding is assigned by default.
|
||||
It allows Readline to insert the pasted text as a single unit without treating
|
||||
each character as if it had been read from the keyboard. The characters
|
||||
are inserted as if each one was bound to @code{self-insert}) instead of
|
||||
are inserted as if each one was bound to @code{self-insert} instead of
|
||||
executing any editing commands.
|
||||
|
||||
@item transpose-chars (C-t)
|
||||
@@ -2071,7 +2071,7 @@ Perform directory name completion if the compspec generates no matches.
|
||||
|
||||
@item filenames
|
||||
Tell Readline that the compspec generates filenames, so it can perform any
|
||||
filename-specific processing (like adding a slash to directory names
|
||||
filename-specific processing (like adding a slash to directory names,
|
||||
quoting special characters, or suppressing trailing spaces).
|
||||
This option is intended to be used with shell functions specified
|
||||
with @option{-F}.
|
||||
|
||||
+2
-2
@@ -677,7 +677,7 @@ rl_bracketed_paste_begin (int count, int key)
|
||||
size_t len, cap;
|
||||
char *buf;
|
||||
|
||||
retval = 1;
|
||||
retval = 0;
|
||||
len = 0;
|
||||
buf = xmalloc (cap = 64);
|
||||
|
||||
@@ -708,7 +708,7 @@ rl_bracketed_paste_begin (int count, int key)
|
||||
if (len == cap)
|
||||
buf = xrealloc (buf, cap + 1);
|
||||
buf[len] = '\0';
|
||||
retval = rl_insert_text (buf);
|
||||
retval = rl_insert_text (buf) == len ? 0 : 1;
|
||||
}
|
||||
|
||||
xfree (buf);
|
||||
|
||||
+59
-3
@@ -75,6 +75,57 @@ int _rl_utf8locale = 0;
|
||||
|
||||
#if defined(HANDLE_MULTIBYTE)
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* UTF-8 specific Character Utility Functions */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* Return the length in bytes of the possibly-multibyte character beginning
|
||||
at S. Encoding is UTF-8. */
|
||||
static int
|
||||
_rl_utf8_mblen (const char *s, size_t n)
|
||||
{
|
||||
unsigned char c, c1;
|
||||
|
||||
if (s == 0)
|
||||
return (0); /* no shift states */
|
||||
if (n <= 0)
|
||||
return (-1);
|
||||
|
||||
c = (unsigned char)*s;
|
||||
if (c < 0x80)
|
||||
return (c != 0);
|
||||
if (c >= 0xc2)
|
||||
{
|
||||
c1 = (unsigned char)s[1];
|
||||
if (c < 0xe0)
|
||||
{
|
||||
if (n >= 2 && (s[1] ^ 0x80) < 0x40)
|
||||
return 2;
|
||||
}
|
||||
else if (c < 0xf0)
|
||||
{
|
||||
if (n >= 3
|
||||
&& (s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40
|
||||
&& (c >= 0xe1 || c1 >= 0xa0)
|
||||
&& (c != 0xed || c1 < 0xa0))
|
||||
return 3;
|
||||
}
|
||||
else if (c < 0xf8)
|
||||
{
|
||||
if (n >= 4
|
||||
&& (s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40
|
||||
&& (s[3] ^ 0x80) < 0x40
|
||||
&& (c >= 0xf1 || c1 >= 0x90)
|
||||
&& (c < 0xf4 || (c == 0xf4 && c1 < 0x90)))
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
/* invalid or incomplete multibyte character */
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int
|
||||
_rl_find_next_mbchar_internal (char *string, int seed, int count, int find_non_zero)
|
||||
{
|
||||
@@ -228,11 +279,16 @@ _rl_get_char_len (char *src, mbstate_t *ps)
|
||||
|
||||
/* Look at no more than MB_CUR_MAX characters */
|
||||
l = (size_t)strlen (src);
|
||||
mb_cur_max = MB_CUR_MAX;
|
||||
tmp = mbrlen((const char *)src, (l < mb_cur_max) ? l : mb_cur_max, ps);
|
||||
if (_rl_utf8locale && l > 0 && UTF8_SINGLEBYTE(*src))
|
||||
tmp = (*src != 0) ? 1 : 0;
|
||||
else
|
||||
{
|
||||
mb_cur_max = MB_CUR_MAX;
|
||||
tmp = mbrlen((const char *)src, (l < mb_cur_max) ? l : mb_cur_max, ps);
|
||||
}
|
||||
if (tmp == (size_t)(-2))
|
||||
{
|
||||
/* shorted to compose multibyte char */
|
||||
/* too short to compose multibyte char */
|
||||
if (ps)
|
||||
memset (ps, 0, sizeof(mbstate_t));
|
||||
return -2;
|
||||
|
||||
@@ -1055,7 +1055,7 @@ _rl_subseq_result (int r, Keymap map, int key, int got_subseq)
|
||||
/* We probably shadowed a keymap, so keep going. */
|
||||
r = _rl_dispatch (ANYOTHERKEY, m);
|
||||
}
|
||||
else if (r && map[ANYOTHERKEY].function)
|
||||
else if (r < 0 && map[ANYOTHERKEY].function)
|
||||
{
|
||||
/* We didn't match (r is probably -1), so return something to
|
||||
tell the caller that it should try ANYOTHERKEY for an
|
||||
|
||||
@@ -173,6 +173,8 @@ _rl_wcwidth (wc)
|
||||
#endif
|
||||
|
||||
#define UTF8_SINGLEBYTE(c) (((c) & 0x80) == 0)
|
||||
#define UTF8_MBFIRSTCHAR(c) (((c) & 0xc0) == 0xc0)
|
||||
#define UTF8_MBCHAR(c) (((c) & 0xc0) == 0x80)
|
||||
|
||||
#else /* !HANDLE_MULTIBYTE */
|
||||
|
||||
|
||||
+9
-2
@@ -92,7 +92,8 @@ CSOURCES = clktck.c clock.c getcwd.c getenv.c oslib.c setlinebuf.c \
|
||||
mktime.c strftime.c mbschr.c zcatfd.c zmapfd.c winsize.c eaccess.c \
|
||||
wcsdup.c fpurge.c zgetline.c mbscmp.c uconvert.c ufuncs.c \
|
||||
casemod.c dprintf.c input_avail.c mbscasecmp.c fnxform.c \
|
||||
strchrnul.c unicode.c wcswidth.c wcsnwidth.c shmbchar.c strdup.c
|
||||
strchrnul.c unicode.c wcswidth.c wcsnwidth.c shmbchar.c strdup.c \
|
||||
utf8.c
|
||||
|
||||
# The header files for this library.
|
||||
HSOURCES =
|
||||
@@ -107,7 +108,7 @@ OBJECTS = clktck.o clock.o getenv.o oslib.o setlinebuf.o strnlen.o \
|
||||
fmtullong.o fmtumax.o zcatfd.o zmapfd.o winsize.o wcsdup.o \
|
||||
fpurge.o zgetline.o mbscmp.o uconvert.o ufuncs.o casemod.o \
|
||||
input_avail.o mbscasecmp.o fnxform.o unicode.o shmbchar.o \
|
||||
wcsnwidth.o ${LIBOBJS}
|
||||
utf8.o wcsnwidth.o ${LIBOBJS}
|
||||
|
||||
SUPPORT = Makefile
|
||||
|
||||
@@ -200,6 +201,7 @@ tmpfile.o: tmpfile.c
|
||||
uconvert.o: uconvert.c
|
||||
ufuncs.o: ufuncs.c
|
||||
unicode.o: unicode.c
|
||||
utf8.o: utf8.c
|
||||
vprint.o: vprint.c
|
||||
wcsdup.o: wcsdup.c
|
||||
wcsnwidth.o: wcsnwidth.c
|
||||
@@ -277,6 +279,7 @@ tmpfile.o: ${BUILD_DIR}/config.h
|
||||
uconvert.o: ${BUILD_DIR}/config.h
|
||||
ufuncs.o: ${BUILD_DIR}/config.h
|
||||
unicode.o: ${BUILD_DIR}/config.h
|
||||
utf8.o: ${BUILD_DIR}/config.h
|
||||
vprint.o: ${BUILD_DIR}/config.h
|
||||
wcsdup.o: ${BUILD_DIR}/config.h
|
||||
wcsnwidth.o: ${BUILD_DIR}/config.h
|
||||
@@ -612,6 +615,10 @@ unicode.o: ${topdir}/bashansi.h ${BASHINCDIR}/ansi_stdlib.h
|
||||
unicode.o: ${BASHINCDIR}/stdc.h
|
||||
unicode.o: ${topdir}/xmalloc.h
|
||||
|
||||
utf8.o: ${topdir}/bashansi.h
|
||||
utf8.o: ${BASHINCDIR}/ansi_stdlib.h
|
||||
utf8.o: ${BASHINCDIR}/shmbutil.h ${BASHINCDIR}/shmbchar.h
|
||||
|
||||
winsize.o: ${BASHINCDIR}/stdc.h
|
||||
winsize.o: ${topdir}/xmalloc.h
|
||||
winsize.o: ${topdir}/bashtypes.h
|
||||
|
||||
+1
-7
@@ -32,13 +32,7 @@ extern int locale_utf8locale;
|
||||
|
||||
#undef mbschr
|
||||
|
||||
static inline char *
|
||||
utf8_mbschr (s, c)
|
||||
const char *s;
|
||||
int c;
|
||||
{
|
||||
return strchr (s, c); /* for now */
|
||||
}
|
||||
extern char *utf8_mbschr (const char *, int); /* XXX */
|
||||
|
||||
/* In some locales, the non-first byte of some multibyte characters have
|
||||
the same value as some ascii character. Faced with these strings, a
|
||||
|
||||
+5
-1
@@ -1,6 +1,6 @@
|
||||
/* mbscmp - multibyte string comparison. */
|
||||
|
||||
/* Copyright (C) 1995-2015 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995-2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
@@ -26,6 +26,10 @@
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
extern int locale_utf8locale;
|
||||
|
||||
extern int utf8_mbscmp (const char *, const char *);
|
||||
|
||||
/* Compare MBS1 and MBS2. */
|
||||
int
|
||||
mbscmp (mbs1, mbs2)
|
||||
|
||||
+3
-124
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2001, 2006, 2009, 2010, 2012, 2015 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2001, 2006, 2009, 2010, 2012, 2015-2018 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -45,102 +45,9 @@ const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] =
|
||||
|
||||
extern int locale_utf8locale;
|
||||
|
||||
/* We can optimize this if we know the locale is UTF-8, but needs to handle
|
||||
malformed byte sequences. */
|
||||
static inline size_t
|
||||
utf8_mbstrlen(s)
|
||||
const char *s;
|
||||
{
|
||||
size_t num = 0;
|
||||
register unsigned char c;
|
||||
extern char *utf8_mbsmbchar (const char *);
|
||||
extern int utf8_mblen (const char *, size_t);
|
||||
|
||||
while ((c = *s++))
|
||||
/* bytes 0xc0 through 0xff are first byte of multi-byte sequence */
|
||||
if ((c & 0xc0) != 0x80) /* skip continuation bytes */
|
||||
++num;
|
||||
return (num);
|
||||
}
|
||||
|
||||
/* Adapted from GNU libutf8 */
|
||||
static inline int
|
||||
utf8_mblen (s, n)
|
||||
const char *s;
|
||||
int n;
|
||||
{
|
||||
unsigned char c;
|
||||
|
||||
if (s == 0)
|
||||
return 0;
|
||||
else if (n == 0)
|
||||
return -1;
|
||||
|
||||
c = (unsigned char) *s;
|
||||
if (c < 0x80)
|
||||
return (c != 0);
|
||||
else if (c < 0xc0)
|
||||
goto return_error;
|
||||
else
|
||||
{
|
||||
const char *start = s;
|
||||
size_t count;
|
||||
int check_unsafe;
|
||||
|
||||
if (c < 0xe0)
|
||||
{
|
||||
count = 1;
|
||||
if (c < 0xc2)
|
||||
goto return_error;
|
||||
check_unsafe = 0;
|
||||
}
|
||||
else if (c < 0xf0)
|
||||
{
|
||||
count = 2;
|
||||
check_unsafe = (c == 0xe0);
|
||||
}
|
||||
#if SIZEOF_WCHAR_T == 4
|
||||
else if (c < 0xf8)
|
||||
{
|
||||
count = 3;
|
||||
check_unsafe = (c == 0xe0);
|
||||
}
|
||||
else if (c < 0xfc)
|
||||
{
|
||||
count = 4;
|
||||
check_unsafe = (c == 0xf8);
|
||||
}
|
||||
else if (c < 0xfe)
|
||||
{
|
||||
count = 5;
|
||||
check_unsafe = (c == 0xfc);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
goto return_error;
|
||||
if (n <= count)
|
||||
return -1;
|
||||
s++;
|
||||
c = (unsigned char) *s++ ^ 0x80;
|
||||
if (c >= 0x40)
|
||||
goto return_error;
|
||||
if (--count > 0)
|
||||
{
|
||||
if (check_unsafe && ((c >> (6 - count)) == 0))
|
||||
goto return_error;
|
||||
do
|
||||
{
|
||||
c = (unsigned char) *s++ ^ 0x80;
|
||||
if (c >= 0x40)
|
||||
goto return_error;
|
||||
}
|
||||
while (--count > 0);
|
||||
}
|
||||
return s - start;
|
||||
}
|
||||
return_error:
|
||||
errno = EILSEQ;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Count the number of characters in S, counting multi-byte characters as a
|
||||
single character. */
|
||||
size_t
|
||||
@@ -170,18 +77,6 @@ mbstrlen (s)
|
||||
return nc;
|
||||
}
|
||||
|
||||
static inline char *
|
||||
utf8_mbsmbchar (str)
|
||||
const char *str;
|
||||
{
|
||||
register char *s;
|
||||
|
||||
for (s = (char *)str; *s; s++)
|
||||
if ((*s & 0xc0) == 0x80)
|
||||
return s;
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Return pointer to first multibyte char in S, or NULL if none. */
|
||||
/* XXX - if we know that the locale is UTF-8, we can just check whether or
|
||||
not any byte has the eighth bit turned on */
|
||||
@@ -219,22 +114,6 @@ mbsmbchar (s)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int
|
||||
utf_mbsnlen(src, srclen, maxlen)
|
||||
const char *src;
|
||||
size_t srclen;
|
||||
int maxlen;
|
||||
{
|
||||
register int sind, count;
|
||||
|
||||
for (sind = count = 0; src[sind] && sind <= maxlen; sind++)
|
||||
{
|
||||
if ((src[sind] & 0xc0) != 0x80)
|
||||
count++;
|
||||
}
|
||||
return (count);
|
||||
}
|
||||
|
||||
int
|
||||
sh_mbsnlen(src, srclen, maxlen)
|
||||
const char *src;
|
||||
|
||||
+147
@@ -0,0 +1,147 @@
|
||||
/* utf8.c - UTF-8 character handling functions */
|
||||
|
||||
/* Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include "bashansi.h"
|
||||
#include "shmbutil.h"
|
||||
|
||||
extern int locale_mb_cur_max;
|
||||
extern int locale_utf8locale;
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
|
||||
char *
|
||||
utf8_mbschr (s, c)
|
||||
const char *s;
|
||||
int c;
|
||||
{
|
||||
return strchr (s, c); /* for now */
|
||||
}
|
||||
|
||||
int
|
||||
utf8_mbscmp (s1, s2)
|
||||
const char *s1, *s2;
|
||||
{
|
||||
/* Use the fact that the UTF-8 encoding preserves lexicographic order. */
|
||||
return strcmp (s1, s2);
|
||||
}
|
||||
|
||||
char *
|
||||
utf8_mbsmbchar (str)
|
||||
const char *str;
|
||||
{
|
||||
register char *s;
|
||||
|
||||
for (s = (char *)str; *s; s++)
|
||||
if ((*s & 0xc0) == 0x80)
|
||||
return s;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
utf8_mbsnlen(src, srclen, maxlen)
|
||||
const char *src;
|
||||
size_t srclen;
|
||||
int maxlen;
|
||||
{
|
||||
register int sind, count;
|
||||
|
||||
for (sind = count = 0; src[sind] && sind <= maxlen; sind++)
|
||||
{
|
||||
if ((src[sind] & 0xc0) != 0x80)
|
||||
count++;
|
||||
}
|
||||
return (count);
|
||||
}
|
||||
|
||||
/* Adapted from GNU gnulib */
|
||||
int
|
||||
utf8_mblen (s, n)
|
||||
const char *s;
|
||||
size_t n;
|
||||
{
|
||||
unsigned char c, c1;
|
||||
|
||||
if (s == 0)
|
||||
return (0); /* no shift states */
|
||||
if (n <= 0)
|
||||
return (-1);
|
||||
|
||||
c = (unsigned char)*s;
|
||||
if (c < 0x80)
|
||||
return (c != 0);
|
||||
if (c >= 0xc2)
|
||||
{
|
||||
c1 = (unsigned char)s[1];
|
||||
if (c < 0xe0)
|
||||
{
|
||||
if (n >= 2 && (s[1] ^ 0x80) < 0x40)
|
||||
return 2;
|
||||
}
|
||||
else if (c < 0xf0)
|
||||
{
|
||||
if (n >= 3
|
||||
&& (s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40
|
||||
&& (c >= 0xe1 || c1 >= 0xa0)
|
||||
&& (c != 0xed || c1 < 0xa0))
|
||||
return 3;
|
||||
}
|
||||
else if (c < 0xf8)
|
||||
{
|
||||
if (n >= 4
|
||||
&& (s[1] ^ 0x80) < 0x40 && (s[2] ^ 0x80) < 0x40
|
||||
&& (s[3] ^ 0x80) < 0x40
|
||||
&& (c >= 0xf1 || c1 >= 0x90)
|
||||
&& (c < 0xf4 || (c == 0xf4 && c1 < 0x90)))
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
/* invalid or incomplete multibyte character */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* We can optimize this if we know the locale is UTF-8, but needs to handle
|
||||
malformed byte sequences. */
|
||||
size_t
|
||||
utf8_mbstrlen(s)
|
||||
const char *s;
|
||||
{
|
||||
size_t clen, nc;
|
||||
int mb_cur_max;
|
||||
|
||||
nc = 0;
|
||||
mb_cur_max = MB_CUR_MAX;
|
||||
while (*s && (clen = (size_t)utf8_mblen(s, mb_cur_max)) != 0)
|
||||
{
|
||||
if (MB_INVALIDCH(clen))
|
||||
clen = 1; /* assume single byte */
|
||||
|
||||
s += clen;
|
||||
nc++;
|
||||
}
|
||||
return nc;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -43,7 +43,7 @@
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
int locale_utf8locale; /* set but unused for now */
|
||||
int locale_utf8locale;
|
||||
int locale_mb_cur_max; /* value of MB_CUR_MAX for current locale (LC_CTYPE) */
|
||||
int locale_shiftstates;
|
||||
|
||||
|
||||
+2
-2
@@ -151,7 +151,7 @@ static int progcomp_debug = 0;
|
||||
|
||||
int prog_completion_enabled = 1;
|
||||
|
||||
#ifdef ALIAS
|
||||
#ifdef ALIAS /* bash-5.0-beta */
|
||||
int progcomp_alias = 0; /* unavailable to user code for now */
|
||||
#endif
|
||||
|
||||
@@ -1688,7 +1688,7 @@ programmable_completions (cmd, word, start, end, foundp)
|
||||
/* Find the first word of the alias value and use that as OCMD. We
|
||||
don't check the alias value to see whether it begins with a valid
|
||||
command name, so this can be fooled. */
|
||||
ind = skip_to_delim (ntxt, 0, "()<>;&| \t\n", SD_NOJMP|SD_COMPLETE); /*)*/
|
||||
ind = skip_to_delim (ntxt, 0, "()<>;&| \t\n", SD_NOJMP|SD_COMPLETE);
|
||||
if (ind > 0)
|
||||
ncmd = substring (ntxt, 0, ind);
|
||||
else
|
||||
|
||||
@@ -1178,7 +1178,10 @@ string_extract_verbatim (string, slen, sindex, charlist, flags)
|
||||
}
|
||||
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
mblength = MBLEN (string + i, slen - i);
|
||||
if (locale_utf8locale && slen > i && UTF8_SINGLEBYTE (string[i]))
|
||||
mblength = (string[i] != 0) ? 1 : 0;
|
||||
else
|
||||
mblength = MBLEN (string + i, slen - i);
|
||||
if (mblength > 1)
|
||||
{
|
||||
wchar_t wc;
|
||||
@@ -10596,9 +10599,14 @@ setifs (v)
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t ifs_len;
|
||||
ifs_len = strnlen (ifs_value, MB_CUR_MAX);
|
||||
ifs_firstc_len = MBLEN (ifs_value, ifs_len);
|
||||
if (locale_utf8locale && UTF8_SINGLEBYTE (*ifs_value))
|
||||
ifs_firstc_len = (*ifs_value != 0) ? 1 : 0;
|
||||
else
|
||||
{
|
||||
size_t ifs_len;
|
||||
ifs_len = strnlen (ifs_value, MB_CUR_MAX);
|
||||
ifs_firstc_len = MBLEN (ifs_value, ifs_len);
|
||||
}
|
||||
if (ifs_firstc_len == 1 || ifs_firstc_len == 0 || MB_INVALIDCH (ifs_firstc_len))
|
||||
{
|
||||
ifs_firstc[0] = ifs_value[0];
|
||||
|
||||
+247
-237
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+257
-120
@@ -2,27 +2,13 @@
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2003 Free Software Foundation, Inc.
|
||||
# Copyright 1996-2018 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
@@ -39,7 +25,7 @@
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except M$VC,
|
||||
# All known linkers require a '.a' archive for static linking (except MSVC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
@@ -49,7 +35,19 @@ host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
|
||||
# Code taken from libtool.m4's _LT_CC_BASENAME.
|
||||
|
||||
for cc_temp in $CC""; do
|
||||
case $cc_temp in
|
||||
compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
|
||||
distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
|
||||
\-*) ;;
|
||||
*) break;;
|
||||
esac
|
||||
done
|
||||
cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
|
||||
|
||||
# Code taken from libtool.m4's _LT_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
@@ -59,7 +57,7 @@ else
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
mingw* | pw32* | os2*)
|
||||
mingw* | cygwin* | pw32* | os2* | cegcc*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
@@ -67,40 +65,83 @@ else
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux*)
|
||||
case $CC in
|
||||
icc|ecc)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
case $cc_basename in
|
||||
ecc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc)
|
||||
icc* | ifort*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
lf95*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
nagfor*)
|
||||
wl='-Wl,-Wl,,'
|
||||
;;
|
||||
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
xl* | bgxl* | bgf* | mpixl*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
como)
|
||||
wl='-lopt='
|
||||
;;
|
||||
*)
|
||||
case `$CC -V 2>&1 | sed 5q` in
|
||||
*Sun\ F* | *Sun*Fortran*)
|
||||
wl=
|
||||
;;
|
||||
*Sun\ C*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sco3.2v5*)
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
case $cc_basename in
|
||||
f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
sysv4 | sysv4.2uw2* | sysv4.3*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
unicos*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
|
||||
# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
@@ -108,7 +149,7 @@ hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
@@ -116,6 +157,10 @@ case "$host_os" in
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
interix*)
|
||||
# we just hope/assume this is gcc and not c89 (= MSVC++)
|
||||
with_gnu_ld=yes
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
@@ -123,32 +168,37 @@ esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
# Set some defaults for GNU ld with shared library support. These
|
||||
# are reset later if shared libraries are not supported. Putting them
|
||||
# here allows them to be overridden if necessary.
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
aix[3-9]*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we can use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
@@ -158,32 +208,57 @@ if test "$with_gnu_ld" = yes; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
haiku*)
|
||||
;;
|
||||
solaris* | sysv5*)
|
||||
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
interix[3-9]*)
|
||||
hardcode_direct=no
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris*)
|
||||
if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
|
||||
case `$LD -v 2>&1` in
|
||||
*\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = yes; then
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
if test "$ld_shlibs" = no; then
|
||||
hardcode_libdir_flag_spec=
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
@@ -197,7 +272,7 @@ else
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
aix[4-9]*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
@@ -207,13 +282,14 @@ else
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
@@ -225,7 +301,7 @@ else
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
hardcode_direct=yes
|
||||
:
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
@@ -233,6 +309,7 @@ else
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
@@ -260,14 +337,18 @@ else
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
case "$host_cpu" in
|
||||
powerpc)
|
||||
;;
|
||||
m68k)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
bsdi4*)
|
||||
bsdi[45]*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
@@ -276,25 +357,21 @@ else
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
|
||||
hardcode_direct=no
|
||||
hardcode_direct=no
|
||||
if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd2*)
|
||||
freebsd2.[01]*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd*)
|
||||
freebsd* | dragonfly*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
@@ -306,24 +383,25 @@ else
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
hpux10* | hpux11*)
|
||||
hpux10*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
case "$host_cpu" in
|
||||
hppa*64*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
fi
|
||||
;;
|
||||
hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
case $host_cpu in
|
||||
hppa*64*|ia64*)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
ia64*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=no
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
@@ -345,19 +423,25 @@ else
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
*nto* | *qnx*)
|
||||
;;
|
||||
openbsd*)
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
if test -f /usr/libexec/ld.so; then
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
@@ -377,8 +461,6 @@ else
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
@@ -407,14 +489,11 @@ else
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4.2uw2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=no
|
||||
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
|
||||
;;
|
||||
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
|
||||
;;
|
||||
sysv5*)
|
||||
hardcode_libdir_flag_spec=
|
||||
sysv5* | sco3.2v5* | sco5v6*)
|
||||
hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
|
||||
hardcode_libdir_separator=':'
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
@@ -426,35 +505,59 @@ else
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
|
||||
# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
|
||||
# Unlike libtool.m4, here we don't care about _all_ names of the library, but
|
||||
# only about the one the linker finds when passed -lNAME. This is the last
|
||||
# element of library_names_spec in libtool.m4, or possibly two of them if the
|
||||
# linker has special search rules.
|
||||
library_names_spec= # the last element of library_names_spec in libtool.m4
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
aix[4-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
amigaos*)
|
||||
case "$host_cpu" in
|
||||
powerpc*)
|
||||
library_names_spec='$libname$shrext' ;;
|
||||
m68k)
|
||||
library_names_spec='$libname.a' ;;
|
||||
esac
|
||||
;;
|
||||
beos*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
bsdi4*)
|
||||
bsdi[45]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
cygwin* | mingw* | pw32* | cegcc*)
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.dll.a $libname.lib'
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
dgux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
freebsd1*)
|
||||
freebsd[23].*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
freebsd*)
|
||||
freebsd* | dragonfly*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
gnu*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
haiku*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case "$host_cpu" in
|
||||
case $host_cpu in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
@@ -465,8 +568,13 @@ case "$host_os" in
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
interix[3-9]*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
library_names_spec='$libname$shrext'
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
@@ -483,42 +591,65 @@ case "$host_os" in
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux*)
|
||||
linux* | k*bsd*-gnu | kopensolaris*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
knetbsd*-gnu)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
netbsd*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
newsos6)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
nto-qnx)
|
||||
*nto* | *qnx*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
openbsd*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
library_names_spec='$libname.a'
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sco3.2v5*)
|
||||
rdos*)
|
||||
;;
|
||||
solaris*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sunos4*)
|
||||
library_names_spec='$libname$shrext$versuffix'
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
sysv4 | sysv4.3*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
tpf*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
uts4*)
|
||||
library_names_spec='$libname$shrext'
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
@@ -529,6 +660,12 @@ libext="$libext"
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Format of library name prefix.
|
||||
libname_spec="$escaped_libname_spec"
|
||||
|
||||
# Library names that the linker finds when passed -lNAME.
|
||||
library_names_spec="$escaped_library_names_spec"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
Executable
+547
@@ -0,0 +1,547 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2003 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
|
||||
# should be set by the caller.
|
||||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# Known limitations:
|
||||
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except M$VC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shrext=.so
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
mingw* | pw32* | os2*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux*)
|
||||
case $CC in
|
||||
icc|ecc)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sunos4*)
|
||||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
hardcode_minus_L=no
|
||||
|
||||
case "$host_os" in
|
||||
cygwin* | mingw* | pw32*)
|
||||
# FIXME: the MSVC++ port hasn't been tested in a loooong time
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
if test "$GCC" != yes; then
|
||||
with_gnu_ld=no
|
||||
fi
|
||||
;;
|
||||
openbsd*)
|
||||
with_gnu_ld=no
|
||||
;;
|
||||
esac
|
||||
|
||||
ld_shlibs=yes
|
||||
if test "$with_gnu_ld" = yes; then
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
|
||||
# that the semantics of dynamic libraries on AmigaOS, at least up
|
||||
# to version 4, is to share data among multiple programs linked
|
||||
# with the same dynamic library. Since this doesn't match the
|
||||
# behavior of shared libraries on other platforms, we can use
|
||||
# them.
|
||||
ld_shlibs=no
|
||||
;;
|
||||
beos*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris* | sysv5*)
|
||||
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
|
||||
ld_shlibs=no
|
||||
elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
*)
|
||||
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = yes; then
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
fi
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
# Note: this linker hardcodes the directories in LIBPATH if there
|
||||
# are no directories specified by -L.
|
||||
hardcode_minus_L=yes
|
||||
if test "$GCC" = yes; then
|
||||
# Neither direct hardcoding nor static linking is supported with a
|
||||
# broken collect2.
|
||||
hardcode_direct=unsupported
|
||||
fi
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
if test "$host_cpu" = ia64; then
|
||||
# On IA64, the linker does run time linking by default, so we don't
|
||||
# have to do anything special.
|
||||
aix_use_runtimelinking=no
|
||||
else
|
||||
aix_use_runtimelinking=no
|
||||
# Test if we are trying to use run time linking or normal
|
||||
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
|
||||
# need to do runtime linking.
|
||||
case $host_os in aix4.[23]|aix4.[23].*|aix5*)
|
||||
for ld_flag in $LDFLAGS; do
|
||||
if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
|
||||
aix_use_runtimelinking=yes
|
||||
break
|
||||
fi
|
||||
done
|
||||
esac
|
||||
fi
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_separator=':'
|
||||
if test "$GCC" = yes; then
|
||||
case $host_os in aix4.[012]|aix4.[012].*)
|
||||
collect2name=`${CC} -print-prog-name=collect2`
|
||||
if test -f "$collect2name" && \
|
||||
strings "$collect2name" | grep resolve_lib_name >/dev/null
|
||||
then
|
||||
# We have reworked collect2
|
||||
hardcode_direct=yes
|
||||
else
|
||||
# We have old collect2
|
||||
hardcode_direct=unsupported
|
||||
hardcode_minus_L=yes
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_libdir_separator=
|
||||
fi
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
echo 'int main () { return 0; }' > conftest.c
|
||||
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
fi
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath="/usr/lib:/lib"
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
bsdi4*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec=' '
|
||||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
|
||||
hardcode_direct=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
freebsd2.2*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
freebsd2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
freebsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
hpux10* | hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
case "$host_cpu" in
|
||||
hppa*64*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=no
|
||||
;;
|
||||
ia64*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=no
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
netbsd*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
newsos6)
|
||||
hardcode_direct=yes
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
openbsd*)
|
||||
hardcode_direct=yes
|
||||
if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
else
|
||||
case "$host_os" in
|
||||
openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
os2*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
osf3*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
osf4* | osf5*)
|
||||
if test "$GCC" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
else
|
||||
# Both cc and cxx compiler support -rpath directly
|
||||
hardcode_libdir_flag_spec='-rpath $libdir'
|
||||
fi
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
;;
|
||||
sunos4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
case $host_vendor in
|
||||
sni)
|
||||
hardcode_direct=yes # is this really true???
|
||||
;;
|
||||
siemens)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
motorola)
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
fi
|
||||
;;
|
||||
sysv4.2uw2*)
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=no
|
||||
;;
|
||||
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
|
||||
;;
|
||||
sysv5*)
|
||||
hardcode_libdir_flag_spec=
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
|
||||
libname_spec='lib$name'
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
;;
|
||||
amigaos*)
|
||||
;;
|
||||
beos*)
|
||||
;;
|
||||
bsdi4*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
shrext=.dll
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shrext=.dylib
|
||||
;;
|
||||
dgux*)
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
freebsd*)
|
||||
;;
|
||||
gnu*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
case "$host_cpu" in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
hppa*64*)
|
||||
shrext=.sl
|
||||
;;
|
||||
*)
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
case "$host_os" in
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux*)
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
nto-qnx)
|
||||
;;
|
||||
openbsd*)
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shrext=.dll
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
;;
|
||||
sunos4*)
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
# How to pass a linker flag through the compiler.
|
||||
wl="$escaped_wl"
|
||||
|
||||
# Static library suffix (normally "a").
|
||||
libext="$libext"
|
||||
|
||||
# Shared library suffix (normally "so").
|
||||
shlibext="$shlibext"
|
||||
|
||||
# Flag to hardcode \$libdir into a binary during linking.
|
||||
# This must work even if \$libdir does not exist.
|
||||
hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
|
||||
|
||||
# Whether we need a single -rpath flag with a separated argument.
|
||||
hardcode_libdir_separator="$hardcode_libdir_separator"
|
||||
|
||||
# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_direct="$hardcode_direct"
|
||||
|
||||
# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
|
||||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
EOF
|
||||
+780
-793
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -1,4 +1,4 @@
|
||||
BUILD_DIR=/usr/local/build/chet/bash/bash-current
|
||||
BUILD_DIR=/usr/local/build/bash/bash-current
|
||||
THIS_SH=$BUILD_DIR/bash
|
||||
PATH=$PATH:$BUILD_DIR
|
||||
|
||||
|
||||
+6
-1
@@ -1777,6 +1777,11 @@ assign_aliasvar (self, value, ind, key)
|
||||
arrayind_t ind;
|
||||
char *key;
|
||||
{
|
||||
if (legal_alias_name (key, 0) == 0)
|
||||
{
|
||||
report_error (_("`%s': invalid alias name"), key);
|
||||
return (self);
|
||||
}
|
||||
add_alias (key, value);
|
||||
return (build_aliasvar (self));
|
||||
}
|
||||
@@ -4900,7 +4905,7 @@ push_var_context (name, flags, tempvars)
|
||||
vc = new_var_context (name, flags);
|
||||
/* Posix interp 1009, temporary assignments preceding function calls modify
|
||||
the current environment *before* the command is executed. */
|
||||
if (posix_func_behavior && tempvars == temporary_env)
|
||||
if (posix_func_behavior && (flags & VC_FUNCENV) && tempvars == temporary_env)
|
||||
merge_temporary_env ();
|
||||
else if (tempvars)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user