BUILDスクリプトを作ってしまおう

MySQL+Tritonnソースをダウンロードしたら、こんな感じでビルドできるといいなと思ってます。

tar zxf mysql-5.0.41.tritonn-1.0.3.tar.gz
cd mysql-5.0.41.tritonn-1.0.3
BUILD/compile-pentium-tritonn
make instal

compile-pentiumをベースに、--with-sennaと--with-mecabが付いたやつを。

"--prefix"だとか"--with-charset"だとかのconfiugreオプションを独自に指定したい人の場合にはもちろんこんな感じ。

tar zxf mysql-5.0.41.tritonn-1.0.3.tar.gz
cd mysql-5.0.41.tritonn-1.0.3
./configure <好きなオプション>
make
make install

ところで、static link問題がそろそろ解消されそうなのでまたstaticなビルドも考慮にいれたいのですが、mecabってlibmecabはstatic linkされても、辞書はやっぱり別なのかな?辞書もいっしょに入ってくれるとうれしいけど。

追記

compile-pentiumはstatic linkだったw iya-n.

compile-pentium-cybozuを参考にしようかなぁ。--with-collationだけ変えればよさげだし。

追記2

compile-pentiumには--with-hoge-storage-enginの記載がない。つまり指定がない場合に組み込まれないエンジンはぜんぶ入らない。

気になったので、BKからmysql-5.1も落としてcompile-pentium -nしたら、--with-pluginsの記載がない。BUILD/autorun.sh && configureした後、config.hを見てみたけどやっぱりInnoDBとかArchiveとかのマクロは未定義だった。

ってことで、extra_configsをまるごと自前のやつを使う感じにしたほうがよさげ。

compile-pentium-tritonnできた

compile-pentium-***ってなってるけど、「IntelのみOKでAMDはNG」とかいう意味ではないっす。x86/x86_64向けということです。

#! /bin/sh

path=`dirname $0`
. "$path/SETUP.sh"

extra_flags="$pentium_cflags $fast_cflags -g"

# following config options are already defined in base_configs in SETUP.sh
#  --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex
# --enable-thread-safe-client --with-big-tables

extra_configs="--localstatedir=/usr/local/mysql/data \
 --libexecdir=/usr/local/mysql/bin \
 --enable-local-infile \
 --with-pic \
 --with-fast-mutexes \
 --disable-shared \
 --with-zlib-dir=bundled \
 --with-yassl \
 --with-readline \
 --with-archive-storage-engine \
 --with-blackhole-storage-engine \
 --with-example-storage-engine \
 --with-federated-storage-engine \
 --with-innodb \
 --with-extra-charsets=complex \
 --with-senna --with-mecab"

. "$path/FINISH.sh"