Patchwork [Qemu-trivial] configure: try pkg-config for curses

login
register
mail settings
Submitter Vadim Evard
Date Dec. 31, 2012, 4:30 p.m.
Message ID <50E1BDC3.5040604@gmail.com>
Download mbox | patch
Permalink /patch/208881/
State New
Headers show

Comments

Vadim Evard - Dec. 31, 2012, 4:30 p.m.
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 <v.e.evard@gmail.com>
---
  configure |    4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
Vadim Evard - Jan. 11, 2013, 12:51 p.m.
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 <v.e.evard@gmail.com>
> ---
> 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"
Stefan Hajnoczi - Jan. 15, 2013, 9:49 a.m.
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 <v.e.evard@gmail.com>
> >---
> >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

Patch

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"