1

I am trying to cross compile gnutls. Gnutls depends on libnettle. I was able to cross compile libnettle, however, when trying to cross compile gnutls, I encounter an error during configure:

configure: error:  Libnettle 2.2 was not found. 

The libnettle version I cross compiled was 2.2.

Command to configure is:

./configure --host=mips --prefix=/home/tom/lib/gnutls-3.0.3 CC=/crosstools/mips-gcc CXX=/crosstools/mips-g++ --enable-shared --with-libnettle-prefix=/home/tom/lib/nettle-2.2

I have also tried: configure with LDFLAGS="-L/home/tom/lib/nettle-2.2" with no luck.

The libs are installed in /home/tom/lib/nettle-2.2/lib. I have also tried this directory. For some reason libnettle is not getting detected. Anyone know why?

Hasturkun
  • 35,395
  • 6
  • 71
  • 104
tommy
  • 11
  • 1
  • 2
  • Try `LFLAGS` instead and look in the output of `configure` (config.log). What fails? – Alex B Oct 09 '11 at 09:54
  • but what's in config.log? It should have what test program was compiled to detect libnettle and what made it fail. – Alex B Oct 10 '11 at 04:01
  • Thank you for your reply, Alex. I have tried with LFLAGS instead, and encounter the same thing. configure:8351: checking for libnettle configure:8370: /crosstoolsmips64/bin/mips-gcc -std= gnu99 -o conftest -g -O2 conftest.c -lnettle -lhogweed -lgmp >&5 conftest.c:36:24: nettle/gcm.h: No such file or directory conftest.c: In function `main': conftest.c:40: warning: implicit declaration of function `gcm_set_iv' configure:8370: $? = 1 configure: failed program was: | /* confdefs.h */ configure:8380: result: no configure:8406: error: *** *** Libnettle 2.2 was not found. – tommy Oct 10 '11 at 04:02
  • As you can see it can't even compile, because it doesn't find the headers. Maybe it doesn't respect `--with-libnettle-prefix` setting or it's not the correct path. – Alex B Oct 10 '11 at 04:11

1 Answers1

1

Based on a similar question and my own personal experience, gnutls needs to see both libnettle and libhogweed in order to get past this check. A nettle build will build both, but only if you also have GMP libraries on the system as well.

Here are some steps to perform to get this working:

  1. Check your /home/tom/lib/nettle-2.2/lib directory and ensure that you have both libnettle.so and libhogweed.so.
  2. If you don't have libhogweed.so, you will have to rebuild nettle with GMP. Your distro may have a gmp-devel package that will install the necessary GMP library (mine did, so I didn't try building GMP from source)
  3. You should then be able to build gnutls, or at the very least, get past the check for libnettle.
Community
  • 1
  • 1
Vector
  • 173
  • 3
  • 6