linux systemd 编译,交叉编译 systemd(to be continued)

其实需要先编译好好多用的库,比如 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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值