Obsolete unused backup project such as OK6410
guowenxue
2018-02-04 00cb813bffdc9876ae03ff0b967be3b1912f2454
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
 
#+--------------------------------------------------------------------------------------------
#|Description:  This shell script used to download iptables source code and cross compile it.
#|     Author:  GuoWenxue <guowenxue@gmail.com>
#|  ChangeLog:
#|           1, Initialize 1.0.0 on 2013.03.22
#+--------------------------------------------------------------------------------------------
. ../scripts/funcs.sh
clear_crossenv
. ../scripts/envs.sh
 
if [ -z $ARCH ]; then
   ARCH=
fi
 
APP_NAME=iptables
DIR_NAME="iptables-1.4.12.2"
PACK_SUFIX="tar.bz2"
DL_ADDR="http://www.netfilter.org/projects/iptables/files/$DIR_NAME.$PACK_SUFIX"
 
LINK_STATIC=YES
 
select_arch
if [ -z $CROSS -a "x86" != "$ARCH" ] ; then
    CROSS="/opt/buildroot-2012.08/${ARCH}/usr/bin/arm-linux-"
fi
set_crosstool $CROSS
 
if [ "x86" != "$ARCH" ] ; then
    CONFIG_CROSS=--host=arm-linux
fi
 
PREFIX_PATH=/apps/${ARCH}/${APP_NAME}
 
 
# Download and decompress source code packet 
download $DL_ADDR
decompress_packet $DIR_NAME $PACK_SUFIX
 
if [ "$LINK_STATIC" == "YES" ] ; then
    export CFLAGS=--static
    export LDFLAGS=-static
    CONFIG_LD_STATUS='--enable-static --disable-shared'
fi
 
echo "+------------------------------------------------------------------+"
echo "|  Platform:  $DIR_NAME for $ARCH  "
echo "|  Compiler:  ${CROSS}gcc  "
echo "+------------------------------------------------------------------+"
mkdir -p $PREFIX_PATH
 
cd $DIR_NAME
   set -x
   ./configure --prefix=$PREFIX_PATH ${CONFIG_CROSS} ${CONFIG_LD_STATUS} \
   --disable-ipv6 --disable-largefile
   make && make install
 
   $STRIP $PREFIX_PATH/sbin/xtables-multi
   file $PREFIX_PATH/sbin/xtables-multi
 
   if [ -n "$INST_PATH" -a -d "$INST_PATH" ] ; then
       cp $PREFIX_PATH/sbin/xtables-multi $INST_PATH/iptables
   fi
   set +x
 
   echo "+------------------------------------------------------------------+"
   echo "|   Install Prefix: $PREFIX_PATH"
   echo "|   Install   Path: $INST_PATH"
   echo "+------------------------------------------------------------------+"
cd -