[Openswan Users] How to use Openswan on ARM platform

Ken Bantoft ken at xelerance.com
Sun Dec 4 18:51:50 CET 2005



Once your toolchain is setup, the rest it just setting the variables and 
building.  For ARM, I used to use this:

#!/bin/sh

# Set these:
export ARCH=arm
# export USERCOMPILE=-Os

# eg: arm-linux-  as in arm-linux-gcc
export TOOLCHAINNAME=arm-unknown-linux-gnu

XCOMPILEHOME=`pwd`
export XCOMPILEHOME
export OPENSWANROOT=$XCOMPILEHOME/openswan-2
# Where you want bins/etc.. to appear.  NEVER SET TO "/"
export DESTDIR=$XCOMPILEHOME/installroot
export TOOLCHAINROOT=$XCOMPILEHOME/toolchain
export KERNELSRC=$XCOMPILEHOME/linux

# Includes libgmp please!
export LD_LIBRARY_PATH="$TOOLCHAINROOT/lib"

export PATH=$TOOLCHAINROOT/bin:$PATH
export CC="$TOOLCHAINROOT/bin/$TOOLCHAINNAME-gcc -I$TOOLCHAINROOT/include"
export KERNELCC=$TOOLCHAINROOT/bin/$TOOLCHAINNAME-gcc
export LD=$TOOLCHAINROOT/bin/$TOOLCHAINNAME-ld
export RANLIB=$TOOLCHAINROOT/bin/$TOOLCHAINNAME-ranlib
export AR=$TOOLCHAINROOT/bin/$TOOLCHAINNAME-ar
export SR=$TOOLCHAINROOT/bin/$TOOLCHAINNAME-as
export AS=$TOOLCHAINROOT/bin/$TOOLCHAINNAME-as
export STRIP=$TOOLCHAINROOT/bin/$TOOLCHAINNAME-strip


# Clean up.  Don't even unset DESTDIR :)
cd $XCOMPILEHOME
rm -rf $DESTDIR

cd $OPENSWANROOT
make programs
# Weird kernel compile voodoo, as it doesn't like our current $CC
make module CC=$KERNELCC AS=$AS LD=$LD

...


On Sun, 4 Dec 2005, Paul Wouters wrote:

> On Sun, 4 Dec 2005, Chen Lintao wrote:
>
>> Now I am working on using Openswan  on ARM based platform ( S3C2410 ), It's
>> the first time for me to do "Cross compiling" work. Someone can give me some
>> references or BEST working steps in detail .
>
> There are a few places you can have a look, but it all comes down to "you only
> need to change the variables from Makefile and Makefile.inc. These can all be
> overridden from the commandline, eg: GCC, RANLIB, AS, AR. Make sure you also
> have a cross compiled gmp library which you need.
>
> A good example to check out is the openwrt openswan package. It cross compiles
> for mips using buildroot, but you can use buildroot for your ARM port as well.
> See http://openwrt.org/
>
> Some hints for windows cross compiling are in docs/cross-compiler.txt.
>
> Paul
>


More information about the Users mailing list