ユーザ用ツール

サイト用ツール


tools:flex:インストール:2.6.4

差分

このページの2つのバージョン間の差分を表示します。

この比較画面にリンクする

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
tools:flex:インストール:2.6.4 [2021/01/13 09:35]
michiya
tools:flex:インストール:2.6.4 [2021/01/14 07:50] (現在)
michiya
行 1: 行 1:
 ====== Flexをソースからのインストール ====== ====== Flexをソースからのインストール ======
  
-必須ライブラリ+===== 依存ライブラリ ===== 
   * [[tools:libtool:インストール:インストール|GNU Libtool]]   * [[tools:libtool:インストール:インストール|GNU Libtool]]
   * [[tools:m4:インストール:インストール|m4]]   * [[tools:m4:インストール:インストール|m4]]
行 7: 行 8:
   * [[tools:gettext:インストール:インストール|gettext]]   * [[tools:gettext:インストール:インストール|gettext]]
   * [[tools:automake:インストール:インストール|automake]]   * [[tools:automake:インストール:インストール|automake]]
-  * [[tools:bison:インストール:インストール|Bison]] +  * [[tools:bison:インストール:インストール|Bison]](任意) 
-  * [[tools:help2man:インストール:インストール|GNU help2man]] +  * [[tools:help2man:インストール:インストール|GNU help2man]](任意) 
-  * [[tools:texinfo:インストール:6.7|Texinfo]] +  * [[tools:texinfo:インストール:6.7|Texinfo]](任意) 
-  * [[tools:gnu_indent:インストール:インストール|GNU Indent]]+  * [[tools:gnu_indent:インストール:インストール|GNU Indent]](任意) 
 + 
 +===== インストール手順 =====
  
 <code> <code>
行 16: 行 19:
 $ tar xvf flex-2.6.4.tar.gz $ tar xvf flex-2.6.4.tar.gz
 $ cd flex-2.6.4/ $ cd flex-2.6.4/
-export LIBTOOLIZE=/opt/libtool/2.4.6/bin/libtoolize  +$ LIBTOOLIZE=/opt/libtool/2.4.6/bin/libtoolize \ 
-$ ./autogen.sh  +  PATH=/opt/automake/1.16.3/bin:/opt/gettext/0.21/bin:/opt/autoconf/2.69/bin:/opt/m4/1.4.18/bin:${PATH} \ 
-$ ./configure --prefix=/opt/flex/2.6.4 CFLAGS='-g -O2 -D_GNU_SOURCE'+  ./autogen.sh  
 +$ ./configure 
 +  PATH=/opt/indent/2.2.12/bin:/opt/texinfo/6.7/bin:/opt/help2man/1.47.16/bin:/opt/bison/3.7.4/bin:/opt/m4/1.4.18/bin:${PATH} \ 
 +  --prefix=/opt/flex/2.6.4 
 +  CFLAGS='-g -O2 -D_GNU_SOURCE'
 $ make $ make
 $ make install $ make install
 </code> </code>
  
 +===== 環境変数 =====
  
 +<code>
 +$ export PATH=/opt/flex/2.6.4/bin:${PATH}
 +$ export LD_LIBRARY_PATH=/opt/flex/2.6.4/lib:${LD_LIBRARY_PATH}
 +$ export C_INCLUDE_PATH=/opt/flex/2.6.4/include:${C_INCLUDE_PATH}
 +$ export CPLUS_INCLUDE_PATH=/opt/flex/2.6.4/include:${CPLUS_INCLUDE_PATH}
 +</code>
 +
 +===== スクリプト =====
 +
 +<code>
 +#!/bin/bash
 +
 +#############################################################
 +inst_ver=2.6.4
 +inst_target=/opt/flex/${inst_ver}
 +arch_file="flex-"${inst_ver}".tar.gz"
 +target_web="https://github.com/westes/flex/releases/download/v2.6.4/"${arch_file}
 +working_dir=$(cd $(dirname $0); pwd)/flex-${inst_ver}
 +m4_path=/opt/m4/1.4.18/bin
 +libtool_path=/opt/libtool/2.4.6/bin/libtoolize
 +autoconf_path=/opt/autoconf/2.69/bin
 +gettext_path=/opt/gettext/0.21/bin
 +automake_path=/opt/automake/1.16.3/bin
 +bison_path=/opt/bison/3.7.4/bin
 +help2man_path=/opt/help2man/1.47.16/bin
 +texinfo_path=/opt/texinfo/6.7/bin
 +indent_path=/opt/indent/2.2.12/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    
 +if [ ! -f ${libtool_path} ];
 +then
 +    echo "libtool is not exist"
 +    exit 1
 +fi
 +if [ ! -d ${autoconf_path} ];
 +then
 +    echo "autoconf_path is not exist"
 +    exit 1
 +fi
 +if [ ! -d ${gettext_path} ];
 +then
 +    echo "gettext_path is not exist"
 +    exit 1
 +fi
 +if [ ! -d ${automake_path} ];
 +then
 +    echo "automake_path 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}
 +LIBTOOLIZE=${libtool_path} PATH=${automake_path}:${gettext_path}:${autoconf_path}:${m4_path:}${PATH} ./autogen.sh 
 +./configure PATH=${indent_path}:${texinfo_path}:${help2man_path}:${bison_path}:${m4_path}:${PATH} --prefix=/opt/flex/2.6.4 CFLAGS='-g -O2 -D_GNU_SOURCE'
 +make
 +make install
 +</code>
tools/flex/インストール/2.6.4.1610530524.txt.gz · 最終更新: 2021/01/13 09:35 by michiya