Cross Compile iptables
- Iptables
FIRST
Download and extra iptables tar ball.
Simple compile on local machine:
cd iptables-1.4.21
./configure
make
make install
Cross compile
Host: arm-hisiv600-linux
Cross compiler: arm-hisiv600-linux-gcc
./configure --host=arm-hisiv600-linux --prefix= CC=arm-hisiv600-linux-gcc
make
make 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-gcc
make
make install
- libmnl
- libnfnetlink
- libnftnl
Maybe also need nftables - nftables
Intall pkg-config if not intalled in system.
Add
prefix/lib/pkgconfigto
PKG_CONFIG_PATH
e.g.
#Append to ~/.bashrc
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/xxx/arm/usr/lib/pkgconfig
#source
source ~/.bashrc