<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Copyright (C) 2010-2023 j8takagi -->
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>YACASL2のインストール</title>
<meta name="description" content="YACASL2のインストール">
<meta name="keywords" content="YACASL2のインストール">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="#Top" rel="start" title="Top">
<link href="#SEC_Contents" rel="contents" title="Table of Contents">
<link href="dir.html#Top" rel="up" title="(dir)">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
body {
margin-left: 6em;
margin-right: 12em;
color: black;
background-color: #EEE;
font-family: sans-serif;
}
h1, h2, h3, h4, h5, h6 {
color: navy;
background-color: inherit;
}
h1, h2 {
margin-left: -2em;
}
.node{
margin-left: -3em;
color: inherit;
background-color: #DDF;
}
.menu, .node {
color: inherit;
background-color: #DDF;
}
table.menu, table.menu th, table.menu td {
border-style: none;
}
h2 {
padding: 0.25em;
border: 2px solid navy;
}
.contents {
background-color: #DDF;
border: 4px double #000;
padding: 0.5em 1em 0.5em 1em;
}
.contents h2 {
margin-left: 0;
color: black;
background-color: #DDF;
}
.contents li {
list-style-type: none;
}
.shortcontents {
background-color: #DDF;
border: 4px double #000;
}
.shortcontents h2{
display: none;
}
h1.node-heading {
display: none;
}
h2.contents-heading{
display: none;
}
h2.shortcontents-heading{
display: none;
}
.shortcontents a {
margin-right: 1em;
}
h3, h4, h5 {
margin-left: -1em;
}
h5 {
font-size: 100%;
}
p {
line-height: 1.25em;
margin-top: 0;
margin-bottom: 0.5em;
}
a:hover {
color: red;
text-decoration: underline;
}
pre.example, pre.verbatim {
padding: 0.5em 1em 0.5em 1em;
border: 1px solid #CCC;
}
a {
text-decoration: none;
}
blockquote {
line-height: 1.25em;
border: 1px solid #00F;
}
kbd, code, .file, var {
font-style: normal;
font-weight: normal;
font-family: monospace;
font-size: 120%;
margin-left:0.25em;
margin-right: 0.25em;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse; /* æ ç·ã®è¡¨ç¤ºæ¹æ³ */
margin-bottom: 1em;
}
table.cartouche, table.cartouche th, table.cartouche td {
border: none;
}
pre.example .command, pre.example .option, pre.example kbd {
font-weight: bold;
font-family: monospace;
font-size: 110%;
background-color: inherit;
font-style: normal;
margin-left:0;
margin-right: 0;
}
pre.example strong {
font: inherit;
border: 2px solid green;
}
pre.example em {
font-size: 100%;
font-style: normal;
font-weight: bold;
}
th {
font-style: normal;
font-weight: bold;
font-family: sans-serif;
}
th {
text-align: center;
}
dfn {
font-style: normal;
}
.header, .menu {
display: none;
}
em {
font-style: normal;
font-weight: bold;
}
-->
</style>
</head>
<body lang="ja_JP">
<h1 class="settitle" align="center">YACASL2のインストール</h1>
<span id="Top"></span><div class="header">
<p>
Next: <a href="#Require" accesskey="n" rel="next">Require</a>, Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<h1 class="node-heading">Top</h1>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Require" accesskey="1">Require</a></td><td> </td><td align="left" valign="top">要件
</td></tr>
<tr><td align="left" valign="top">• <a href="#install" accesskey="2">install</a></td><td> </td><td align="left" valign="top">インストール
</td></tr>
</table>
<span id="SEC_Contents"></span>
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
<ul class="no-bullet">
<li><a id="toc-Yao-Jian-" href="#Require">1 要件</a></li>
<li><a id="toc-insutorunoShou-Shun-" href="#install">2 インストールの手順</a>
<ul class="no-bullet">
<li><a id="toc-YACASL2huairunodaunrodo" href="#Download">2.1 YACASL2ファイルのダウンロード</a></li>
<li><a id="toc-YACASL2huairunoJian-Zheng-" href="#Verify">2.2 YACASL2ファイルの検証</a>
<ul class="no-bullet">
<li><a id="toc-GnuPGFen-Li-Shu-Ming-denoJian-Zheng-" href="#GnuPGFen-Li-Shu-Ming-denoJian-Zheng-">2.2.1 GnuPG分離署名での検証</a></li>
<li><a id="toc-MD5hatusiyuZhi-denoJian-Zheng-" href="#MD5hatusiyuZhi-denoJian-Zheng-">2.2.2 MD5ハッシュ値での検証</a></li>
</ul></li>
<li><a id="toc-YACASL2huairunoZhan-Kai-" href="#Expand">2.3 YACASL2ファイルの展開</a></li>
<li><a id="toc-casl2-comet2-dumpwordnobirudo" href="#Build">2.4 <samp>casl2</samp> <samp>comet2</samp> <samp>dumpword</samp>のビルド</a></li>
<li><a id="toc-casl2noShi-Xing-tesuto" href="#Simple-Test">2.5 <samp>casl2</samp>の実行テスト</a></li>
<li><a id="toc-Xiang-Xi-natesuto" href="#Detail-Test">2.6 詳細なテスト</a></li>
<li><a id="toc-insutoru" href="#Install">2.7 インストール</a></li>
<li><a id="toc-Huan-Jing-Bian-Shu-noShe-Ding-" href="#Environment">2.8 環境変数の設定</a>
<ul class="no-bullet">
<li><a id="toc-sierunoQue-Ren-" href="#sierunoQue-Ren-">シェルの確認</a></li>
<li><a id="toc-PATHnoShe-Ding-" href="#PATHnoShe-Ding-">2.8.1 <code>PATH</code>の設定</a></li>
<li><a id="toc-INFOPATHnoShe-Ding-" href="#INFOPATHnoShe-Ding-">2.8.2 <code>INFOPATH</code>の設定</a></li>
</ul></li>
</ul></li>
</ul>
</div>
<hr>
<span id="Require"></span><div class="header">
<p>
Next: <a href="#install" accesskey="n" rel="next">install</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="Yao-Jian-"></span><h2 class="chapter">1 要件</h2>
<p>YACASL2は、LinuxやMac OS Xなど、UNIX系のOS上で動作します。現在動作を確認しているのは、Arch LinuxとUbuntu Linux、Mac OS Xです。
</p>
<p>インストール時に、<code>tar</code> <code>gcc</code> <code>make</code>が必要です。Linuxでは多くの場合、標準でインストールされています。Mac OS Xの場合、Xcodeの「Command Line Tools」に含まれます。
</p>
<hr>
<span id="install"></span><div class="header">
<p>
Previous: <a href="#Require" accesskey="p" rel="prev">Require</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="insutorunoShou-Shun-"></span><h2 class="chapter">2 インストールの手順</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Download" accesskey="1">Download</a></td><td> </td><td align="left" valign="top">YACASL2ファイルのダウンロード
</td></tr>
<tr><td align="left" valign="top">• <a href="#Verify" accesskey="2">Verify</a></td><td> </td><td align="left" valign="top">YACASL2ファイルの検証
</td></tr>
<tr><td align="left" valign="top">• <a href="#Expand" accesskey="3">Expand</a></td><td> </td><td align="left" valign="top">YACASL2ファイルの展開
</td></tr>
<tr><td align="left" valign="top">• <a href="#Build" accesskey="4">Build</a></td><td> </td><td align="left" valign="top"><samp>casl2</samp> <samp>comet2</samp> <samp>dumpword</samp>のビルド
</td></tr>
<tr><td align="left" valign="top">• <a href="#Simple-Test" accesskey="5">Simple Test</a></td><td> </td><td align="left" valign="top"><samp>casl2</samp>の実行テスト
</td></tr>
<tr><td align="left" valign="top">• <a href="#Detail-Test" accesskey="6">Detail Test</a></td><td> </td><td align="left" valign="top">詳細なテスト
</td></tr>
<tr><td align="left" valign="top">• <a href="#Install" accesskey="7">Install</a></td><td> </td><td align="left" valign="top">インストール
</td></tr>
<tr><td align="left" valign="top">• <a href="#Environment" accesskey="8">Environment</a></td><td> </td><td align="left" valign="top">環境変数の設定
</td></tr>
</table>
<hr>
<span id="Download"></span><div class="header">
<p>
Next: <a href="#Verify" accesskey="n" rel="next">Verify</a>, Previous: <a href="#install" accesskey="p" rel="prev">install</a>, Up: <a href="#install" accesskey="u" rel="up">install</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="YACASL2huairunodaunrodo"></span><h3 class="section">2.1 YACASL2ファイルのダウンロード</h3>
<p><a href="http://www.j8takagi.net/yacasl2/">YACASL2のサイト</a>から、<samp>tar.gz</samp>または<samp>tar.xz</samp>ファイルと、対応する検証用ファイルをダウンロードします。<a href="http://github.com/j8takagi/YACASL2/downloads/">githubのダウンロードページ</a>から<samp>tar.gz</samp>などのファイルをダウンロードすることもできます。
</p>
<hr>
<span id="Verify"></span><div class="header">
<p>
Next: <a href="#Expand" accesskey="n" rel="next">Expand</a>, Previous: <a href="#Download" accesskey="p" rel="prev">Download</a>, Up: <a href="#install" accesskey="u" rel="up">install</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="YACASL2huairunoJian-Zheng-"></span><h3 class="section">2.2 YACASL2ファイルの検証</h3>
<p>ダウンロードが完了したら、圧縮ファイルが改竄されていないか検証します。検証には、GnuPG分離署名か、MD5ハッシュ値を使います。
</p>
<span id="GnuPGFen-Li-Shu-Ming-denoJian-Zheng-"></span><h4 class="subsection">2.2.1 GnuPG分離署名での検証</h4>
<p>GnuPGの<code>gpg</code>で圧縮ファイルを検証します。この検証を行うには、GnuPGがインストールされ、自分の秘密鍵と公開鍵のペアが作成されている必要があります。
</p>
<div class="example">
<pre class="example">$ <kbd>gpg --verify yacasl2.tar.xz.asc</kbd>
gpg: Signature made Sat Oct 27 02:17:16 2012 JST using RSA key ID 25B62DD1
gpg: Can't check signature: public key not found
$ <kbd>gpg --recv-keys 25B62DD1</kbd>
gpg: requesting key 25B62DD1 from hkp server keys.gnupg.net
gpg: key 25B62DD1: public key "j8takagi <j8takagi@nifty.com>" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
$ <kbd>gpg --lsign-key 25B62DD1</kbd>
pub 2048R/25B62DD1 created: 2012-09-29 expires: never usage: SC
trust: unknown validity: full
sub 2048R/92E25C29 created: 2012-09-29 expires: never usage: E
[ full ] (1). j8takagi <j8takagi@nifty.com>
pub 2048R/25B62DD1 created: 2012-09-29 expires: never usage: SC
trust: unknown validity: full
Primary key fingerprint: ...
.* <.*@.*>
Are you sure that you want to sign this key with your
key ".* <.*@.*>"
The signature will be marked as non-exportable.
Really sign? (y/N) <kbd>y</kbd>
You need a passphrase to unlock the secret key for
user: ".* <.*@.*>"
2048-bit RSA key, ID ........, created 20..-..-..
<input password> <kbd>password</kbd>
$ <kbd>gpg --verify yacasl2.tar.xz.asc</kbd>
gpg: Signature made Sat Oct 27 02:17:16 2012 JST using RSA key ID 25B62DD1
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 4 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1 valid: 4 signed: 0 trust: 4-, 0q, 0n, 0m, 0f, 0u
gpg: Good signature from "j8takagi <j8takagi@nifty.com>"
</pre></div>
<span id="MD5hatusiyuZhi-denoJian-Zheng-"></span><h4 class="subsection">2.2.2 MD5ハッシュ値での検証</h4>
<p><code>openssl</code>と<code>diff</code>で圧縮ファイルを検証します。
</p>
<div class="example">
<pre class="example">$ <kbd>openssl md5 yacasl2.tar.gz | diff -s yacasl2.tar.gz.md5sum -</kbd>
Files yacasl2.tar.gz.md5sum and - are identical
</pre></div>
<hr>
<span id="Expand"></span><div class="header">
<p>
Next: <a href="#Build" accesskey="n" rel="next">Build</a>, Previous: <a href="#Verify" accesskey="p" rel="prev">Verify</a>, Up: <a href="#install" accesskey="u" rel="up">install</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="YACASL2huairunoZhan-Kai-"></span><h3 class="section">2.3 YACASL2ファイルの展開</h3>
<p>YACASL2ファイルをダウンロードしたら、<code>tar</code>コマンドで展開します。
</p>
<div class="example">
<pre class="example">$ <kbd>tar xvzf yacasl2.tar.gz</kbd>
</pre></div>
<hr>
<span id="Build"></span><div class="header">
<p>
Next: <a href="#Simple-Test" accesskey="n" rel="next">Simple Test</a>, Previous: <a href="#Expand" accesskey="p" rel="prev">Expand</a>, Up: <a href="#install" accesskey="u" rel="up">install</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="casl2-comet2-dumpwordnobirudo"></span><h3 class="section">2.4 <samp>casl2</samp> <samp>comet2</samp> <samp>dumpword</samp>のビルド</h3>
<p>展開したら、<code>make</code>コマンドで<samp>casl2</samp> <samp>comet2</samp> <samp>dumpword</samp>をビルドします。
</p>
<div class="example">
<pre class="example">$ <kbd>cd yacasl2</kbd>
$ <kbd>make</kbd>
make -C src
make[1]: Entering directory ‘/home/kazubito/yacasl2/src’
gcc -c -g -Wall -I ../include casl2.c
gcc -c -g -Wall -I ../include word.c
gcc -c -g -Wall -I ../include hash.c
gcc -c -g -Wall -I ../include cerr.c
gcc -c -g -Wall -I ../include struct.c
gcc -c -g -Wall -I ../include cmd.c
gcc -c -g -Wall -I ../include assemble.c
gcc -c -g -Wall -I ../include token.c
gcc -c -g -Wall -I ../include label.c
gcc -c -g -Wall -I ../include macro.c
gcc -c -g -Wall -I ../include exec.c
gcc -c -g -Wall -I ../include dump.c
gcc -g -Wall -I ../include -o ../casl2 casl2.o word.o hash.o cerr.o st
ruct.o cmd.o assemble.o token.o label.o macro.o exec.o dump.o
gcc -c -g -Wall -I ../include comet2.c
gcc -g -Wall -I ../include -o ../comet2 comet2.o word.o hash.o cerr.o
struct.o cmd.o exec.o dump.o
gcc -c -g -Wall -I ../include dumpword.c
gcc -g -Wall -I ../include -o ../dumpword dumpword.o word.o cerr.o
make[1]: Leaving directory ‘/home/kazubito/yacasl2/src’
</pre></div>
<hr>
<span id="Simple-Test"></span><div class="header">
<p>
Next: <a href="#Detail-Test" accesskey="n" rel="next">Detail Test</a>, Previous: <a href="#Build" accesskey="p" rel="prev">Build</a>, Up: <a href="#install" accesskey="u" rel="up">install</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="casl2noShi-Xing-tesuto"></span><h3 class="section">2.5 <samp>casl2</samp>の実行テスト</h3>
<p>ビルドしたら、次のコマンドが正常に実行できるかを確認します。
正常に実行された場合は、「Hello, World!」と表示されます。
</p>
<div class="example">
<pre class="example">$ <kbd>./casl2 as/hello.casl</kbd>
Hello, World!
</pre></div>
<hr>
<span id="Detail-Test"></span><div class="header">
<p>
Next: <a href="#Install" accesskey="n" rel="next">Install</a>, Previous: <a href="#Simple-Test" accesskey="p" rel="prev">Simple Test</a>, Up: <a href="#install" accesskey="u" rel="up">install</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="Xiang-Xi-natesuto"></span><h3 class="section">2.6 詳細なテスト</h3>
<p><code>make check</code>コマンドを実行すると、正常にビルドできているかどうかを詳細にテストできます。
テストには、しばらく時間がかかります。
</p>
<div class="example">
<pre class="example">$ <kbd>make check</kbd>
195 / 195 tests passed. Details in /home/username/yacasl2/test/integra
tion/casl2/Test.log
All tests are succeded.
149 / 149 tests passed. Details in /home/username/yacasl2/test/integra
tion/comet2/Test.log
All tests are succeded.
4 / 4 tests passed. Details in /home/username/yacasl2/test/integration
/dumpword/Test.log
All tests are succeded.
</pre></div>
<hr>
<span id="Install"></span><div class="header">
<p>
Next: <a href="#Environment" accesskey="n" rel="next">Environment</a>, Previous: <a href="#Detail-Test" accesskey="p" rel="prev">Detail Test</a>, Up: <a href="#install" accesskey="u" rel="up">install</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="insutoru"></span><h3 class="section">2.7 インストール</h3>
<p>ビルドが成功したら、<code>make install</code>コマンドで必要なファイルをインストールできます。
初期設定では、ホームディレクトリー以下にYACASL2のファイルがインストールされます。
</p>
<div class="example">
<pre class="example">$ <kbd>make install</kbd>
</pre></div>
<p>コマンド実行時にオプションを指定することで、インストール先のディレクトリーを変更できます。
例えば、<samp>/usr/local</samp>以下にファイルをインストールするには、
次のようにコマンドを実行します。
</p>
<div class="example">
<pre class="example">$ <kbd>sudo make install prefix=/usr/local</kbd>
</pre></div>
<p>オプションの詳細は次のとおりです。
</p>
<table>
<thead><tr><th width="20%">オプション</th><th width="50%">説明</th><th width="30%">初期設定</th></tr></thead>
<tr><td width="20%"><var>prefix</var></td><td width="50%">インストール時のルートファイル</td><td width="30%"><samp>~</samp></td></tr>
<tr><td width="20%"><var>bindir</var></td><td width="50%">実行ファイルのインストール先</td><td width="30%"><samp>$prefix/bin</samp></td></tr>
<tr><td width="20%"><var>infodir</var></td><td width="50%">infoファイルのインストール先</td><td width="30%"><samp>$prefix/share/info</samp></td></tr>
</table>
<hr>
<span id="Environment"></span><div class="header">
<p>
Previous: <a href="#Install" accesskey="p" rel="prev">Install</a>, Up: <a href="#install" accesskey="u" rel="up">install</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
</div>
<span id="Huan-Jing-Bian-Shu-noShe-Ding-"></span><h3 class="section">2.8 環境変数の設定</h3>
<p>環境変数<code>PATH</code>や<code>CASL2LIB</code>を設定することで、YACASL2が使いやすくなります。環境変数は、使っているシェルを確認してから設定します。
</p>
<span id="sierunoQue-Ren-"></span><h4 class="unnumberedsubsec">シェルの確認</h4>
<p>環境変数の設定方法は使っているシェルによって異なります。シェルは、次のコマンドで確認できます。
</p>
<div class="example">
<pre class="example">$ <kbd>echo $SHELL</kbd>
/bin/bash
</pre></div>
<p>現在もっとも多く使われているシェルは、Bashでしょう。以下、Bashでの設定方法を説明します。
</p>
<span id="PATHnoShe-Ding-"></span><h4 class="subsection">2.8.1 <code>PATH</code>の設定</h4>
<p><code>PATH</code>にYACASL2の実行ファイルのインストール先を追加すると、ディレクトリーの指定を省略して<code>casl2</code> <code>comet2</code> <code>dumpword</code>を実行できます。例えば、初期設定のまま実行ファイルを<samp>~/bin</samp>にインストールしたときは、次のコマンドで設定できます。
</p>
<div class="example">
<pre class="example">$ <kbd>PATH=$PATH:~/bin && export PATH</kbd>
</pre></div>
<p>環境変数の設定は、シェルの初期設定ファイルに追加することでログインしたあと自動的に反映されるようになります。Bashでは<samp>~/.bashrc</samp>が初期設定ファイルです。次のコマンドで追加できます。
</p>
<div class="example">
<pre class="example">$ <kbd>echo ’PATH=$PATH:~/bin && export PATH’ >>~/.bashrc</kbd>
</pre></div>
<span id="INFOPATHnoShe-Ding-"></span><h4 class="subsection">2.8.2 <code>INFOPATH</code>の設定</h4>
<p><code>INFOPATH</code>にYACASL2のInfoファイルをインストールしたディレクトリーを追加すると、ディレクトリーの指定を省略して<code>casl2</code> <code>comet2</code> <code>dumpword</code>を実行できます。例えば、初期設定のままInfoファイルを<samp>~/share/info</samp>にインストールしたときは、次のコマンドで設定できます。
</p>
<div class="example">
<pre class="example">$ <kbd>INFOPATH=$INFOPATH:~/share/info && export INFOPATH</kbd>
</pre></div>
<p><samp>~/.bashrc</samp>には次のコマンドで追加できます。
</p>
<div class="example">
<pre class="example">$ <kbd>echo 'INFOPATH=$INFOPATH:~/share/info && export INFOPATH' >>~/.bashrc</kbd>
</pre></div>
<hr>
</body>
</html>