Answer

问题及解答

编译 gnttls-3.6.7 可能出现的问题

Posted by haifeng on 2019-05-06 09:09:52 last update 2019-05-06 12:12:38 | Edit | Answers (0)

/usr/local/src/gnutls-3.6.7/build-aux/missing: line 81: makeinfo: command not found

此时需要安装 texinfo

# apt-get install texinfo

 

# export NETTLE_CFLAGS="-I/usr/local/include/nettle" NETTLE_LIBS="-L/usr/lib64 -lnettle" HOGWEED_CFLAGS="-I/usr/local/include/nettle" HOGWEED_LIBS="-L/usr/lib64 -lhogweed" P11_KIT_CFLAGS="-I/usr/local/include/p11-kit-1/p11-kit" P11_KIT_LIBS="-L/usr/local/lib -lp11-kit" LIBTASN1_CFLAGS="-I/usr/local/include" LIBTASN1_LIBS="-L/usr/local/lib -ltasn1"

# ./configure --prefix=/usr/local --disable-guile --with-default-trust-store-pkcs11="pkcs11:" --with-included-unistring

 

# make

出现下面的错误

In file included from verify.c:40:0:
supported_exts.gperf:26:1: warning: no previous prototype for 'is_ext_oid_supported' [-Wmissing-prototypes]
  CC       x509.lo
In file included from x509.c:38:0:
./../pkcs11_int.h:27:28: fatal error: p11-kit/pkcs11.h: No such file or directory
compilation terminated.
make[5]: *** [x509.lo] Error 1

直接将 p11-kit 文件夹拷贝到 gnutls-3.6.7源码所在的 lib/ 文件夹下.

# cp -R /usr/local/include/p11-kit-1/p11-kit/ /usr/local/src/gnutls-3.6.7/lib/p11-kit

重新 make

回到 php-7.3.5 的目录

make

/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_module_get_name'
/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_module_get_flags'
/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_uri_get_pin_value'
/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_module_finalize'
/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_module_release'
/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_module_load'
/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_config_option'
/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_modules_load_and_initialize'
/usr/local/lib/libgnutls.so.30: undefined reference to `p11_kit_module_initialize'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

 

# sudo apt-get remove libp11-kit-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgpg-error-dev libgnutls-openssl27 libgnutlsxx27 libidn11-dev libgcrypt11-dev libldap2-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  libcurl4-openssl-dev libgnutls-dev libp11-kit-dev librtmp-dev
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 5,458 kB disk space will be freed.
Do you want to continue [Y/n]? y

make

/usr/bin/ld: cannot find -lcurl

源码安装 curl, 并删除系统中不再使用的软件包

The following packages were automatically installed and are no longer required:
  libgpg-error-dev libgnutls-openssl27 libgnutlsxx27 libidn11-dev libgcrypt11-dev libldap2-dev
Use 'apt-get autoremove' to remove them.

/usr/bin/ld: cannot find -lldap

 

 

 

 


References:

  1. http://linuxfromscratch.org/blfs/view/svn/postlfs/gnutls.html
  2. https://amon.org/gnutls
  3. https://www.gnutls.org/manual/html_node/gnutls_002dcli-Invocation.html