また、ftp://ftp.vim.org/pub/vim/patches/7.2/ には、バージョン 7.2 向けのパッチが、 7.2.xxx という形式のファイル名で置かれているので、 必要に応じて取得する。
たとえば $HOME/src/vim の下に patches という サブディレクトリを作成し、ここにダウンロードした パッチ を保管する。 こうすると、patches サブディレクトリの中は、 たとえば以下のようになる。
$ ls patches/ ./ ../ 7.2.001 7.2.002
次に $HOME/src/vim ディレクトリの下で、 ソースパッケージを展開する。 これによって vim72 というサブディレクトリが作成され、 その下にソースコードが展開される。
$ cd $HOME/src/vim $ tar xvjf vim-7.2.tar.bz2 $ tar xvzf vim-7.2-extra.tar.gz $ tar xvzf vim-7.2-lang.tar.gz
正常に展開されたら vim72 サブディレクトリに移動し、 以下のようにしてパッチを適用する。
$ cd vim72 $ cat ../patches/* | patch -p0
すでに何度か構築していて、バイナリなどが残っている場合は、 make clean distclean してから patch コマンド を実行する方がいいと思う。
$ cd vim72 $ make clean distclean $ cat ../patches/* | patch -p0
それから、以下のようにして構築する。
$ ./configure \ --enable-multibyte \ --enable-xim \ --with-features=big \ --enable-perlinterp \ --enable-pythoninterp \ --enable-rubyinterp \ --enable-gui=gtk2 $ make $ su # make install
2. Unix
=======
Summary:
要約すると。
1. make run configure, compile and link
configure、コンパイル、リンクが実行される
2. make install installation in /usr/local
/usr/local にインストール
This will include the GUI and X11 libraries, if you have them. If you want a
version of Vim that is small and starts up quickly, see the Makefile for how
to disable the GUI and X11. If you don't have GUI libraries and/or X11, these
features will be disabled automatically.
これにより、GUI と X11 ライブラリがあれば、それらが組み込まれます。
小型で立ち上がりの速い Vim がほしければ、Makefile を参照して、
GUI と X11 を無効にしてください。GUI や X11 が無ければ、それら
を使った機能は自動的に無効になります。
See the start of Makefile for more detailed instructions about how to compile
Vim.
Vim の詳しいコンパイル方法については、Makefile の冒頭の内容を参照
してください。
If you need extra compiler and/or linker arguments, set $CFLAGS and/or $LIBS
before starting configure. Example:
コンパイラやリンカーへの引数が別途必要な場合は、configure の実行前
に $CFLAGS や $LIBS を設定してください。たとえば以下のように設定
します。
env CFLAGS=-I/usr/local/include LIBS=-lm make
This is only needed for things that configure doesn't offer a specific argument
for or figures out by itself. First try running configure without extra
arguments.
しかしこれが必要なのは、configure に用意されていなかったり、
configure だけでは解釈できない特殊な引数を使う場合だけです。最初は
引数を何も付けずに configure を実行してみてください。
GNU Autoconf and a few other tools have been used to make Vim work on many
different Unix systems. The advantage of this is that Vim should compile
on most sytems without any adjustments. The disadvantage is that when
adjustments are required, it takes some time to understand what is happening.
多種多様な Unix システムで Vim が動かすため、GNU Autocnof をは
じめとするツールをいくつか使っています。これは、ほとんどのシステムで、
Vim をコンパイルする際に調整が一切不要になるという利点にもなりますが、
いざ調整が必要になると、処理内容の理解に時間がかかるという欠点にもな
ります。
If configure finds all library files and then complains when linking that some
of them can't be found, your linker doesn't return an error code for missing
libraries. Vim should be linked fine anyway, mostly you can just ignore these
errors.
configure ではすべてのライブラリが検出されているのに、リンクする際
に、見つからないライブラリがあるというメッセージが出るのは、ライブラ
リが見つからないのに、そのエラーコードがリンカーから返らないからです。
でも Vim はなんとかリンクされますから、ほとんどの場合、このようなエ
ラーは無視してかまいません。
If you run configure by hand (not using the Makefile), remember that any
changes in the Makefile have no influence on configure. This may be what you
want, but maybe not!
Makefile を使わず、自前で configure を実行する場合、Makefile
をいくら変更しても、configure には一切影響しないので注意してくださ
い。これでいいのかどうかは分かりませんけど。
The advantage of running configure separately, is that you can write a script
to build Vim, without changing the Makefile or feature.h. Example (using sh):
しかし configure を個別に実行すれば、Makefile も feature.h
も変更せずに、Vim を構築するためのスクリプトが書けるので便利です。
以下は sh を使った例です。
CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif
One thing to watch out for: If the configure script itself changes, running
"make" will execute it again, but without your arguments. Do "make clean" and
run configure again.
注意点を一つ。configure そのものが変更された場合、"make" を実行す
ると、ユーザーが指定した引数を何も付けずに configure が再度実行され
ます。その場合は、"make clean" してから、もう一度 configure を
実行してください。
If you are compiling Vim for several machines, for each machine:
Vim を使用するコンピュータがいくつかある場合は、それぞれのコンピュー
タごとに、以下の手順でコンパイルしてください。
a. make shadow
b. mv shadow machine_name
c. cd machine_name
d. make; make install
[Don't use a path for machine_name, just a directory name, otherwise the links
that "make shadow" creates won't work.]
ただし、 machine_name にはパス名ではなく、ディレクトリ名だけを指定
してください。そうしないと、"make shadow" によって作成されたリンク
が機能しません。
Unix: COMPILING WITH/WITHOUT GUI
コンパイル時に GUI を組み込む/組み込まない
NOTE: This is incomplete, look in Makefile for more info.
注。以下の説明には網羅されていないものがあります。詳細は Makefile を
参照してください。
These configure arguments can be used to select which GUI to use:
使用する GUI を選ぶ場合は、以下の configure 引数を指定します。
--enable-gui=gtk or: gtk2, motif, athena or auto
--disable-gtk-check
--disable-motif-check
--disable-athena-check
--enable-gui defaults to "auto", so it will automatically look for a GUI (in
the order of GTK, Motif, then Athena). If one is found, then is uses it and
does not proceed to check any of the remaining ones. Otherwise, it moves on
to the next one.
--enable-gui は "auto" がデフォルトになっているので、GTK、Motif、
Athena の順で、自動的に GUI が検索されます。そして最初に見つかった
GUI が使われ、それ以降は検索されません。見つからなければ、次が検索され
ます。
--enable-{gtk,gtk2,kde,motif,athena}-check all default to "yes", such that if
--enable-gui is "auto" (which it is by default), GTK, Motif, and Athena will
be checked for. If you want to *exclude* a certain check, then you use
--disable-{gtk,gtk2,kde,motif,athena}-check.
--enable-{gtk,gtk2,kde,motif,athena}-check は、すべて "yes"
がデフォルトになってるので、--enable-gui が "auto" になっていれば
(デフォルトではそうなっています)、GTK、Motif、Athena が検査されます。
検査対象から外したい GUI があれば、
--disable-{gtk,gtk2,kde,motif,athena}-check を使ってください。
For example, if --enable-gui is set to "auto", but you don't want it look for
Motif, you then also specify --disable-motif-check. This results in only
checking for GTK and Athena.
たとえば、--enable-gui が "auto" に設定されていても、Motif は
検査から外したい場合は、併せて --disable-motif-check も指定して
ください。これによって、検査対象は GTK と Athena だけになります。
Lastly, if you know which one you want to use, then you can just do
--enable-gui={gtk,gtk2,kde,motif,athena}. So if you wanted to only use Motif,
then you'd specify --enable-gui=motif. Once you specify what you want, the
--enable-{gtk,gtk2,kde,motif,athena}-check options are ignored.
最後に、使いたい GUI が分かっている場合は、
--enable-gui={gtk,gtk2,kde,motif,athena} だけを指定しても
かまいません。ですから Motif を使いたいだけなら、
--enable-gui=motif を指定すればいいでしょう。このように使いたい
GUI だけを直接指定した場合、
--enable-{gtk,gtk2,kde,motif,athena}-check オプションは
無視されます。
On Linux you usually need GUI "-devel" packages. You may already have GTK
libraries installed, but that doesn't mean you can compile Vim with GTK, you
also need the header files.
Linux では、使用する GUI の "-devel" パッケージが必要になるの
が普通です。ですから GTK のライブラリがインストール済みだとしても、
それで Vim に GTK を組み込んでコンパイルできることにはなりません。
ヘッダーファイルも必要だからです。
For compiling with the GTK+ GUI, you need a recent version of glib and gtk+.
Configure checks for at least version 1.1.16. An older version is not selected
automatically. If you want to use it anyway, run configure with
"--disable-gtktest".
GTK requires an ANSI C compiler. If you fail to compile Vim with GTK+ (it
is the preferred choice), try selecting another one in the Makefile.
If you are sure you have GTK installed, but for some reason configure says you
do not, you may have left-over header files and/or library files from an older
(and incompatible) version of GTK. if this is the case, please check
auto/config.log for any error messages that may give you a hint as to what's
happening.
GTK+ の GUI を組み込んでこんパイルするには、最新版の glib と
gtk+ が必要です。configuer では、バージョン 1.1.16 以上のもの
が検索されます。それ以前のものは自動的に除外されます。どうしても古い
ものが使いたい場合は、"--disable-gtktest" オプションを付けて、
configure を実行してください。
GTK には ANSI C コンパイラが必要です。Vim には GTK+ を使うのが
お勧めなのですが、そのコンパイルに失敗する場合は、Makefile で別の
GUI を選んでみてください。GTK は間違いなくインストールされているの
に、どういうわけか configure ではインストールされていないことにな
るときは、古くて互換性のない GTK のヘッダーファイルやライブラリファ
イルが残っている場合があります。その場合は、auto/config.log に
エラーメッセージが無いかどうか調べてください。問題の手がかりが得られ
るかもしれません。
There used to be a KDE version of Vim, using Qt libraries, but since it didn't
work very well and there was no maintainer it was dropped.
昔は Qt ライブラリを使った KDE 版の Vim もありましたが、うまく動
かなかったし、保守担当者もいなかったので消されました。
Unix: COMPILING WITH MULTI-BYTE
Unix: マルチバイト機能を組み込んでコンパイルする
When you want to compile with the multi-byte features enabled, make sure you
compile on a machine where the locale settings actually work. otherwise the
configure tests may fail. You need to compile with "big" features:
マルチバイト機能を有効にしてコンパイルしたい場合は、コンパイルに使う
コンピュータで、ロケールの設定が実際に機能していることを確認してくだ
さい。そうしないと configure で行われる検査が失敗する場合がありま
す。それから、以下のように、 Vim に盛り込む機能も "big" を選択し
てコンパイルする必要があります。
./configure --with-features=big
Unix: COMPILING ON LINUX
Unix: Linux でコンパイルする
On Linux, when using -g to compile (which is default for gcc), the executable
will probably be statically linked. If you don't want this, remove the -g
option from CFLAGS.
Linux では、-g を付けてコンパイル(gcc ではそれがデフォルトです)
すると、おそらく実行可能ファイルは静的にリンクされます。それがいやな
ら、CFLAGS から -g オプションを取り除いてください。
Unix: PUTTING vimrc IN /etc
Unix: vimrc を /etc に置く
Some Linux distributions prefer to put the global vimrc file in /etc, and the
Vim runtime files in /usr. This can be done with:
Linux のディストリビューションによっては、グローバルな vimrc は
/etc に、そして Vim の実行時ファイルは /usr に、それぞれ置く方
がいい場合があります。その場合は以下のようにしてください。
./configure --prefix=/usr
make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim MAKE="make -e"
以上。