From 94a32720c9977787dba929b522638fd9de3b10b1 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Wed, 19 Jul 2023 17:23:24 +0000 Subject: [PATCH] LU-16969 build: check that pkg-config is installed PKG_CHECK_MODULES macro fails in very annoying to debug ways. Often, this will fail with: syntax error near unexpected token `LIBNL3,' ` PKG_CHECK_MODULES(LIBNL3, libnl-genl-3.0 >= 3.1)' and provide no indication that the real error is that pkg-config is not installed. Adding an explicit check for pkg-config will make the error more self-evident. Test-Parameters: trivial Signed-off-by: Timothy Day Signed-off-by: James Simmons Change-Id: Ic2ee8e4c3ec3fa2e03c5ece03e6a9ce335133578 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51716 Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- configure.ac | 1 + lnet/autoconf/lustre-lnet.m4 | 3 +++ 2 files changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index 7c96386..4000a38 100644 --- a/configure.ac +++ b/configure.ac @@ -29,6 +29,7 @@ AC_PROG_MKDIR_P AC_PATH_PROG(FLEX, flex) AC_PATH_PROG(BISON, bison) AC_PATH_PROG(RPMBUILD, rpmbuild) +AC_PATH_PROG(PKGCONF, pkg-config) LUSTRE_VERSION_CPP_MACROS LB_CONFIGURE diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index 84a2b0d..acb1317 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -1211,6 +1211,9 @@ LB_CHECK_FILE([$GDS_PATH/nvfs-dma.h], ) # lnet/utils/lnetconfig/liblnetconfig_netlink.c +AS_IF([test "x$PKGCONF" = "x"], + [AC_MSG_ERROR([pkg-config package is required to configure Lustre])]) + AS_IF([test "x$enable_dist" = xno], [ PKG_CHECK_MODULES(LIBNL3, [libnl-genl-3.0 >= 3.1]) ]) -- 1.8.3.1