diff options
author | Karel Zak | 2017-09-19 12:55:49 +0200 |
---|---|---|
committer | Karel Zak | 2017-09-19 12:55:49 +0200 |
commit | ad442a818c6eefabb8258a9949206e12f2296161 (patch) | |
tree | cfa781ac84bb453f854dc152c80cae0a6a36cfc4 /m4 | |
parent | su: (pty) improve SIGSTOP/SIGCONT semantic (diff) | |
download | kernel-qcow2-util-linux-ad442a818c6eefabb8258a9949206e12f2296161.tar.gz kernel-qcow2-util-linux-ad442a818c6eefabb8258a9949206e12f2296161.tar.xz kernel-qcow2-util-linux-ad442a818c6eefabb8258a9949206e12f2296161.zip |
build-sys: add libtinfow check
It seems some systems differentiate between tinfo and tinfow. And it
seems that mix ncursesw and tinfo (wide vs. non-wide char) is problem
for the systems.
Note that for example Fedora have ncursesw as well as ncurses, but
only one tinfo library. So, we need fallback this scenario.
Reported-by: Stanislav Brabec <sbrabec@suse.cz>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ul.m4 | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -498,3 +498,30 @@ AC_DEFUN([UL_NCURSES_CHECK], [ AS_IF([test "x$have_[]suffix" = xyes], [NCURSES_LIBS="-l[]suffix"]) ]) ]) + +dnl +dnl UL_TINFO_CHECK(NAME) +dnl +dnl Initializes $have_<name>, TINFO_LIBS and TINFO_CFLAGS variables. +dnl +dnl The expected <name> is tinfow or tinfo. +dnl +AC_DEFUN([UL_TINFO_CHECK], [ + m4_define([suffix], $1) + m4_define([SUFFIX], m4_toupper($1)) + + PKG_CHECK_MODULES(SUFFIX, [$1], [ + dnl pkg-config success + have_[]suffix=yes + TINFO_LIBS=${SUFFIX[]_LIBS} + TINFO_CFLAGS=${SUFFIX[]_CFLAGS} + UL_PKG_STATIC([TINFO_LIBS_STATIC], [$1]) + ],[ + dnl If pkg-config failed, fall back to classic searching. + AC_CHECK_LIB([$1], [tgetent], [ + have_[]suffix=yes + TINFO_LIBS="-l[]suffix" + TINFO_LIBS_STATIC="-l[]suffix" + TINFO_CFLAGS=""]) + ]) +]) |