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
總結
以上是生活随笔為你收集整理的linux systemd 编译,交叉编译 systemd(to be continued)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux 安装go编译器,CentOS
- 下一篇: 如何为linux 桌面文件内存,linu