summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorKarel Zak2016-10-20 16:52:31 +0200
committerKarel Zak2016-10-20 16:52:31 +0200
commite5cc93b5a8854fce80537f86a244977df212dcb5 (patch)
tree194c92f61f5f3eeb6f864428ae37a00e7865bf75 /m4
parentbuild-sys: release++ (v2.29-rc2) (diff)
downloadkernel-qcow2-util-linux-e5cc93b5a8854fce80537f86a244977df212dcb5.tar.gz
kernel-qcow2-util-linux-e5cc93b5a8854fce80537f86a244977df212dcb5.tar.xz
kernel-qcow2-util-linux-e5cc93b5a8854fce80537f86a244977df212dcb5.zip
build-sys: use ncurses-config rather than pkg-config
It's painful, but ncurses upstream does not distribute .pc files by default and it seems that ncurses{6,5}-config is the preferred solution. For better compatibility lets use ncurses-config. Reported-by: Ruediger Meier <sweet_f_a@gmx.de> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/ul.m435
1 files changed, 35 insertions, 0 deletions
diff --git a/m4/ul.m4 b/m4/ul.m4
index 6c439511d..280e422ae 100644
--- a/m4/ul.m4
+++ b/m4/ul.m4
@@ -428,3 +428,38 @@ AC_DEFUN([UL_DEFAULT_ENABLE], [
enable_[]suffix=$2
fi
])
+
+dnl UL_NCURSES_CHECK(NAME)
+dnl
+dnl Initializes $have_<name>, NCURSES_LIBS and NCURSES_CFLAGS variables according to
+dnl <name>{6,5}_config output.
+dnl
+dnl The expected <name> is ncurses or ncursesw.
+dnl
+AC_DEFUN([UL_NCURSES_CHECK], [
+ m4_define([suffix], $1)
+
+ # ncurses-config should be everywhere, pkg-config is not supported by default
+ # by ncurses upstream
+ #
+ AC_MSG_CHECKING([$1])
+ if AC_RUN_LOG([suffix[]6-config --version >/dev/null]); then
+ have_[]suffix=yes
+ NCURSES_LIBS=`suffix[]6-config --libs`
+ NCURSES_CFLAGS=`suffix[]6-config --cflags`
+ AC_MSG_RESULT([(v6) yes])
+ elif AC_RUN_LOG([suffix[]5-config --version 2>/dev/null]); then
+ have_[]suffix=yes
+ NCURSES_LIBS=`suffix[]5-config --libs`
+ NCURSES_CFLAGS=`suffix[]5-config --cflags`
+ AC_MSG_RESULT([(v5) yes])
+ else
+ AC_MSG_RESULT([no])
+
+ # fallback
+ AC_CHECK_LIB([$1], [initscr], [have_[]suffix=yes], [have_[]suffix=no])
+ AS_IF([test "x$have_[]suffix" = xyes], [
+ NCURSES_LIBS="-l[]suffix"
+ ])
+ fi
+])