Skip to content

Commit 35e8e66

Browse files
committed
Merge branch 'develop' of https://github.com/luwanjia/sdl_implementation_reference into develop
2 parents 0490756 + df380c5 commit 35e8e66

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

HowToBuild.md

+20-18
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,38 @@
22
## Build Instruction
33

44
### 1. Install the compiler.
5-
6-
We should use an cross compiler which requires the version lower than 4.9, otherwise the program can not run.
7-
8-
#### a) if your system support default package, please use follow command to install the compiler
5+
#### a) Download the package of arm-linux-gnueabihf-gcc
6+
The compiler is [gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz](https://releases.linaro.org/components/toolchain/binaries/5.4-2017.05/arm-linux-gnueabihf/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz), please download and extract it, and copy to /opt directory as administrator.
97
```shell
10-
sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
8+
$wget -c https://releases.linaro.org/components/toolchain/binaries/5.4-2017.05/arm-linux-gnueabihf/gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
9+
$tar -xvf gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf.tar.xz
10+
$sudo mv gcc-linaro-5.4.1-2017.05-x86_64_arm-linux-gnueabihf /opt/arm-linux-gnueabihf-5.4.1
1111
```
12-
#### b) otherwise, use the local package. Here is [gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz](https://releases.linaro.org/archive/14.04/components/toolchain/binaries/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux.tar.xz), please extract it, and copy to /opt directory as administrator.
13-
then set the PATH to your bash system. Open the file .bashrc in your home directory, append the string:
12+
#### b) Setup the environment variable
13+
Open the file .bashrc in your home directory, append the string:
14+
15+
export PATH=$PATH:/opt/arm-linux-gnueabihf-5.4.1/bin
16+
17+
then update environment variable and test the compiler version
1418
```shell
15-
export PATH=$PATH:<path to the compiler you just copied>
19+
$source .bashrc
20+
$arm-linux-gnueabihf-gcc --version
1621
```
17-
then restart your bash window, and now it should work.
18-
Here to download the cross compiler:
19-
Link:http://pan.baidu.com/s/1i542ohn Key: xwqs
2022

2123
#### c) if can not find compiler, say "No such file or directory.", please install 32 bits library.
2224
```shell
2325
sudo apt-get install lib32ncurses5 lib32z1 lib32stdc++6
2426
```
25-
### 2. Install the bluetooth compiler.
27+
### 2. Add bluetooth library to compiler.
2628

27-
#### a) Download the installation package from "http://www.filewatcher.com/d/Debian/armhf/libdevel/libbluetooth-dev_4.99-2_armhf.deb.111400.html"
28-
29-
#### b) Please extract libbluetooth-dev_4.99-2_armhf.deb,and copy to /opt directory as administrator.
30-
31-
#### c) Set the PATH to your bash system. Open the file .bashrc in your home directory, append the string:
29+
Download package from "ftp://ftp.th.debian.org/debian/pool/main/b/bluez/libbluetooth-dev_4.99-2_armhf.deb"
3230
```shell
33-
export CPLUS_INCLUDE_PATH=<path to the compiler you just copied>
31+
$wget -c ftp://ftp.th.debian.org/debian/pool/main/b/bluez/libbluetooth-dev_4.99-2_armhf.deb
32+
$dpkg-deb -x libbluetooth-dev_4.99-2_armhf.deb libbluetooth
33+
$sudo cp -rf libbluetooth/usr/include/* /opt/arm-linux-gnueabihf-5.4.1/arm-linux-gnueabihf/include/
34+
$sudo cp -rf libbluetooth/usr/lib/* /opt/arm-linux-gnueabihf-5.4.1/arm-linux-gnueabihf/lib/
3435
```
36+
3537
### 3. Build and Run
3638

3739
#### a) Get source code.

0 commit comments

Comments
 (0)