diff options
author | Arkadiusz Miskiewicz <arekm@maven.pl> | 2007-06-19 20:58:04 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2007-07-02 16:26:20 +0200 |
commit | 46e711180f6c7ef6b52373438a4bf0cecb7c646c (patch) | |
tree | c3395a25031fde6f0a4ee1bbf6fe14858fde58ca | |
parent | a6f628832a1e6292cfdf9074ba32ba8cd21f899d (diff) | |
download | util-linux-old-46e711180f6c7ef6b52373438a4bf0cecb7c646c.tar.gz |
build-sys: fix linking when ncurses is built with --with-termlib=tinfo
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>
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | misc-utils/Makefile.am | 8 | ||||
-rw-r--r-- | text-utils/Makefile.am | 6 |
3 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index aeb92b55..71808def 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/misc-utils/Makefile.am b/misc-utils/Makefile.am index 30836706..a9ea5ef4 100644 --- a/misc-utils/Makefile.am +++ b/misc-utils/Makefile.am @@ -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 diff --git a/text-utils/Makefile.am b/text-utils/Makefile.am index 9ec071df..7c9e9064 100644 --- a/text-utils/Makefile.am +++ b/text-utils/Makefile.am @@ -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 |