Memcached1.4.2をx86_Solaris10でビルドする

libevent-1.4.12とmemcached-1.4.2の組み合わせでビルド環境は↓のような感じです。

$uname -a
SunOS tamsvr11 5.10 Generic_137138-09 i86pc i386 i86pc Solaris

$gcc -v
/usr/local/lib/gcc/i386-pc-solaris2.10/3.4.6/specs から spec を読み込み中
コンフィグオプション: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --enable-shared --enable-languages=c,c++,f77
スレッドモデル: posix
gcc バージョン 3.4.6

libeventは普通にconfigureしてgmake; gmake installで通ります。

memcachedは-pthreadなんてオプション知らないよ!怒られます。というわけで怒られないようにするには3種類の方法があります。1つはGCCを使わない(ぉぃ)。2つめはconfigure時に「--disable-coverage」をつける。3つめはMakefileの-pthreadを-pthreadsに置換する。(最後にsがついているのが違いです)

2番目のやり方だと以下のような感じになります。

./configure --prefix=/export/home/tamtam/service/memcached-1.4.
2 --with-libevent=/export/home/tamtam/service/libevent-1.4.12 --disable-coverage
gmake
gmake install

3番目のやり方だと以下のような感じになります。

./configure --prefix=/export/home/tamtam/service/memcached-1.4.
2 --with-libevent=/export/home/tamtam/service/libevent-1.4.12
perl -i -p -e "s/-pthread/-pthreads/g;" Makefile
gmake
gmake install

本当はLDFLAGSに-Rxxxとか指定してますが省略しました。

新しいサイトもよろしくお願いします!