From 246d306eeb7db3d2f776f69b9596445d9b642907 Mon Sep 17 00:00:00 2001 From: Milan Broz Date: Sun, 22 Aug 2021 10:37:57 +0200 Subject: [PATCH] Check for argp library that can be standalone. Some systems without glibc provides standalone package for argp. --- configure.ac | 7 ++++++- tokens/Makemodule.am | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index e5e45cf1..4ed350da 100644 --- a/configure.ac +++ b/configure.ac @@ -404,10 +404,15 @@ PKG_CHECK_MODULES([JSON_C], [json-c]) AC_CHECK_DECLS([json_object_object_add_ex], [], [], [#include ]) AC_CHECK_DECLS([json_object_deep_copy], [], [], [#include ]) -dnl Check for libssh for SSH plugin +dnl Check for libssh and argp for SSH plugin if test "x$enable_ssh_token" = "xyes"; then PKG_CHECK_MODULES([LIBSSH], [libssh]) AC_CHECK_DECLS([ssh_session_is_known_server], [], [], [#include ]) + AC_CHECK_HEADER([argp.h], [], AC_MSG_ERROR([You need argp library.])) + saved_LIBS=$LIBS + AC_SEARCH_LIBS([argp_usage],[argp]) + AC_SUBST(ARGP_LIBS, $LIBS) + LIBS=$saved_LIBS fi dnl Crypto backend configuration. diff --git a/tokens/Makemodule.am b/tokens/Makemodule.am index 208150c6..4be7bc5d 100644 --- a/tokens/Makemodule.am +++ b/tokens/Makemodule.am @@ -21,7 +21,7 @@ cryptsetup_ssh_SOURCES = tokens/ssh/cryptsetup-ssh.c \ lib/utils_io.c \ lib/utils_loop.c cryptsetup_ssh_LDADD = -lm libcryptsetup.la @LIBSSH_LIBS@ @JSON_C_LIBS@ @POPT_LIBS@ \ - @PWQUALITY_LIBS@ @PASSWDQC_LIBS@ + @PWQUALITY_LIBS@ @PASSWDQC_LIBS@ @ARGP_LIBS@ cryptsetup_ssh_CFLAGS = $(AM_CFLAGS)