Re: [PATCH libvirt 1/3] build: do not build shunloadtest if pthread missing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/20/2012 07:13 AM, Marc-André Lureau wrote:
> Fixes build on Windows systems
> ---
>  configure.ac      |    2 ++
>  tests/Makefile.am |    8 +++++++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 89fe818..347c48c 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -154,6 +154,8 @@ AC_CHECK_FUNC([clock_gettime],[
>  LIBS=$old_libs
>  AC_SUBST(RT_LIBS)
>  
> +AM_CONDITIONAL([HAVE_PTHREAD], [test x"$HAVE_PTHREAD_H" = x"1"])

NACK.  If I understand things, the only reason you are adding this
conditional is so that:

> +if HAVE_PTHREAD
>  shunloadtest_SOURCES = \
>  	shunloadtest.c
>  shunloadtest_LDADD = -lpthread

this line won't trigger a link failure if -lpthread does not exist.  But
we've already conditionalized -pthread; so does this (shorter) patch
work to fix the problem instead?

diff --git i/tests/Makefile.am w/tests/Makefile.am
index c4d550f..b30d79c 100644
--- i/tests/Makefile.am
+++ w/tests/Makefile.am
@@ -529,7 +529,7 @@ libshunload_la_LDFLAGS = -module -avoid-version
-rpath /evil/libtool/hack/to/for

 shunloadtest_SOURCES = \
 	shunloadtest.c
-shunloadtest_LDADD = -lpthread
+shunloadtest_LDADD = $(LIB_PTHREAD)
 shunloadtest_DEPENDENCIES = libshunload.la

 if WITH_CIL

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]