Skip to content

Commit

Permalink
build: don't link everything against libgcrypt
Browse files Browse the repository at this point in the history
Use AM_PATH_LIBGCRYPT instead of AC_CHECK_LIB for checking
libgcrypt, with doesn't add -lgcrypt to the globac $LIBS.

Fixes: #1365

Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
  • Loading branch information
tstruk committed Jan 29, 2020
1 parent 41f555a commit 3c98f73
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,9 @@ AM_CONDITIONAL(ESYS_GCRYPT, test "x$with_crypto" = "xgcrypt")

AS_IF([test "x$enable_esapi" = xyes],
[AS_IF([test "x$with_crypto" = xgcrypt], [
AC_CHECK_HEADER([gcrypt.h],,
[AC_MSG_ERROR([Missing required header: gcrypt.h.])])
AC_CHECK_LIB([gcrypt],
[gcry_mac_open],,
[AC_MSG_ERROR([Missing required library: gcrypt.])])
TSS2_ESYS_CFLAGS_CRYPTO=""
TSS2_ESYS_LDFLAGS_CRYPTO="-lgcrypt"
AM_PATH_LIBGCRYPT([1.6.0], [], [AC_MSG_ERROR([Missing required gcrypt library])])
TSS2_ESYS_CFLAGS_CRYPTO="$LIBGCRYPT_CFLAGS"
TSS2_ESYS_LDFLAGS_CRYPTO="$LIBGCRYPT_LIBS"
], [test "x$with_crypto" = xossl], [
PKG_CHECK_MODULES([LIBCRYPTO], [libcrypto])
AC_DEFINE([OSSL], [1], [OpenSSL cryptographic backend])
Expand Down

5 comments on commit 3c98f73

@mrwiora
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tstruk
running a ./configure currently leads to:

./configure: line 13909: syntax error near unexpected token `1.6.0,'
./configure: line 13909: `           AM_PATH_LIBGCRYPT(1.6.0, , AC_MSG_ERROR([Missing required gcrypt library]))'

it gets solved by removing line 141 - which seems introduced with this commit...
Just in case someone has the same issue...

Cheers,
Matthias

@tstruk
Copy link
Contributor Author

@tstruk tstruk commented on 3c98f73 Feb 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tstruk
running a ./configure currently leads to:

./configure: line 13909: syntax error near unexpected token `1.6.0,'
./configure: line 13909: `           AM_PATH_LIBGCRYPT(1.6.0, , AC_MSG_ERROR([Missing required gcrypt library]))'

it gets solved by removing line 141 - which seems introduced with this commit...
Just in case someone has the same issue...

Thanks for the report, but please see https://github.com/tpm2-software/tpm2-tss/blob/master/INSTALL.md#gnulinux
and the note about AM_PATH_LIBGCRYPT. Looks like you are missing the libgcrypt-dev dependency.

@mrwiora
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually I installed libgcrypt-dev via apt on my debian 10 (libgcrypt20-dev/stable 1.8.4-5 amd64), as well as I've compiled (and installed) version 1.6.0 from https://gnupg.org/ftp/gcrypt/libgcrypt/ - the issue persisted...

@tstruk
Copy link
Contributor Author

@tstruk tstruk commented on 3c98f73 Feb 20, 2020 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrwiora
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are so right - rerunning ./bootstrap after install libgcrypt-dev solves the issue.
Case closed :) and THANKS!

Please sign in to comment.