SWIG (Simplified Wrapper and Interface Generator) is a compiler that integrates C and C++ with languages including Perl, Python, Tcl, Ruby, PHP, Java, C#, D, Go, Lua, Octave, R, Scheme, and Ocaml. SWIG can also export its parse tree into Lisp s-expressions and XML.
SWIG reads annotated C/C++ header files and creates wrapper code (glue code) in order to make the corresponding C/C++ libraries available to the listed languages, or to extend C/C++ programs with a scripting language.
LFS や依存パッケージが本ブックに示す最新安定バージョンでなかった場合には、BLFS 開発版においては、パッケージのビルドや処理実行が適切に行われないことがあります。
ダウンロード (HTTP): https://downloads.sourceforge.net/swig/swig-4.1.1.tar.gz
ダウンロード MD5 sum: c7d55a1bca26752f3846c85b43c1a69c
ダウンロードサイズ: 8.2 MB
必要ディスク容量: 82 MB (2.1 GB with tests)
概算ビルド時間: 0.1 SBU (add 7.8 SBU for tests; both using parallelism=4)
Boost-1.84.0 for tests, and any of the languages mentioned in the introduction, as run-time dependencies
以下のコマンドを実行して SWIG をビルドします。
./configure --prefix=/usr \ --without-javascript \ --without-maximum-compile-warnings && make
To test the results, issue: PY3=1
make -k check TCL_INCLUDE=. The unsetting of the
variable TCL_INCLUDE
is necessary since
it is not correctly set by configure. The tests are only executed
for the languages installed on your machine, so the disk space and
SBU values given for the tests may vary, and should be considered
as mere orders of magnitude. According to SWIG's documentation, the failure of some
tests should not be considered harmful. The go tests are buggy and
may generate a lot of meaningless output.
root
ユーザーになって以下を実行します。
make install && install -v -m755 -d /usr/share/doc/swig-4.1.1 && cp -v -R Doc/* /usr/share/doc/swig-4.1.1
--without-maximum-compile-warnings
:
disables compiler ansi conformance enforcement, which triggers
errors in the Lua headers
(starting with Lua 5.3).
--without-<language>
: allows
disabling the building of tests and examples for <language>,
but all the languages capabilities of SWIG are always built.