「インストール - Code Composer Studio」の版間の差分

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


案内メニュー