Skip to content

Commit b03fcf7

Browse files
committed
Merge PR tcsh-org#71 (lukem/color-improvements)
2 parents 7244244 + f6ab709 commit b03fcf7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2792
-551
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
**/Makefile
33
!win32/msg/Makefile
44
atconfig
5+
atlocal
56
autom4te.cache
67
config.h
78
config.log

Fixes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
23. Support LS_COLORS su,sg,tw,ow,st,mh variables. (Luke Mewburn)
2+
22. Fixes for LS_COLORS ln=target: ls-F directory; reset on unsetenv;
3+
intermittent parse bug; only support lower-case "target". (Luke Mewburn)
4+
21. Fix LSCOLORS bold/bright color support, add to manual (Luke Mewburn)
5+
20. Implement CLICOLOR_FORCE (Luke Mewburn)
6+
19. On startup, use LS_COLORS in preference to LSCOLORS (Luke Mewburn)
7+
18. Improve color ls-F documentation (Luke Mewburn)
18
17. V6.24.07 - 2022-12-21
29
16. V6.24.06 - 2022-12-12
310
15. V6.24.05 - 2022-12-04

Makefile.in

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ TCOBJS= tc.alloc.${SUF} tc.bind.${SUF} tc.const.${SUF} tc.defs.${SUF} \
482482
# tests/*.at except for tests/testsuite.at
483483
TESTFILES= \
484484
tests/aliases.at tests/arguments.at tests/commands.at \
485-
tests/expr.at tests/history.at tests/lexical.at \
485+
tests/expr.at tests/history.at tests/lexical.at tests/ls-F.at \
486486
tests/mb-eucjp.at tests/mb-utf8.at tests/noexec.at \
487487
tests/parenthesis.at tests/sh.dol.at tests/subst.at \
488488
tests/syntax.at tests/variables.at
@@ -620,6 +620,8 @@ $(srcdir)/tests/testsuite: $(srcdir)/tests/package.m4 $(srcdir)/tests/testsuite.
620620
atconfig: config.status
621621
$(SHELL) ./config.status ./atconfig
622622

623+
atlocal: config.status $(srcdir)/atlocal.in
624+
$(SHELL) ./config.status atlocal
623625

624626
csh.prof: ${OBJS} sh.prof.${SUF} mcrt0.${SUF}
625627
rm -f csh.prof
@@ -697,7 +699,7 @@ cleandir distclean veryclean: clean
697699
${RM} -f Makefile config.h config_p.h dch-template nls/Makefile patchlevel.h tcsh.man
698700
${RM} -f config.status config.cache config.log tcsh.html tcsh.ps
699701
${RM} -f missing
700-
${RM} -f atconfig testsuite.log
702+
${RM} -f atconfig atlocal testsuite.log
701703
${RM} -rf testsuite.dir
702704
${RM} -rf autom4te.cache
703705
${RM} -f *~ #*
@@ -719,8 +721,9 @@ $(srcdir)/stamp-h.in: $(srcdir)/configure.ac
719721
cd $(srcdir) && autoheader
720722
@echo timestamp > $(srcdir)/stamp-h.in
721723

722-
check test: atconfig $(srcdir)/tests/testsuite
724+
check test: atconfig atlocal $(srcdir)/tests/testsuite $(BUILD)
723725
$(ENVCMD) - \
726+
TESTSUITEREGEN="$(TESTSUITEREGEN)" \
724727
USER="$(USER)" \
725728
$(SHELL) $(srcdir)/tests/testsuite $(TESTSUITEFLAGS)
726729

aclocal.m4

Lines changed: 69 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# PARTICULAR PURPOSE.
1313

1414
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15-
# host-cpu-c-abi.m4 serial 13
16-
dnl Copyright (C) 2002-2020 Free Software Foundation, Inc.
15+
# host-cpu-c-abi.m4 serial 15
16+
dnl Copyright (C) 2002-2022 Free Software Foundation, Inc.
1717
dnl This file is free software; the Free Software Foundation
1818
dnl gives unlimited permission to copy and/or distribute it,
1919
dnl with or without modifications, as long as this notice is preserved.
@@ -225,7 +225,7 @@ changequote([,])dnl
225225
# be generating 64-bit code.
226226
AC_COMPILE_IFELSE(
227227
[AC_LANG_SOURCE(
228-
[[#if defined __powerpc64__ || defined _ARCH_PPC64
228+
[[#if defined __powerpc64__ || defined __LP64__
229229
int ok;
230230
#else
231231
error fail
@@ -396,6 +396,9 @@ EOF
396396
#ifndef __ia64__
397397
#undef __ia64__
398398
#endif
399+
#ifndef __loongarch64__
400+
#undef __loongarch64__
401+
#endif
399402
#ifndef __m68k__
400403
#undef __m68k__
401404
#endif
@@ -619,7 +622,7 @@ changequote([,])dnl
619622
# be generating 64-bit code.
620623
AC_COMPILE_IFELSE(
621624
[AC_LANG_SOURCE(
622-
[[#if defined __powerpc64__ || defined _ARCH_PPC64
625+
[[#if defined __powerpc64__ || defined __LP64__
623626
int ok;
624627
#else
625628
error fail
@@ -688,15 +691,21 @@ changequote([,])dnl
688691
HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
689692
])
690693

691-
# iconv.m4 serial 21
692-
dnl Copyright (C) 2000-2002, 2007-2014, 2016-2020 Free Software Foundation,
694+
# iconv.m4 serial 24
695+
dnl Copyright (C) 2000-2002, 2007-2014, 2016-2022 Free Software Foundation,
693696
dnl Inc.
694697
dnl This file is free software; the Free Software Foundation
695698
dnl gives unlimited permission to copy and/or distribute it,
696699
dnl with or without modifications, as long as this notice is preserved.
697700

698701
dnl From Bruno Haible.
699702

703+
AC_PREREQ([2.64])
704+
705+
dnl Note: AM_ICONV is documented in the GNU gettext manual
706+
dnl <https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html>.
707+
dnl Don't make changes that are incompatible with that documentation!
708+
700709
AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
701710
[
702711
dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
@@ -776,8 +785,9 @@ AC_DEFUN([AM_ICONV_LINK],
776785
#endif
777786
]],
778787
[[int result = 0;
779-
/* Test against AIX 5.1 bug: Failures are not distinguishable from successful
780-
returns. */
788+
/* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
789+
successful returns. This is even documented in
790+
<https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
781791
{
782792
iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
783793
if (cd_utf8_to_88591 != (iconv_t)(-1))
@@ -915,70 +925,58 @@ AC_DEFUN([AM_ICONV_LINK],
915925
AC_SUBST([LTLIBICONV])
916926
])
917927

918-
dnl Define AM_ICONV using AC_DEFUN_ONCE for Autoconf >= 2.64, in order to
919-
dnl avoid warnings like
928+
dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like
920929
dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
921930
dnl This is tricky because of the way 'aclocal' is implemented:
922931
dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
923932
dnl Otherwise aclocal's initial scan pass would miss the macro definition.
924933
dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
925934
dnl Otherwise aclocal would emit many "Use of uninitialized value $1"
926935
dnl warnings.
927-
m4_define([gl_iconv_AC_DEFUN],
928-
m4_version_prereq([2.64],
929-
[[AC_DEFUN_ONCE(
930-
[$1], [$2])]],
931-
[m4_ifdef([gl_00GNULIB],
932-
[[AC_DEFUN_ONCE(
933-
[$1], [$2])]],
934-
[[AC_DEFUN(
935-
[$1], [$2])]])]))
936-
gl_iconv_AC_DEFUN([AM_ICONV],
936+
AC_DEFUN_ONCE([AM_ICONV],
937937
[
938938
AM_ICONV_LINK
939939
if test "$am_cv_func_iconv" = yes; then
940-
AC_MSG_CHECKING([for iconv declaration])
941-
AC_CACHE_VAL([am_cv_proto_iconv], [
942-
AC_COMPILE_IFELSE(
943-
[AC_LANG_PROGRAM(
944-
[[
940+
AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature],
941+
[gl_cv_iconv_nonconst],
942+
[AC_COMPILE_IFELSE(
943+
[AC_LANG_PROGRAM(
944+
[[
945945
#include <stdlib.h>
946946
#include <iconv.h>
947947
extern
948948
#ifdef __cplusplus
949949
"C"
950950
#endif
951-
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
952951
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
953-
#else
954-
size_t iconv();
955-
#endif
956-
]],
957-
[[]])],
958-
[am_cv_proto_iconv_arg1=""],
959-
[am_cv_proto_iconv_arg1="const"])
960-
am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
961-
am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
962-
AC_MSG_RESULT([
963-
$am_cv_proto_iconv])
952+
]],
953+
[[]])],
954+
[gl_cv_iconv_nonconst=yes],
955+
[gl_cv_iconv_nonconst=no])
956+
])
964957
else
965958
dnl When compiling GNU libiconv on a system that does not have iconv yet,
966959
dnl pick the POSIX compliant declaration without 'const'.
967-
am_cv_proto_iconv_arg1=""
960+
gl_cv_iconv_nonconst=yes
961+
fi
962+
if test $gl_cv_iconv_nonconst = yes; then
963+
iconv_arg1=""
964+
else
965+
iconv_arg1="const"
968966
fi
969-
AC_DEFINE_UNQUOTED([ICONV_CONST], [$am_cv_proto_iconv_arg1],
967+
AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1],
970968
[Define as const if the declaration of iconv() needs const.])
971969
dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
972970
m4_ifdef([gl_ICONV_H_DEFAULTS],
973971
[AC_REQUIRE([gl_ICONV_H_DEFAULTS])
974-
if test -n "$am_cv_proto_iconv_arg1"; then
972+
if test $gl_cv_iconv_nonconst != yes; then
975973
ICONV_CONST="const"
976974
fi
977975
])
978976
])
979977

980-
# lib-ld.m4 serial 9
981-
dnl Copyright (C) 1996-2003, 2009-2020 Free Software Foundation, Inc.
978+
# lib-ld.m4 serial 10
979+
dnl Copyright (C) 1996-2003, 2009-2022 Free Software Foundation, Inc.
982980
dnl This file is free software; the Free Software Foundation
983981
dnl gives unlimited permission to copy and/or distribute it,
984982
dnl with or without modifications, as long as this notice is preserved.
@@ -1101,7 +1099,7 @@ else
11011099
*-*-aix*)
11021100
AC_COMPILE_IFELSE(
11031101
[AC_LANG_SOURCE(
1104-
[[#if defined __powerpc64__ || defined _ARCH_PPC64
1102+
[[#if defined __powerpc64__ || defined __LP64__
11051103
int ok;
11061104
#else
11071105
error fail
@@ -1146,8 +1144,8 @@ fi
11461144
AC_LIB_PROG_LD_GNU
11471145
])
11481146

1149-
# lib-link.m4 serial 31
1150-
dnl Copyright (C) 2001-2020 Free Software Foundation, Inc.
1147+
# lib-link.m4 serial 33
1148+
dnl Copyright (C) 2001-2022 Free Software Foundation, Inc.
11511149
dnl This file is free software; the Free Software Foundation
11521150
dnl gives unlimited permission to copy and/or distribute it,
11531151
dnl with or without modifications, as long as this notice is preserved.
@@ -1344,8 +1342,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
13441342
eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
13451343
])
13461344
AC_ARG_WITH(PACK[-prefix],
1347-
[[ --with-]]PACK[[-prefix[=DIR] search for ]PACKLIBS[ in DIR/include and DIR/lib
1348-
--without-]]PACK[[-prefix don't search for ]PACKLIBS[ in includedir and libdir]],
1345+
[[ --with-]]PACK[[-prefix[=DIR] search for ]]PACKLIBS[[ in DIR/include and DIR/lib
1346+
--without-]]PACK[[-prefix don't search for ]]PACKLIBS[[ in includedir and libdir]],
13491347
[
13501348
if test "X$withval" = "Xno"; then
13511349
use_additional=no
@@ -1779,7 +1777,20 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
17791777
;;
17801778
-l*)
17811779
dnl Handle this in the next round.
1782-
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
1780+
dnl But on GNU systems, ignore -lc options, because
1781+
dnl - linking with libc is the default anyway,
1782+
dnl - linking with libc.a may produce an error
1783+
dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie"
1784+
dnl or may produce an executable that always crashes, see
1785+
dnl <https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00052.html>.
1786+
dep=`echo "X$dep" | sed -e 's/^X-l//'`
1787+
if test "X$dep" != Xc \
1788+
|| case $host_os in
1789+
linux* | gnu* | k*bsd*-gnu) false ;;
1790+
*) true ;;
1791+
esac; then
1792+
names_next_round="$names_next_round $dep"
1793+
fi
17831794
;;
17841795
*.la)
17851796
dnl Handle this in the next round. Throw away the .la's
@@ -1947,8 +1958,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
19471958
AC_SUBST([$1])
19481959
])
19491960

1950-
# lib-prefix.m4 serial 17
1951-
dnl Copyright (C) 2001-2005, 2008-2020 Free Software Foundation, Inc.
1961+
# lib-prefix.m4 serial 20
1962+
dnl Copyright (C) 2001-2005, 2008-2022 Free Software Foundation, Inc.
19521963
dnl This file is free software; the Free Software Foundation
19531964
dnl gives unlimited permission to copy and/or distribute it,
19541965
dnl with or without modifications, as long as this notice is preserved.
@@ -2123,14 +2134,14 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
21232134
21242135
AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
21252136
[AC_EGREP_CPP([Extensible Linking Format],
2126-
[#ifdef __ELF__
2137+
[#if defined __ELF__ || (defined __linux__ && defined __EDG__)
21272138
Extensible Linking Format
21282139
#endif
21292140
],
21302141
[gl_cv_elf=yes],
21312142
[gl_cv_elf=no])
2132-
])
2133-
if test $gl_cv_elf; then
2143+
])
2144+
if test $gl_cv_elf = yes; then
21342145
# Extract the ELF class of a file (5th byte) in decimal.
21352146
# Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
21362147
if od -A x < /dev/null >/dev/null 2>/dev/null; then
@@ -2147,20 +2158,23 @@ AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
21472158
echo
21482159
}
21492160
fi
2161+
# Use 'expr', not 'test', to compare the values of func_elfclass, because on
2162+
# Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
2163+
# not 1 or 2.
21502164
changequote(,)dnl
21512165
case $HOST_CPU_C_ABI_32BIT in
21522166
yes)
21532167
# 32-bit ABI.
21542168
acl_is_expected_elfclass ()
21552169
{
2156-
test "`func_elfclass | sed -e 's/[ ]//g'`" = 1
2170+
expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null
21572171
}
21582172
;;
21592173
no)
21602174
# 64-bit ABI.
21612175
acl_is_expected_elfclass ()
21622176
{
2163-
test "`func_elfclass | sed -e 's/[ ]//g'`" = 2
2177+
expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null
21642178
}
21652179
;;
21662180
*)

0 commit comments

Comments
 (0)