- Back to Home »
- DirectFB »
- Build DirectFB cho board nhúng FriendlyARM Mini2440
Wednesday, September 30, 2015
1. Build DirectFB-1.6.0
Thư viện phụ thuộc
- libpng
- freetype
# toolchain
export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin
export CROSS=arm-none-linux-gnueabi-
export HOST=arm-none-linux-gnueabi
#thư viện phụ thuộc
DEPEND_LIB_DIR=/friendlyarm
export CFLAGS=-I${DEPEND_LIB_DIR}/include
export CPPFLAGS=-I${DEPEND_LIB_DIR}/include
export LDFLAGS=-L${DEPEND_LIB_DIR}/lib
export PKG_CONFIG_PATH=${DEPEND_LIB_DIR}/lib/pkgconfig
export LD_LIBRARY_PATH=${DEPEND_LIB_DIR}/lib
export PATH=$PATH:${DEPEND_LIB_DIR}/bin:${DEPEND_LIB_DIR}/sbin
#cấu hình
export PREFIX=/friendlyarm
./configure --prefix=${PREFIX} --host=${HOST} \
--disable-x11 --enable-fbdev=yes --disable-devmem \
--with-gfxdrivers=none --with-inputdrivers=none \
CC=${CROSS}gcc
#compile
make
make install
2. Build DirectFB-examples-1.6.0
# toolchain
export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin
export CROSS=arm-none-linux-gnueabi-
export HOST=arm-none-linux-gnueabi
# thu vien phu thuoc: directfb
DEPEND_LIB_DIR=/friendlyarm/directfb
export CFLAGS=-I${DEPEND_LIB_DIR}/include
export CPPFLAGS=-I${DEPEND_LIB_DIR}/include
export LDFLAGS=-L${DEPEND_LIB_DIR}/lib
export PKG_CONFIG_PATH=${DEPEND_LIB_DIR}/lib/pkgconfig
export LD_LIBRARY_PATH=${DEPEND_LIB_DIR}/lib
export PATH=$PATH:${DEPEND_LIB_DIR}/bin:${DEPEND_LIB_DIR}/sbin
#config
export PREFIX=/friendlyarm/directfb
./configure --prefix=${PREFIX} --host=${HOST} \
CC=${CROSS}gcc
make
make install
3. Build Directfb application
df_matrix.c là một ví dụ được lấy ra từ gói DirectFB-examples-1.6.0
export PATH=$PATH:/opt/FriendlyARM/toolschain/4.4.3/bin
DEPEND_LIB_DIR=/friendlyarm
export PKG_CONFIG_PATH=${DEPEND_LIB_DIR}/lib/pkgconfig
export LD_LIBRARY_PATH=${DEPEND_LIB_DIR}/lib
arm-none-linux-gnueabi-gcc df_matrix.c -o
df_matrix $(pkg-config --libs --cflags direct directfb directfb-internal)
4. Chạy thử app directfb trên board
Chúng ta sẽ chạy thử các app đã build ở mục 3
- copy tất cả các lib và example xuống board (sdcard or mount NFS)
- export biến môi trường
DEPEND_LIB_DIR=/friendlyarm
export CFLAGS=-I${DEPEND_LIB_DIR}/include
export CPPFLAGS=-I${DEPEND_LIB_DIR}/include
export LDFLAGS=-L${DEPEND_LIB_DIR}/lib
export PKG_CONFIG_PATH=${DEPEND_LIB_DIR}/lib/pkgconfig
export LD_LIBRARY_PATH=${DEPEND_LIB_DIR}/lib
export PATH=$PATH:${DEPEND_LIB_DIR}/bin:${DEPEND_LIB_DIR}/sbin
- chạy thử các app
$ cd /friendlyarm/directfb-1.6.0-exam/bin
$ ./df_andi