|
2 | 2 | ## Build Instruction
|
3 | 3 |
|
4 | 4 | ### 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. |
9 | 7 | ```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 |
11 | 11 | ```
|
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 |
14 | 18 | ```shell
|
15 |
| -export PATH=$PATH:<path to the compiler you just copied> |
| 19 | +$source .bashrc |
| 20 | +$arm-linux-gnueabihf-gcc --version |
16 | 21 | ```
|
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 |
20 | 22 |
|
21 | 23 | #### c) if can not find compiler, say "No such file or directory.", please install 32 bits library.
|
22 | 24 | ```shell
|
23 | 25 | sudo apt-get install lib32ncurses5 lib32z1 lib32stdc++6
|
24 | 26 | ```
|
25 |
| -### 2. Install the bluetooth compiler. |
| 27 | +### 2. Add bluetooth library to compiler. |
26 | 28 |
|
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" |
32 | 30 | ```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/ |
34 | 35 | ```
|
| 36 | + |
35 | 37 | ### 3. Build and Run
|
36 | 38 |
|
37 | 39 | #### a) Get source code.
|
|
0 commit comments