gconf-dbus-2.6移植笔记

本文介绍了一种在嵌入式环境下编译gconf-dbus的过程,包括环境变量设置、Makefile生成、编译及安装过程中的错误处理,并最终完成目标文件的部署。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 启动测试
正常,大功告成!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值