From 2b8f22bd90f8074c714afaa872c314287e54a9a6 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 29 Sep 2013 00:44:43 -0400 Subject: clean up term lib handling The ncurses package has been providing pkg-config files for a while now. So let's start using them to get the proper linker & compiler flags. It can make a difference when ncurses is configured in a way that requires extra link time flags but util-linux doesn't provide them, or when the headers live in a weird place and util-linux can't find them. Since the NCURSES_LIBS is always defined for the Makefile, there's no need to gate on the HAVE_NCURSES conditional. When it's disabled, the var will simply be empty. With a minor tweak to how tinfo is handled, we can do the same thing -- we just always use TINFO_LIBS in the Makefile's. Signed-off-by: Mike Frysinger --- text-utils/Makemodule.am | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'text-utils/Makemodule.am') diff --git a/text-utils/Makemodule.am b/text-utils/Makemodule.am index d3ebfdc5b..a2b6fe9b2 100644 --- a/text-utils/Makemodule.am +++ b/text-utils/Makemodule.am @@ -53,11 +53,8 @@ if BUILD_PG usrbin_exec_PROGRAMS += pg dist_man_MANS += text-utils/pg.1 pg_SOURCES = text-utils/pg.c -pg_CFLAGS = $(AM_CFLAGS) $(BSD_WARN_CFLAGS) -pg_LDADD = $(LDADD) libcommon.la @NCURSES_LIBS@ -if HAVE_TINFO -pg_LDADD += -ltinfo -endif +pg_CFLAGS = $(AM_CFLAGS) $(BSD_WARN_CFLAGS) $(NCURSES_CFLAGS) +pg_LDADD = $(LDADD) libcommon.la $(NCURSES_LIBS) $(TINFO_LIBS) endif # BUILD_PG @@ -65,12 +62,8 @@ if BUILD_UL usrbin_exec_PROGRAMS += ul dist_man_MANS += text-utils/ul.1 ul_SOURCES = text-utils/ul.c -ul_LDADD = $(LDADD) -if HAVE_TINFO -ul_LDADD += -ltinfo -else -ul_LDADD += @NCURSES_LIBS@ -endif +ul_CFLAGS = $(AM_CFLAGS) $(NCURSES_CFLAGS) +ul_LDADD = $(LDADD) $(NCURSES_LIBS) $(TINFO_LIBS) endif # BUILD_UL @@ -78,17 +71,11 @@ if BUILD_MORE bin_PROGRAMS += more dist_man_MANS += text-utils/more.1 more_SOURCES = text-utils/more.c -more_CFLAGS = $(AM_CFLAGS) $(BSD_WARN_CFLAGS) -more_LDADD = $(LDADD) -if HAVE_TINFO -more_LDADD += -ltinfo -else -if HAVE_NCURSES -more_LDADD += @NCURSES_LIBS@ -else +more_CFLAGS = $(AM_CFLAGS) $(BSD_WARN_CFLAGS) $(NCURSES_CFLAGS) +more_LDADD = $(LDADD) $(NCURSES_LIBS) $(TINFO_LIBS) +if HAVE_TERMCAP more_LDADD += -ltermcap endif -endif check_PROGRAMS += test_more test_more_SOURCES = $(more_SOURCES) -- cgit v1.2.3-55-g7522