From: Daniel Veillard Date: Mon, 25 Feb 2008 13:55:56 +0000 (+0000) Subject: fix compilation against static libraries X-Git-Tag: LIBVIRT_0_4_1~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b1cd481b83239aa46369a1c7c57c289f5a24d9f;p=thirdparty%2Flibvirt.git fix compilation against static libraries * src/Makefile.am src/util-lib.h: fix done with Jim to allow compilation of virsh with the static libraries. Daniel --- diff --git a/ChangeLog b/ChangeLog index be6b623a38..3d8bb994a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 25 14:53:59 CET 2008 Daniel Veillard + + * 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 Avoid new "make syntax-check" failures. diff --git a/src/Makefile.am b/src/Makefile.am index 1da0d73865..b2bc900e6e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/util-lib.h b/src/util-lib.h index 4a148105d8..c256289c75 100644 --- a/src/util-lib.h +++ b/src/util-lib.h @@ -10,6 +10,15 @@ #include +/* + * 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);