ユーザ用ツール

サイト用ツール


サイドバー


最近の更新




タグ一覧

タグ#
1
1
1
1
1
1
1
1
1
1
tools:bison:インストール:3.7.4

Bisonをソースからインストール

依存ライブラリ

手順

$ wget https://ftp.gnu.org/gnu/bison/bison-3.7.4.tar.gz
$ tar xvf bison-3.7.4.tar.gz
$ cd bison-3.7.4/
$ mkdir build
$ cd build
$ PATH=/opt/m4/1.4.18/bin:${PATH} \
  ../configure --prefix=/opt/bison/3.7.4
$ make
$ make install

環境変数

$ export PATH=/opt/bison/3.7.4/bin:${PATH}
$ export LD_LIBRARY_PATH=/opt/bison/3.7.4/lib:${LD_LIBRARY_PATH}

スクリプト

#!/bin/bash

#############################################################
inst_ver=3.7.4
inst_target=/opt/bison/${inst_ver}
arch_file="bison-"${inst_ver}".tar.gz"
target_web="https://ftp.gnu.org/gnu/bison/"${arch_file}
working_dir=$(cd $(dirname $0); pwd)/bison-${inst_ver}
m4_path=/opt/m4/1.4.18/bin
#############################################################

if [ -d ${inst_target} ];
then
    echo "${inst_target} is already exist"
    exit 0
fi

if [ ! -d ${m4_path} ];
then
    echo "m4 is not exist"
    exit 1
fi    

mkdir -p ${inst_target}
if [ $? -ne 0 ];
then
    echo "You do not have write permission on "${inst_target}"."
    echo "Scipt is aborted."
    exit 1
fi

rm -rf ${arch_file} ${working_dir}

wget ${target_web}
if [ $? -ne 0 ];
then
    echo "command is failed"
    echo "wget ${target_web}"
    exit 1
fi
mkdir ${working_dir}
tar xvf ${arch_file} -C ${working_dir} --strip-components 1
cd ${working_dir}
mkdir -p build
cd build
PATH=${m4_path}:${PATH} ../configure --prefix=${inst_target}
make
make install
tools/bison/インストール/3.7.4.txt · 最終更新: 2021/01/14 07:06 by michiya