Patchwork [11/20] Add pthread to new feature convencion

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

Comments

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

Patch

diff --git a/configure b/configure
index b4a6669..86cd0ab 100755
--- a/configure
+++ b/configure
@@ -182,6 +182,7 @@  esac
 brlapi=""
 curl=""
 curses=""
+pthread=""
 vde=""
 vnc_tls=""
 vnc_sasl=""
@@ -211,7 +212,6 @@  bsd_user="no"
 guest_base=""
 build_docs="yes"
 uname_release=""
-pthread="yes"
 aio="yes"
 io_thread="no"
 nptl="yes"
@@ -531,6 +531,8 @@  for opt do
   ;;
   --disable-pthread) pthread="no"
   ;;
+  --enable-pthread) pthread="yes"
+  ;;
   --disable-aio) aio="no"
   ;;
   --enable-io-thread) io_thread="yes"
@@ -677,6 +679,7 @@  echo "  --sparc_cpu=V            Build qemu for Sparc architecture v7, v8, v8plu
 echo "  --disable-vde            disable support for vde network"
 echo "  --enable-vde             enable support for vde network"
 echo "  --disable-pthread        disable pthread support"
+echo "  --enable-pthread         enable pthread support"
 echo "  --disable-aio            disable AIO support"
 echo "  --enable-io-thread       enable IO thread"
 echo "  --disable-blobs          disable installing provided firmware blobs"
@@ -1257,19 +1260,27 @@  fi
 # pthread probe
 PTHREADLIBS_LIST="-lpthread -lpthreadGC2"

-if test "$pthread" = yes; then
-  pthread=no
+if test "$pthread" != "no" ; then
+  pthread_found=no
 cat > $TMPC << EOF
 #include <pthread.h>
 int main(void) { pthread_create(0,0,0,0); return 0; }
 EOF
   for pthread_lib in $PTHREADLIBS_LIST; do
     if compile_prog "" "$pthread_lib" ; then
-      pthread=yes
+      pthread_found=yes
       LIBS="$pthread_lib $LIBS"
       break
     fi
   done
+  if test "$pthread_found" = "yes" ; then
+    pthread=yes
+  else
+    if test "$pthread" = "yes" ; then
+      feature_not_found "pthread"
+    fi
+    pthread=no
+  fi
 fi

 if test "$pthread" = no; then