autoconf 2.60 と automake 1.9.6 をビルドする (for LLVM)

LLVM の configure script を変更すると、 configure ファイルを再度生成する必要がある。 しかし、それを生成するために llvm/autconf/Autogen.sh を実行すると、 automake と autoconf のバージョンが期待と違うと言って怒られる。期待のバージョンは、 autoconf 2.60 と automake 1.9.6 なのだけど、 Ubuntu 14.10 環境では、 autoconf 2.69 と automake 1.14.1 になっている。

しょうがなく autoconf と automake をビルドしたので、メモを残しておく。

autoconf のビルド

特に何も考えずに通常の手順に沿えばビルドできる。

$ git clone http://git.sv.gnu.org/r/autoconf.git
$ cd autoconf
$ git checkout AUTOCONF-2.60
$ ./configure --prefix=/hoge/fuga
$ make
$ make install

automake のビルド

2つ注意点がある。

  • make の前にいくつかコマンドが必要なこと
  • 当該のバージョンにバグがあってそのままではビルドできないこと

まずソースコードをダウンロードする。

$ git clone git://git.savannah.gnu.org/automake.git
$ cd automake
$ git checkout Release-1-9-6

1点目の make の前に必要なコマンドとその理由は以下のページに記載がある。

http://inti.sourceforge.net/tutorial/libinti/autotoolsproject.html

正しくコマンドを実行しないと、エラーがでるのでそれを見ると大体分かる。

$ aclocal
$ autoconf
$ automake --add-missing
$ ./configure --prefix=/hoge/fuga

2点目のバグは以下のページに記載がある。パッチが添付されているので適用する。

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=739974

バグは makeinfo を適用するドキュメントのフォーマットに起因するものなので、プログラム自体の問題ではなさそうである。 最後のビルドする。

$ make
$ make install

llvm の configure ファイルの生成

最後に configure ファイルを生成する。

$ cd llvm/autoconf
$ export PATH=/hoge/fuga:$PATH
$ ./Autogen.sh