From: Thomas Weißschuh Date: Wed, 27 Sep 2023 17:53:55 +0000 (+0200) Subject: build-sys: only build col on glibc X-Git-Tag: v2.40-rc1~217^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8886d84e25a457702b45194d69a47313f76dc6bc;p=thirdparty%2Futil-linux.git build-sys: only build col on glibc 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 --- diff --git a/configure.ac b/configure.ac index 1c2cb4f0d3..615639c1cd 100644 --- a/configure.ac +++ b/configure.ac @@ -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 ], [__GLIBC__], [building for glibc]) AM_CONDITIONAL([BUILD_COL], [test "x$build_col" = xyes]) UL_BUILD_INIT([colcrt], [yes]) diff --git a/meson.build b/meson.build index b1e4fcd108..281bda19e0 100644 --- a/meson.build +++ b/meson.build @@ -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',