From: W.C.A. Wijngaards Date: Tue, 29 Apr 2025 10:43:56 +0000 (+0200) Subject: - Fix dnstap to use protoc. X-Git-Tag: release-1.24.0rc1~104 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a904a3a2c29a5440d1e1bb0802b064c40fd2626a;p=thirdparty%2Funbound.git - Fix dnstap to use protoc. --- diff --git a/configure b/configure index ac1a22790..adbd18b9e 100755 --- a/configure +++ b/configure @@ -686,6 +686,7 @@ ENABLE_DNSTAP PROTOBUFC_LIBS PROTOBUFC_CFLAGS PROTOC_C +PROTOC UBSYMS EXTRALINK COMMON_OBJ_ALL_SYMBOLS @@ -24249,7 +24250,55 @@ fi if test "x$opt_dnstap" != "xno"; then - # Extract the first word of "protoc-c", so it can be a program name with args. + # Extract the first word of "protoc", so it can be a program name with args. +set dummy protoc; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PROTOC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $PROTOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PROTOC="$PROTOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PROTOC="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PROTOC=$ac_cv_path_PROTOC +if test -n "$PROTOC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PROTOC" >&5 +printf "%s\n" "$PROTOC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + # 'protoc-c' is deprecated. We use 'protoc' instead. If it can not be + # found, try 'protoc-c'. + if test -z "$PROTOC"; then + # Extract the first word of "protoc-c", so it can be a program name with args. set dummy protoc-c; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } @@ -24294,9 +24343,12 @@ printf "%s\n" "no" >&6; } fi - if test -z "$PROTOC_C"; then - as_fn_error $? "The protoc-c program was not found. Please install protobuf-c!" "$LINENO" 5 - fi + else + PROTOC_C="$PROTOC" + fi + if test -z "$PROTOC_C"; then + as_fn_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" "$LINENO" 5 + fi # Check whether --with-protobuf-c was given. if test ${with_protobuf_c+y} diff --git a/dnstap/dnstap.m4 b/dnstap/dnstap.m4 index 78d0dd68b..166402d81 100644 --- a/dnstap/dnstap.m4 +++ b/dnstap/dnstap.m4 @@ -18,10 +18,17 @@ 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 AC_ARG_WITH([protobuf-c], AS_HELP_STRING([--with-protobuf-c=path], [Path where protobuf-c is installed, for dnstap]), [ diff --git a/doc/Changelog b/doc/Changelog index 68a10be60..bdbfc3adc 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 29 April 2025: Wouter - Fix for parallel build of dnstap protoc-c output. + - Fix dnstap to use protoc. 28 April 2025: Yorgos - Merge #1275: Use macros for the fr_check_changed* functions.