From 5f4c4a17072395bb8d54ab7b9e2d43ef05894c4d Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 8 Apr 2010 22:38:11 +0200 Subject: [PATCH] Build system: Make it possible to (conditionally) build the protobuf stuff. The dependency for the module is still missing, but I don't know how to specify that from the top of my head. --- configure.in | 7 ++++--- src/Makefile.am | 7 ++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/configure.in b/configure.in index c15cbcea..84cccba7 100644 --- a/configure.in +++ b/configure.in @@ -47,7 +47,8 @@ AC_PROG_LEX AC_PROG_YACC PKG_PROG_PKG_CONFIG -AC_CHECK_PROG([HAVE_PROTOC_C], [protoc-c], [yes], [no]) +AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no]) +AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes") AC_MSG_CHECKING([for kernel type ($host_os)]) case $host_os in @@ -4298,7 +4299,7 @@ AC_PLUGIN([openvpn], [yes], [OpenVPN client statistics]) AC_PLUGIN([oracle], [$with_oracle], [Oracle plugin]) AC_PLUGIN([perl], [$plugin_perl], [Embed a Perl interpreter]) # FIXME: Check for libevent, too. -AC_PLUGIN([pinba], [$HAVE_PROTOC_C], [Pinba statistics]) +AC_PLUGIN([pinba], [$have_protoc_c], [Pinba statistics]) AC_PLUGIN([ping], [$with_liboping], [Network latency statistics]) AC_PLUGIN([postgresql], [$with_libpq], [PostgreSQL database statistics]) AC_PLUGIN([powerdns], [yes], [PowerDNS statistics]) @@ -4541,7 +4542,7 @@ Configuration: libxmms . . . . . . . $with_libxmms libyajl . . . . . . . $with_libyajl libevent . . . . . . $with_libevent - protobuf-c . . . . . $HAVE_PROTOC_C + protobuf-c . . . . . $have_protoc_c oracle . . . . . . . $with_oracle python . . . . . . . $with_python diff --git a/src/Makefile.am b/src/Makefile.am index 53cfac2f..ca43fc9f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -809,7 +809,7 @@ endif if BUILD_PLUGIN_PINBA pkglib_LTLIBRARIES += pinba.la -pinba_la_SOURCES = pinba.c pinba-pb.c +pinba_la_SOURCES = pinba.c pinba.pb-c.c pinba.pb-c.h pinba_la_LDFLAGS = -module -avoid-version collectd_LDADD += "-dlopen" pinba.la collectd_DEPENDENCIES += pinba.la @@ -1239,6 +1239,11 @@ EXTRA_DIST += collectd.conf.pod \ echo "$@ has some POD errors!"; false; \ fi +if HAVE_PROTOC_C +pinba.pb-c.c pinba.pb-c.h: pinba.proto + protoc-c --c_out $(builddir) pinba.proto +endif + install-exec-hook: $(mkinstalldirs) $(DESTDIR)$(sysconfdir) if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \ -- 2.11.0