Web・IT うんたらら

業務系とWeb系の狭間でIT業界を彷徨いながら備忘録と足跡を残していきます

CentOS5.9にEmacs24.2をソースからインストール

ServersMan@VPSのCentOS5.9にEmacs24.2(執筆時点で最新)をインストールしたのでメモ。
SELinuxなし、Xなしの環境です。


まずは正解から。

yum install gcc make ncurses-devel
yum install giflib-devel libjpeg-devel libtiff-devel

cd /usr/local/src
wget http://ftp.gnu.org/pub/gnu/emacs/emacs-24.2.tar.gz
tar xzvf emacs-24.2.tar.gz
cd emacs-24.2
./configure --without-x --without-selinux
make
make install


以下、少しハマった点。


libgifじゃなくてgiflib

ソースをダウンロード後、何はともあれとりあえず./configureを実行。
すると次のように怒られました。

configure: error: The following required libraries were not found:
     libjpeg libgif/libungif libtiff

あぁなるほど…とまあ普通こうしますよね。

yum install libgif-devel libjpeg-devel libtiff-devel

しかし、libgifなんてパッケージないよーと怒られます。
むむ、じゃあrpmからインストールするか…とぐぐったところ、
こっちが正解らしいです。

yum install giflib-devel libjpeg-devel libtiff-devel

こういう統一感のなさがオープンソースの不満なところです……


SELinux未導入の場合は、--without-selinux

無事コンパイルは通ったものの、今度はmakeで以下のエラーが発生。

fileio.c:37:29: warning: selinux/selinux.h: No such file or directory
fileio.c:38:29: warning: selinux/context.h: No such file or directory
fileio.c: In function ‘Fcopy_file’:
fileio.c:1873: error: ‘security_context_t’ undeclared (first use in this function)
fileio.c:1873: error: (Each undeclared identifier is reported only once
fileio.c:1873: error: for each function it appears in.)
fileio.c:1873: error: expected ‘;’ before ‘con’

とりあえずSELinuxはインストールしたくなかったので、除外オプションがあるだろうとまたググりました。
./configure --disable-selinuxというオプションでいけるらしい。
が、そんなオプションないよーとこれまた怒られます。
いろいろ調べた挙句、ふとconfigureのヘルプを確認。

./configure --help

ありました。これが正解。ついでにx関係も除外。

./configure --without-selinux --without-x


無事、makeもmake installも完了し、インストール成功!

# emacs --version
GNU Emacs 24.2.1
Copyright (C) 2012 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.