Compile error: checking for libXaw... configure: error: No X toolkit could be found


Take a close look at the output file in your question:

[ ... ]
checking for lgetfilecon in -lselinux... no
checking for gnutls >= 2.6.6... no
checking for gnutls_certificate_set_verify_function... no
checking for xaw3d... no
checking for libXaw... configure: error: No X toolkit could be found.
If you are sure you want Emacs compiled without an X toolkit, pass --with-x-toolkit=no
to configure. Otherwise, install the development libraries for the toolkit
that you want to use (e.g. Gtk+) and re-run configure.


So it stopped, and asked you to choose:

  • Either you decide to build a text mode only programm. But then, you need to tell configure clearly.
    Run it as:

./configure --with-x-toolkit=no

Note, even if you do not want to use GUI functions, it may be good to build with X
support, because the system clipboard it handeled by X, and you may need to access it.

  • Or you provide some GUI library, X11 toolkit etc;
    Most probably you need to install some development packages for X
    According to What libraries do I need to install if I want to compile Emacs?,
    try installing this set of packages - you may already have most of it.

    All in one line:

    sudo apt-get install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev automake autoconf

You want to compile emacs yourself, but if you would only want to install it, Ubuntu has the version 24.3, with and without X: apt-get install emacs24 or with emacs24-nox


You should install the development library of GTK+. It it better to compile Emacs against the GTK+ 3 and not the older version which is GTK+ 2.

$ sudo apt-get install libgtk-3-dev