1.设置环境变量
export LC_ALL=en_US
export TOP_DIR=$PWD/work/source
export BUILD_ROOT=/work #安装的工作目标
export DEFAULT_DIST_DIR=$BUILD_ROOT/usr
export PATH=$PATH:/usr/bin/arm/iwmmxt_le/bin/:/usr/bin/cee/host/bin/:$BUILD_ROOT/usr/bin #交叉编译工具路径
2.生成Makefile文件
CC=iwmmxt_le-gcc CFLAGS="-g -O2 -I/work/usr/include -I/work/usr/lib/glib-2.0/include " LDFLAGS="-L/work/usr/lib -lintl" ./configure --prefix=$BUILD_ROOT/usr --host=arm-linux
出错:config.status: error: cannot find input file: examples/Makefile.in
由于example内源文件不存在,所以touch Makefile.in 以便编译过
再生成Makefile文件
3.make
出错:
make[2]: Entering directory `/opt/work-app/source/gconf-dbus-2.6.4.15/examples'
make[2]: *** No rule to make target `all'. Stop.
make[2]: Leaving directory `/opt/work-app/source/gconf-dbus-2.6.4.15/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/work-app/source/gconf-dbus-2.6.4.15'
make: *** [all] Error 2
不理会,ls gconf/.libs/ 查看需要的文件都已经生成。
make install
出错:
Making install in examples
make[1]: Entering directory `/opt/work-app/source/gconf-dbus-2.6.4.15/examples'
make[1]: *** No rule to make target `install'. Stop.
make[1]: Leaving directory `/opt/work-app/source/gconf-dbus-2.6.4.15/examples'
make: *** [install-recursive] Error 1
不用理。需要的文件已经安装成功。
4.把工作区安装的目标文件copy到要rootfs里
1). 后端库文件
[root@localhost lib]#cp gconf-dbus/ -fr /rootfs/work/usr/lib -fr
/lib/gconf-dbus/2/
libgconfbackend-oldxml.a libgconfbackend-oldxml.so libgconfbackend-xml.la
libgconfbackend-oldxml.la libgconfbackend-xml.a libgconfbackend-xml.so
2). gconf库文件
[root@localhost lib]#cp libgconf* /rootfs/work/usr/lib -fr
libgconf-2.la
libgconf-2.so -> libgconf-2.so.4.1.0
libgconf-2.so.4 -> libgconf-2.so.4.1.0
libgconf-2.so.4.1.0
libgdk-1.2.so.0 -> libgdk-1.2.so.0.9.1
libgdk-1.2.so.0.9.1
3). 复制生成的服务例程文件
[root@localhost libexec]# cp gconfd-2 /rootfs/work/usr/bin/ -fr
4).复制etc文件
[root@localhost etc]# cp gconf/ /rootfs/work/usr/etc/ -fr
进入安装区:usr/share/dbus-1/services 复制dbus 服务配置文件 (很重要)
[root@localhost services]# cp gconf.service /rootfs/work/usr/share/dbus-1/services/ -fr
5.修改配置文件 修改可写区域
vi /rootfs/work/usr/etc/gconf/2/path
# Now see where users want us to look - basically the user can stick arbitrary
# sources in a ~/.gconf.path file and they're inserted here
include "${HOME}/.gconf.path" =====>"/jffs2/.gconf.path"
# Give users a default storage location, ~/.gconf
xml:readwrite:${HOME}/.gconf =====>"/jffs2/.gconf.path"
6.创建只读区域的文件夹 gconf.xml.mandatory 和 gconf.xml.defaults (很重要)
根据配置可以看出
# Look first in systemwide mandatory settings directory
xml:readonly:/work/usr/etc/gconf/gconf.xml.mandatory
...
# Finally, look at the systemwide defaults
xml:readonly:/work/usr/etc/gconf/gconf.xml.defaults
必须创建只读区域的文件夹 gconf.xml.mandatory 和 gconf.xml.defaults 以免后面出错 gconfd-2无法启动
[root@localhost gconf]# mkdir gconf.xml.mandatory
[root@localhost gconf]# mkdir gconf.xml.defaults
7.进入源文件安装目录下tests目录,执行make 生成可执行测试程序
[root@localhost gconf-dbus-2.6.4.15]# cd tests/
[root@localhost tests]# make
[root@localhost .libs]# ls
testaddress testchangeset testencode testlisteners testschemas
testbackend testdirlist testgconf testpersistence testunique
[root@localhost .libs]# cp testgconf /rootfs/work/usr/bin/ -fr
8.制作镜像
/opt/montavista/cee/host/bin/mkcramfs rootfs/ rootfs.img
9.启动 进入终端
bash-2.05a# gconfd & 后台启动服务例程
bash-2.05a# testgconf 启动测试
正常,大功告成!