![无法为 emacs 25.2 启用 xft 和 freetype 支持](https://linux22.com/image/1060374/%E6%97%A0%E6%B3%95%E4%B8%BA%20emacs%2025.2%20%E5%90%AF%E7%94%A8%20xft%20%E5%92%8C%20freetype%20%E6%94%AF%E6%8C%81.png)
这个问题与 emacs 编译有关,但它更多的是关于 Ubuntu 上的库查找问题,所以我认为我应该放在这里。如果放在 emacs 论坛上更好,我稍后会这样做。
Emacs 25.2 源代码从这里下载:http://ftp.gnu.org/gnu/emacs/
我想在编译configure
emacs 25.2 之前让它支持xft
、cairo
和。我该怎么做?gnutls
gtk3
我安装了下面所有我能想到的依赖项。条目太多了,sudo apt-get
因为我来回尝试让它们正常工作:
sudo apt-get build-dep emacs24
sudo apt-get install libxft2
sudo apt-get install libfreetype6-dev
sudo apt-get install libgnutls28-dev
sudo apt-get install libm17n-dev libxft-dev libotf-dev
sudo apt-get upgrade
sudo apt-get install libfreetype6-dev
sudo apt-get install libgtk-3-dev libwebkitgtk-3.0-dev
sudo apt-get install libcairo2-dev
sudo apt-get install libharfbuzz-dev libpangoxft-1.0-0 libpango1.0-dev libpangoft2-1.0-0
sudo apt-get install libharfbuzz
sudo apt-get install libharfbuzz-dev libharfbuzz-bin
sudo apt-get install build-essential texinfo libx11-dev libxpm-dev libjpeg-dev libpng-dev libgif-dev libtiff-dev libgtk2.0-dev libncurses-dev
在此之后,我还尝试重新启动计算机,运行ldconfig -v
并查看库是否确实列在详细输出中。
这是尝试启用的配置命令xft
:
./configure --with-xft --with-x
配置输出:
Configured for 'x86_64-unknown-linux-gnu'.
Where should the build process find the source code? .
What compiler should emacs be built with? gcc -g3 -O2
Should Emacs use the GNU version of malloc? yes
(Using Doug Lea's new malloc from the GNU C Library.)
Should Emacs use a relocating allocator for buffers? no
Should Emacs use mmap(2) for buffer allocation? no
What window system should Emacs use? x11
What toolkit should Emacs use? LUCID
Where do we find X Windows header files? Standard dirs
Where do we find X Windows libraries? Standard dirs
Does Emacs use -lXaw3d? yes
Does Emacs use -lXpm? yes
Does Emacs use -ljpeg? yes
Does Emacs use -ltiff? yes
Does Emacs use a gif library? yes -lgif
Does Emacs use a png library? yes -lpng12
Does Emacs use -lrsvg-2? no
Does Emacs use cairo? no
Does Emacs use imagemagick? no
Does Emacs support sound? yes
Does Emacs use -lgpm? yes
Does Emacs use -ldbus? no
Does Emacs use -lgconf? no
Does Emacs use GSettings? no
Does Emacs use a file notification library? yes -lglibc (inotify)
Does Emacs use access control lists? yes -lacl
Does Emacs use -lselinux? yes
Does Emacs use -lgnutls? no
Does Emacs use -lxml2? yes
Does Emacs use -lfreetype? no
Does Emacs use -lm17n-flt? no
Does Emacs use -lotf? no
Does Emacs use -lxft? no
Does Emacs directly use zlib? yes
Does Emacs have dynamic modules support? no
Does Emacs use toolkit scroll bars? yes
Does Emacs support Xwidgets (requires gtk3)? no
答案1
天哪,莫莉
原来是因为configure
在我的 下找不到一些依赖项$HOME/.linuxbrew
,所以.linuxbrew/Cellar/libxml2/2.9.4/include/libxml2
它一直在同一个目录中搜索其他依赖项。这就是为什么尽管安装了许多依赖项,却找不到它们的原因。$HOME/.linuxbrew
由于我不再使用 linuxbrew,所以删除后,一切都按预期完美运行。顺便说一句,linuxbrew
即使从我的电脑上的坟墓中也让我很难受。与 Mac OSX 的 homebrew 相比,它的稳定性要差得多。
Configured for 'x86_64-unknown-linux-gnu'.
Where should the build process find the source code? .
What compiler should emacs be built with? gcc -g3 -O2
Should Emacs use the GNU version of malloc? yes
(Using Doug Lea's new malloc from the GNU C Library.)
Should Emacs use a relocating allocator for buffers? no
Should Emacs use mmap(2) for buffer allocation? no
What window system should Emacs use? x11
What toolkit should Emacs use? GTK3
Where do we find X Windows header files? Standard dirs
Where do we find X Windows libraries? Standard dirs
Does Emacs use -lXaw3d? no
Does Emacs use -lXpm? yes
Does Emacs use -ljpeg? yes
Does Emacs use -ltiff? yes
Does Emacs use a gif library? yes -lgif
Does Emacs use a png library? yes -lpng12
Does Emacs use -lrsvg-2? yes
Does Emacs use cairo? no
Does Emacs use imagemagick? yes
Does Emacs support sound? yes
Does Emacs use -lgpm? yes
Does Emacs use -ldbus? yes
Does Emacs use -lgconf? yes
Does Emacs use GSettings? yes
Does Emacs use a file notification library? yes -lglibc (inotify)
Does Emacs use access control lists? yes -lacl
Does Emacs use -lselinux? yes
Does Emacs use -lgnutls? yes
Does Emacs use -lxml2? yes
Does Emacs use -lfreetype? yes
Does Emacs use -lm17n-flt? yes
Does Emacs use -lotf? yes
Does Emacs use -lxft? yes
Does Emacs directly use zlib? yes
Does Emacs have dynamic modules support? no
Does Emacs use toolkit scroll bars? yes
Does Emacs support Xwidgets (requires gtk3)? no