2008年5月24日土曜日

(FreeBSD) ports/japanese/grepのエラー ~ acinclude.m4:463: error: m4_defn: undefined macro: _m4_divert_diversion / autom4te-2.62: /usr/local/bin/gm4 failed with exit status: 1 / aclocal-1.10: autom4te failed with exit status: 1

ふと、FreeBSDのportsで、japanese/grepがビルドできないことに気がつきました。



ビルドしようとするFreeBSDによって(どんなツール類がインストールされているかによって?)、エラーメッセージが微妙に異なるらしいのですが、あるところでは、こんな感じでした。



===>  Building for ja-grep-2.4.2
cd . && aclocal
acinclude.m4:3: warning: underquoted definition of AC_DJGPP
acinclude.m4:3:   run info '(automake)Extending aclocal'
acinclude.m4:3:   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
acinclude.m4:50: the serial number must appear before any macro definition
acinclude.m4:427: the serial number must appear before any macro definition
acinclude.m4:461: the serial number must appear before any macro definition
acinclude.m4:468: the serial number must appear before any macro definition
acinclude.m4:485: the serial number must appear before any macro definition
acinclude.m4:622: the serial number must appear before any macro definition
acinclude.m4:660: the serial number must appear before any macro definition
acinclude.m4:701: the serial number must appear before any macro definition
acinclude.m4:463: error: m4_defn: undefined macro: _m4_divert_diversion
acinclude.m4:463: the top level
autom4te-2.62: /usr/local/bin/gm4 failed with exit status: 1
aclocal-1.10: autom4te failed with exit status: 1



どうやら、aclocalを実行してエラーになる、というのは共通らしいです。



それって、automake、autoconfのバージョンの違いのせいじゃない?っていう気がして、古いバージョンのautomake、autoconfが使われるようにしてみたら、それでいけました。

まずは



make clean



しておいてから、とりあえず、





make USE_AUTOTOOLS="autoconf:213 aclocal:15"



でOK。



portsの修正方法としては、Makefileに以下の1行を追加でしょうか?



USE_AUTOTOOLS=  autoconf:213 aclocal:15





それにしても、portsって、とってもフレキシブルですねぇ。とりあえず、makeに引数をつけくわえるだけ、っていう実行方法でも、なんとか対応できちゃうなんて。


でも、portsの中で何をやってるのかがわかんないときは、

あーもう、本当にもう何がなんだか・・・

てイライラなときもあります(笑)。





1 件のコメント:

  1. 先日、FreeBSD 6.3-RELEASEで環境を構築していて、同じ不具合に遭遇しました。
    私の環境では「autoconf213」も「automake15」も導入されていなかったので、それぞれportsからインストールした後、
    make USE_AUTOTOOLS="autoconf:213 aclocal:15" install
    でうまくいきました。
    とても参考なりました、ありがとうございます。

    返信削除