The pkg-config string to check, if gnutls is installed is "gnutls", not "libgnutls", the corresponding line in configure.ac:629, has to be updated to
PKG_CHECK_MODULES([GNUTLS], [gnutls >= 2.11.7], ...)
However, then the workarounds for missing pkg-config fail, and the linking parameters for gnutls are added to the GNUTLS_LIBS/GNUTLS_CFLAGS variables, but this variables are not used, so fixing PKG_CHECK_MODULE disables the workarounds for missing pkg-config, and the system does not find the correct linking flags anymore.
-- fix PKG_CHECK_MODULES to search for gnutls (instead of libgnutls), and
-- when pkg-config is not installed, fill in the lines afterwards (configure.ac:634-716) the variables GNUTLS_LIB and GNUTLS_CFLAGS, rather than appending to LIBS
-- use the variables GNUTLS_LIBS and GNUTLS_CFLAGS constistanly, and don't polute LIBS and CFLAGS
But even with broken PGK_CHECK_MODULES line, running just "./configure --with-gnutls", when libgnutls is on my default LDFLAGS-path (I set in /usr/local/etc/config.site export LDFLAGS="-L/usr/lib64 -L/lib64"), then the linker can link with -lgnutls without adding any additional flags. However, configure.ac in opendkim, tries to add -L/usr/local (in the line 'gcdirs="/usr/local /usr"'), and when the linking succeeds, it prints out, that -lgnutls was found in /usr/local . But it is in /usr/lib64 !
The linking succeeds here, because LDFLAGS was set correctly, not because after adding "-L/usr/local/lib" the linker finds -lgnutls.
That said, the workarounds for finding where gnutls are, shall try to insert additional paths (like -L/usr/local/lib), only if the paths contained in LDFLAGS are insufficient to link with -lgnutls.
Log in to post a comment.