DirectFB-1.4.1 を codesourcery G++ 2008q3 arm でコンパイル

armadillo-500 に液晶がついたので動くものがほしい。

ということで DirectFB をチョイス。

atmark-dist とか debian 使えば楽なのだろうけど
仕事で codesourcery-G++-Lite 使ってるので同じ環境でいきたい。

楽すると得るものも少ないし。

つうことではじめたが、前の日記に残したとおり
一苦労ありました。

DirectFBは依存関係が・・・

  • libpng
    • zlib
  • libjpeg
  • libfreetype

つうことで以下のSourceを準備

autoconf系が多いので、ほとんど似たようなcompile手順。

Directory

$ export ROOTFS_DIR=${PRJROOT}/arm-2008q3/arm-none-linux-gnueabi/libc

色々試したが、gcc の "-L" option をうまく利かせられないので
ツールチェインのデフォルトのパスに各ライブラリとHeaderを install することに。


これが一番うまくいった。なんか釈然としないが・・・そこはまた後日に研究。

zlib-1.2.3 のクロスコンパイル

google検索するとconfugure後にMakefile編集してるpageが多いようだけど、
正しくconfigureするか、diffしたほうがいいと思う・・・


・・・こういう作業記録をつけるときeditor編集部分が書きにくいから・・・


私は

$ cd ${SRC_DIR}/zlib-1.2.3
$ ./configure --help

でparameterを確認して、以下のようにして作成。

$ cd ${SRC_DIR}/zlib-1.2.3
$ CC=arm-none-linux-gnueabi-gcc ./configure --shared --prefix=${ROOTFS_DIR}/usr
$ make
$ make install

特に、いじる必要ない。なんで皆Makefileいじるんだろ?

$ readelf -h ${ROOTFS_DIR}/usr/lib/libz.so
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x15c4
  Start of program headers:          52 (bytes into file)
  Start of section headers:          76148 (bytes into file)
  Flags:                             0x5000002, has entry point, Version5 EABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         4
  Size of section headers:           40 (bytes)
  Number of section headers:         27
  Section header string table index: 24
$

ちゃんとARM用ですな。

libpng-1.2.38 のクロスコンパイル

$ cd ${SRC_DIR}/libpng-1.2.38
$ CC=arm-none-linux-gnueabi-gcc \
  ./configure --host=arm-none-linux-gnueabi --prefix="${ROOTFS_DIR}/usr"
$ make
$ make install

libjpeg-7 のクロスコンパイル

$ cd ${SRC_DIR}/jpeg-7
$ CC=arm-none-linux-gnueabi-gcc \
  ./configure --host=arm-none-linux-gnueabi --prefix="${ROOTFS_DIR}/usr"
$ make
$ make install

libfreetype のクロスコンパイル

$ cd ${SRC_DIR}/freetype-2.3.5
$ CC=arm-none-linux-gnueabi-gcc \
  ./configure --host=arm-none-linux-gnueabi --prefix="${ROOTFS_DIR}/usr"
$ make
$ make install

DirectFB-1.4.1 のクロスコンパイル

$ cd ${SRC_DIR}/DirectFB-1.4.1
$ CC=arm-none-linux-gnueabi-gcc \
  FREETYPE_CFLAGS="-I${ROOTFS_DIR}/usr/include/freetype2" \
  FREETYPE_LIBS="-lfreetype" \
  ./configure --host=arm-none-linux-gnueabi --prefix="${ROOTFS_DIR}/usr" \
  --enable-shared --disable-x11 --disable-libtool-lock
$ make

コンパイルは何とか通った。

さて、

$ make install

.....

make[2]: Leaving directory `/home/takino/Projects/armadillo9-uo0/XTools/lib.src/DirectFB-1.4.1'
make[1]: Leaving directory `/home/takino/Projects/armadillo9-uo0/XTools/lib.src/DirectFB-1.4.1'

いったっぽい。