From 38e764606d9ac90cc5e9cdef66c3feb18def956e Mon Sep 17 00:00:00 2001 From: Craig Small Date: Wed, 26 Oct 2011 22:29:44 +1100 Subject: [PATCH] fixed ncurses double linking --- configure.ac | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/configure.ac b/configure.ac index 183e24a9..4ed45257 100644 --- a/configure.ac +++ b/configure.ac @@ -17,9 +17,6 @@ AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_LN_S -# Checks for libraries. -AC_CHECK_LIB([ncurses], [setupterm]) - # Checks for header files. AC_HEADER_MAJOR AC_CHECK_HEADERS([\ @@ -106,38 +103,29 @@ dnl --------------------------------- AC_DEFUN([UTIL_CHECK_LIB], [ m4_define([suffix], m4_default([$3],$1)) [have_]suffix=yes - m4_ifdef([$3], - [AC_CHECK_LIB([$1], [$2], [AC_DEFINE(AS_TR_CPP([HAVE_LIB]suffix), 1)], [[have_]suffix=no])], - [AC_CHECK_LIB([$1], [$2], [], [[have_]suffix=no])]) + m4_ifdef([$3], [AC_CHECK_LIB([$1], [$2], [], [[have_]suffix=no])], []) AM_CONDITIONAL(AS_TR_CPP([HAVE_]suffix), [test [$have_]suffix = yes]) ]) AC_ARG_WITH([ncurses], - AS_HELP_STRING([--with-ncurses], [build with non-wide ncurses, default is wide version - (--without-ncurses disables all ncurses(w) support)]), - [], with_ncurses=auto + AS_HELP_STRING([--without-ncurses], [build only applications not needing ncurses]), + [], with_ncurses=yes ) AM_CONDITIONAL(HAVE_NCURSES, false) if test "x$with_ncurses" != xno; then have_ncurses=no AC_CHECK_HEADERS([ncurses.h ncurses/ncurses.h], [ - if test "x$with_ncurses" = xauto; then + if test "x$with_ncurses" = xyes; then UTIL_CHECK_LIB(ncursesw, initscr, ncurses) if test "x$have_ncurses" = xyes; then AC_CHECK_HEADERS([ncursesw/ncurses.h]) NCURSES_LIBS="-lncursesw" fi fi - if test "x$have_ncurses" = xno; then - UTIL_CHECK_LIB(ncurses, initscr) - if test "x$have_ncurses" = xyes; then - NCURSES_LIBS="-lncurses" - fi - fi ]) if test "x$have_ncurses" = xno; then - AC_MSG_ERROR([ncurses or ncursesw selected, but library not found (--without-ncurses to disable)]) + AC_MSG_ERROR([ncurses selected, but library not found (--without-ncurses to disable)]) fi fi AC_SUBST([NCURSES_LIBS])