]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
build: fix linking on BSD
authorEric Blake <eblake@redhat.com>
Fri, 4 Nov 2011 20:53:15 +0000 (14:53 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 4 Nov 2011 22:43:37 +0000 (16:43 -0600)
commit9d86cbcf5f799b711e06ff989edb3bb3b2fa6556
treed3b6d2cd94a36545070f536296c82f29599deabe
parent53c91e999c865f835cbf45d172f2728d4ea6b12b
build: fix linking on BSD

While building on FreeBSD (and after fixing a ptsname_r link error),
I got this failure:

./.libs/libvirt_util.a(libvirt_util_la-threads.o)(.text+0x240): In function `virThreadCreate':
util/threads-pthread.c:185: undefined reference to `pthread_create'

It turns out that gnulib used only pthread_join for LIB_PTHREAD,
but on FreeBSD, libc provides that (as a stub function); whereas
the more complex pthread_create really does require -pthread,
which gnulib tracked under [LT]LIBMULTITHREAD.

* configure.ac (LIBS): Check LIBMULTITHREAD alongside LIB_PTHREAD.
* src/Makefile.am (THREAD_LIBS): New variable.
(libvirt_util_la_LIBADD, libvirt_lxc_LDADD): Use it.
configure.ac
src/Makefile.am