13,005
回編集
33行目: | 33行目: | ||
==== ソースコードからインストール ==== | ==== ソースコードからインストール ==== | ||
SLEDの場合、libncurses5およびlibusb-0_1-4はパッケージ管理システムから提供されていないため、ビルドしてインストールする必要がある。<br> | SLEDの場合、libncurses5およびlibusb-0_1-4はパッケージ管理システムから提供されていないため、ビルドしてインストールする必要がある。<br> | ||
<br> | <br> | ||
===== libusb-0_1-4のインストール ===== | |||
libusb-0_1-4のGithubからソースコードをダウンロードする。<br> | |||
git clone https://github.com/libusb/libusb-compat-0.1.git | |||
cd libusb-compat-0.1 | |||
<br> | |||
configureスクリプトを生成する。<br> | |||
autoreconf -i | |||
<br> | |||
libusb-0_1-4をビルドおよびインストールする。<br> | |||
mkdir build && cd build | |||
# 64bit版 | |||
../configure --prefix=<libusb-0_1-4のインストールディレクトリ> | |||
make -j $(nproc) | |||
make install | |||
<br> | |||
# 32bit版 | |||
export LIBUSB_1_0_SONAME="/usr/lib/libusb-1.0.so.0"; \ | |||
CC="gcc -m32" CXX="g++ -m32" ../configure --prefix=<libusb-0_1-4のインストールディレクトリ> | |||
make -j $(nproc) | |||
make install | |||
<br> | |||
~/.profileファイル等に、以下の環境変数を追記する。<br> | |||
<syntaxhighlight lang="sh"> | |||
# ~/.profileファイル | |||
export PATH="/<libusb-0_1-4のインストールディレクトリ>/bin:$PATH" | |||
export LD_LIBRARY_PATH="/<libusb-0_1-4のインストールディレクトリ>/lib64:/<libusb-0_1-4のインストールディレクトリ>/lib:$LD_LIBRARY_PATH" | |||
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(pkg-config --variable pc_path pkg-config)" | |||
export PKG_CONFIG_PATH="/<libusb-0_1-4のインストールディレクトリ>/lib64/pkgconfig:/<libusb-0_1-4のインストールディレクトリ>/lib/pkgconfig:$PKG_CONFIG_PATH" | |||
</syntaxhighlight> | |||
<br> | |||
==== libncurses5のインストール ==== | |||
[https://invisible-island.net/ncurses/announce.html libncurses5の公式Webサイト]にアクセスして、libncurses5のソースコードをダウンロードする。<br> | |||
または、<code>wget</code>コマンドを実行して、libncurses5のソースコードをダウンロードする。<br> | |||
wget https://invisible-mirror.net/archives/ncurses/ncurses-5.x.tar.gz | |||
<br> | |||
ダウンロードしたファイルを解凍する。<br> | |||
tar ncurses-5.x.tar.gz | |||
cd ncurses-5.x | |||
<br> | |||
ビルドディレクトリを作成する。<br> | |||
mkdir build && cd build | |||
<br> | |||
libncurses5をビルドおよびインストールする。<br> | |||
<u>(1)から順に(4)までビルドおよびインストールする。</u><br> | |||
(1) 32bit版 ワイド文字対応 | |||
../configure \ | |||
CC="/<GCC6.5以前のインストールディレクトリ>/bin/gcc -m32" \ | |||
CXX="/<GCC6.5以前のインストールディレクトリ>/bin/g++ -m32" \ | |||
--bindir=/<libncurses5のインストールディレクトリ>/baselibs-32bit \ | |||
--libdir=/<libncurses5のインストールディレクトリ>/lib \ | |||
--with-shared --with-cxx-shared --with-normal --with-ticlib --with-debug \ | |||
--without-progs --without-tests --without-manpages \ | |||
--enable-widec --enable-pc-files \ | |||
--program-suffix="w" \ | |||
--prefix=<libncurses5のインストールディレクトリ> \ | |||
CPPFLAGS="-P" | |||
make -j $(nproc) | |||
# pkgconfファイルは強制的に/usr/lib/pkgconfigディレクトリにインストールされるため、 | |||
# スーパーユーザ権限で実行する | |||
sudo make install.libs | |||
# pkgconfigファイルをインストールディレクトリに移動する | |||
mkdir /<libncurses5のインストールディレクトリ>/lib/pkgconfig | |||
sudo mv \ | |||
/usr/lib/pkgconfig/formw.pc \ | |||
/usr/lib/pkgconfig/menuw.pc \ | |||
/usr/lib/pkgconfig/ncurses++w.pc \ | |||
/usr/lib/pkgconfig/ncursesw.pc \ | |||
/usr/lib/pkgconfig/panelw.pc \ | |||
/usr/lib/pkgconfig/ticw.pc \ | |||
/<libncurses5のインストールディレクトリ>/lib/pkgconfig | |||
# スーパーユーザでインストールしているため、オーナーを一般ユーザに変更する | |||
sudo chown -R $USER:$GROUP <libncurses5のインストールディレクトリ> | |||
# 不要なファイルを削除する | |||
rm -rf /<libncurses5のインストールディレクトリ>/include | |||
rm -rf /<libncurses5のインストールディレクトリ>/share | |||
<br> | |||
(2) 32bit版 非ワイド文字 | |||
../configure \ | |||
CC="/<GCC6.5以前のインストールディレクトリ>/bin/gcc -m32" \ | |||
CXX="/<GCC6.5以前のインストールディレクトリ>/bin/g++ -m32" \ | |||
--bindir=/<libncurses5のインストールディレクトリ>/baselibs-32bit \ | |||
--libdir=/<libncurses5のインストールディレクトリ>/lib \ | |||
--with-shared --with-cxx-shared --with-normal --with-ticlib --with-debug --with-termlib --disable-widec --enable-pc-files \ | |||
--without-progs --without-tests --without-manpages \ | |||
--prefix=<libncurses5のインストールディレクトリ> \ | |||
CPPFLAGS="-P" | |||
make -j $(nproc) | |||
# pkgconfファイルは強制的に/usr/lib/pkgconfigディレクトリにインストールされるため、 | |||
# スーパーユーザ権限で実行する | |||
sudo make install.libs | |||
# pkgconfigファイルをインストールディレクトリに移動する | |||
mkdir /<libncurses5のインストールディレクトリ>/lib/pkgconfig | |||
sudo mv \ | |||
/usr/lib/pkgconfig/form.pc \ | |||
/usr/lib/pkgconfig/menu.pc \ | |||
/usr/lib/pkgconfig/ncurses++.pc \ | |||
/usr/lib/pkgconfig/ncurses.pc \ | |||
/usr/lib/pkgconfig/panel.pc \ | |||
/usr/lib/pkgconfig/tic.pc \ | |||
/<libncurses5のインストールディレクトリ>/lib/pkgconfig | |||
# スーパーユーザでインストールしているため、オーナーを一般ユーザに変更する | |||
sudo chown -R $USER:$GROUP <libncurses5のインストールディレクトリ> | |||
# 不要なファイルを削除する | |||
rm -rf /<libncurses5のインストールディレクトリ>/include | |||
rm -rf /<libncurses5のインストールディレクトリ>/share | |||
<br> | |||
(3) 64bit版 ワイド文字対応 | |||
../configure \ | |||
CC="/<GCC6.5以前のインストールディレクトリ>/bin/gcc" \ | |||
CXX="/<GCC6.5以前のインストールディレクトリ>/bin/g++" \ | |||
--with-shared --with-normal --with-ticlib --with-debug --enable-widec --enable-pc-files \ | |||
--prefix=<libncurses5のインストールディレクトリ> \ | |||
--includedir=/<libncurses5のインストールディレクトリ>/include/ncursesw \ | |||
CPPFLAGS="-P" | |||
make -j $(nproc) | |||
make install | |||
<br> | |||
(4) 64bit版 | |||
../configure \ | |||
CC="/<GCC6.5以前のインストールディレクトリ>/bin/gcc" \ | |||
CXX="/<GCC6.5以前のインストールディレクトリ>/bin/g++" \ | |||
--with-shared --with-normal --with-ticlib --with-debug --with-termlib --disable-widec --enable-pc-files \ | |||
--prefix=<libncurses5のインストールディレクトリ> \ | |||
--includedir=/<libncurses5のインストールディレクトリ>/include/ncurses \ | |||
CPPFLAGS="-P" | |||
make -j $(nproc) | |||
make install | |||
<br> | |||
~/.profileファイル等に、以下の環境変数を追記する。<br> | |||
<syntaxhighlight lang="sh"> | |||
export PATH="/<libncurses5のインストールディレクトリ>/bin:/<libncurses5のインストールディレクトリ>/baselibs-32bit/bin:$PATH" | |||
export LD_LIBRARY_PATH="/<libncurses5のインストールディレクトリ>/lib64:/<libncurses5のインストールディレクトリ>/lib:$LD_LIBRARY_PATH" | |||
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(pkg-config --variable pc_path pkg-config)" | |||
export PKG_CONFIG_PATH="/<llibncurses5のインストールディレクトリ>/lib64/pkgconfig:/<llibncurses5のインストールディレクトリ>/lib/pkgconfig:$PKG_CONFIG_PATH" | |||
</syntaxhighlight> | |||
<br><br> | <br><br> | ||