PCRE (Perl-Compatible Regular Expressions Library) のインストール

PCRE (Perl-Compatible Regular Expressions Library) というPerlで採用されている正規表現と互換性のある正規表現エンジンのライブラリーをソースコードからインストールする。
PCREはApache HTTP Serverなどの多くのパッケージの正規表現エンジンとして採用されている。現在はPCRE2が最新である。しかし,昔から存在するソフトにはPCREが採用されている。
そのため,PCRE2ではなくPCREをインストールする。
項目 | 説明 |
---|---|
配布元 | PCRE – Perl Compatible Regular Expressions |
リポジトリー | [pcre] Index of / |
手順 | [pcre] Contents of /code/tags/pcre-8.43/README |
依存情報 | |
依存先 (必須) | Make (GNU Make) |
依存先 (任意) | CMake, BZip2, ZLib, Readline, Editline |
依存元 | Apache HTTP Server |
sh -eux <<-"EOT"
PKG=pcre VER=8.43 TAG=
LOCAL=~/.local J=$(grep -cs '^processor' /proc/cpuinfo || echo 2)
mkdir -p "$LOCAL/src"
cd "$LOCAL/src"
if false command -v git >/dev/null; then
[ -e $PKG ] || git clone --depth 1 svn://vcs.exim.org/pcre/code/trunk $PKG
cd $PKG
git fetch --depth 1 origin tag $TAG
git checkout -f $TAG
git clean -dfX
else
[ -e $PKG-$VER ] || wget https://ftp.pcre.org/pub/pcre/$PKG-$VER.tar.bz2
tar -xf $PKG-$VER.*
cd $PKG-$VER
make -kj $J distclean clean || :
fi
./configure --prefix="$LOCAL/stow/$PKG-$VER"
make -j $J
make -j $J check
make -j $J install
cd "$LOCAL/stow"
echo $PKG-[0-9]* | xargs -n 1 stow --ignore=dir -D
stow --ignore=dir $PKG-$VER
EOT
日付 | バージョン | OS | 依存関係 |
---|---|---|---|
2018-05-30 | 8.42 | Ubuntu 16.04 | |
2019-03-31 | 8.43 | Ubuntu 18.04 | GNU Make 4.2.1, GCC 7.4.0 |
Windowsなどでインストールする際にはCMakeを使ったほうがいいかもしれない。
また,PCREのリポジトリーはSVNになっており,チェックアウトの方法などがわからなかったため,配布用tarファイルからインストールした。