diff options
author | Kamil Dudka <kdudka@redhat.com> | 2008-08-01 19:33:45 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-08-01 22:13:25 +0200 |
commit | 84f6abfe00b4ab533145623638b417a2221f9c75 (patch) | |
tree | 8fe27700e521e70a538ba114ccc86f984c8cb3c8 /m4 | |
parent | 00c6aacf318a6ef0db4895b08d572d924eab90d0 (diff) | |
download | coreutils-84f6abfe00b4ab533145623638b417a2221f9c75.tar.xz |
ls: --color now highlights files with capabilities, too
* src/ls.c: [HAVE_CAP] Include <sys/capability.h>.
(has_capability): New function for capability detection.
(print_color_indicator): Colorize file with capability.
* m4/jm-macro.m4: New configure option: --disable-libcap.
Check for libcap usability.
* src/Makefile.am (dir_LDADD, ls_LDADD, ...): Append $(LIB_CAP).
* src/dircolors.c: Update color lists.
* src/dircolors.hin: Mention new CAPABILITY color attribute.
* tests/ls/capability: Test for ls - colorize file with capability.
* tests/Makefile.am (root_tests): Add ls/capability.
* NEWS: Mention the change.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/jm-macros.m4 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4 index 062737b09..a691d9507 100644 --- a/m4/jm-macros.m4 +++ b/m4/jm-macros.m4 @@ -82,6 +82,19 @@ AC_DEFUN([coreutils_MACROS], AC_CHECK_FUNCS(fdatasync) LIBS=$coreutils_saved_libs + # Check whether libcap is usable -- for ls --color support + AC_ARG_ENABLE([libcap], + AC_HELP_STRING([--disable-libcap], [disable libcap support]), + AC_MSG_WARN([libcap support disabled by user]), + [AC_CHECK_LIB([cap], [cap_get_file], + [AC_CHECK_HEADER([sys/capability.h], + [LIB_CAP=-lcap AC_DEFINE([HAVE_CAP], 1, [libcap usability])], + [AC_MSG_WARN([header sys/capability.h was not found, support for libcap will not be built])] + )], + [AC_MSG_WARN([libcap library was not found or not usable, support for libcap will not be built])]) + ]) + AC_SUBST([LIB_CAP]) + # See if linking `seq' requires -lm. # It does on nearly every system. The single exception (so far) is # BeOS which has all the math functions in the normal runtime library |