summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSÅ‚awomir Nizio <slawomir.nizio@sabayon.org>2018-09-22 09:46:41 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2018-09-22 09:46:41 +0200
commitf15cffae936c5643a8fe502a2170d0d2aab0fb5f (patch)
tree6f477c0f613de90c90c97f4a4dd6e282f0f09a76
parente9ae00f32aee264ba136ec384fe1bbbcc7f5ff06 (diff)
Support libtinfow, avoiding a crash.
bug: https://bugs.gentoo.org/654866
-rw-r--r--configure.ac28
1 files changed, 17 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 8a771a8..a3d7e09 100644
--- a/configure.ac
+++ b/configure.ac
@@ -545,20 +545,26 @@ if test "x$with_ncurses" != "xno"; then
testdisk_LDADD="$testdisk_LDADD -l${ncurses_lib}"
photorec_LDADD="$photorec_LDADD -l${ncurses_lib}"
fi
- AC_CHECK_LIB(tinfo,keypad,[
+
+ if test "${ncurses_lib}" = "ncursesw"; then
+ AC_CHECK_LIB(tinfow,keypad, [ tinfo_lib="tinfow" ])
+ else
+ AC_CHECK_LIB(tinfo,keypad, [ tinfo_lib="tinfo" ])
+ fi
+ if test "${tinfo_lib}" != ""; then
AC_DEFINE([HAVE_TINFO],1,[Define to 1 if you have the tinfo library (-ltinfo).])
-# if lib${ncurses_lib}.a is present, try to use libtinfo.a
- if test "${ncurses_lib_dir}" != "" -a -e "${ncurses_lib_dir}/lib${ncurses_lib}.a";
- then
- if test -e "${ncurses_lib_dir}/libtinfo.a"; then
- testdisk_LDADD="$testdisk_LDADD ${ncurses_lib_dir}/libtinfo.a"
- photorec_LDADD="$photorec_LDADD ${ncurses_lib_dir}/libtinfo.a"
+ # if lib${ncurses_lib}.a is present, try to use libtinfo.a
+ if test "${ncurses_lib_dir}" != "" -a -e "${ncurses_lib_dir}/lib${ncurses_lib}.a";
+ then
+ if test -e "${ncurses_lib_dir}/lib${tinfo_lib}.a"; then
+ testdisk_LDADD="$testdisk_LDADD ${ncurses_lib_dir}/lib${tinfo_lib}.a"
+ photorec_LDADD="$photorec_LDADD ${ncurses_lib_dir}/lib${tinfo_lib}.a"
+ fi
+ else
+ testdisk_LDADD="$testdisk_LDADD -l${tinfo_lib}"
+ photorec_LDADD="$photorec_LDADD -l${tinfo_lib}"
fi
- else
- testdisk_LDADD="$testdisk_LDADD -ltinfo"
- photorec_LDADD="$photorec_LDADD -ltinfo"
fi
- ])
if test "$use_ncmouse" = "true";
then
ac_save_LIBS="$LIBS"