summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorKarel Zak2017-05-30 17:01:00 +0200
committerKarel Zak2017-05-30 17:08:36 +0200
commit3cc8a9f42ad0e903d25cc927e920b59c4a10b5d3 (patch)
tree2f2473d9732beb82d4b482742ebc446837dd6d98 /configure.ac
parenttests: check for ps --ppid (diff)
downloadkernel-qcow2-util-linux-3cc8a9f42ad0e903d25cc927e920b59c4a10b5d3.tar.gz
kernel-qcow2-util-linux-3cc8a9f42ad0e903d25cc927e920b59c4a10b5d3.tar.xz
kernel-qcow2-util-linux-3cc8a9f42ad0e903d25cc927e920b59c4a10b5d3.zip
build-sys: make ncurses detection more robust
It seems Debina 8 is a little bit incompatible with us: * ncurses-config is packaged in ncurses-bin where is *no* any development files! It means the script returns paths to not installed files (IMHO packaging bug) Fixed, we need to check for header files too. * term.h is "everywhere" on Fedora: <term.h> <ncurses/term.h> <ncursesw/term.h> Debian is more strict and uses <ncurses[w]/term.h> only. Fixed, we need #ifdef storm to use the correct path * libtinfo-dev does not contains any header files Fixed, we have to always require installed ncurses devel stuff to compile, but we can link with -ltinfo only (cal, ul, more, ...) * we don't use termcap for more(1) Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 18 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 36e0c4930..91c3dd544 100644
--- a/configure.ac
+++ b/configure.ac
@@ -793,12 +793,18 @@ AC_ARG_WITH([ncursesw],
[], [with_ncursesw=auto]
)
have_ncursesw=no
+have_ncursesw_header=no
AS_IF([test "x$with_ncursesw" != xno], [
UL_NCURSES_CHECK([ncursesw])
AS_IF([test "x$have_ncursesw" = xyes], [
- AC_DEFINE([HAVE_LIBNCURSESW], [1], [Define if ncursesw library available])
+ AC_CHECK_HEADERS([ncursesw/ncurses.h ncurses.h],
+ [have_ncursesw_header=yes])
+ AC_CHECK_HEADERS([ncursesw/term.h term.h])
+ AS_IF([test "x$have_ncursesw_header" = xno], [have_ncursesw=no])
+ ])
+ AS_IF([test "x$have_ncursesw" = xyes], [
CURSES_LIB_NAME="ncursesw"
- AC_CHECK_HEADERS([ncursesw/ncurses.h ncurses.h])
+ AC_DEFINE([HAVE_LIBNCURSESW], [1], [Define if ncursesw library available])
])
])
AS_CASE([$with_ncursesw:$have_ncursesw],
@@ -811,16 +817,21 @@ AC_ARG_WITH([ncurses],
[], [with_ncurses=auto]
)
have_ncurses=no
-
+have_ncurses_header=no
AS_CASE([$with_ncurses:$build_widechar],
[yes:yes], [AC_MSG_ERROR([wide-char support enabled, but non-wide ncurses selects])])
AS_IF([test "x$have_ncursesw" = xno -a "x$with_ncurses" != xno ], [
UL_NCURSES_CHECK([ncurses])
AS_IF([test "x$have_ncurses" = xyes], [
- AC_DEFINE([HAVE_LIBNCURSES], [1], [Define if ncurses library available])
+ AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h],
+ [have_ncurses_header=yes])
+ AC_CHECK_HEADERS([ncurses/term.h term.h])
+ AS_IF([test "x$have_ncurses_header" = xno], [have_ncurses=no])
+ ])
+ AS_IF([test "x$have_ncurses" = xyes], [
CURSES_LIB_NAME="ncurses"
- AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h])
+ AC_DEFINE([HAVE_LIBNCURSES], [1], [Define if ncurses library available])
])
])
AS_CASE([$with_ncurses:$have_ncurses],
@@ -1868,7 +1879,7 @@ AC_ARG_ENABLE([ul],
[], [UL_DEFAULT_ENABLE([ul], [check])]
)
UL_BUILD_INIT([ul])
-UL_REQUIRES_HAVE([ul], [ncursesw, tinfo, ncurses], [ncursesw, ncurses or tinfo libraries])
+UL_REQUIRES_HAVE([ul], [ncursesw, ncurses], [ncursesw or ncurses libraries])
AM_CONDITIONAL([BUILD_UL], [test "x$build_ul" = xyes])
@@ -1877,7 +1888,7 @@ AC_ARG_ENABLE([more],
[], [UL_DEFAULT_ENABLE([more], [check])]
)
UL_BUILD_INIT([more])
-UL_REQUIRES_HAVE([more], [ncursesw, tinfo, ncurses, termcap], [ncursesw, ncurses, tinfo or termcap libraries])
+UL_REQUIRES_HAVE([more], [ncursesw, ncurses], [ncursesw or ncurses libraries])
AM_CONDITIONAL([BUILD_MORE], [test "x$build_more" = xyes])