author | Ruben Kerkhof <ruben@tilaa.nl> | |
Sat, 28 Nov 2015 12:32:24 +0000 (13:32 +0100) | ||
committer | Ruben Kerkhof <ruben@tilaa.nl> | |
Sat, 28 Nov 2015 12:32:24 +0000 (13:32 +0100) |
Protoc
configure.ac | patch | blob | history | |
src/Makefile.am | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index bb400dea9c50cb735118c4a8df1f676a8c467773..62c5de515c364d76712d854d61790f49aa11a221 100644 (file)
--- a/configure.ac
+++ b/configure.ac
PKG_PROG_PKG_CONFIG
AC_CHECK_PROG([have_protoc_c], [protoc-c], [yes], [no])
-AC_CHECK_HEADERS([google/protobuf-c/protobuf-c.h],
- [have_protobuf_c_h="yes"],
- [have_protobuf_c_h="no"])
-if test "x$have_protoc_c" = "xyes" && test "x$have_protobuf_c_h" != "xyes"
+if test "x$have_protoc_c" = "xno"
then
- have_protoc_c="no (unable to find <google/protobuf-c/protobuf-c.h>)"
+ have_protoc_c="no (protoc-c compiler not found)"
+fi
+
+if test "x$have_protoc_c" = "xyes"
+then
+ AC_CHECK_HEADERS([protobuf-c/protobuf-c.h google/protobuf-c/protobuf-c.h],
+ [have_protoc_c="yes"; break],
+ [have_protoc_c="no (<google/protobuf-c/protobuf-c.h> not found)"])
+fi
+if test "x$have_protoc_c" = "xyes"
+then
+ AC_CHECK_LIB([protobuf-c], [protobuf_c_version],
+ [have_protoc_c="yes"],
+ [have_protoc_c="no (libprotobuf-c not found)"])
+
fi
AM_CONDITIONAL(HAVE_PROTOC_C, test "x$have_protoc_c" = "xyes")
diff --git a/src/Makefile.am b/src/Makefile.am
index 199adcfcafee10a08c8389689eadb7f92395934f..d2e6bd6f4c64e90a2643488f18525e783e4e4ea4 100644 (file)
--- a/src/Makefile.am
+++ b/src/Makefile.am
echo "$@ has some POD errors!"; false; \
fi
+AM_V_PROTOC_C = $(am__v_PROTOC_C_@AM_V@)
+am__v_PROTOC_C_ = $(am__v_PROTOC_C_@AM_DEFAULT_V@)
+am__v_PROTOC_C_0 = @echo " PROTOC-C " $@;
+am__v_PROTOC_C_1 =
+
# Protocol buffer for the "pinba" plugin.
EXTRA_DIST += pinba.proto
-if HAVE_PROTOC_C
+if BUILD_PLUGIN_PINBA
CLEANFILES += pinba.pb-c.c pinba.pb-c.h
BUILT_SOURCES += pinba.pb-c.c pinba.pb-c.h
pinba.pb-c.c pinba.pb-c.h: pinba.proto
- protoc-c -I$(srcdir) --c_out . $(srcdir)/pinba.proto
+ $(AM_V_PROTOC_C)protoc-c -I$(srcdir) --c_out . $(srcdir)/pinba.proto
endif
# Protocol buffer for the "write_riemann" plugin.
EXTRA_DIST += riemann.proto
-if HAVE_PROTOC_C
+if BUILD_PLUGIN_WRITE_RIEMANN
CLEANFILES += riemann.pb-c.c riemann.pb-c.h
BUILT_SOURCES += riemann.pb-c.c riemann.pb-c.h
riemann.pb-c.c riemann.pb-c.h: riemann.proto
- protoc-c -I$(srcdir) --c_out . $(srcdir)/riemann.proto
+ $(AM_V_PROTOC_C)protoc-c -I$(srcdir) --c_out . $(srcdir)/riemann.proto
endif
install-exec-hook: