2012-03-13 122 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