]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
fix compilation against static libraries
authorDaniel Veillard <veillard@redhat.com>
Mon, 25 Feb 2008 13:55:56 +0000 (13:55 +0000)
committerDaniel Veillard <veillard@redhat.com>
Mon, 25 Feb 2008 13:55:56 +0000 (13:55 +0000)
* src/Makefile.am src/util-lib.h: fix done with Jim to allow
  compilation of virsh with the static libraries.
Daniel

ChangeLog
src/Makefile.am
src/util-lib.h

index be6b623a381605907666d0eb686e7c2e5ed0a566..3d8bb994a2cf7136ff489836e362bb91d449606a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Feb 25 14:53:59 CET 2008 Daniel Veillard <veillard@redhat.com>
+
+       * src/Makefile.am src/util-lib.h: fix done with Jim to allow
+         compilation of virsh with the static libraries.
+
 Mon Feb 25 10:59:43 CET 2008 Jim Meyering <meyering@redhat.com>
 
        Avoid new "make syntax-check" failures.
index 1da0d73865a701a789e3c5da5b2d01813325648e..b2bc900e6e1eed4881b5ea60b5ce343246d13e7f 100644 (file)
@@ -96,7 +96,7 @@ libvirt_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libvirt_sym.version \
                      -version-info @LIBVIRT_VERSION_INFO@ \
                     $(COVERAGE_CFLAGS:-f%=-Wc,-f%) \
                    @CYGWIN_EXTRA_LDFLAGS@ @MINGW_EXTRA_LDFLAGS@
-libvirt_la_CFLAGS = $(COVERAGE_CFLAGS)
+libvirt_la_CFLAGS = $(COVERAGE_CFLAGS) -DIN_LIBVIRT
 
 bin_PROGRAMS = virsh
 
index 4a148105d87dc466bdbc52a3472c06a754bf6a2d..c256289c7544a133383ded41a324508b47ab9151 100644 (file)
 
 #include <sys/types.h>
 
+/*
+ * To avoid a double definition of the function when compiling
+ * programs using both util-lib and libvirt, like virsh
+ */
+#ifdef IN_LIBVIRT
+#define saferead libvirt_saferead
+#define safewrite libvirt_safewrite
+#endif
+
 int saferead(int fd, void *buf, size_t count);
 ssize_t safewrite(int fd, const void *buf, size_t count);