エラー: Cannot –enable-pcretest-libedit because libedit library was not found.

FreeBSDのcvsがアップデートされたので、portupgrade を掛けたところ、

** Listing the failed packages (-:ignored / *:skipped / !:failed)
 ! devel/pcre (pcre-8.30_2) (unknown build error)

となってしまった。devel/pcre パッケージが問題のようだ。

手動で devel/pcre に移動して make config; make を掛けたところ、configure の最中、

checking edit/readline/readline.h presence... no
checking for edit/readline/readline.h... no
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking for readline in -ledit... no
** Cannot --enable-pcretest-libedit because libedit library was not found.
===> Script "configure" failed unexpectedly.
Please report the problem to mm@FreeBSD.org [maintainer] and attach the
"/usr/ports/devel/pcre/work/pcre-8.31/config.log" including the output of the
failure of your make command. Also, it might be a good idea to provide an
overview of all packages installed on your system (e.g. an `ls /var/db/pkg`).
*** Error code 1

Stop in /usr/ports/devel/pcre.
*** Error code 1

Stop in /usr/ports/devel/pcre.

となる。「checking for readline in -ledit… no
** Cannot –enable-pcretest-libedit because libedit library was not found.
===> Script “configure” failed unexpectedly.」の部分が問題だ。
これは初めて体験するエラー。

/usr/ports/devel/pcre/work/pcre-8.31 の中を確認して、configure ファイルを開いてみると、

# Similarly for --enable-pcretest-readline

if test "$enable_pcretest_libedit" = "yes"; then
if test "$enable_pcretest_libreadline" = "yes"; then
echo "** Cannot use both --enable-pcretest-libedit and --enable-pcretest-readline"
exit 1
fi
if test "$HAVE_EDITLINE_READLINE_H" != "1" -a ¥
"$HAVE_READLINE_READLINE_H" != "1"; then
echo "** Cannot --enable-pcretest-libedit because neither editline/readline.h"
echo "** nor readline/readline.h was found."
exit 1
fi
if test -z "$LIBEDIT"; then
echo "** Cannot --enable-pcretest-libedit because libedit library was not found."
exit 1
fi
fi

という行が見つかる。「 –enable-pcretest-libedit and –enable-pcretest-readline」ということなので、二つのオプションは同時には使えないはず。pcretest-libedit を外しちゃえばいいんじゃない。ってことで、手動で「 ./configure –enable-utf –enable-unicode-properties –enable-pcre8 –enable-pcre16 –enable-jit –prefix=/usr/local –mandir=/usr/local/man –infodir=/usr/local/info/ –build=i386-portbld-freebsd8.2」とタイプして、make すれば make は通ることが判明。make install でインストールしてしまえばアップデートは出来るはずだが、パッケージとしては扱われなさそうなので、調査は翌日に延期。

そして翌日基本的な問題切り分けを実施して一つずつ確認して行く事にする。まずは、/usr/ports/distfiles/ フォルダーを空にして、再度

# portupgrade pcre-8.30_2

を実行してみる。
すると、ソースファイルのダウンロードが再度行われ、昨日とは違ってあっさりビルドが進んで、パッケージのインストールまで到達してpcre-8.31が無事にインストールされた。

 ===> Compressing manual pages for pcre-8.31
 ===> Running ldconfig
 /sbin/ldconfig -m /usr/local/lib
 ===> Registering installation for pcre-8.31
 ===> Cleaning for pcre-8.31
 ---> Cleaning out obsolete shared libraries

なぜ?
ソースファイル展開中にファイルが壊れていたのか?
しかし、チェックサムを計算して比較していると思うのだが。昨日のアーカイブを保存していないのでわからないが、ファイルの一部が壊れていたと推測して、この問題は調査終了。

Comments

  1. いきなりのコメント失礼致します。

    とある理由からApacheのビルドを行っており、pcreのライブラリ依存でこけて手詰まりだったところ
    当ブログの記事からpcreのビルドを試したところ、apacheのビルドが通るようになりました。

    FreeBSDの技術的な記事が少ない中、当記事は大変ありがたくコメントさせて頂きました。
    ありがとうございました

    1. 私のメモがお役に立って幸いです。
      システム管理を行っていると、わけのわからない症状にしばしば出会いますからね。お互い様です。

コメントを残す