此篇再說明如何建立一個 Cross-Compile 的 Linux x86 編譯環境,透過相對應 CPU 的 toolchain,就可編譯適合嵌入系統的 Asterisk 套件。
重點項目如下:
cd /home/alang/ARM_Cross-Compile/build_start/ncurses-5.9/ CC=arm-none-linux-gnueabi-gcc \ CXX=arm-none-linux-gnueabi-g++ \ ./configure arm-linux --host=arm-none-linux-gnueabi --with-shared --without-ada --with-build-cc=gcc --with-build-cpp=arm-none-linux-gnueabi-g++ --enable-termcap --prefix=/home/alang/ARM_Cross-Compile/build_opt/ncurses make make install
cd /home/alang/ARM_Cross-Compile/build_start/asterisk-1.8.10.1 CC=arm-none-linux-gnueabi-gcc \ AR=arm-none-linux-gnueabi-ar \ CXX=arm-none-linux-gnueabi-g++ \ CPPFLAGS="-I/home/alang/ARM_Cross-Compile/build_opt/ncurses/include/ncurses/" \ LDFLAGS="-L/home/alang/ARM_Cross-Compile/build_opt/ncurses/lib" \ RANLIB=arm-none-linux-gnueabi-ranlib \ ./configure --build=i386-pc-linux-gnu --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi --without-pwlib --without-curl --with-ncurses=/home/alang/ARM_Cross-Compile/build_opt/ncurses --disable-xmldoc --prefix=/home/alang/ARM_Cross-Compile/build_opt/asterisk18_arm make make install make samples
TIPs
CPPFLAGS 用法是 -I<非標準的 include 目錄>
LDFLAGS 用法是 -L<非標準的 library 目錄>