Obsolete unused backup project such as OK6410
guowenxue
2019-07-29 7fe273e8e8bd1ffd4735cb5d6f09ad8e58a39a96
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
72
73
74
75
76
#!/bin/sh
 
#+--------------------------------------------------------------------------------------------
#|Description:  This shell script used to download openswan source code and cross compile it.
#|     Author:  GuoWenxue <guowenxue@gmail.com>
#|  ChangeLog:
#|           1, Initialize 1.0.0 on 2011.12.23
#+--------------------------------------------------------------------------------------------
. ../scripts/funcs.sh
clear_crossenv
. ../scripts/envs.sh
 
APP_NAME=openswan
DIR_NAME=Openswan-3.0.14
PACK_SUFIX="zip"
DL_ADDR=https://nodeload.github.com/xelerance/Openswan/zip/v3.0.14
 
 
if [ -z $ARCH ]; then
    ARCH=
fi
 
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
 
INST_PREFIX=/apps/$ARCH/
PREFIX_PATH=${INST_PREFIX}/${APP_NAME}
GMP_LIB_PATH=${INST_PREFIX}/gmp/lib
GMP_INC_PATH=${INST_PREFIX}/gmp/include
OPENSSL_LIB_PATH=${INST_PREFIX}/openssl/lib
OPENSSL_INC_PATH=${INST_PREFIX}/openssl/include
 
#Check GMP dependency
if [ ! -d ${GMP_LIB_PATH} ] ; then
    echo "${GMP_LIB_PATH} doesn't exist, cross compile GMP" 
    cd ../gmp
    sh build.sh
    cd -
fi
 
#Check Openssl dependency
if [ ! -d ${OPENSSL_LIB_PATH} ] ; then
    cd ../openssl
    sh build.sh
    cd -
fi
 
export CFLAGS="-I${OPENSSL_INC_PATH} --static"
export C_INCLUDE_PATH=${GMP_INC_PATH}
export LDFLAGS="-L${GMP_LIB_PATH} -L${OPENSSL_LIB_PATH} -static"
 
export ARCH=arm
export KERNELSRC=/home/guowenxue/stac.1/src/kernel/linux-3.4/
export DESTDIR=${PREFIX_PATH}
 
#Prepare OpenSwan source code
if [ ! -f ${DIR_NAME}.$PACK_SUFIX ] ; then
   wget https://nodeload.github.com/xelerance/Openswan/zip/v3.0.14 -O ${DIR_NAME}.${PACK_SUFIX}
fi
decompress_packet $DIR_NAME $PACK_SUFIX
 
cd ${DIR_NAME}
make programs install
 
${STRIP} ${DESTDIR}/usr/local/libexec/ipsec/*