How to compile GnuTLS

前端 未结 7 619
太阳男子
太阳男子 2021-02-07 03:57

I\'m trying to compile GnuTLS library several times on Centos 6.2 but with no luck. These are the steps:

I downloaded Nettle 2.4

[root@localhost opt]# wg         


        
相关标签:
7条回答
  • 2021-02-07 04:35

    Had this problem on Debian for a while, try installing pkgconf package.

    0 讨论(0)
  • 2021-02-07 04:42

    Gnu TLS configure script does not say out loud that pkg-config is needed and other package may not even be tried if pkg-config is not installed. Installing pkg-config fixed the issue for me.

    0 讨论(0)
  • 2021-02-07 04:44
    configure:8798: checking for libnettle
    configure:8820: gcc -std=gnu99 -o conftest -g -O2   conftest.c  /usr/lib/libnettle.so /usr/lib/libhogweed.so -lgmp >&5
    /usr/bin/ld: cannot find -lgmp
    collect2: ld returned 1 exit status
    configure:8820: $? = 1
    configure: failed program was:
    configure:8830: result: no
    configure:8856: error: 
      ***
      *** Libnettle 2.4 was not found.
    

    I install gmp-devel. The problem is fixed.

    0 讨论(0)
  • 2021-02-07 04:53

    I installed nettle-dev & nettle-bin and it works :)

    0 讨论(0)
  • 2021-02-07 04:53

    Actually the problem was in configure script, incorrectly invoking the pkg-config Looks like its due to the version differences in autogen files. Anyway I fixed it in configure script.

    They invoke pkg-config with => operator but libnettle names itelf incorrectly. For example, they invoke $PKG_CONFIG --libs "nettle >= 3.4.1" 2>/dev/null

    The fix : so I just removed "=> 3.4.1" substring and voila:

        if test -n "$NETTLE_CFLAGS"; then
        pkg_cv_NETTLE_CFLAGS="$NETTLE_CFLAGS"
     elif test -n "$PKG_CONFIG"; then
        if test -n "$PKG_CONFIG" && \
        { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nettle\""; } >&5
      ($PKG_CONFIG --exists --print-errors "nettle") 2>&5
      ac_status=$?
      $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
      test $ac_status = 0; }; then
      pkg_cv_NETTLE_CFLAGS=`$PKG_CONFIG --cflags "nettle" 2>/dev/null`
                  test "x$?" != "x0" && pkg_failed=yes
    

    its for CFLAGS and down below for LIBS flag:

    if test -n "$NETTLE_LIBS"; then
        pkg_cv_NETTLE_LIBS="$NETTLE_LIBS"
     elif test -n "$PKG_CONFIG"; then
        if test -n "$PKG_CONFIG" && \
        { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"nettle\""; } >&5
      ($PKG_CONFIG --exists --print-errors "nettle") 2>&5
      ac_status=$?
      $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
      test $ac_status = 0; }; then
      pkg_cv_NETTLE_LIBS=`$PKG_CONFIG --libs "nettle" 2>/dev/null`
                  test "x$?" != "x0" && pkg_failed=yes
    else
      pkg_failed=yes
    fi
     else
        pkg_failed=untried
    fi
    
    0 讨论(0)
  • 2021-02-07 04:56

    GnuTLS depends on nettle which is missing on your environment.

    • You can download the nettle package and install
    cd nettle-xxx
    ./configure 
    make 
    sudo make install
    
    • Or if it is ubuntu system you can install from apt
    sudo apt install nettle-dev nettle-bin
    
    0 讨论(0)
提交回复
热议问题