From 23886a788a60bc0996f219b41bf3a3cdb0adaf07 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 14 Feb 2012 21:26:52 +0900 Subject: [PATCH] Add -lncrses to CUNIT_LIBS for Mac OS X build. We chooses the way to just add -lncurses to CUNIT_LIBS only for Mac OS X. This is because currently only Mac's cunit requires ncurses and adding a flag is simpler than erabolate checking. --- configure.ac | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 61509a3..67c98ca 100644 --- a/configure.ac +++ b/configure.ac @@ -66,14 +66,15 @@ if test "x${have_cunit}" = "xno"; then fi fi if test "x${have_cunit}" = "xyes"; then - # Check whether the installed cunit requires ncurses. This is - # needed because cunit in Mac OS X requires it. - LIBS_TEMP=${LIBS} - LIBS=${CUNIT_LIBS} - AC_SEARCH_LIBS([CU_initialize_registry], [ncurses]) - CUNIT_LIBS=${LIBS} - AC_SUBST([CUNIT_LIBS]) - LIBS=${LIBS_TEMP} + # cunit in Mac OS X requires ncurses. Note that in Mac OS X, test + # program can be built without -lncurses, but it emits runtime + # error. + case "${build}" in + *-apple-darwin*) + CUNIT_LIBS="$CUNIT_LIBS -lncurses" + AC_SUBST([CUNIT_LIBS]) + ;; + esac fi AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])