0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

plv8をOSXでビルド出来た Postgres.app編

Last updated at Posted at 2013-07-11

2017年10月 追記

以下の記事はplv8がv1.xの頃の話です。
最新の2.x系は、Unix系の環境であれば、

make static

一発でV8も内部的にDLしてビルドしてplv8に静的リンクしてくれます。

v8の古いバージョンを使う

これがポイントだった。

実は、Ubuntuでは最新のv8をビルドして、すんなりplv8がビルド出来たように
見えたのですが、どうもすでにインストール済みのv8のヘッダとライブラリを
使ってビルドされていたという罠があり、OSXでのビルドにハマっていた
時期があったのですが、Twitterで@umitanukiさんにアドバイスいただき、
v8の古いバージョンを使うことを知ることが出来た。
@umitanukiさんありがとうございました。

git cloneするだけで実は古いバージョンのソースも入手できてた件

githubにアカウントあるだけでgitコマンドは未だによくわからないので、
今回v8の古い版をどうやって入手するのかも初めは分かりませんでした。

git clone git://github.com/v8/v8.git v8 && cd v8
git checkout 3.17.1

3.17.1に特に意味はありません。もう少し新しくでも良いかもです。

native.checkだと動かない

手元のHomeBrewベースの環境だと、run-test.pyで

Unknown mode 
Usage: run-tests.py [options]

となぜかエラーになるので、
v8のビルドは以下のようにした。

make native library=shared console=readline strictaliasing=off

plv8本体のビルド

アイコンが好みなので、Postgres.appを愛用中w

OSXにはPostgresqlが/usr配下に入っているので、Postgres.appへの
パスを優先させておく

export PATH=/Applications/Postgres.app/Contents/MacOS/bin:$PATH

ビルドしたv8のパスを環境変数に設定

export V8_OUTDIR=../v8/out/native/
export V8_SRCDIR=../v8/

あとは

make以降手順の通り

 関連記事

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?