2012-01-06
Ninjaのテストにgtest 1.6.0以降を使う
NinjaはテストのためにGoogle C++ Testing Framework(以下gtest)が使われているが、当初はシステムにインストールされたgtestをテストプログラム(ninja_test)のビルドに利用されていた。しかしgtestの最新版である1.6.0以降はシステムへのインストールできなくなり、gtestを使う各プロジェクト毎にビルドする形になった。その理由はgtestのFAQにて説明されている。
僕が使っている環境(Mac OS X + Homebrew)でもgtest 1.5.0を使用できるが、gtest 1.6.0とうっかり混ざるとコンパイルエラーになり、かつ今自分がgtest 1.5.0とgtest 1.6.0のどちらを利用しているのか判別つかないことが多々あり、自分の環境ではgtest 1.6.0で統一しようと考えた。
そこでNinjaでもgtest 1.6.0を使うことになるが、2012-01-06現在のNinjaではconfigure.pyからgtestを展開したディレクトリを指定するオプションが用意されているため、そのオプションを利用する。
% ./configure.py --help Usage: configure.py [options] Options: -h, --help show this help message and exit --platform=PLATFORM target platform (linux/freebsd/mingw/windows) --host=HOST host platform (linux/freebsd/mingw/windows) --debug enable debugging flags --profile=TYPE enable profiling (gmon/pprof) --with-gtest=PATH use gtest unpacked in directory PATH --with-python=EXE use EXE as the Python interpreter % ./configure.py --with-gtest=./gtest-1.6.0 % ./ninja ninja_test
これでninja_testが出来上がる。
2011-12-16
ruby-buildにconfigureのオプションを渡す
FreeBSD上でrbenv install 1.9.3-p0としたらiconvが無効になってたので、いつものconfigureのオプション--with-opt-dir=/usr/localを渡した。やりかたはgoogle:rbenv configure オプションとかなんとかでググった結果から類推した。その覚書。
% env CONFIGURE_OPTS="--with-opt-dir=/usr/local" rbenv install 1.9.3-p0