2017-01-05

Emacs 25.1 を macOS でコンパイルした

Emacs 25.1 (というか git リポジトリーの HEAD) を macOS 10.12 でコンパイルした。作業記録を残しておく。

emacs-25.1

準備

必要なパッケージを予めインストールしておく。必要なのは autoconf と automake。

$ brew install autoconf automake
$ autoconf --version
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David J. MacKenzie and Akim Demaille.
$ automake --version
automake (GNU automake) 1.15
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Tom Tromey <tromey@redhat.com>
       and Alexandre Duret-Lutz <adl@gnu.org>.

あと、デフォールトで入っている makeinfo のバージョンが古かったので、新しいものと入れ替えた。

$ brew link --force texinfo
$ makeinfo --version
texi2any (GNU texinfo) 6.3

Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

ソースコードを取得する

Emacs の最新ソースを git 経由で取得する。

$ git clone git://git.savannah.gnu.org/emacs.git

コンパイル

git で取得したソースには configure スクリプトがないので、autogen コマンドで作成。

$ cd emacs
$ ./autogen.sh

configure スクリプトを、適当なオプションを付けて実行。

$ ./configure --without-xim
(snip)
Configured for 'x86_64-apple-darwin16.1.0'.

  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?             no
    (The GNU allocators don't work with this system configuration.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    nextstep
  What toolkit should Emacs use?                          none
  Where do we find X Windows header files?                /usr/X11/include
  Where do we find X Windows libraries?                   /usr/X11/lib
  Does Emacs use -lXaw3d?                                 no
  Does Emacs use -lXpm?                                   no
  Does Emacs use -ljpeg?                                  yes
  Does Emacs use -ltiff?                                  no
  Does Emacs use a gif library?                           no 
  Does Emacs use a png library?                           no 
  Does Emacs use -lrsvg-2?                                no
  Does Emacs use cairo?                                   no
  Does Emacs use imagemagick?                             no
  Does Emacs support sound?                               no
  Does Emacs use -lgpm?                                   no
  Does Emacs use -ldbus?                                  yes
  Does Emacs use -lgconf?                                 no
  Does Emacs use GSettings?                               no
  Does Emacs use a file notification library?             yes (kqueue)
  Does Emacs use access control lists?                    yes 
  Does Emacs use -lselinux?                               no
  Does Emacs use -lgnutls?                                yes
  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 use -lsystemd?                               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
  Does Emacs have threading support in lisp?              yes
(snip)

make install でコンパイル。./nextstep ディレクトリー以下に Emacs が出来上がる。

$ make install

ぼくは .bashrc に次の一行を書いて、ターミナルから emacs コマンドを叩いている。

# Emacs
alias emacs='open ~/project/emacs/nextstep/Emacs.app/'

あとがき

久しぶりに Emacs をソースかマコンパイルした。画像系のライブラリーが configure で no になっていたり、dynamic modules support を yes にしていなかったり。いくつか手直ししたい所も残っている。ヒマを見て、また再コンパイルを試したい。

No comments:

Post a Comment