Patchwork [02/20] Use the same structure for list of libs in curses and pthread

login
register
mail settings
Submitter Juan Quintela
Date Aug. 12, 2009, 4:20 p.m.
Message ID <2dea62bd3e3f5dbe88eb1f9fe0ecebafbd9dc314.1250093910.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/31202/
State Superseded
Headers show

Comments

Juan Quintela - Aug. 12, 2009, 4:20 p.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 configure |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

Patch

diff --git a/configure b/configure
index 1acabf1..4573453 100755
--- a/configure
+++ b/configure
@@ -1078,8 +1078,10 @@  fi

 ##########################################
 # curses probe
+curses_list="-lncurses -lcurses"

 if test "$curses" = "yes" ; then
+  curses=no
   cat > $TMPC << EOF
 #include <curses.h>
 #ifdef __OpenBSD__
@@ -1087,14 +1089,14 @@  if test "$curses" = "yes" ; then
 #endif
 int main(void) { resize_term(0, 0); return curses_version(); }
 EOF
-  if compile_prog "" "-lncurses" ; then
-    libs_softmmu="-lncurses $libs_softmmu"
-  elif compile_prog "" "-lcurses" ; then
-    libs_softmmu="-lcurses $libs_softmmu"
-  else
-    curses=no
-  fi
-fi # test "$curses"
+  for curses_lib in $curses_list; do
+    if compile_prog "" "$curses_lib" ; then
+      curses=yes
+      libs_softmmu="$curses_lib $libs_softmmu"
+      break
+    fi
+  done
+fi

 ##########################################
 # curl probe