From: Jim Meyering Date: Mon, 17 Aug 2009 16:44:37 +0000 (+0200) Subject: avoid compiler warnings about unused vars in generated code X-Git-Tag: 1.0.68~28 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=5a07cdc35856adfa25b8d0924a8d641b2320aadf;p=libguestfs.git avoid compiler warnings about unused vars in generated code * src/Makefile.am: Compile protocol.c into a convenience library, so it can have its own CFLAGS, and link that with the destination one. --- diff --git a/src/Makefile.am b/src/Makefile.am index c6006d2..9eb71b9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,6 +48,14 @@ BUILT_SOURCES = \ guestfs-actions.c \ guestfs-bindtests.c +# This convenience library is solely to avoid compiler warnings +# in its generated sources. +libprotocol_la_SOURCES = \ + guestfs_protocol.c \ + guestfs_protocol.h + +libprotocol_la_CFLAGS = -Wall -Wno-unused + $(BUILT_SOURCES): stamp-generator CLEANFILES = guestfs_protocol.c guestfs_protocol.h @@ -98,13 +106,15 @@ libguestfs_la_LDFLAGS = -version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR) libguestfs_la_SOURCES = \ guestfs.c \ guestfs.h \ - guestfs_protocol.c \ - guestfs_protocol.h \ guestfs-actions.h \ guestfs-actions.c \ guestfs-bindtests.c \ gettext.h +# Make libguestfs include the convenience library. +noinst_LTLIBRARIES = libprotocol.la +libguestfs_la_LIBADD = libprotocol.la + libguestfs_la_CFLAGS = -Wall -DGUESTFS_DEFAULT_PATH='"$(libdir)/guestfs"' if HAVE_RPCGEN