问题
I am trying to build Emacs 24.0.94 with X support on a 64-bit SUSE Linux (10.2 Enterprise release) box. I see that the X11 libraries are installed in /usr/lib/X11R6 and I am telling the configure script to look for them in that location:
--x-includes=/usr/X11R6/include:/usr/include --x-libraries=/usr/X11R6/lib64:/usr/lib64
Even with the above options, the configure script complains that it cannot find any X toolkit:
checking X11 version 6... before 6
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for librsvg-2.0 >= 2.11.0... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for Wand >= 6.2.8... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for gtk+-2.0 >= 2.10 glib-2.0 >= 2.10... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for dbus-1 >= 1.0... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for gio-2.0 >= 2.26... no
checking for pkg-config... (cached) /usr/bin/pkg-config
checking for gconf-2.0 >= 2.13... no
checking for lgetfilecon in -lselinux... no
checking for pkg-config... (cached) /usr/bin/pkg-config
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.
How can I fix this?
回答1:
On SUSE Linux you will typically want to compile Emacs with support for GTK, so you should install GTK headers along with X headers (package gtk2-devel
).
In order to compile Emacs with all modern features you will want to install development packages for packages not found in your ./configure
output: rsvg, dbus, gnutls, etc...
回答2:
Since like last week you can now compile with GTK3.
Here is the list of dependencies for Debian-based systems:
Tools:
gcc autoconf automake texinfo libtool git
libraries:
libncurses5-dev libgnutls-dev librsvg2-dev libxpm-dev libjpeg62-dev libtiff-dev libgif-dev libqt4-dev libgtk-3-dev
(another way is to use
apt-get build-dep emacs23
and addgtk3
)
And here is the script I use for automated builds on all my machines:
#!/bin/bash
init=false
SRC_DIR=~/src
if [ ! -d "$SRC_DIR" ]; then mkdir $SRC_DIR; fi
if [ ! -d "$SRC_DIR/emacs" ]; then
init=true
cd $SRC_DIR && pwd && git clone git://git.sv.gnu.org/emacs.git && cd emacs
else
cd $SRC_DIR/emacs
fi
git pull 1>&1 | grep "Already up-to-date."
if [[ ! $? -eq 0 && ! $init ]]; then
read -e -p "## Branch moved, build and install emacs? [Y/n] " yn
if [[ $yn == "y" || $yn == "Y" || $yn == "" ]] ; then
make distclean && autoreconf -i -I m4 && ./configure --with-x-toolkit=gtk3 && make && sudo make install
fi
fi
来源:https://stackoverflow.com/questions/9678189/build-emacs-with-x-support