]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: only build col on glibc
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 27 Sep 2023 17:53:55 +0000 (19:53 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 27 Sep 2023 18:22:38 +0000 (20:22 +0200)
col expects an EILSEQ failure of getwchar() to leave the undecoded data
in the buffer to be read by a subsequent getchar().

This is not guaranteed by the standard and for example musl libc does
not conform to this expectation.

As col is deprecated anyways just disable it on non-glibc instead of fixing it.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
configure.ac
meson.build

index 1c2cb4f0d37dc00194a9100ff3431990c96d79c4..615639c1cdb4bc34e4522cc7897f7be8a71f5d3f 100644 (file)
@@ -2160,7 +2160,8 @@ UL_REQUIRES_HAVE([scriptlive], [pty], [openpty function (libutil)])
 AM_CONDITIONAL([BUILD_SCRIPTLIVE], [test "x$build_scriptlive" = xyes])
 
 
-UL_BUILD_INIT([col], [yes])
+UL_BUILD_INIT([col], [check])
+UL_REQUIRES_COMPILE([col], [#include <limits.h>], [__GLIBC__], [building for glibc])
 AM_CONDITIONAL([BUILD_COL], [test "x$build_col" = xyes])
 
 UL_BUILD_INIT([colcrt], [yes])
index b1e4fcd1080053f1b0e127f0f68ec722dcdf5619..281bda19e0ec62f61381d44541310bba81d4211a 100644 (file)
@@ -803,6 +803,8 @@ conf.set('HAVE_TLS', get_option('use-tls') ? 1 : false)
 conf.set('PG_BELL', get_option('pg-bell') ? 1 : false)
 conf.set('USE_COLORS_BY_DEFAULT', get_option('colors-default') ? 1 : false)
 
+is_glibc = cc.has_header_symbol('limits.h', '__GLIBC__')
+
 ############################################################
 
 
@@ -1120,16 +1122,18 @@ endif
 
 ############################################################
 
-exe = executable(
-  'col',
-  col_sources,
-  include_directories : includes,
-  link_with : lib_common,
-  install_dir : usrbin_exec_dir,
-  install : true)
-exes += exe
-manadocs += ['text-utils/col.1.adoc']
-bashcompletions += ['col']
+if is_glibc
+  exe = executable(
+    'col',
+    col_sources,
+    include_directories : includes,
+    link_with : lib_common,
+    install_dir : usrbin_exec_dir,
+    install : true)
+  exes += exe
+  manadocs += ['text-utils/col.1.adoc']
+  bashcompletions += ['col']
+endif
 
 exe = executable(
   'colcrt',