openssl-1.0.2j (URL:https://www.openssl.org/source/)
readline-6.2 (URL:http://ftp.gnu.org/gnu/readline/)
termcap-1.3.1 (URL:http://ftp.gnu.org/gnu/termcap/)
sysv_ipc-0.7.0 (URL:http://semanchuk.com/philip/sysv_ipc/)
libmodbus-3.1.4 (URL:http://libmodbus.org/download/)
openswan-2.6.49.1 (URL:https://download.openswan.org/openswan/)
strongswan-5.5.3 (URL:https://download.strongswan.org/)
$ tar zxvf openssl-1.0.2j.tar.gz
$ ./Configure linux-armv4 -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard shared --cross-compile-prefix=/home/gcc-linaro/bin/arm-linux-gnueabihf-
$ make
$ make install
Install default path: /usr/local/ssl
$ CC=arm-linux-gnueabihf-gcc ./configure --host=arm-linux-gnueabihf --prefix=/usr/local/readline
$ vim Makefile
CC = arm-linux-gnueabihf-
gcc
AR = arm-linux-gnueabihf-
ar
RANLIB = arm-linux-gnueabihf-
ranlib
$ make
$ make install
$ ./comfigure
$ vim Makefile
CC = arm-linux-gnueabihf-
gcc
AR = arm-linux-gnueabihf-
ar
RANLIB = arm-linux-gnueabihf-
ranlib
CFLAGS = -g -fPIC
prefix = /usr/local/readline
$ make
$ make install
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
readline readline.c -I/usr/local/readline/include
-L/usr/local/readline/lib
-lreadline -ltermcap
$ tar zxvf sysv_ipc-0.7.0.tar.gz
sysv_ipc-0.7.0 $ cp probe_results.h ./
sysv_ipc-0.7.0 $ cp Makefile ./
sysv_ipc-0.7.0 $ make
sysv_ipc.cpython-35m-arm-linux-gnueabihf.so
$ tar zxvf libmodbus-3.1.4.tar.gz
$ ./configure --host=arm-linux-gnueabihf --prefix=/usr/local/modbus
$ vim config.h.in
$ //#undef malloc (removed this line)
$ make
$ make install
For Windows (VS2015)
1.git clone git://github.com/stephane/libmodbus (Download libmodbus src)
2.Double-click .\libmodbus\src\win32\configure.js
3.Open modbus-9.sln use IDE for vs2015.
4.Build release version.
$ export PREFIX=/home/ToolChain/gcc-linaro
$ export DESTDIR=/tmp/openswan.arm
$ export ARCH=arm
$ export CC=$PREFIX/bin/arm-linux-gnueabihf-gcc
$ export GCC=$PREFIX/bin/arm-linux-gnueabihf-gcc
$ export LD=$PREFIX/bin/arm-linux-gnueabihf-ld
$ export RANLIB=$PREFIX/bin/arm-linux-gnueabihf-ranlib
$ export AR=$PREFIX/bin/arm-linux-gnueabihf-ar
$ export AS=$PREFIX/bin/arm-linux-gnueabihf-as
$ export STRIP=$PREFIX/bin/arm-linux-gnueabihf-strip
$ export CPATH=/home/gmp-6.1.2/gmp/include
$ export LD_LIBRARY_PATH = /home/gmp-6.1.2/gmp/lib:/usr/lib
$
$ make programs
$ make install
$ (and the install will go into $DESTDIR/)
$ [ARM system]
$ tar -zxvf openswan-2.6.49.1.arm.tar.gz
$ tar -zxvf gmp-6.1.2.arm.tar.gz
Method 1 (gmp) 2017-06-27 It's bad method. Maybe gmp does not work.
$ export CPATH=/home/gmp-6.1.2/gmp/include
$ ./configure --host=arm-linux CC=arm-linux-gnueabihf-gcc --prefix=/usr/local/strongswan
Method 2 (OpenSSL)
$ export CPATH=/home/gmp-6.1.2/gmp/include:/usr/local/ssl/include
$ ./configure --host=arm-linux CC=arm-linux-gnueabihf-gcc LDFLAGS="-L/usr/local/ssl/lib" --prefix=/usr/local/strongswan --enable-openssl --disable-gmp
$ ./configure --host=arm-linux CC=arm-linux-gnueabihf-gcc LDFLAGS="-L/usr/local/ssl/lib" --prefix=/usr/local/strongswan --enable-eap-radius --enable-eap-mschapv2 --enable-eap-identity --enable-eap-md5 --enable-eap-tls --enable-eap-ttls --enable-eap-peap --enable-eap-tnc --enable-eap-dynamic --enable-xauth-eap --enable-openssl --disable-gmp --enable-kernel-pfkey --enable-gcm
$ make
$ make install
$ cd /usr/local/strongswan
$ tar -czf strongswan.tar.gz *
$ [ARM system]
$ mkdir /usr/local/strongswan
$ cd /usr/local/strongswan
$ tar -czf strongswan.tar.gz *
$ cp pki /bin/
/usr/local/strongswan/sbin$ cp ipsec swanctl /sbin/
[Configure]
See: https://wiki.strongswan.org/projects/strongswan/wiki/UserDocumentation
See: https://www.strongswan.org/testing/testresults/ikev1/xauth-id-psk-config/
Client configure file.
$ cat /usr/local/strongswan/etc/ipsec.conf
config setup
#charondebug="ike 1, knl 1, cfg 0"
uniqueids=no
conn home
keyexchange=ikev2
#fragmentation=yes
#forceencaps=yes
#compress=yes
#type=tunnel
ike=aes256-sha1-modp1024,3des-sha1-modp1024!
esp=aes256-sha1,3des-sha1!
leftsourceip=%config
leftauth=eap-mschapv2
leftsendcert=never
leftfirewall=yes
right=1.2.3.4
rightid=1.2.3.4
rightsubnet=0.0.0.0/0
rightauth=pubkey
rightfirewall=yes
eap_identity=heyn
auto=add
#installpolicy=yes