2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-03 08:05:21 +00:00

Print out the Userspace-RCU flavor and version

The `named -V` now prints out the liburcu flavor used and the
compile-time version.
This commit is contained in:
Ondřej Surý
2023-04-24 13:32:34 +02:00
parent 7d1ceaf35d
commit 6948060e01
3 changed files with 64 additions and 19 deletions

View File

@@ -591,6 +591,7 @@ printversion(bool verbose) {
printf("compiled with libuv version: %d.%d.%d\n", UV_VERSION_MAJOR,
UV_VERSION_MINOR, UV_VERSION_PATCH);
printf("linked to libuv version: %s\n", uv_version_string());
printf("compiled with %s version: %s\n", RCU_FLAVOR, RCU_VERSION);
#if HAVE_LIBNGHTTP2
nghttp2_info *nginfo = NULL;
printf("compiled with libnghttp2 version: %s\n", NGHTTP2_VERSION);

View File

@@ -201,34 +201,43 @@ PKG_PROG_PKG_CONFIG
AS_IF([test -z "$PKG_CONFIG"],
[AC_MSG_ERROR([The pkg-config script could not be found or is too old.])])
#
# Pick Userspace-RCU flavor (developer only option)
#
# [pairwise: --with-liburcu=membarrier, --with-liburcu=qsbr, --with-libucru=mb, --with-liburcu=signal, --with-liburcu=bp]
AC_ARG_WITH([liburcu],
[AS_HELP_STRING([--with-liburcu=FLAVOR],
[Build with Userspace-RCU variant (membarrier|qsbr|mb|signal|bp) [default=membarrier]]))],
[], [with_liburcu=membarrier])
#
# Pick Userspace-RCU flavor (developer only option)
#
AC_MSG_CHECKING([liburcu flavor])
AS_CASE([$with_liburcu],
[membarrier],[AC_MSG_RESULT([membarrier])
PKG_CHECK_MODULES([LIBURCU], [liburcu liburcu-cds])
[membarrier],
[RCU_FLAVOR="liburcu"
AC_DEFINE([RCU_MEMBARRIER], [1], [Build with membarrier Userspace-RCU flavor])],
[qsbr],[AC_MSG_RESULT([qsbr])
PKG_CHECK_MODULES([LIBURCU], [liburcu-qsbr liburcu-cds])
[qsbr],
[RCU_FLAVOR="liburcu-qsbr"
AC_DEFINE([RCU_QSBR], [1], [Build with QSBR Userspace-RCU flavor])],
[mb],[AC_MSG_RESULT([mb])
PKG_CHECK_MODULES([LIBURCU], [liburcu-mb liburcu-cds])
[mb],
[RCU_FLAVOR="liburcu-mb"
AC_DEFINE([RCU_MB], [1], [Build with mb Userspace-RCU flavor])],
[signal],[AC_MSG_RESULT([signal])
PKG_CHECK_MODULES([LIBURCU], [liburcu-signal liburcu-cds])
[signal],
[RCU_FLAVOR="liburcu-signal"
AC_DEFINE([RCU_SIGNAL], [1], [Build with signal Userspace-RCU flavor])],
[bp],[AC_MSG_RESULT([bulletproof])
PKG_CHECK_MODULES([LIBURCU], [liburcu-bp liburcu-cds])
AC_DEFINE([RCU_BP], [1], [Pick bulletproof Userspace-RCU flavor])],
[bp],
[RCU_FLAVOR="liburcu-bp"
AC_DEFINE([RCU_BP], [1], [Build with bulletproof Userspace-RCU flavor])],
[AC_MSG_ERROR([Invalid Userspace-RCU flavor picked])])
AC_MSG_RESULT([$RCU_FLAVOR])
PKG_CHECK_MODULES([LIBURCU], [$RCU_FLAVOR liburcu-cds])
AC_DEFINE_UNQUOTED([RCU_FLAVOR], ["$RCU_FLAVOR"], [Chosen Userspace-RCU flavor])
PKG_CHECK_VERSION([RCU_VERSION], [$RCU_FLAVOR])
AC_DEFINE_UNQUOTED([RCU_VERSION], ["$RCU_VERSION"], [Compile-time Userspace-RCU version])
# Fuzzing is not included in pairwise testing as fuzzing tools are
# not present in the relevant Docker image.
#

35
m4/pkg-modversion.m4 Normal file
View File

@@ -0,0 +1,35 @@
# SPDX-License-Identifier: FSFAP
#
# ===========================================================================
# https://gitlab.isc.org/isc-projects/autoconf-archive/ax_jemalloc.html
# ===========================================================================
#
# SYNOPSIS
#
# PKG_CHECK_VERSION(VARIABLE, MODULE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# DESCRIPTION
#
# Retrieves the value of the pkg-config version for the given module.
#
# LICENSE
#
# Copyright (c) 2023 Internet Systems Consortium
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 1
#
AC_DEFUN([PKG_CHECK_VERSION],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [version of $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [modversion], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$4], [$3])dnl
])dnl PKG_CHECK_VERSION