Whamcloud - gitweb
LU-16969 build: check that pkg-config is installed 16/51716/3
authorTimothy Day <timday@amazon.com>
Wed, 19 Jul 2023 17:23:24 +0000 (17:23 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 1 Aug 2023 06:15:34 +0000 (06:15 +0000)
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 <timday@amazon.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Change-Id: Ic2ee8e4c3ec3fa2e03c5ece03e6a9ce335133578
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51716
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
configure.ac
lnet/autoconf/lustre-lnet.m4

index 7c96386..4000a38 100644 (file)
@@ -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
index 84a2b0d..acb1317 100644 (file)
@@ -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])
 ])