0. 环境变量
export PREFIX=/program/stb225gtkdfb
export LD_LIBRARY_PATH=$PREFIX/lib
export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig
export ARCH=mips
export CROSS_COMPILE=/program/eldk/usr/bin/mips_4KCle-
export CC=${CROSS_COMPILE}gcc
export CXX=${CROSS_COMPILE}g++
export AR=${CROSS_COMPILE}ar
export RANLIB=${CROSS_COMPILE}ranlib
export NM=${CROSS_COMPILE}nm
export AS=${CROSS_COMPILE}as
export LD=${CROSS_COMPILE}ld
1. libtool-2.2.2
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux
make
make install
2. libpng-1.2.26 jpeg-6b tiff-3.8.2
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux
make
make install
(jpeg-6b执行make install-lib)
3. freetype-2.3.4
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux
make
make install
4. glib-2.16.3
(重新开一个终端,不要设置0步骤的所有环境变量,只设置如下的:
export PREFIX=/program/stb225gtkdfb
export ARCH=mips
export CROSS_COMPILE=/program/eldk/usr/bin/mips_4KCle-
export CC=${CROSS_COMPILE}gcc
export CXX=${CROSS_COMPILE}g++
export AR=${CROSS_COMPILE}ar
export RANLIB=${CROSS_COMPILE}ranlib
export NM=${CROSS_COMPILE}nm
export AS=${CROSS_COMPILE}as
export LD=${CROSS_COMPILE}ld
)
echo glib_cv_uscore=no>>mips-linux.cache
echo ac_cv_func_posix_getpwuid_r=yes>>mips-linux.cache
echo ac_cv_func_posix_getgrgid_r=yes>>mips-linux.cache
echo glib_cv_stack_grows=no>>mips-linux.cache
./configure --disable-ccache --cache-file=mips-linux.cache --prefix=/program/stb225gtkdfb --build=i686 \
--target=mips-linux --host=mips-linux --enable-mem-pools
make
make install
5. pkgconfig-0.18
(恢复步骤0的设置:
export PREFIX=/program/stb225gtkdfb
export LD_LIBRARY_PATH=$PREFIX/lib
export PKG_CONFIG_PATH=$LD_LIBRARY_PATH/pkgconfig
export ARCH=mips
export CROSS_COMPILE=/program/eldk/usr/bin/mips_4KCle-
export CC=${CROSS_COMPILE}gcc
export CXX=${CROSS_COMPILE}g++
export AR=${CROSS_COMPILE}ar
export RANLIB=${CROSS_COMPILE}ranlib
export NM=${CROSS_COMPILE}nm
export AS=${CROSS_COMPILE}as
export LD=${CROSS_COMPILE}ld
)
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux
make
make install
6. libxml2-2.6.32
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux
make
make install
7. fontconfig-2.5.91
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux \
--with-arch=mips --enable-libxml2 --with-freetype-config=/program/stb225gtkdfb/bin/freetype-config
make
make install
8. DirectFB-1.1.1
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux --disable-x11 --with-gfxdrivers=none "CFLAGS=-I/program/stb225gtkdfb/include"
make
make install
9. atk-1.22.0
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux --disable-glibtest
make
make install
10. pixman-0.10.0
(
将Makefile的
SUBDIRS = pixman test
改为
SUBDIRS = pixman
)
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux
make
make install
11. cairo-1.6.4
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux --enable-directfb --disable-xlib --disable-win32 "LIBS=-L/program/stb225gtkdfb/lib \
-lfontconfig -lfreetype -lxml2"
(须指定LIBS, 否则报错configure: error: Cairo requires at least one font backend.查看config.log会有详细出错信息)
make
make install
12. pango-1.21.0
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux --without-x
make
make install
13. gtk+-2.12.9
export CC="/program/eldk/usr/bin/mips_4KCle-gcc -I/program/stb225gtkdfb/include"
./configure --prefix=$PREFIX --build=i686 --target=mips-linux --host=mips-linux --with-gdktarget=directfb --without-x \
"LIBS=-L/program/stb225gtkdfb/lib -ljpeg -ltiff -lz -lxml2 -lpixman-1 -lpng12 -ldirect -ldirectfb -lfusion"
make
make install
编译gtk时,修改configure文件中的参数PANGO_PACKAGES=”pango pangocairo”为PANGO_PACKAGES=”pango pangoft2 pangocairo ”,使得编译gtk的时候可以链接到库libpangoft2库。
编译gtk时,修改configure文件中的参数GLIB_GENMARSHAL=`$PKG_CONFIG variable=glib genmarshal glib-2.0`为GLIB_GENMARSHAL=/usr/bin/glib-genmarshal,和环境变量
export LD_LIBRARY_PATH=/usr/lib:$PREFIX/lib,使得编译gtk的时候可以运行pc上/usr/bin下的glib-genmarshal而不是交叉编译下的glib-genmarshal程序。
编译gtk时,修改文件gtk+-2.12.9/gtk/gtkicontheme.c文件中的builtin_icons为icon_theme_builtin_icons,在函数_gtk_icon_theme_ensure_builtin_cache()中。
export LD_LIBRARY_PATH=$PREFIX/lib
$PREFIX/bin/gtk-demo
阅读(3497) | 评论(2) | 转发(0) |