Skip to content

Instantly share code, notes, and snippets.

@sksat
Created May 15, 2017 11:24
Show Gist options
  • Save sksat/75c1baa63c234a92732ab7445893411b to your computer and use it in GitHub Desktop.
Save sksat/75c1baa63c234a92732ab7445893411b to your computer and use it in GitHub Desktop.
LinuxでのOSECPU-VMのビルド
ちょっと躓いたのでメモ(主にblike関係)
まずはOSECPU-VMのリポジトリをclone
```
git clone https://github.com/osecpu/osecpu-vm-rev2.git
```
あと、描画用のライブラリのblikeもcloneしてくる
```
git clone https://github.com/takeutch-kemeco/blike.git
```
で、blikeのビルドをするのだけれど、その前にblikeの依存ライブラリを入れる
```
sudo apt-get install libgtk-3-dev
```
これでblikeがビルドできるはずなので、やる。
```
cd blike
./autogen.sh
./configure --prefix=/usr
make
sudo make install
```
なんか上手く行かなかったらsudo付けとけば多分OK.
最後に、OSECPU-VMのビルドをする。
任意のVMのソースコードのディレクトリに入って、linux/memo.txtに書いてあるコマンドを打てばビルドできるはず。
例えば、こんなかんじ
```
gcc -D__linux__ -o osecpu osecpu-vm.c other.c integer.c pointer.c float.c extend.c api.c driver.c decode.c tek.c debug.c `pkg-config blike --libs --cflags`
```
```
gcc: error: `pkg-config: そのようなファイルやディレクトリはありません
gcc: error: blike: そのようなファイルやディレクトリはありません
gcc: error: unrecognized command line option ‘--libs’
gcc: error: unrecognized command line option ‘--cflags`’
```
...あれ?
あ、これはシェルの問題ですね。
テキトーに以下のようにしたらできました
```
sh -c "gcc -D__linux__ -o osecpu osecpu-vm.c other.c integer.c pointer.c float.c extend.c api.c driver.c decode.c tek.c debug.c `pkg-config blike --libs --cflags`"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment