DirectFB + GTK+ (target compile)
DirectFB + GTK+
GTK+ - The GTK+ library which includes the GTK-DFB backend
Cairo - The 2D vectorial drawing library that GTK relies upon starting from version 2.8.0
Pango - GTK+ font rendering library
GLib - A Library that extends libc functions
ATK - GTK+ accessibility toolkit
날짜 수정.
date 060710392010 2010년 6월 7일 10시 39분 설정.
http://blog.163.com/a3563@126/blog/static/54675706201042251625893/ : 설치 참조
http://www.freebsdcity.org/~nahu5/obsolete/gnu/windows/gtk.html : 설치 프로그램 의존성
1. target에서 변경
$ export PREFIX=/usr
$ export LD_LIBRARY_PATH=$PREFIX/lib
$ export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig
(작업 편리성을 위해 fedora에서 export PREFIX=/opt/eldk/ppc_4xxFP/usr/local)
2. install
DirectFB-1.2.5
glib-2.12.13 -> pango깔 때 버전 문제 생겨서 glib-2.16으로 교체
atk-1.19.3
freetype-2.3.5
libxml2-2.6.29
fontconfig-2.4.2
zlib-1.2.3
libpng-1.2.19
(pixman 0.18.2 - cairo 1.8.2)
cairo-1.4.10, 1.6.0, 1.8.2
pango-1.16.4
gtk+-2.10.14
target에서 pkg-config-0.22 , autoconf-2.60, automake-1.9 libtoollibtool-1.5.8 gettext-0.17설치가 필요.
pkg-config
./configure --prefix=$PREFIX --without-x
make
make install
DirectFB-1.2.5
:framebuffer만 사용하는 것 보다 다양한 기능을 지원하고 속도가 더 빠른 gtk+를 사용할 수 있다.
$ tar zxvf DirectFB-1.2.5.tar.gz
$ cd DirectFB-1.2.5
$ ./configure --prefix=$PREFIX
vi lib/direct/ppcasm_memcpy_cachable.S
#include
$ gmake
$ gmake install
glib-2.12.13 -> pango깔 때 버전 문제 생겨서 glib-2.16으로 교체
$ tar zxvf glib-2.12.13.tar.gz -> tar zxvf glib-2.16.tar.gz
$ cd glib-2.12.13 -> glib-2.16
$ ./configure --prefix=$PREFIX
$ gmake
$ gmake install
atk-1.19.3
$ ./configure --prefix=$PREFIX --disable-glibtest
/, /atk,/tests에 있는 세 군데의 Makefile에서 DEP_CFLAGS, DEP_LIBS, GLIB_CFLAGS
경로가 나와 동일한지 확인만(동일함)
vi Makefile
vi atk/Makefile
DEP_CFLAGS = -pthread -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include
DEP_LIBS = -L/usr/lib \
-lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
GLIB_CFLAGS = -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include
GLIB_LIBS = -L/usr/lib -lgobject-2.0 \
-lgmodule-2.0 -ldl -lglib-2.0
$ gmake
$ gmake install
freetype-2.3.5
$./configure --prefix=$PREFIX
$ gmake
$ gmake install
libxml2-2.6.29
$./configure --prefix=$PREFIX --without-debug
$ gmake
$ gmake install
Fontconfig
$./configure --prefix=$PREFIX \
--with-freetype-config=$PREFIX/bin/freetype-config --enable-libxml2 --with-arch=powerpc
$ gmake
$ gmake install
zlib
$./configure --prefix=$PREFIX --shared
$ gmake
$ gmake install
libpng
$ vi configure
:%s/ac_cv_lib_z_zlibVersion=no/ac_cv_lib_z_zlibVersion=yes/g
$./configure --prefix=$PREFIX
$ gmake
$ gmake install
(pixman 0.18.2)
$ PKG_CONFIG=$PREFIX/bin/pkg-config \
./configure --prefix=$PREFIX \
--disable-shared --enable-static --disable-vmx --disable-mmx
make
make install
cairo-1.4.10, 1.6.0, 1.8.2
vi configure
:%s/ac_cv_lib_z_compress=no/ac_cv_lib_z_compress=yes/g
:%s/ac_header_compiler=no/ac_header_compiler=yes/g
:%s/ac_header_preproc=no/ac_header_preproc=yes/g
$ PKG_CONFIG=$PREFIX/bin/pkg-config \
directfb_CFLAGS="-I$PREFIX/include/directfb" \
directfb_LIBS="$PREFIX/lib/libdirectfb.so \
$PREFIX/lib/libdirect.so \
$PREFIX/lib/libfusion.so" \
png_REQUIRES="$PREFIX/lib/pkgconfig" \
png_CFLAGS="-I$PREFIX/include" \
png_LIBS=$PREFIX/lib/libpng12.so \
FONTCONFIG_CFLAGS="-I$PREFIX/include/fontconfig" \
FONTCONFIG_LIBS=$PREFIX/lib/libfontconfig.so \
FREETYPE_CFLAGS="-I$PREFIX/include/freetype2" \
FREETYPE_LIBS=$PREFIX/lib/libfreetype.so \
./configure --prefix=$PREFIX \
--enable-directfb=yes --without-x --disable-xlib --disable-xlib-xrender \
--disable-quartz --disable-quartz-font \
--disable-win32 \
--disable-win32-font \
--disable-pdf --disable-ps --disable-svg --enable-png
$ gmake
$ gmake install
pango-1.16.4
$ vi configure
have_cairo=true
have_cairo_png=true
have_cairo_freetype=true
$ GLIB_CFLAGS="-I$PREFIX/include/glib-2.0 \
-I$PREFIX/lib/glib-2.0/glib" \
GLIB_LIBS="$PREFIX/lib/libglib-2.0.so \
$PREFIX/lib/libgmodule-2.0.so \
$PREFIX/lib/libgobject-2.0.so \
$PREFIX/lib/libfontconfig.so \
$PREFIX/lib/libxml2.so \
$PREFIX/lib/libfreetype.so" \
CAIRO_CFLAGS="-I$PREFIX/include/cairo" \
CAIRO_LIBS=$PREFIX/lib/libcairo.so \
FONTCONFIG_CFLAGS="-I$PREFIX/include/fontconfig" \
FONTCONFIG_LIBS=$PREFIX/lib/libfontconfig.so \
FREETYPE_CFLAGS="-I$PREFIX/include/freetype2" \
FREETYPE_LIBS=$PREFIX/lib/libfreetype.so \
FREETYPE_CONFIG=$PREFIX/bin/freetype-config \
./configure --prefix=$PREFIX --without-x
(Makefile에서 GLIB_CFLAGS가 바로 잡힌지 check)
$vi examples/Makefile GLIB_LIBS 변수 끝에다가 붙이기
/usr/lib/libpng12.so \
/usr/lib/libdirectfb.so \
/usr/lib/libdirect.so \
/usr/lib/libfusion.so
$vi tools/Makefile 과 tests/Makefile 각각을 추가
LIBS = $(GLIB_LIBS)
(GLIB_CFLAGS, GLIB_LIBS의 path들이 정상적인가 check)
$ gmake
$ gmake install
GTK+
$ vi configure
"Can't find cairo-pdf.h"랑
"Can't find cairo-pdf.h"을 검색해서
{ (exit 1); exit 1; }; <=========== 그 뒤 바로 나오는 이 글을 삭제하고 jump.
파일들에서 모두 아래를 찾아서 막기.
#ifdef CAIRO_PDF
#include
#include
cairo_pdf_surface_set_size()
cairo_pdf_surface_create()
cairo_ps_surface_create_for_stream()
$ PKG_CONFIG=$PREFIX/bin/pkg-config \
BASE_DEPENDENCIES_CFLAGS="-I$PREFIX/include \
-I$PREFIX/lib/glib-2.0/include \
-I$PREFIX/include/glib-2.0 \
-I$PREFIX/include/pango-1.0 \
-I$PREFIX/include/cairo \
-I$PREFIX/include/atk-1.0" \
BASE_DEPENDENCIES_LIBS="-L$PREFIX/lib \
$PREFIX/lib/libglib-2.0.so \
$PREFIX/lib/libgobject-2.0.so \
$PREFIX/lib/libgmodule-2.0.so \
$PREFIX/lib/libfontconfig.so \
$PREFIX/lib/libxml2.so" \
GLIB_CFLAGS="-I$PREFIX/include \
-I$PREFIX/lib/glib-2.0/include \
-I$PREFIX/include/glib-2.0" \
GLIB_LIBS="-L$PREFIX/lib \
$PREFIX/lib/libglib-2.0.so \
$PREFIX/lib/libgobject-2.0.so \
$PREFIX/lib/libgmodule-2.0.so \
$PREFIX/lib/libfontconfig.so \
$PREFIX/lib/libxml2.so" \
PANGO_CFLAGS="-I$PREFIX/include/pango-1.0" \
PANGO_LIBS="-L$PREFIX/lib \
$PREFIX/lib/libpango-1.0.so \
$PREFIX/lib/libpangoft2-1.0.so \
$PREFIX/lib/libpangocairo-1.0.so" \
GDK_DEP_CFLAGS="-pthread \
-I$PREFIX/include/glib-2.0 \
-I$PREFIX/lib/glib-2.0/include \
-I$PREFIX/include/pango-1.0 \
-I$PREFIX/include/cairo \
-I$PREFIX/include -D_REENTRANT -D_GNU_SOURCE \
-I$PREFIX/include \
-I$PREFIX/include/directfb" \
GDK_DEP_LIBS="-L$PREFIX/lib -ldirectfb -lfusion -ldirect -lpthread -ldl -lpangocairo-1.0 \
-lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lpng12 -lm" \
GDK_PIXBUF_DEP_CFLAGS="-pthread \
-I$PREFIX/include/glib-2.0 \
-I$PREFIX/lib/glib-2.0/include \
-I$PREFIX/include -I$PREFIX/../include" \
GDK_PIXBUF_DEP_LIBS="-L$PREFIX/lib -lgmodule-2.0 -ldl -lgobject-2.0 -lglib-2.0 -lpng12 -lm" \
GTK_DEP_CFLAGS="-pthread -I$PREFIX/include/glib-2.0 -I$PREFIX/lib/glib-2.0/include \
-I$PREFIX/include/pango-1.0 -I$PREFIX/include/cairo -I$PREFIX/include -D_REENTRANT -D_GNU_SOURCE \
-I$PREFIX/include/directfb -I$PREFIX/include/atk-1.0 -I$PREFIX/../include" \
GTK_DEP_LIBS="-L$PREFIX/lib -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lgobject-2.0 -lgmodule-2.0 \
-ldl -lglib-2.0 -lcairo -lpng12 -lm" \
GDK_EXTRA_CFLAGS="-I$PREFIX/include" \
GDK_EXTRA_LIBS="-L$PREFIX/lib -ldirectfb -lz -lfusion -ldirect -lpthread -ldl" \
./configure \
--prefix=$PREFIX \
--without-x \
--with-gdktarget=directfb \
--without-libtiff \
--disable-glibtest \
--disable-largefile \
--disable-modules \
--without-libjpeg \
--with-included-loaders=gif,png,xpm
(필요시 jpeg를 위해서 --without-libjpeg제거하고 필요한 부분 -ljpeg 추가하여 하장)
모든 Makefile을 수정
BASE_DEPENDENCIES_CFL AGS = -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include \
-I/usr/include/pango-1.0 \
-I/usr/include/cairo \
-I/usr/include/atk-1.0
BASE_DEPENDENCIES_LIBS = -L/usr/lib \
-latk-1.0 -lpango-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lcairo
GDK_DEP_CFLAGS = -pthread -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include \
-I/usr/include/pango-1.0 \
-I/usr/include/cairo \
-I/usr/include \
-I/usr/freetype2 \
-I/usr/libpng12 -D_REENTRANT -D_GNU_SOURCE \
-I/usr/include/directfb
GDK_DEP_LIBS = -L/usr/lib \
-L/usr/lib -ldirectfb -lfusion -ldirect -lpthread \
-ldl -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lpng12 -lm
GDK_PIXBUF_DEP_CFLAGS = -pthread -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include \
-I/usr/include
GDK_PIXBUF_DEP_LIBS = -L/usr/lib \
-L/usr/lib
-lgmodule-2.0 -ldl -lgobject-2.0 -lglib-2.0 -lpng12 -lm
GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include
GLIB_LIBS = -pthread -L/usr/lib \
-lgobject-2.0 -lgmodule-2.0 -ldl -lgthread-2.0 -lglib-2.0
GTK_DEP_CFLAGS = -pthread -I/usr/include/glib-2.0 \
-I/usr/lib/glib-2.0/include \
-I/usr/include/pango-1.0 \
-I/usr/include/cairo \
-I/usr/include/atk-1.0 \
-I/usr/include -D_REENTRANT -D_GNU_SOURCE \
-I/usr/include/directfb
GTK_DEP_LIBS = -L/usr/lib \
/usr/lib/libdirectfb.so -lpangocairo-1.0 -lpango-1.0 \
-latk-1.0 -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 -lcairo -lpng12 -lfontconfig -lxml2 -lm
$ vi gdk/directfb/Makefile 에서 INCLUDES변수 마지막 라인에 넣기.
$(GDK_DEP_CFLAGS)
$vi gdk/Makefile 에서 GDK_DEP_LIBS변수에 지정하기.
GDK_DEP_LIBS = -L/usr/lib \
-lpthread -ldl -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 \
-lgmodule-2.0 -lglib-2.0 -lpng12 -lm
$ vi gtk/Makefile 에서 해당부분 주석처리.
#$(LINK) $(gtk_query_immodules_2_0_LDFLAGS) $(gtk_query_immodules_2_0_OBJECTS) \
$(gtk_query_immodules_2_0_LDADD) $(LIBS)
$vi demos/gtk-demo/Makefile GDK_DEP_LIBS를 설정.
GDK_DEP_LIBS = -L/usr/lib -lpthread -ldl \
-lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0 \
-lpng12 -lm /usr/lib/libdirectfb.so \
/usr/lib/libdirect.so /usr/lib/libfusion.so
vi demos/gtk-demo/Makefile
vi demos/Makefile
vi tests/Makefile
vi perf/Makefile 4개 모두에서 LIBS를 각각 설정
LIBS = /usr/lib/libdirectfb.so \
/usr/lib/libdirect.so /usr/lib/libfusion.so
----------------------------------------------
눈물의 컴파일 과정 ㅡ.ㅜ 흑흑흑
gtk+가 install 되는 순간의 감격&감동!! 흑흑ㅡ.ㅜ
DirectFB
./configure --prefix=$PREFIX \
--enable-sdl=no \
--disable-debug \
--disable-joystick \
--disable-cdrom \
--enable-shared \
--disable-x11 \
--enable-fbdev \
--with-gfxdrivers=none \
--with-inputdrivers=keyboard,linuxinput \
--with-tests
$ make
$ make install
예제)
gcc -I/usr/include/directfb -o dfbex dfbex.c -ldirectfb
'IT > SW' 카테고리의 다른 글
Frame buffer 란 (0) | 2018.07.11 |
---|---|
DirectFB + GTK+ (cross compile) (0) | 2018.07.11 |
DirectFB + GTK+ 설치 순서 (0) | 2018.07.11 |
심볼릭 링크 걸기 & 해제 (DirectFB + GTK+) (0) | 2018.07.11 |
default ren-level 바꾸기 (DirectFB + GTK+) (0) | 2018.07.11 |
댓글