| 1 |
// -*- coding: utf-8 -*- |
| 2 |
:source-highlighter: pygments |
| 3 |
|
| 4 |
//@start header |
| 5 |
// This is a source document from which INSTALL.en.adoc (English) and |
| 6 |
// INSTALL.ja.adoc (Japanese) are generated. If you're reading this in |
| 7 |
// an un-tarred source tree, check out one of the generated adoc files. |
| 8 |
|
| 9 |
// Use English as the default language. |
| 10 |
// Use "--attribute=lang=ja" option for Japanese output. |
| 11 |
ifndef::lang[:lang: en] |
| 12 |
|
| 13 |
ifeval::["{lang}" == "en"] |
| 14 |
:EN: |
| 15 |
endif::[] |
| 16 |
ifeval::["{lang}" == "ja"] |
| 17 |
:JA: |
| 18 |
endif::[] |
| 19 |
|
| 20 |
//@end header |
| 21 |
|
| 22 |
ifdef::JA[] |
| 23 |
= Gaucheのコンパイルとインストール |
| 24 |
endif::JA[] |
| 25 |
ifdef::EN[] |
| 26 |
= Compiling and Installing Gauche |
| 27 |
endif::EN[] |
| 28 |
|
| 29 |
ifdef::JA[] |
| 30 |
NOTE: Gaucheは開発中のシステムで、頻繁に更新しています。次のURLで最新の |
| 31 |
情報が得られます: |
| 32 |
endif::JA[] |
| 33 |
ifdef::EN[] |
| 34 |
NOTE: The Gauche system is a work in progress and frequently updated. |
| 35 |
Check out the latest information on the site: |
| 36 |
endif::EN[] |
| 37 |
https://practical-scheme.net/gauche/ |
| 38 |
|
| 39 |
ifdef::JA[] |
| 40 |
このドキュメントでは、配布されるtarballからGaucheをコンパイルしてインストールする |
| 41 |
方法を説明します。ソースリポジトリをcloneしてコンパイルする場合はさらに準備が必要です。 |
| 42 |
詳しくは link:HACKING.adoc[] ファイルを参照してください。 |
| 43 |
endif::JA[] |
| 44 |
ifdef::EN[] |
| 45 |
This document explains how to compile and install Gauche from a distributed |
| 46 |
tarball. To compile from cloned source tree from the repository, |
| 47 |
you need some extra steps; See the file link:HACKING.adoc[] for the details. |
| 48 |
endif::EN[] |
| 49 |
|
| 50 |
|
| 51 |
ifdef::JA[] |
| 52 |
== 必要なもの |
| 53 |
endif::JA[] |
| 54 |
ifdef::EN[] |
| 55 |
== Prerequisites |
| 56 |
endif::EN[] |
| 57 |
|
| 58 |
|
| 59 |
ifdef::JA[] |
| 60 |
Unix環境の標準的なビルドツールとGNU makeが必要です。 |
| 61 |
|
| 62 |
それに加え、以下のツールとライブラリをあらかじめ入れておくことを |
| 63 |
推奨します。無くてもGaucheはビルドできますが、一部機能が使えなくなります。 |
| 64 |
|
| 65 |
- Makeinfo (バージョン5.0以降) - infoドキュメントをビルドするのに使います。 |
| 66 |
入ってなければドキュメントはインストールされません (その場合、REPLでのオンラインドキュメント |
| 67 |
も使えません) |
| 68 |
- Gzip - 同じくドキュメントビルド時に使われます。 |
| 69 |
- Libiconv - 文字エンコーディング変換に使われます。下の説明も参照。 |
| 70 |
- link:https://tls.mbed.org/[Mbed TLS] - TLS/SSL接続に使われます。下の説明も参照。 |
| 71 |
|
| 72 |
他のオプショナルなライブラリについては以下で順次説明します。 |
| 73 |
|
| 74 |
Windows上では、MSYS/MinGWを使ってビルドできます。 |
| 75 |
詳しくはlink:doc/HOWTO-mingw.adoc[]を参照してください。 |
| 76 |
endif::JA[] |
| 77 |
ifdef::EN[] |
| 78 |
You need the standard build tools of the Unix environment, and |
| 79 |
GNU make. |
| 80 |
|
| 81 |
Besides that, the following |
| 82 |
tools and libraries are recommended to have. You can build Gauche without |
| 83 |
them, but some features won't be available. |
| 84 |
|
| 85 |
- Makeinfo (version 5.0 or later) - used to build info document. |
| 86 |
If the build platform doesn't have it, document building is skipped and info |
| 87 |
document won't be installed. (You need info document to use online document |
| 88 |
browsing from REPL.) |
| 89 |
- Gzip - also used during document building. |
| 90 |
- Libiconv - Used for character encoding conversion. See below. |
| 91 |
- link:https://tls.mbed.org/[Mbed TLS] - Used for TLS/SSL connection. See below. |
| 92 |
|
| 93 |
There are other optional libraries, which will be explained below. |
| 94 |
|
| 95 |
To build on Windows, you can use MSYS/MinGW. |
| 96 |
See link:doc/HOWTO-mingw.adoc[] for the details. |
| 97 |
endif::EN[] |
| 98 |
|
| 99 |
|
| 100 |
ifdef::JA[] |
| 101 |
== 簡単な方法 |
| 102 |
endif::JA[] |
| 103 |
ifdef::EN[] |
| 104 |
== Quick Start |
| 105 |
endif::EN[] |
| 106 |
|
| 107 |
[source,console] |
| 108 |
---- |
| 109 |
% ./configure |
| 110 |
% make |
| 111 |
% make check |
| 112 |
% make install |
| 113 |
---- |
| 114 |
|
| 115 |
ifdef::JA[] |
| 116 |
これで、Gaucheシステムが `/usr/local/bin`, `/usr/local/lib/gauche` 及び |
| 117 |
`/usr/local/share/gauche` 以下にインストールされます。 |
| 118 |
endif::JA[] |
| 119 |
ifdef::EN[] |
| 120 |
Things will be installed under `/usr/local/bin`, `/usr/local/lib/gauche`, |
| 121 |
and `/usr/local/share/gauche`. |
| 122 |
endif::EN[] |
| 123 |
|
| 124 |
ifdef::JA[] |
| 125 |
既にGaucheがインストールされているシステムで、 |
| 126 |
全く同じconfigurationオプションで新しいバージョンのGaucheをインストール |
| 127 |
する場合、`configure` の代わりに次のコマンドを使うこともできます。 |
| 128 |
endif::JA[] |
| 129 |
ifdef::EN[] |
| 130 |
If you have installed Gauche before, and want to install |
| 131 |
new version of Gauche with the same configuration option, |
| 132 |
you can use the following command instead of `configure`. |
| 133 |
endif::EN[] |
| 134 |
|
| 135 |
[source,console] |
| 136 |
---- |
| 137 |
% gauche-config --reconfigure | sh |
| 138 |
---- |
| 139 |
|
| 140 |
ifdef::JA[] |
| 141 |
`--reconfigure` オプションが与えられると、 `gauche-config` は現在 |
| 142 |
インストールされているGaucheがconfigureされた時のコマンドラインを |
| 143 |
標準出力に書き出します。それをシェルに評価させれば、同じオプションで |
| 144 |
configureすることができます。Gaucheをアップデートする場合に便利です。 |
| 145 |
endif::JA[] |
| 146 |
ifdef::EN[] |
| 147 |
When the option `--reconfigure` is given, `gauche-config` prints out |
| 148 |
the command line when it is configured. Pass the output to |
| 149 |
shell and you can reconfigure with the same options. It is a |
| 150 |
convenient way to update Gauche. |
| 151 |
endif::EN[] |
| 152 |
|
| 153 |
|
| 154 |
ifdef::JA[] |
| 155 |
== TLS/SSL のサポート |
| 156 |
endif::JA[] |
| 157 |
ifdef::EN[] |
| 158 |
== TLS/SSL support |
| 159 |
endif::EN[] |
| 160 |
|
| 161 |
ifdef::JA[] |
| 162 |
Gaucheはセキュアソケット通信にlink:https://tls.mbed.org/[MbedTLS]を |
| 163 |
使っています。 |
| 164 |
|
| 165 |
デフォルトでは、システムにMbedTLSライブラリがあればそれを使い、 |
| 166 |
無ければTLSのサポートを組み込みません。 |
| 167 |
システムにMbedTLSをインストールできない事情があったり、 |
| 168 |
コンパイル後のバイナリだけを別環境に持ってゆくので依存ライブラリを減らしたい場合は、 |
| 169 |
ビルド中にMbedTLSのソースをダウンロードしてGaucheに組み込んでしまうこともできます。 |
| 170 |
endif::JA[] |
| 171 |
ifdef::EN[] |
| 172 |
Gauche relies on link:https://tls.mbed.org/[MbedTLS] for secure |
| 173 |
connection support. |
| 174 |
|
| 175 |
By default, `configure` checks if the MbedTLS library is installed |
| 176 |
on the system, and use it if it's available. Otherwise, no TLS support |
| 177 |
is compiled. If you can't install MbedTLS for some reason, |
| 178 |
or you want to bring the compiled binary to the target system that |
| 179 |
may not have MbedTLS library, you can specify to download MbedTLS |
| 180 |
source during build and compile it into Gauche binary. |
| 181 |
endif::EN[] |
| 182 |
|
| 183 |
[horizontal] |
| 184 |
`--with-tls=none` :: do not include TLS/SSL support |
| 185 |
`--with-tls=mbedtls` :: include only mbedTLS support |
| 186 |
`--with-tls=mbedtls-internal` :: During the build, MbedTLS source is downloaded |
| 187 |
and compiled with Gauche. See below. |
| 188 |
|
| 189 |
|
| 190 |
ifdef::JA[] |
| 191 |
`mbedtls-internal` を指定すると、ビルド中にMbedTLSのソースを |
| 192 |
ダウンロードして、Gaucheの拡張ライブラリの一部として組み込みます。生成されるバイナリは |
| 193 |
システムのMbedTLSライブラリには依存しないので、MbedTLSが入っていないターゲットシステムに |
| 194 |
もバイナリをそのまま持って行けます。このオプションを使う場合はビルドにCMakeが必要です。 |
| 195 |
またその場合、`rfc--tls--mbed.so`および`libgauche-static-*.a`に |
| 196 |
MbedTLSのコードが含まれるため、バイナリの配布にあたってはMbedTLSのライセンスにも従う |
| 197 |
必要があります (Apache License 2.0)。 |
| 198 |
endif::JA[] |
| 199 |
ifdef::EN[] |
| 200 |
If you give `mbedtls-internal` in place of `mbedtls`, the build process downloads |
| 201 |
MbedTLS source and compile it into Gauche's extension library. The resulting |
| 202 |
binary doesn't depend on system's MbedTLS dynamic library, so you can move it |
| 203 |
to the systems that don't have MbedTLS. You need CMake to use this option. |
| 204 |
Note that if you use `mbedtls-internal`, MbedTLS code is included in |
| 205 |
`rfc--tls--mbed.so` and `libgauche-static-*.a`, so they are subject to the |
| 206 |
MbedTLS license as well (Apache License 2.0). |
| 207 |
endif::EN[] |
| 208 |
|
| 209 |
ifdef::JA[] |
| 210 |
MbedTLSライブラリはコンパイル時にでマルチスレッド対応にするかどうかを |
| 211 |
選べるようになっていますが、Gaucheではマルチスレッド対応でないと使えません。 |
| 212 |
システムのMbedTLSライブラリがマルチスレッド対応でコンパイルされていない場合は、 |
| 213 |
Gaucheに組み込むオプションを使ってください。 |
| 214 |
endif::JA[] |
| 215 |
ifdef::EN[] |
| 216 |
MbedTLS library can be compiled with or without multi-threading support. |
| 217 |
Gauche requires MbedTLS library to be compiled with multi-threading support. |
| 218 |
If the system's library doesn't have that support, use the option to |
| 219 |
build it into Gauche library. |
| 220 |
endif::EN[] |
| 221 |
|
| 222 |
ifdef::JA[] |
| 223 |
TLSを使う場合、サーバー証明書を認証するためにはCA(認証局)証明書が必要になります。 |
| 224 |
どこから証明書を探すかについて、いくつか選択肢を指定できます。 |
| 225 |
endif::JA[] |
| 226 |
ifdef::EN[] |
| 227 |
If you use TLS, you need CA certificates bundle to validate |
| 228 |
server certificates. You may specify several options where to look for one. |
| 229 |
endif::EN[] |
| 230 |
|
| 231 |
[horizontal] |
| 232 |
`--with-ca-bundle=check` :: Use heuristics to find CA bundle (default) |
| 233 |
`--with-ca-bundle=none` :: Do not set default CA bundle |
| 234 |
`--with-ca-bundle=system` :: Use system CA bundle. |
| 235 |
On MinGW, it accesses system CA store via |
| 236 |
Windows API. Otherwise, it checks several |
| 237 |
known paths used for popular systems. |
| 238 |
`--with-ca-bundle=<path>` :: Use given path as the CA bundle file |
| 239 |
|
| 240 |
|
| 241 |
ifdef::JA[] |
| 242 |
詳しくはマニュアルの`rfc.tls`の項を参照してください。 |
| 243 |
endif::JA[] |
| 244 |
ifdef::EN[] |
| 245 |
See the manual's `rfc.tls` entry for the details. |
| 246 |
endif::EN[] |
| 247 |
|
| 248 |
|
| 249 |
ifdef::JA[] |
| 250 |
== 共通コマンド名 |
| 251 |
endif::JA[] |
| 252 |
ifdef::EN[] |
| 253 |
== Common command names |
| 254 |
endif::EN[] |
| 255 |
|
| 256 |
ifdef::JA[] |
| 257 |
Schemeの仕様を議論するSRFI (Scheme Requrests for Implementation) では、 |
| 258 |
準拠する実装について、特定のコマンド名を推奨していることがあります。それらのコマンド名は |
| 259 |
他の処理系も使ってる可能性があるため、デフォルトではインストールされません。 |
| 260 |
|
| 261 |
オプション `--enable-shared-commands` を指定すると、以下のコマンドがインストールされます。 |
| 262 |
endif::JA[] |
| 263 |
ifdef::EN[] |
| 264 |
SRFI (Scheme Requrests for Implementation), where various aspects of |
| 265 |
Scheme spec are discussed, suggests some common names for Scheme-related |
| 266 |
commands if the implementation comforms certain specs. Those command |
| 267 |
names may be used by other implementation, so we don't install them |
| 268 |
by default. |
| 269 |
|
| 270 |
If you give `--enable-shared-commands` option, the following commands are |
| 271 |
installed: |
| 272 |
|
| 273 |
endif::EN[] |
| 274 |
|
| 275 |
`scheme-r7rs`, `scheme-srfi-0`, `scheme-srfi-7`:: |
| 276 |
ifdef::JA[] |
| 277 |
`gosh`の別名。 |
| 278 |
endif::JA[] |
| 279 |
ifdef::EN[] |
| 280 |
Aliases of `gosh`. |
| 281 |
endif::EN[] |
| 282 |
|
| 283 |
`compile-r7rs`:: |
| 284 |
ifdef::JA[] |
| 285 |
`gauche-compile-r7rs`の別名。 |
| 286 |
endif::JA[] |
| 287 |
ifdef::EN[] |
| 288 |
Alias of `gauche-compile-r7rs`. |
| 289 |
endif::EN[] |
| 290 |
|
| 291 |
|
| 292 |
|
| 293 |
ifdef::JA[] |
| 294 |
== DBMデータベースのサポート |
| 295 |
endif::JA[] |
| 296 |
ifdef::EN[] |
| 297 |
== DBM database support |
| 298 |
endif::EN[] |
| 299 |
|
| 300 |
ifdef::JA[] |
| 301 |
デフォルトでは、Gaucheはシステム中にgdbm, ndbm, odbm (original dbm)のライブラリ |
| 302 |
があるかどうかを調べ、見つかったライブラリに対するインタフェースサポートをビルドします。 |
| 303 |
|
| 304 |
もし特定のdbmライブラリのサポートを除外したい場合は、configureスクリプトの`--with-dbm` |
| 305 |
オプションに、*含めたいライブラリ*を列挙してください。例えば `--with-dbm=ndbm,odbm` と |
| 306 |
すれば、gdbmがシステムにあってもそれらは含まれず、 |
| 307 |
ndbmとodbmのサポートだけビルドされます。いずれのライブラリサポートも含めたくなければ |
| 308 |
`--with-dbm=no` と指定してください。 |
| 309 |
endif::JA[] |
| 310 |
ifdef::EN[] |
| 311 |
By default, Gauche looks for gdbm, ndbm and odbm (original dbm) libraries |
| 312 |
on your system, and build support for available libraries. |
| 313 |
|
| 314 |
If you want to exclude any of these support, list the libraries you |
| 315 |
want to *inlucde* in `--with-dbm` configure option. For example, |
| 316 |
if you want to include ndbm and odbm but nothing else, |
| 317 |
specify `--with-dbm=ndbm,odbm`. |
| 318 |
If you want to include none of them, specify `--with-dbm=no`. |
| 319 |
endif::EN[] |
| 320 |
|
| 321 |
|
| 322 |
ifdef::JA[] |
| 323 |
== 文字エンコーディング変換 |
| 324 |
endif::JA[] |
| 325 |
ifdef::EN[] |
| 326 |
== Character encoding conversion |
| 327 |
endif::EN[] |
| 328 |
|
| 329 |
ifdef::JA[] |
| 330 |
GaucheはUnicode(UTF-8, 16, 32)、Latin-N、および代表的な日本語文字エンコーディングを |
| 331 |
認識し変換することができますが、それ以外のエンコーディングに関しては、iconvが利用可能で |
| 332 |
あればそれを利用して変換を行います。iconvが標準でインストールされていないシステムでは、 |
| 333 |
`--with-iconv` オプションで外部のiconvライブラリを利用することができます。 |
| 334 |
endif::JA[] |
| 335 |
ifdef::EN[] |
| 336 |
Gauche can recognize and converts Unicode (UTF-8, 16, 32), Latin-N, and |
| 337 |
typical japanese character encodings, but delegates other conversion work |
| 338 |
to iconv library (when available). If your system does not have iconv |
| 339 |
installed in the standard location, you can specify the location of your |
| 340 |
external iconv library by `--with-iconv` option. |
| 341 |
endif::EN[] |
| 342 |
|
| 343 |
[source,sh] |
| 344 |
---- |
| 345 |
--with-iconv=DIR |
| 346 |
---- |
| 347 |
|
| 348 |
|
| 349 |
ifdef::JA[] |
| 350 |
例えば `--with-iconv=/usr/local` とすれば、Gaucheは `iconv.h` を `/usr/local/include` |
| 351 |
から、 `libiconv` を `/usr/local/lib` から探します。もしあなたのiconvライブラリが |
| 352 |
libiconv以外の名前 ( `libmyconv` とか) だったとしたら、 |
| 353 |
`--with-iconv-lib=myconv` というオプションも指定して下さい。 |
| 354 |
|
| 355 |
外部のiconvライブラリとしては、Bruno Haible氏のlibiconvが以下から入手可能です。 |
| 356 |
endif::JA[] |
| 357 |
ifdef::EN[] |
| 358 |
For example, if your say `--with-iconv=/usr/local`, Gauche looks |
| 359 |
for the header iconv.h from `/usr/local/include` and the library |
| 360 |
libiconv from `/usr/local/lib`. |
| 361 |
In case if your iconv library is named other than libiconv, say, |
| 362 |
`libmyconv`, you can also specify `--with-iconv-lib=myconv` to tell |
| 363 |
Gauche to link against the library. |
| 364 |
|
| 365 |
You can obtain Bruno Haible's libiconv library from here: |
| 366 |
endif::EN[] |
| 367 |
https://www.gnu.org/software/libiconv/ |
| 368 |
|
| 369 |
|
| 370 |
ifdef::JA[] |
| 371 |
== ローカルライブラリパス |
| 372 |
endif::JA[] |
| 373 |
ifdef::EN[] |
| 374 |
== Local library paths |
| 375 |
endif::EN[] |
| 376 |
|
| 377 |
ifdef::JA[] |
| 378 |
Gaucheのビルドに、標準でない場所にインストールされているライブラリを |
| 379 |
使用したい場合、次のオプションでその場所を指定することができます。 |
| 380 |
|
| 381 |
[source,sh] |
| 382 |
---- |
| 383 |
--with-local=PATH:PATH2:... |
| 384 |
---- |
| 385 |
|
| 386 |
これで、`PATH/include` 、`PATH2/include` 、... がインクルードパスに、 |
| 387 |
`PATH/lib` 、`PATH2/lib` 、... がライブラリサーチパスに追加されます。 |
| 388 |
|
| 389 |
例えば、`/usr/local` にインストールされたgdbmライブラリを使用したい |
| 390 |
場合は次のようにします。 |
| 391 |
|
| 392 |
[source,sh] |
| 393 |
---- |
| 394 |
--with-local=/usr/local |
| 395 |
---- |
| 396 |
endif::JA[] |
| 397 |
ifdef::EN[] |
| 398 |
If you want to use some libraries installed in non-standard location |
| 399 |
to build Gauche, you can use the following option to specify the |
| 400 |
locations. |
| 401 |
|
| 402 |
[source,sh] |
| 403 |
---- |
| 404 |
--with-local=PATH:PATH2:... |
| 405 |
---- |
| 406 |
|
| 407 |
This addts `PATH/include`, `PATH2/include`, ... to the include paths, |
| 408 |
and `PATH/lib`, `PATH2/lib`, ... to the library search paths. |
| 409 |
|
| 410 |
For example, if you want to use gdbm library in `/usr/local`, |
| 411 |
you can say: |
| 412 |
|
| 413 |
[source,sh] |
| 414 |
---- |
| 415 |
--with-local=/usr/local |
| 416 |
---- |
| 417 |
endif::EN[] |
| 418 |
|
| 419 |
|
| 420 |
ifdef::JA[] |
| 421 |
== SLIBの場所 |
| 422 |
endif::JA[] |
| 423 |
ifdef::EN[] |
| 424 |
== Selecting SLIB location |
| 425 |
endif::EN[] |
| 426 |
|
| 427 |
ifdef::JA[] |
| 428 |
link:http://people.csail.mit.edu/jaffer/SLIB[SLIB]は、 |
| 429 |
ポータブルなSchemeライブラリで、いろいろ便利な機能が |
| 430 |
完全にSchemeで書かれています。GaucheはSLIBがインストールされていれば |
| 431 |
その機能を利用することができます。 |
| 432 |
endif::JA[] |
| 433 |
ifdef::EN[] |
| 434 |
link:http://people.csail.mit.edu/jaffer/SLIB[SLIB] |
| 435 |
is a portable Scheme library containing various useful functions, |
| 436 |
entirely written in Scheme. Gauche can use SLIB features if you have |
| 437 |
it on your system. |
| 438 |
endif::EN[] |
| 439 |
|
| 440 |
ifdef::JA[] |
| 441 |
configureスクリプトは、 `/usr/local/slib` や `/usr/share/slib` などいくつかの基本的なディレクトリ |
| 442 |
からSLIBを自動的に探します。もしあなたのSLIBシステムが標準的ではない場所に |
| 443 |
インストールされていたら、次のオプションでその場所を指定してください。 |
| 444 |
endif::JA[] |
| 445 |
ifdef::EN[] |
| 446 |
The configure script tries to find where SLIB is installed. It looks |
| 447 |
for some typical directories like `/usr/local/slib` or `/usr/share/slib`. |
| 448 |
If you installed your SLIB in some non-standard location, you can tell |
| 449 |
it to the configure script as follows: |
| 450 |
endif::EN[] |
| 451 |
|
| 452 |
[source,sh] |
| 453 |
---- |
| 454 |
./configure --with-slib=PATH |
| 455 |
---- |
| 456 |
|
| 457 |
ifdef::JA[] |
| 458 |
ここで、`PATH` はSLIBがインストールされたパスです。 |
| 459 |
endif::JA[] |
| 460 |
ifdef::EN[] |
| 461 |
where `PATH` is the path you installed your SLIB. |
| 462 |
endif::EN[] |
| 463 |
|
| 464 |
ifdef::JA[] |
| 465 |
GauchehはSLIB無しでも動作します。SLIBを使う必要がなければ、このオプションは |
| 466 |
気にしなくてよいです。 |
| 467 |
endif::JA[] |
| 468 |
ifdef::EN[] |
| 469 |
Gauche works without SLIB, anyway. If you're not interested, you |
| 470 |
don't need to care about this. |
| 471 |
endif::EN[] |
| 472 |
|
| 473 |
ifdef::JA[] |
| 474 |
SLIBは最初に使う前にGaucheのライブラリディレクトリにカタログファイルを |
| 475 |
作成します。Gaucheのインストール時に既にSLIBが存在すればインストール |
| 476 |
スクリプトがカタログファイルを作成しますが、Gaucheインストール後にSLIB |
| 477 |
がインストールされた場合、最初にSLIBを使おうとした時点でカタログファイルが |
| 478 |
作成されます。この時、Gauche使用者がライブラリディレクトリに書き込み権限を |
| 479 |
持っていないとエラーとなります。書き込み権限を持つユーザが `gosh` を起動して |
| 480 |
例えば次のような式を評価すればカタログファイルが正しく作られます。 |
| 481 |
endif::JA[] |
| 482 |
ifdef::EN[] |
| 483 |
SLIB needs a catalog file to be created in the Gauche library |
| 484 |
directory before use. If Gauche finds SLIB during installation, |
| 485 |
the install procedure creates the catalog file. |
| 486 |
If you install slib after installing Gauche, it tries to create |
| 487 |
the catalog file when you use slib first time, and you may get |
| 488 |
an error if you don't have a permission to write into the |
| 489 |
Gauche library directory. Run `gosh` in the right permission |
| 490 |
and evaluate something like the following will solve the problem. |
| 491 |
endif::EN[] |
| 492 |
|
| 493 |
[source,scheme] |
| 494 |
---- |
| 495 |
(use slib) |
| 496 |
(require 'logical) |
| 497 |
---- |
| 498 |
|
| 499 |
|
| 500 |
ifdef::JA[] |
| 501 |
== 実行時のライブラリパス |
| 502 |
endif::JA[] |
| 503 |
ifdef::EN[] |
| 504 |
== Run-time library path |
| 505 |
endif::EN[] |
| 506 |
|
| 507 |
ifdef::JA[] |
| 508 |
しばしば、環境のコントロールができない箇所でGaucheを走らせなければならない |
| 509 |
場合があります。例えばCGIスクリプトをISPのサーバーで走らせる場合などです。 |
| 510 |
もし、Gaucheが標準的でない場所にインストールされた共有ライブラリに依存し |
| 511 |
ている場合、それが問題となります。 |
| 512 |
|
| 513 |
例えば、最新の `libiconv.so` を自分でコンパイルして `/home/yours/lib` に |
| 514 |
インストールしたとします。`--with-iconv=/home/yours/lib` としてconfigure |
| 515 |
すれば、Gaucheはあなたのiconvを使うようにコンパイルされます。実行時に適切 |
| 516 |
な環境変数、例えば `LD_LIBRARY_PATH` などを設定しておけば、Gaucheの |
| 517 |
インタプリタ `gosh` は `libiconv.so` を捜し出すことができます。しかし、 |
| 518 |
CGIスクリプトはWeb serverによって起動され、Web serverは `LD_LIBRARY_PATH` |
| 519 |
を設定してくれないかもしれません。その場合、`gosh` は `libiconv.so` が見つけられずに |
| 520 |
起動に失敗するかもしれません。 |
| 521 |
|
| 522 |
コンパイラによっては、プログラムが依存している共有ライブラリのパスをプログラム |
| 523 |
本体に書き込んでしまえるオプションを持っています。 `configure` の `--with-rpath` |
| 524 |
オプションはそれを利用します。 `--with-rpath=DIR` とすると、実行時に `DIR` から |
| 525 |
共有ライブラリを探すような設定になります。このオプションは今のところ `gcc` でしか |
| 526 |
動作しません。 |
| 527 |
endif::JA[] |
| 528 |
ifdef::EN[] |
| 529 |
In some cases, your have to run Gauche under the environment |
| 530 |
you don't have much control. One of such cases is when you |
| 531 |
want to run CGI script on the ISP's machine. It may become |
| 532 |
a problem that your build of Gauche depends on some dynamically |
| 533 |
loaded libraries that are installed in non-standard location. |
| 534 |
|
| 535 |
For example, suppose you install a new `libiconv.so` in `/home/yours/lib` |
| 536 |
on the ISP's server and compile Gauche with `--with-iconv=/home/yours/lib`. |
| 537 |
You have set up correct environment variables such as `LD_LIBRARY_PATH`, |
| 538 |
so you can invoke Gauche interpreter `gosh` without a problem. Now, |
| 539 |
you write a CGI script. Unfortunately, the ISP's web server |
| 540 |
doesn't set `LD_LIBRARY_PATH` as you desired, and your script never |
| 541 |
runs on the server, for the interpreter can't find `libiconv.so` |
| 542 |
in the system default path. |
| 543 |
|
| 544 |
Some compilers have an option that writes exact path of shared |
| 545 |
libraries that the binary depends on. A `configure` option `--with-rpath` |
| 546 |
utilizes the feature. When an option `--with-rpath=DIR` is given, |
| 547 |
configure sets up a build process so that the shared libraries |
| 548 |
are looked from `DIR`. This works only on `gcc`, however. |
| 549 |
endif::EN[] |
| 550 |
|
| 551 |
|
| 552 |
ifdef::JA[] |
| 553 |
== インストール先の指定 |
| 554 |
endif::JA[] |
| 555 |
ifdef::EN[] |
| 556 |
== Customizing install location |
| 557 |
endif::EN[] |
| 558 |
|
| 559 |
ifdef::JA[] |
| 560 |
次のようにconfigureスクリプトを起動することにより、インストール先の |
| 561 |
ディレクトリを指定できます。 |
| 562 |
endif::JA[] |
| 563 |
ifdef::EN[] |
| 564 |
Call configure with those parameters to specify where to install. |
| 565 |
endif::EN[] |
| 566 |
|
| 567 |
[source,console] |
| 568 |
---- |
| 569 |
% ./configure --prefix=$PREFIX --exec-prefix=$EXEC_PREFIX |
| 570 |
---- |
| 571 |
|
| 572 |
|
| 573 |
ifdef::JA[] |
| 574 |
`--prefix` オプションが指定されなければ、 `/usr/local` が指定されたものとみなされます。 |
| 575 |
`--exec-prefix` オプションが指定されなければ、 `EXEC_PREFIX` は `PREFIX` と同じものに |
| 576 |
なります。 |
| 577 |
endif::JA[] |
| 578 |
ifdef::EN[] |
| 579 |
If `--prefix` option is omitted, `/usr/local` is assumed as `PREFIX`. |
| 580 |
If `--exec-prefix` option is omitted, `EXEC_PREFIX` is set the same as `PREFIX`. |
| 581 |
endif::EN[] |
| 582 |
|
| 583 |
|
| 584 |
ifdef::JA[] |
| 585 |
インストールされるファイルの内訳は以下の通りです。 |
| 586 |
endif::JA[] |
| 587 |
ifdef::EN[] |
| 588 |
The files are installed in those locations: |
| 589 |
endif::EN[] |
| 590 |
|
| 591 |
`$EXEC_PREFIX/bin/*`:: |
| 592 |
ifdef::JA[] |
| 593 |
インタプリタ (`gosh`) とコンフィグレーションスクリプト (`gauche-config`) |
| 594 |
endif::JA[] |
| 595 |
ifdef::EN[] |
| 596 |
The interpreter (`gosh`) and configuration script (`gauche-config`). |
| 597 |
endif::EN[] |
| 598 |
|
| 599 |
`$EXEC_PREFIX/lib/*`:: |
| 600 |
ifdef::JA[] |
| 601 |
ライブラリ (`libgauche.a`). |
| 602 |
endif::JA[] |
| 603 |
ifdef::EN[] |
| 604 |
Library (`libgauche.a`). |
| 605 |
endif::EN[] |
| 606 |
|
| 607 |
`$PREFIX/share/gauche/VERSION/include/*`:: |
| 608 |
ifdef::JA[] |
| 609 |
libgaucheをリンクするアプリケーションに必要なヘッダーファイル |
| 610 |
endif::JA[] |
| 611 |
ifdef::EN[] |
| 612 |
Header files required to create applications using libgauche. |
| 613 |
endif::EN[] |
| 614 |
|
| 615 |
`$PREFIX/share/gauche/VERSION/lib/*`:: |
| 616 |
ifdef::JA[] |
| 617 |
マシンに依存しないSchemeファイル |
| 618 |
endif::JA[] |
| 619 |
ifdef::EN[] |
| 620 |
Machine-independent Scheme files. |
| 621 |
endif::EN[] |
| 622 |
|
| 623 |
`$PREFIX/share/info/*`:: |
| 624 |
ifdef::JA[] |
| 625 |
infoファイル |
| 626 |
endif::JA[] |
| 627 |
ifdef::EN[] |
| 628 |
info files. |
| 629 |
endif::EN[] |
| 630 |
|
| 631 |
`$EXEC_PREFIX/lib/gauche/VERSION/ARCHITECTURE/*`:: |
| 632 |
ifdef::JA[] |
| 633 |
マシンに依存するファイル (`.so`, `gosh`, `gauche-config`, `libgauche.a`) |
| 634 |
endif::JA[] |
| 635 |
ifdef::EN[] |
| 636 |
Machine-dependent files (`.so` files, `gosh`, `gauche-config`, and `libgauche.a`) |
| 637 |
endif::EN[] |
| 638 |
|
| 639 |
`$PREFIX/share/gauche/site/lib/*`:: |
| 640 |
`$EXEC_PREFIX/lib/gauche/site/VERSION/ARCHITECTURE/*`:: |
| 641 |
ifdef::JA[] |
| 642 |
ユーザが独自にインストールするマシン非依存/依存ファイルのデフォルトの置き場所。 |
| 643 |
endif::JA[] |
| 644 |
ifdef::EN[] |
| 645 |
These are default locations where user installed |
| 646 |
machine-independent/dependent files will go. |
| 647 |
endif::EN[] |
| 648 |
|
| 649 |
|
| 650 |
ifdef::JA[] |
| 651 |
== 最適化オプション |
| 652 |
endif::JA[] |
| 653 |
ifdef::EN[] |
| 654 |
== Optimization options |
| 655 |
endif::EN[] |
| 656 |
|
| 657 |
|
| 658 |
ifdef::JA[] |
| 659 |
Make時に、 `make` マクロ `OPTFLAGS` を用いて追加のコンパイルオプションを指定すること |
| 660 |
ができます。 `configure` が設定する `OPTFLAGS` 以外のオプションを試したい場合は |
| 661 |
次のように `make` を走らせて下さい。 |
| 662 |
endif::JA[] |
| 663 |
ifdef::EN[] |
| 664 |
You can pass extra options at make time, using `make` macro `OPTFLAGS`. |
| 665 |
`configure` sets a default, but if you want to explore different |
| 666 |
options, just run `make` as follows: |
| 667 |
endif::EN[] |
| 668 |
|
| 669 |
[source,sh] |
| 670 |
---- |
| 671 |
make OPTFLAGS="--some-compiler-option --other-option" |
| 672 |
---- |
| 673 |
|
| 674 |
|
| 675 |
ifdef::JA[] |
| 676 |
== アンインストール |
| 677 |
endif::JA[] |
| 678 |
ifdef::EN[] |
| 679 |
== Uninstallation |
| 680 |
endif::EN[] |
| 681 |
|
| 682 |
ifdef::JA[] |
| 683 |
インストールされたGaucheソフトウェアを取り除くには、ソースツリーのトップ |
| 684 |
ディレクトリで |
| 685 |
|
| 686 |
[source,sh] |
| 687 |
---- |
| 688 |
make uninstall |
| 689 |
---- |
| 690 |
|
| 691 |
として下さい。 |
| 692 |
endif::JA[] |
| 693 |
ifdef::EN[] |
| 694 |
You can remove installed Gauche software by running |
| 695 |
|
| 696 |
[source,sh] |
| 697 |
---- |
| 698 |
make uninstall |
| 699 |
---- |
| 700 |
|
| 701 |
on top of the source tree. |
| 702 |
endif::EN[] |
| 703 |
|
| 704 |
|
| 705 |
ifdef::JA[] |
| 706 |
== クロスコンパイル |
| 707 |
endif::JA[] |
| 708 |
ifdef::EN[] |
| 709 |
== Cross compilation |
| 710 |
endif::EN[] |
| 711 |
|
| 712 |
ifdef::JA[] |
| 713 |
Gaucheはautotool標準のクロスコンパイルをサポートしています。 |
| 714 |
つまり、 `configure` スクリプトに `--build` と `--host` オプションを与えて |
| 715 |
makeするだけです (クロス開発に必要なツールはもちろんインストールされているとします)。 |
| 716 |
ただ、二つばかり気をつけることがあります。 |
| 717 |
endif::JA[] |
| 718 |
ifdef::EN[] |
| 719 |
Gauche supports autotools-standard cross compilation, that is, |
| 720 |
you give `--build` and `--host` option to `configure` script and |
| 721 |
just make (assuming you have appropriate cross development tools). |
| 722 |
There are a couple of caveats, though. |
| 723 |
endif::EN[] |
| 724 |
|
| 725 |
ifdef::JA[] |
| 726 |
- クロスコンパイルしようとしているのと同じバージョンのGaucheをビルドマシンに |
| 727 |
インストールしておいてください。 |
| 728 |
+ |
| 729 |
通常のビルドでは、Gaucheは作ったばかりの `gosh` を使って `ext/` 以下の拡張 |
| 730 |
ライブラリをビルドします。クロスコンパイル時には、作ったばかりの `gosh` は |
| 731 |
ビルドマシンでは実行できないので、既にビルドマシンにインストールされている |
| 732 |
`gosh` を使うことになります。 |
| 733 |
|
| 734 |
- `./configure` に `--with-libatomic-ops=no` オプションが必要かもしれません。 |
| 735 |
+ |
| 736 |
このオプションをつけることで、システムにインストールされている `libatomic_ops` |
| 737 |
ではなく同梱されたソースを使うようになります。どうもconfigureスクリプトが |
| 738 |
ビルドシステム用の `libatomic_ops` をホスト用と誤認するケースがあるようです。 |
| 739 |
endif::JA[] |
| 740 |
ifdef::EN[] |
| 741 |
- You have to have the same version of Gauche that you're trying to |
| 742 |
cross-compile on the build machine. |
| 743 |
+ |
| 744 |
In normal build, Gauche uses freshly built `gosh` to compile |
| 745 |
extension libraries (under `ext/`). While cross compiling we can't run |
| 746 |
freshly built `gosh` on the build machine, so we rely on the `gosh` already |
| 747 |
installed on it. |
| 748 |
|
| 749 |
- You may need `--with-libatomic-ops=no` option for `./configure` |
| 750 |
+ |
| 751 |
The option forces Gauche to use bundled `libatomic_ops` source instead |
| 752 |
of system provided one. We noticed that `./configure` may misunderstood |
| 753 |
the build system's `libatmic_ops` as the host system's. |
| 754 |
endif::EN[] |
| 755 |
|
| 756 |
ifdef::JA[] |
| 757 |
例として、次のコマンドラインで、Windows (mingw-w64 32bit) 用バイナリを |
| 758 |
あなたのシステム上でクロスコンパイルできます: |
| 759 |
endif::JA[] |
| 760 |
ifdef::EN[] |
| 761 |
For example, the following command line is to cross build on your machine |
| 762 |
for Windows (mingw-w64 32bit): |
| 763 |
endif::EN[] |
| 764 |
|
| 765 |
[source,sh] |
| 766 |
---- |
| 767 |
./configure --build=`./config.guess` \ |
| 768 |
--host=i686-w64-mingw32 \ |
| 769 |
--with-libatomic-ops=no \ |
| 770 |
--prefix=/usr/local |
| 771 |
---- |
| 772 |
|
| 773 |
ifdef::JA[] |
| 774 |
== 機種依存の情報 |
| 775 |
endif::JA[] |
| 776 |
ifdef::EN[] |
| 777 |
== Machine-dependent information |
| 778 |
endif::EN[] |
| 779 |
|
| 780 |
|
| 781 |
ifdef::JA[] |
| 782 |
* MacOS X - 10.15 (Catalina) では、ダウンロードしたtarballから取り出されたファイル |
| 783 |
はセキュリティ機構にマークされているため、ビルド時に必要なシェルスクリプトを実行できません。 |
| 784 |
tarballを展開した後、次のコマンドを実行してください。(VERSIONは配布バージョンに |
| 785 |
置き換えてください)。 |
| 786 |
tarballが真正のものであるかどうかは、https://practical-scheme.net/vault/ に置いてある |
| 787 |
asc署名で確認してください。 |
| 788 |
endif::JA[] |
| 789 |
ifdef::EN[] |
| 790 |
* MacOS X - 10.15 (Catalina) enhanced the security check, and doesn't allow |
| 791 |
to execute shell scripts extracted from an unsigned downloaded tarball. |
| 792 |
Run the following command after extractng tarball |
| 793 |
(Replace VERSION for Gauche's version). |
| 794 |
You can check if the tarball isn't tampered using asc signature file |
| 795 |
distributed from https://practical-scheme.net/vault/. |
| 796 |
endif::EN[] |
| 797 |
+ |
| 798 |
[source,sh] |
| 799 |
---- |
| 800 |
xattr -r -d com.apple.quarantine Gauche-VERSION/ |
| 801 |
---- |
| 802 |
|
| 803 |
ifdef::JA[] |
| 804 |
* IRIX with 64bit binary - デフォルトの32bit ABIではなく64bit ABIでコンパイル |
| 805 |
したい場合は次のようにして下さい。 |
| 806 |
endif::JA[] |
| 807 |
ifdef::EN[] |
| 808 |
* IRIX with 64bit binary - If you want to compile for 64bit ABI instead |
| 809 |
of the default 32bit ABI, run configure like this: |
| 810 |
endif::EN[] |
| 811 |
+ |
| 812 |
[source,sh] |
| 813 |
---- |
| 814 |
CC="cc -64" AS="as -64" ./configure |
| 815 |
---- |
| 816 |
|
| 817 |
ifdef::JA[] |
| 818 |
* Linux/Crusoe TM5800 - 最近のLinuxでは Crusoe TM5800がi686互換とされる |
| 819 |
ようになったようですが、gc中でi686特有のprefetch命令を使っているところ |
| 820 |
でコンパイルに失敗するという報告がありました。 |
| 821 |
この場合は以下のように環境依存の最適化を無効にして下さい。 |
| 822 |
endif::JA[] |
| 823 |
ifdef::EN[] |
| 824 |
* Linux/Crusoe TM5800 - It is reported that recent Linux kernel thinks |
| 825 |
TM5800 as i686-compatible, and compilation of Gauche fails at |
| 826 |
gc where the i686's prefetch instruction is used. |
| 827 |
If you want to disable this machine-dependent heuristic optimization, |
| 828 |
run configure like this: |
| 829 |
endif::EN[] |
| 830 |
+ |
| 831 |
[source,sh] |
| 832 |
---- |
| 833 |
./configure --disable-heuristic-optimization |
| 834 |
---- |