2012-03-13 76 views
10

我正尝试在64位Suse Linux(10.2企业版)框中构建带有X支持的emacs 24.0.94。我看到X11库安装在/ usr/lib目录/ X11R6和我说的是配置脚本来寻找他们在该位置:使用X支持构建emacs

--x-includes=/usr/X11R6/include:/usr/include --x-libraries=/usr/X11R6/lib64:/usr/lib64 

即使在上述选项中,配置脚本出错,它不能找到任何Xtoolkit:

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. 

请问有人可以告诉我可能是什么问题?

+0

你想使用哪个工具包?你有它正确安装?哪里?如果你不知道,你可能想要与GTK一起去。 – tripleee 2012-03-13 05:47:47

+0

是的,X11是显示功能的最低级别。为了与Windows并行绘图,可以将其视为处理图形卡驱动程序和在屏幕上绘制斑点所需的一些功能。在该层之上,您需要一些提供按钮和菜单的库以及其他所有进入图形应用程序的东西,并且您错过了该部分。 Gtk +可能就是你想要的那个,所以正如其他人所说的那样,只需安装gtk2-devel(或者其他所谓的?),并且构建应该可以工作。 – deong 2012-03-13 09:57:47

+0

谢谢。请参阅下面关于本地安装emacs/gtk2-devel – Raj 2012-03-13 10:13:13

回答

4

在Suse上,您通常需要编译支持GTK的Emacs,因此您应该安装GTK头文件和X头文件(程序包gtk2-devel)。

为了编译Emacs的所有现代化功能,你将要安装在您的./configure输出没有找到包开发包:RSVG,DBUS,GNUTLS等..

+0

的评论谢谢。我正在做一个本地安装(在我的主目录中安装emacs),因为我没有系统上的sudo/root权限。是否可以在本地安装gtk2-devel软件包并将其用于构建emacs? – Raj 2012-03-13 09:58:47

+0

@Raj尝试下载RPM并在本地安装。 [这是一些指令](http://www.linuxquestions.org/questions/linux-newbie-8/rpm-installation-having-no-root-access-762363/),但我没有测试它们。 – Antoine 2012-03-13 11:36:33

+0

@Antoine可能有更简单的解决方案,但您也可以下载Gtk +源代码并以相同的方式安装它(“./configure --prefix =/home/Raj/local”)。使用RPM的好处是它应该为你处理依赖关系。有了源代码,你必须确保你自己安装任何必需的库。无论如何,你可能需要告诉配置脚本emacs的库安装位置,例如“./configure --prefix =/home/Raj/local --with-gtk =/home/Raj/local ”。阅读配置帮助以获得正确的标志。 – deong 2012-03-13 12:36:38

11

由于像上周你现在可以与GTK3

这里编译是依赖关系基于Debian的系统列表:

  • 工具:

GCC的autoconf的automake的texinfo libtool的GIT中

  • 库:

中的libncurses5-dev的libgnutls-dev的librsvg2-dev的libxpm-dev的中的libjpeg62-dev的的libtiff-dev的libgif-dev的libqt4-dev的libgtk -3-开发

(另一种方法是使用apt-get build-dep emacs23并添加gtk3)

,这里是我使用的自动化脚本建立在我所有的机器:

#!/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 
+1

感谢您的脚本。拉杰,不客气, – Raj 2012-08-08 14:07:10

+0

不客气。它可以更好 ;我不喜欢我如何强迫grep输出git来确定分支是否已经移动。 – yPhil 2012-08-08 17:19:32

+0

好答案... – 2013-11-27 14:40:05