]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix dnstap to use protoc.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 29 Apr 2025 10:43:56 +0000 (12:43 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 29 Apr 2025 10:43:56 +0000 (12:43 +0200)
configure
dnstap/dnstap.m4
doc/Changelog

index ac1a22790af2a2c001e072e8227d89c1b75ce168..adbd18b9ef32e26a1999c63b69925c05afb64c9d 100755 (executable)
--- a/configure
+++ b/configure
@@ -686,6 +686,7 @@ ENABLE_DNSTAP
 PROTOBUFC_LIBS
 PROTOBUFC_CFLAGS
 PROTOC_C
+PROTOC
 UBSYMS
 EXTRALINK
 COMMON_OBJ_ALL_SYMBOLS
 
 
     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}
index 78d0dd68b7626d26b28a29072b23c8a177b774d4..166402d8136c24169058d6147d8887639ac3923e 100644 (file)
@@ -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]),
             [
index 68a10be60d8bd09e39dc55b10dd5b7f95602e34c..bdbfc3adccb1a8a194666b06ead95e626e5c09f7 100644 (file)
@@ -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.