On 05/12/2011 05:58 AM, Eric Blake wrote: >> +++ b/configure.ac >> @@ -638,7 +638,10 @@ if test "$with_libvirtd" = "no" ; then >> with_lxc=no >> fi >> if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then >> - AC_TRY_LINK([#define _GNU_SOURCE >> + AC_TRY_LINK([ >> + #ifndef _GNU_SOURCE >> + #define _GNU_SOURCE >> + #endif >> #include <sched.h> > > This hunk might be worthwhile; I'll look into it more later today. Here, the problem was that gl_INIT already AC_DEFINE'd _GNU_SOURCE, but with a value of 1. It's actually an error to redefine a macro if the redefinition is not to the identical value, but since it guaranteed to already be defined, we can simplify your patch. I'm pushing this simpler fix in your name: From 1ba6e2d926dadd6267084fe0b27209ba6c1099ff Mon Sep 17 00:00:00 2001 From: Wen Congyang <wency@xxxxxxxxxxxxxx> Date: Thu, 12 May 2011 17:55:43 +0800 Subject: [PATCH] build: avoid compiler warning during configure There is no need to redefine _GNU_SOURCE in tests that occur after gl_INIT, since that macro already AC_DEFINE'd it for us. Signed-off-by: Eric Blake <eblake@xxxxxxxxxx> --- configure.ac | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 71c4968..a2ce97e 100644 --- a/configure.ac +++ b/configure.ac @@ -638,7 +638,7 @@ if test "$with_libvirtd" = "no" ; then with_lxc=no fi if test "$with_lxc" = "yes" || test "$with_lxc" = "check"; then - AC_TRY_LINK([#define _GNU_SOURCE + AC_TRY_LINK([ #include <sched.h> ], [ unshare (1); -- 1.7.4.4 -- Eric Blake eblake@xxxxxxxxxx +1-801-349-2682 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