4

I'm trying to build GnuTLS-3.x on my OS X Lion and here is my configure command:

./configure --prefix=/usr/local/gnutls-3.4.9 --with-included-libtasn1 --without-p11-kit

It ends up

checking for NETTLE... no
configure: error:
  ***
  *** Libnettle 3.4.1 was not found.

though libnettle-3.4.1 is installed under /usr/local/libnettle-3.4.1 and its pkg-config file libnettle.pc is defined under /usr/local/lib/pkgconfig (I've built nettle-4.3.1 from source successfully)

I've read the stackoverflow post GnuTLS Libnettle 3.4 was not found but it didn't help a bit. All other posts on the Internet didn't help either.

I'm stuck on this error. Any help is appreciated. Thanks.

Terry
  • 1,099
  • 7
  • 22

2 Answers2

2

I've found the cause of the problem. It was the incorrectly defined environment variable PKG_CONFIG. It was set just to the installation directory of the pkg-config i.e. /usr/local/pkg-config-0.28

However it looks like that it must have been set to the full path plus the pkg-config command itself, like: /usr/local/pkg-config-0.28/bin/pkg-config

Terry
  • 1,099
  • 7
  • 22
0

PKG_CONFIG should include nettle.pc and hogweed.pc, which were not copied to /usr/lib/pkgconfig/ in my build of nettle3 on Linux Ubuntu 20.04 x64, so I had to configure gnutls3 as follows:

PKG_CONFIG_PATH="$NETTLE3_ROOT:$PKG_CONFIG_PATH" ./configure --with-included-libtasn1 --with-included-unistring

where NETTLE3_ROOT is the path of nettle3 sources.

luart
  • 1,135
  • 1
  • 13
  • 22
  • Just seen the answer. Good to see further information on the usage of `Nettle` and anything related to `GNUTLS` as they are very inclined to cause dirty problems on `macOS` – Terry Sep 29 '20 at 14:55