LoginSignup
0
1

More than 3 years have passed since last update.

macOS Catalina で Oniguruma v5.9.6 をコンパイル

Last updated at Posted at 2020-05-25

需要なさそうだけど、成り行きでやったのでメモ。

configureファイルとMakefile生成に必要なツールをインストール

❯ brew install autoconf
❯ brew install automake
❯ brew install libtool
❯ brew install intltool
❯ brew install pkgconfig
❯ brew install cmake

ソースコード取得

❯ git clone https://github.com/kkos/oniguruma.git
❯ cd oniguruma 
❯ git checkout v5.9.6

ソースコードの前処理

よくわからないけど、automakeやlibtoolのバージョン違いなどに起因しているように思われるエラーが出るので、それを解消するために、ファイル作ったりすこし内容を置換したり。

❯ touch NEWS
❯ touch ChangeLog
❯ sed -i '' -e 's/INCLUDES/AM_CPPFLAGS/g' Makefile.am 
❯ sed -i '' -e 's/INCLUDES/AM_CPPFLAGS/g' sample/Makefile.am 
❯ glibtoolize --ltdl --force --copy
❯ automake --add-missing

configureファイル・Makefile.in生成

❯ autoreconf

いろいろwarningは出ますが、これでconfigureとMakefile.inの両ファイルが生成されればOK。

Makefile生成・コンパイル・インストール

インストール先はお好きに。

❯ ./configure
❯ make
❯ make DESTDIR=/Users/xxx/Library/oniguruma5.9.6 install 

エラーと参考サイト

上記手順で進めればエラーは出ないと思いますが、エラーメッセージから解決を求めて来た方の参考になればということで。

test-driverがないエラー

parallel-tests: error: required file './test-driver' not found
parallel-tests:   'automake --add-missing' can install 'test-driver'

エラーメッセージのとおり automake --add-missing すれば解消します。

Makefile.in生成でエラー

古いバージョンのautomakeが期待されていることから起きるエラー?のようですが。これはもうMakefile.amのほうを編集して解決してしまいます。

sample/Makefile.am:5: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

configureでエラー

sed: ./ltmain.sh: No such file or directory
mv: rename libtoolT to libtool: No such file or directory
cp: libtoolT: No such file or directory
chmod: libtool: No such file or directory
config.status: executing default commands

↑を参考にしました。configureファイル生成前に、必要なライブラリをインストールして glibtoolize 実施。

0
1
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
1