diff options
| author | Cy Schubert <cy@FreeBSD.org> | 2025-10-07 13:46:20 +0000 |
|---|---|---|
| committer | Cy Schubert <cy@FreeBSD.org> | 2025-10-07 13:46:20 +0000 |
| commit | 0064eb9cf1c8d526e87d3149249445d4bc8d0248 (patch) | |
| tree | 787781364f76fc0dfa0085fd1f3208b5b1f44b5a /dnstap/dnstap.m4 | |
| parent | c8864f6ba46ff3271d97b4ae1c3cc6ce01eaf18a (diff) | |
unbound: Vendor import 1.24.0vendor/unbound/1.24.0
Release notes at
https://nlnetlabs.nl/news/2025/Sep/18/unbound-1.24.0-released/
Diffstat (limited to 'dnstap/dnstap.m4')
| -rw-r--r-- | dnstap/dnstap.m4 | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/dnstap/dnstap.m4 b/dnstap/dnstap.m4 index 78d0dd68b762..89eda929bfb3 100644 --- a/dnstap/dnstap.m4 +++ b/dnstap/dnstap.m4 @@ -18,10 +18,41 @@ AC_DEFUN([dt_DNSTAP], [opt_dnstap_socket_path="$1"]) if test "x$opt_dnstap" != "xno"; then - AC_PATH_PROG([PROTOC_C], [protoc-c]) - if test -z "$PROTOC_C"; then - AC_MSG_ERROR([The protoc-c program was not found. Please install protobuf-c!]) - fi + AC_PATH_PROG([PROTOC], [protoc]) + # 'protoc-c' is deprecated. We use 'protoc' instead. If it can not be + # found, try 'protoc-c'. + if test -z "$PROTOC"; then + AC_PATH_PROG([PROTOC_C], [protoc-c]) + else + PROTOC_C="$PROTOC" + fi + if test -z "$PROTOC_C"; then + AC_MSG_ERROR([[The protoc or protoc-c program was not found. It is needed for dnstap, use --disable-dnstap, or install protobuf-c to provide protoc or protoc-c]]) + fi + + # Check for protoc-gen-c plugin + AC_PATH_PROG([PROTOC_GEN_C], [protoc-gen-c]) + if test -z "$PROTOC_GEN_C"; then + AC_MSG_ERROR([[The protoc-gen-c plugin was not found. It is needed for dnstap, use --disable-dnstap, or install protobuf-c-compiler to provide protoc-gen-c]]) + fi + + # Test that protoc-gen-c actually works + AC_MSG_CHECKING([if protoc-gen-c plugin works]) + cat > conftest.proto << EOF +syntax = "proto2"; +message TestMessage { + optional string test_field = 1; +} +EOF + if $PROTOC_C --c_out=. conftest.proto >/dev/null 2>&1; then + AC_MSG_RESULT([yes]) + rm -f conftest.proto conftest.pb-c.c conftest.pb-c.h + else + AC_MSG_RESULT([no]) + rm -f conftest.proto conftest.pb-c.c conftest.pb-c.h + AC_MSG_ERROR([[The protoc-gen-c plugin is not working properly. Please ensure protobuf-c-compiler is properly installed]]) + fi + AC_ARG_WITH([protobuf-c], AS_HELP_STRING([--with-protobuf-c=path], [Path where protobuf-c is installed, for dnstap]), [ |
