Cross Compile iptables

来源:互联网 发布:橙光制作工具 mac 编辑:程序博客网 时间:2024/06/06 06:57

Cross Compile iptables

- Iptables

FIRST
Download and extra iptables tar ball.

Simple compile on local machine:

cd iptables-1.4.21./configuremakemake install

Cross compile

Host: arm-hisiv600-linux
Cross compiler: arm-hisiv600-linux-gcc

./configure --host=arm-hisiv600-linux --prefix= CC=arm-hisiv600-linux-gccmakemake install prefix=/home/xxx/arm/install/iptables

then copy all files in /home/xxx/arm/iptables to target arm board.
prefix: where to install
according to error infomation, compile dependence first.

Compile static:

./configure --host=arm-hisiv600-linux --prefix= CC=arm-hisiv600-linux-gcc --enable-static./configure --host=arm-hisiv600-linux --prefix= CC=arm-hisiv600-linux-gcc --enable-static --diable-share

Set PKG_CONFIG_PATH

./configure --host=aarch64-hisiv610-linux --prefix= CC=aarch64-hisiv610-linux-gcc PKG_CONFIG_PATH=/home/xxx/arm/usr/lib/pkgconfig

Compile dependence

All dependence would be same to compile.

./configure --host=arm-hisiv600-linux --prefix=/home/xxx/arm/usr CC=arm-hisiv600-linux-gccmakemake install
  • libmnl
  • libnfnetlink
  • libnftnl
    Maybe also need nftables
  • nftables

Intall pkg-config if not intalled in system.
Add prefix/lib/pkgconfigtoPKG_CONFIG_PATH
e.g.

#Append to ~/.bashrcexport PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/xxx/arm/usr/lib/pkgconfig#sourcesource ~/.bashrc
原创粉丝点击