APR-utilのインストール

APRの同伴ライブラリーであり,よくAPRとセット使われるAPR-utilをソースコードからインストールする。
項目 | 説明 |
---|---|
配布元 | Welcome! – The Apache Portable Runtime Project |
リポジトリー | |
手順 | apr/README at 1.6.5 · apache/apr |
依存情報 | apr/README at 1.6.5 · apache/apr |
依存先 (必須) | |
依存先 (任意) | リポジトリーからのビルド用: autoconf, libtool 1.4+, python |
依存元 |
|
sh -eux <<-"EOT"
PKG=apr-util VER=1.6.1 TAG=$VER
LOCAL=~/.local J=$(grep -cs '^processor' /proc/cpuinfo || echo 2)
mkdir -p "$LOCAL/src"
cd "$LOCAL/src"
if command -v git >/dev/null; then
[ -e $PKG ] || git clone --depth 1 https://github.com/apache/apr-util $PKG
cd $PKG
git fetch --depth 1 origin tag $TAG
git checkout -f $TAG
git clean -dfX
[ -e .gitmodules ] && git submodule foreach --recursive git clean -dfX
[ -e configure.ac ] && autoreconf -is
./buildconf
else
[ -e $PKG-$VER ] || wget http://archive.apache.org/dist/apr/$PKG-$VER.tar.bz2
tar -xf $PKG-$VER.*
cd $PKG-$VER
make -kj $J distclean clean || :
fi
./configure --prefix="$LOCAL/stow/$PKG-$VER" --with-apr="$LOCAL"
make -j $J
make 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-16 | 1.6.1 | Ubuntu 16.04 | |
2019-03-31 | 1.6.1 | Ubuntu 18.04 | GNU Make 4.2.1, GCC 7.4.0, libtool 2.4.6 |
APR-utilのインストール手順はAPRと同じようだ。
configureの実行時に,--with-apr
オプションでAPRのインストール場所を指定していない場合,以下のエラーが出るので注意する。
./configure --prefix=$LOCAL/stow/$PKG-$VER
Applying apr-util hints file rules for x86_64-pc-linux-gnu checking for APR... no configure: error: APR could not be located. Please use the --with-apr option.
また,make check
実行時に,-j $J
があると以下のエラーが出てしまったので,-j $J
を外した。
make -j $J check
のエラー/bin/bash /home/senooken/.local/stow/apr-1.6.5/build-1/libtool --silent --mode=l ink gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/home/senooken/.local/src/apr-util/include -I/home/senooken/.local/src/apr-uti l/include/private -I/home/senooken/.local/stow/apr-1.6.5/include/apr-1 -L /home/senooken/.local/lib64 -L/home/senooken/.local/lib -L/home/senooken/.local/ opt/lib64 -L/home/senooken/.local/opt/lib -no-install -o testall abts.lo testut il.lo teststrmatch.lo testuri.lo testuuid.lo testbuckets.lo testpass.lo testmd4. lo testmd5.lo testldap.lo testdate.lo testdbm.lo testdbd.lo testxml.lo testrmm.l o testreslist.lo testqueue.lo testxlate.lo testmemcache.lo testcrypto.lo testsip hash.lo testredis.lo ../libaprutil-1.la -lexpat /home/senooken/.local/stow/apr-1 .6.5/lib/libapr-1.la -lrt -lcrypt -lpthread -ldl libtool: error: 'testmemcache.lo' is not a valid libtool object make[1]: *** [Makefile:50: testall] Error 1
make check
実行時は並列ビルドは控えたほうが無難なのかもしれない。