From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41816) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv5SR-0005CS-7G for qemu-devel@nongnu.org; Tue, 15 Jan 2013 07:17:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv5SO-0002DQ-MD for qemu-devel@nongnu.org; Tue, 15 Jan 2013 07:17:35 -0500 Message-ID: <50F548D4.90903@gmail.com> Date: Tue, 15 Jan 2013 16:17:24 +0400 From: Vadim Evard MIME-Version: 1.0 References: <50E1BDC3.5040604@gmail.com> <50F00ACC.8020606@gmail.com> <20130115094933.GA2654@stefanha-thinkpad.redhat.com> In-Reply-To: <20130115094933.GA2654@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [Qemu-trivial] [PATCH v2] configure: try pkg-config for curses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Static linkikng against ncurses may require explicit -ltinfo. In case -lcurses and -lncurses both didn't work give pkg-config a chance. Fixes #1094786 for me. Signed-off-by: Vadim Evard --- configure | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/configure b/configure index c908f66..40473a9 100755 --- a/configure +++ b/configure @@ -2039,7 +2039,7 @@ fi if test "$mingw32" = "yes" ; then curses_list="-lpdcurses" else - curses_list="-lncurses -lcurses" + curses_list="-lncurses:-lcurses:$($pkg_config --libs ncurses)" fi if test "$curses" != "no" ; then @@ -2052,13 +2052,16 @@ int main(void) { return s != 0; } EOF + IFS=: for curses_lib in $curses_list; do + unset IFS if compile_prog "" "$curses_lib" ; then curses_found=yes libs_softmmu="$curses_lib $libs_softmmu" break fi done + unset IFS if test "$curses_found" = "yes" ; then curses=yes else -- 1.7.10.4 On 15.01.2013 13:49, Stefan Hajnoczi wrote: > On Fri, Jan 11, 2013 at 04:51:24PM +0400, Vadim Evard wrote: >> ping >> >> Пнд 31 Дек 2012 20:30:59, Vadim Evard писал: >>> configure: try pkg-config for curses >>> >>> Static linkikng against ncurses may require explicit -ltinfo. >>> In case -lcurses and -lncurses both didn't work give pkg-config a >>> chance. >>> >>> Signed-off-by: Vadim Evard >>> --- >>> configure | 4 +++- >>> 1 file changed, 3 insertions(+), 1 deletion(-) >>> >>> diff --git a/configure b/configure >>> index b0c7e54..16280e2 100755 >>> --- a/configure >>> +++ b/configure >>> @@ -2030,7 +2030,7 @@ fi >>> if test "$mingw32" = "yes" ; then >>> curses_list="-lpdcurses" >>> else >>> - curses_list="-lncurses -lcurses" >>> + curses_list="-lncurses:-lcurses:$($pkg_config --libs ncurses)" >>> fi >>> >>> if test "$curses" != "no" ; then >>> @@ -2043,7 +2043,9 @@ int main(void) { >>> return s != 0; >>> } >>> EOF >>> + IFS=: >>> for curses_lib in $curses_list; do >>> + unset IFS >>> if compile_prog "" "$curses_lib" ; then >>> curses_found=yes >>> libs_softmmu="$curses_lib $libs_softmmu" > > Please also unset IFS after the loop so there will never be a problem if > curses_list="". > > Stefan