summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorKarel Zak2008-03-05 00:53:24 +0100
committerKarel Zak2008-03-20 12:25:15 +0100
commit08d64aa23288062c926823555d85ee89a65f6f41 (patch)
tree1b43993345076c42696570578eb3e52974fae299 /configure.ac
parentbuild-sys: add VARSUFFIX to UTIL_CHECK_LIB (diff)
downloadkernel-qcow2-util-linux-08d64aa23288062c926823555d85ee89a65f6f41.tar.gz
kernel-qcow2-util-linux-08d64aa23288062c926823555d85ee89a65f6f41.tar.xz
kernel-qcow2-util-linux-08d64aa23288062c926823555d85ee89a65f6f41.zip
build-sys: use ncursesw (wide version) when possibe
Detect ncursesw and use it in place of ncurses when possible (default). Allow people to use classic (non-wide) version by --with-ncurses or disable all ncurses/ncursesw support by --without-ncurses. Co-Author: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac41
1 files changed, 29 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 50e8b6ffe..6ca6ec084 100644
--- a/configure.ac
+++ b/configure.ac
@@ -196,18 +196,35 @@ else
ALL_LINGUAS="af am ar as be bg bn_IN bn ca cs cy da de el en_GB es et eu_ES fa fi fr gl gu he hi hr hu hy id is it ja ka kn ko ku lo lt lv mk ml mr ms my nb nl nn no nso or pa pl pt_BR pt ro ru si sk sl sq sr@Latn sr sv ta te th tr uk ur vi zh_CN zh_TW zu"
fi
-have_ncurses=no
-AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [have_ncurses=yes])
-case $have_ncurses in
-yes)
- AC_MSG_NOTICE([you have ncurses])
- AC_DEFINE(HAVE_NCURSES, 1, [Do we have -lncurses?])
- ;;
-no)
- AC_MSG_NOTICE([you do not have ncurses])
- ;;
-esac
-AM_CONDITIONAL(HAVE_NCURSES, test x$have_ncurses = xyes)
+AC_ARG_WITH([ncurses],
+ AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version
+ (--without-ncurses disables all ncurses(w) support)]),
+ [], with_ncurses=auto
+)
+AM_CONDITIONAL(HAVE_NCURSES, false)
+
+if test "x$with_ncurses" != xno; then
+ have_ncurses=no
+ AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [
+ if test "x$with_ncurses" = xauto; then
+ UTIL_CHECK_LIB(ncursesw, tputs, ncurses)
+ if test "x$have_ncurses" = xyes; then
+ NCURSES_LIBS="-lncursesw"
+ fi
+ fi
+ if test x$have_ncurses = xno; then
+ UTIL_CHECK_LIB(ncurses, tputs)
+ if test x$have_ncurses = xyes; then
+ NCURSES_LIBS="-lncurses"
+ fi
+ fi
+ ])
+ if test x$have_ncurses = xno; then
+ AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)])
+ fi
+fi
+AC_SUBST([NCURSES_LIBS])
+
AC_ARG_WITH([slang],
AS_HELP_STRING([--with-slang], [compile cfdisk with slang]),