Hi Jia,
> I will still have a link failure with crypto/gc-sm3 and even
> crypto/gc.
>
> In order to reproduce this link failure, I need to have a latest
> libgcrypt installed, and then configure gnulib in this way:
>
> $ ./gnulib-tool --create-testdir --dir=testdir --single-configure
> crypto/gc-sm3 // or crypto/gc
> $ cd testdir
> $ ./configure CPPFLAGS=-Wall --with-libgcrypt
> --with-libgcrypt-prefix=<path_to_libgcrypt> // with gc-libgcrypt
> $ make
>
> ... the gc-libgcrypt case will require
> libgcrypt, and we will see a link failure.
>
> To fix this issue, I must specify *--libtool* with gnulib-tool.
In normal situations, you need libtool only for _creating_ shared
libraries, not for merely linking with shared libraries. And a
gnulib testdir does not create shared libraries.
What exactly was the link error about? Did it not find libgcrypt,
or did it not find a dependency of it (libgpg-error)?
Did you install the "latest libgcrypt" in system directories?
If yes, try running ldconfig.
If no, the AC_LIB_HAVE_LINKFLAGS macro may not work right for you.
- As a workaround, try using
CPPFLAGS="-I<path_to_libgcrypt>/include" LDFLAGS="-L<path_to_libgcrypt>/lib
-Wl,-rpath,<path_to_libgcrypt>/lib"
- or maybe you are on a bi-arch system, and there is a mismatch
between 'lib' and lib64'. You can resolve this by placing a symlink
lib64 -> lib or lib -> lib64.
Bruno