[libvirt] [PATCH] Workaround python header file insanity

2012-02-24 Thread Daniel P. Berrange
From: Daniel P. Berrange berra...@redhat.com

The /usr/include/python/pyconfig.h file pollutes the global
namespace with a huge number of HAVE_XXX and WITH_XXX
defines. These change what we detected in our own config.h
In particular if you try to build without DTrace, python's
headers turn it back on with predictable fail.

THe hack to workaround this is to rename WITH_DTRACE to
WITH_DTRACE_PROBES to avoid the namespace clash
---
 configure.ac   |4 ++--
 daemon/Makefile.am |2 +-
 src/Makefile.am|4 ++--
 src/internal.h |2 +-
 tests/Makefile.am  |2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index 732f4fe..262e63b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1378,10 +1378,10 @@ if test $with_dtrace != no ; then
 with_dtrace=yes
   fi
   if test $with_dtrace = yes; then
-AC_DEFINE_UNQUOTED([WITH_DTRACE], 1, [whether DTrace static probes are 
available])
+AC_DEFINE_UNQUOTED([WITH_DTRACE_PROBES], 1, [whether DTrace static probes 
are available])
   fi
 fi
-AM_CONDITIONAL([WITH_DTRACE], [test $with_dtrace != no])
+AM_CONDITIONAL([WITH_DTRACE_PROBES], [test $with_dtrace != no])
 
 
 dnl NUMA lib
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index e2c1357..db4abf5 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -109,7 +109,7 @@ libvirtd_LDADD =\
$(SASL_LIBS)\
$(POLKIT_LIBS)
 
-if WITH_DTRACE
+if WITH_DTRACE_PROBES
 libvirtd_LDADD += ../src/probes.o
 endif
 
diff --git a/src/Makefile.am b/src/Makefile.am
index d5f52a0..9b1921d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1284,7 +1284,7 @@ libvirt_la_CFLAGS = -DIN_LIBVIRT $(AM_CFLAGS)
 # picked out for us.
 libvirt_la_DEPENDENCIES = $(libvirt_la_BUILT_LIBADD) $(LIBVIRT_SYMBOL_FILE)
 
-if WITH_DTRACE
+if WITH_DTRACE_PROBES
 libvirt_la_BUILT_LIBADD += probes.o
 libvirt_la_DEPENDENCIES += probes.o
 nodist_libvirt_la_SOURCES = probes.h
@@ -1521,7 +1521,7 @@ libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \
$(LIBNL_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) \
$(RT_LIBS) \
../gnulib/lib/libgnu.la
-if WITH_DTRACE
+if WITH_DTRACE_PROBES
 libvirt_lxc_LDADD += probes.o
 endif
 if WITH_SECDRIVER_SELINUX
diff --git a/src/internal.h b/src/internal.h
index fabcb52..3408541 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -247,7 +247,7 @@
 # define VIR_DIV_UP(value, size) (((value) + (size) - 1) / (size))
 
 
-# if WITH_DTRACE
+# if WITH_DTRACE_PROBES
 #  ifndef LIBVIRT_PROBES_H
 #   define LIBVIRT_PROBES_H
 #   include probes.h
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3fb9e2f..9974c2f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -29,7 +29,7 @@ INCLUDES += \
 endif
 
 PROBES_O =
-if WITH_DTRACE
+if WITH_DTRACE_PROBES
 PROBES_O += ../src/probes.o
 endif
 
-- 
1.7.7.6

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


Re: [libvirt] [PATCH] Workaround python header file insanity

2012-02-24 Thread Eric Blake
On 02/24/2012 08:13 AM, Daniel P. Berrange wrote:
 From: Daniel P. Berrange berra...@redhat.com
 
 The /usr/include/python/pyconfig.h file pollutes the global
 namespace with a huge number of HAVE_XXX and WITH_XXX
 defines. These change what we detected in our own config.h
 In particular if you try to build without DTrace, python's
 headers turn it back on with predictable fail.
 
 THe hack to workaround this is to rename WITH_DTRACE to
 WITH_DTRACE_PROBES to avoid the namespace clash
 ---
  configure.ac   |4 ++--
  daemon/Makefile.am |2 +-
  src/Makefile.am|4 ++--
  src/internal.h |2 +-
  tests/Makefile.am  |2 +-
  5 files changed, 7 insertions(+), 7 deletions(-)

ACK.  (And I really wish python would clean up their act).

-- 
Eric Blake   ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc
Description: OpenPGP digital signature
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list