您的位置:首页 > 产品设计 > UI/UE

交叉编译 systemd(to be continued)

2017-05-09 06:21 561 查看
其实需要先编译好好多用的库,比如 attr, caps等,然后才能开始编 systemd.这些细节以后补上。

开始编 systemd的时候,先指定 CFLAGS, LDFLAGS:

export LDFLAGS="-L/home/charles/code/build_systemd/_install/lib -lattr"

export CFLAGS="-I/home/charles/code/build_systemd/_install/include"

然后,执行 configure:

./configure --host=arm-linux-gnueabi  --prefix=/home/charles/code/build_systemd/_install

最后还是有错:

 CCLD     test-bus-marshal

/toolchain/armv7-gcc-6.3/bin/../lib/gcc/arm-linux-gnueabi/6.3.0/../../../../arm-linux-gnueabi/bin/ld: cannot find -ldbus-1

collect2: error: ld returned 1 exit status

Makefile:13722: recipe for target 'test-bus-marshal' failed

make[2]: *** [test-bus-marshal] Error 1

Makefile:22641: recipe for target 'all-recursive' failed

make[1]: *** [all-recursive] Error 1

Makefile:10161: recipe for target 'all' failed

make: *** [all] Error 2

还需要编 dbus..

编完dbus后基本上就没问题了。

最后使用的configure配置为:

./configure --host=arm-linux-gnueabi --prefix=/home/charles/code/build_systemd/_install/usr --exec-prefix=/home/charles/code/build_systemd/_install/usr --disable-xkbcommon CFLAGS="-I/home/charles/code/build_systemd/_install/include" LDFLAGS="-L/home/charles/code/build_systemd/_install/lib -lattr"


然后,还需要修改makefile文件,不然,安装的时候,有些文件会被安装到系统目录下。。
rootprefix = /home/charles/code/build_systemd/_install/usr
bashcompletiondir = /home/charles/code/build_systemd/_install/usr/share/bash-completion/completions
SYSTEM_SYSVINIT_PATH = /home/charles/code/build_systemd/_install/etc/init.d
SYSTEM_SYSVRCND_PATH = /home/charles/code/build_systemd/_install/etc/rc.d
其实上面有些路径也可以在上面的configure里面指定的。。
--with-sysvinit-path

--with-sysvrcnd-path

--with-bashcompletiondir
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  systemd