From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 11F72138010 for ; Wed, 3 Apr 2013 13:39:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E6577E09C1; Wed, 3 Apr 2013 13:39:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7AAC4E09C1 for ; Wed, 3 Apr 2013 13:39:12 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 66CE633DC54 for ; Wed, 3 Apr 2013 13:39:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 87A1FE4073 for ; Wed, 3 Apr 2013 13:39:08 +0000 (UTC) From: "Sven Eden" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sven Eden" Message-ID: <1364996401.1827b95160b29d5b53393add21b54bdab2cbc8e0.yamakuzure@gentoo> Subject: [gentoo-commits] proj/ufed:master commit in: / X-VCS-Repository: proj/ufed X-VCS-Files: Makefile.am configure.ac X-VCS-Directories: / X-VCS-Committer: yamakuzure X-VCS-Committer-Name: Sven Eden X-VCS-Revision: 1827b95160b29d5b53393add21b54bdab2cbc8e0 X-VCS-Branch: master Date: Wed, 3 Apr 2013 13:39:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: fa296089-80d4-41ea-bd0e-113bb842f1a1 X-Archives-Hash: 8750b60a4d2faea4546ef4c55e4855da commit: 1827b95160b29d5b53393add21b54bdab2cbc8e0 Author: Sven Eden gmx de> AuthorDate: Wed Apr 3 13:40:01 2013 +0000 Commit: Sven Eden gmx de> CommitDate: Wed Apr 3 13:40:01 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/ufed.git;a=commit;h=1827b951 Use pkg-config to check for ncurses. this should fix bug #464328 --- Makefile.am | 2 ++ configure.ac | 28 +++++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index aaf93cd..2e92da4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -15,6 +15,8 @@ ufed_curses_SOURCES = \ ufed-curses-globals.c \ ufed-curses-types.c +ufed_curses_LDADD = $(NCURSES_LIBS) + noinst_HEADERS = \ ufed-curses.h \ ufed-curses-debug.h \ diff --git a/configure.ac b/configure.ac index 1f47b68..a3308b9 100644 --- a/configure.ac +++ b/configure.ac @@ -18,14 +18,36 @@ else fi CFLAGS="${CFLAGS} -Wmissing-prototypes -Wstrict-prototypes" +PKG_PROG_PKG_CONFIG + AC_TYPE_SIZE_T AC_CHECK_HEADER_STDBOOL +curses="default" +HAVE_CURSES=0 + AC_ARG_WITH([curses], [AS_HELP_STRING([--with-curses], [override default curses library (ncursesw ncurses curses)])], - [curses=$withval], - [curses="ncursesw ncurses curses"]) -AC_SEARCH_LIBS([initscr], [$curses], [], [AC_MSG_ERROR([curses library not found])]) + [curses=$withval]) + +dnl try user option first +dnl --------------------- + +AS_IF([test "x$curses" != "xdefault"], [ + PKG_CHECK_MODULES([NCURSES], [$curses], [HAVE_CURSES=1]) +]) + +dnl otherwise check the defaults +dnl ---------------------------- + +AS_IF([test "x$HAVE_CURSES" = "x0"], [ + PKG_CHECK_MODULES([NCURSES], [ncursesw], [HAVE_CURSES=1], [ + PKG_CHECK_MODULES([NCURSES], [ncurses], [HAVE_CURSES=1], [ + PKG_CHECK_MODULES([NCURSES], [curses], [HAVE_CURSES=1], [ + AC_MSG_ERROR([No valid ncurses installation found])]) + ]) + ]) +]) AC_PATH_PROG([PERL], [perl], [])