]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: fix irqtop compilation with -lslang
authorKarel Zak <kzak@redhat.com>
Mon, 8 Jun 2020 11:18:20 +0000 (13:18 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Jun 2020 11:18:20 +0000 (13:18 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/Makemodule.am
sys-utils/irqtop.c

index daeb34f8904841f5e40cfa4938fe71c9805b891f..5855e1cc1a78bcf09817bd91ed565cdc43559e19 100644 (file)
@@ -57,8 +57,14 @@ irqtop_SOURCES = sys-utils/irqtop.c \
                 sys-utils/irq-common.c \
                 sys-utils/irq-common.h \
                 lib/monotonic.c
-irqtop_LDADD = $(LDADD) libcommon.la $(NCURSES_LIBS) $(REALTIME_LIBS) libsmartcols.la
-irqtop_CFLAGS = $(AM_CFLAGS) $(NCURSES_CFLAGS) -I$(ul_libsmartcols_incdir)
+irqtop_LDADD = $(LDADD) libcommon.la $(REALTIME_LIBS) libsmartcols.la
+irqtop_CFLAGS = $(AM_CFLAGS) -I$(ul_libsmartcols_incdir)
+if HAVE_SLANG
+irqtop_LDADD += -lslang
+else
+irqtop_CFLAGS += $(NCURSES_CFLAGS)
+irqtop_LDADD += $(NCURSES_LIBS)
+endif
 endif
 
 if BUILD_LSIRQ
index 107bcdf6dfac67d32b516cc2f43a6801077b0c30..4363fffb75d15e905a7ab43c447674da419c12df 100644 (file)
@@ -188,7 +188,9 @@ static int event_loop(struct irqtop_ctl *ctl, struct irq_output *out)
                                }
                                if (siginfo.ssi_signo == SIGWINCH) {
                                        get_terminal_dimension(&ctl->cols, &ctl->rows);
+#if HAVE_RESIZETERM
                                        resizeterm(ctl->rows, ctl->cols);
+#endif
                                }
                                else {
                                        ctl->request_exit = 1;
@@ -319,7 +321,9 @@ int main(int argc, char **argv)
 
        ctl.win = initscr();
        get_terminal_dimension(&ctl.cols, &ctl.rows);
+#if HAVE_RESIZETERM
        resizeterm(ctl.rows, ctl.cols);
+#endif
        curs_set(0);
 
        ctl.hostname = xgethostname();