[libvirt] [PATCH] configure.in: Prepend -lpthread to LIBS if required.

Jim Meyering jim at meyering.net
Thu Aug 21 18:23:21 UTC 2008


"Jun Koi" <junkoi2004 at gmail.com> wrote:
> The latest cvs version has an error when compiling:
>
> make[3]: Entering directory `/home/jun/projects/libvirt-0821/src'
> /bin/bash ../libtool --tag=CC   --mode=link gcc   -g -O2 -Wall
...
> ./.libs/libvirt.so: undefined reference to `pthread_sigmask'
> collect2: ld returned 1 exit status
> make[3]: *** [virsh] Error 1

Thanks for the report.
Next time, please tell us about your system,
because I didn't 'see any such problem on a rawhide-based build.
However, I did reproduce it on a Debian/unstable system.

Applying the patch below solved the problem for me.
I'll check it in soon.

>From 3b51f7ad00bc8acde5bddf6cc61517289b9b0c4a Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering at redhat.com>
Date: Thu, 21 Aug 2008 20:17:19 +0200
Subject: [PATCH] configure.in: Prepend -lpthread to LIBS if required.

* configure.in: With an empty "ACTION_IF_FOUND", AC_CHECK_LIB would
have done that for us automatically, but when there is an explicit
3rd argument, those commands are run instead of the default
---
 configure.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure.in b/configure.in
index 3789abd..9479f1c 100644
--- a/configure.in
+++ b/configure.in
@@ -90,6 +90,7 @@ AC_CHECK_HEADER([pthread.h],
 	[AC_CHECK_LIB([pthread],[pthread_join],[
 		AC_DEFINE([HAVE_LIBPTHREAD],[],[Define if pthread (-lpthread)])
 		AC_DEFINE([HAVE_PTHREAD_H],[],[Define if <pthread.h>])
+		LIBS="-lpthread $LIBS"
 	])])

 dnl Miscellaneous external programs.
--
1.6.0.90.g436ed




More information about the libvir-list mailing list