About the role of GnuTLS for Emacs compilation

Image credit: Emacs logo

Table of Contents

Reasons for Emacs compilation failure

GnuTLS not found

This error can be resolved by the following command.

  ./configure --with-gnutls=no

Lack of some basic dependencies

Modify the configuration options according to the error messages so that the compilation after this will not apply to these dependencies.

No write permission

It also often causes compilation errors when there is no white permission outside the user directory. At this time, perform the following configuration.

  bash configure --prefix=$HOME/.local --with-gif=no --with-gnutls=no

About the above example, when finished make, Emacs will be installed under the path $HOME/.local.

Problems caused by incomplete installation

Because when opening the https hyperlink in Emacs, Emacs will call GnuTLS which provides SSL, TLS, and DTLS protocol support. If Emacs is installed without GnuTLS, it will only support http hyperlinks but not support https hyperlinks. This not only reduces safety, but also greatly shrinks functionality.

Reduced safety

For example, Emacs needs to download some lisp packages from online repositories such as Melpa.org during initialization. At this time, none of the https links in the Emacs configuration file can be accessed. If you replace all the https links in the configuration file with http links, you can temporarily solve the problem, but the security will be reduced.

Functional shrinkage

For example, when using the lisp package google-translate in Emacs to implement the translation function, even if you change all https in *.el under the path of elpa to http, there are still some functions for the translation service that need use https, which resulting some translation exceptions.

By the way, after modifying the configuration in *.el, you need to delete the previously existing *.elc for the modification to take effect.

Install Gnutls

To solve the above problems, the most convenient method is to install GnuTLS to the current environment. Take OpenSUSE as an example, execute the following command to install GnuTLS.

  sudo zypper install gnutls

After GnuTLS installation is complete, when reconfiguring Emacs compilation options, remove the --with-gnutls=no option and complete the compilation and installation.

Something else

Error message

  checking for library containing tputs... no
  configure: error: The required function 'tputs' was not found in any library.
  The following libraries were tried (in order):
    libtinfo, libncurses, libterminfo, libcurses, libtermcap
  Please try installing whichever of these libraries is most appropriate
  for your system, together with its header files.
  For example, a libncurses-dev(el) or similar package.
  make: *** No targets specified and no makefile found.  Stop.
  make: *** No rule to make target 'install'.  Stop.


(For OpenSUSE)

  sudo zypper install ncurses-devel

Edit this page

Xin Li
Xin Li

Research in areas such as machine learning, deep learning, and artificial intelligence applications, specialize in priority sampling and learning algorithm for non-uniform data and offset data.Learn more

comments powered by Disqus