]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: fix linking when ncurses is built with --with-termlib=tinfo
authorArkadiusz Miskiewicz <arekm@maven.pl>
Tue, 19 Jun 2007 18:58:04 +0000 (20:58 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 2 Jul 2007 14:26:20 +0000 (16:26 +0200)
When system ncurses is built with --with-termlib=tinfo option
then there are two libraries - libtinfo (which contains terminal
related functions) and libncurses (rest).

Correctly link against libtinfo in such case.

Signed-off-by: Arkadiusz Miskiewicz <arekm@maven.pl>
configure.ac
misc-utils/Makefile.am
text-utils/Makefile.am

index aeb92b559cd01eea44a02fd5a6e7cbffc400e962..71808defc28bd3b01515cf7fa107764e53f628c3 100644 (file)
@@ -121,6 +121,10 @@ AC_ARG_WITH([slang],
   [], with_slang=no
 )
 
+have_tinfo=no
+AC_CHECK_LIB(tinfo, tgetent, [have_tinfo=yes])
+AM_CONDITIONAL(HAVE_TINFO, test x$have_tinfo = xyes)
+
 use_slang=no
 if test x$with_slang = xyes; then
   AC_CHECK_HEADERS([slcurses.h slang/slcurses.h], [use_slang=yes])
index 3083670614b65d0c820dc0df38dbd5b7b6030613..a9ea5ef4b1160d421e976914b1b59d5221e31855 100644 (file)
@@ -17,6 +17,9 @@ CLEANFILES = chkdupexe scriptreplay
 man_MANS = cal.1 chkdupexe.1 ddate.1 logger.1 look.1 mcookie.1 \
        namei.1 script.1 whereis.1 scriptreplay.1
 
+if HAVE_TINFO
+cal_LDADD = -ltinfo -lncurses
+else
 if HAVE_NCURSES
 cal_LDADD = -lncurses
 else
@@ -24,6 +27,7 @@ if HAVE_TERMCAP
 cal_LDADD = -ltermcap
 endif
 endif
+endif
 
 if HAVE_UTIL
 script_LDADD = -lutil
@@ -32,8 +36,12 @@ endif
 if HAVE_NCURSES
 usrbinexec_PROGRAMS += setterm
 man_MANS += setterm.1
+if HAVE_TINFO
+setterm_LDADD = -ltinfo
+else
 setterm_LDADD = -lncurses
 endif
+endif
 
 if BUILD_KILL
 bin_PROGRAMS += kill
index 9ec071df5cf6cf23c8d4761cdc4ec9a3acd16b90..7c9e906445c675c928e221b9cfc9c5d7aa051c5b 100644 (file)
@@ -12,9 +12,15 @@ man_MANS = col.1 colcrt.1 colrm.1 column.1 hexdump.1 rev.1 line.1 tailf.1
 if HAVE_NCURSES
 bin_PROGRAMS = more
 usrbinexec_PROGRAMS += ul pg
+if HAVE_TINFO
+more_LDADD = -ltinfo
+pg_LDADD = -ltinfo -lncurses
+ul_LDADD = -ltinfo
+else
 more_LDADD = -lncurses
 pg_LDADD = -lncurses
 ul_LDADD = -lncurses
+endif
 man_MANS += ul.1 more.1 pg.1
 else
 if HAVE_TERMCAP