=?gb2312?B?tPC4tDogW09wZW5zd2FuIFVzZXJzXSBIb3cgdG8gdXNlIE9wZW5zd2FuIG8=?= =?gb2312?B?biBBUk0gcGxhdGZvcm0=?=

Chen Lintao chenlt at icevpn.org
Mon Dec 5 13:30:02 CET 2005


Shoud it work for openswan-1.x ?=20

With your help, I build up the cross compiling env.
And now I use openswan-1.0.10 =20
After one day's hard work. It is now compiled well after several
modification as following.

1. Add gmp arm lib from
http://www.buserror.org/~ebrown/sshf2001/download/gmp-3.1.1/gmp-3.1.1-bui=
ld-
arm-striped.tar.gz

2. modify some Makefiles using CC=3Dgcc AR=3Dar ...
${OPNSWANDIR}./libcrypto/libblowfish/Makefile
	CC=3Darm-linux-gcc
	AR=3D            arm-liux-ar r
	RANLIB=3D                arm-linux-ranlib
${OPNSWANDIR}./libcrypto/libcast/Makefile=20
	CC=3Darm-linux-gcc
	AR=3D            arm-liux-ar r
	RANLIB=3D                arm-linux-ranlib
${OPNSWANDIR}./klips/utils/Makefile
	CC=3Darm-linux-gcc
3. In openswan dir
CC=3Darm-linux-gcc RANLIB=3Darm-linux-ranlib AS=3Darm-linx-as =
AR=3Darm-linux-ar
LD=3Darm-linux-ld make menugo

Now all the programs and kernel compile with no Error. Look greater.

But I didn't put them  on the ARM platform for testing . The arm board =
will
be arrived in several days . I'm waiting for the result .

Questions: 1. Should it work ? hehe=20
		  2. Which is better for ARM ? openswan-2 or openswan-1 ?
		  3. How could I test all these when I have no arm board now
?

Thx


-----=D3=CA=BC=FE=D4=AD=BC=FE-----
=B7=A2=BC=FE=C8=CB: Ken Bantoft [mailto:ken at xelerance.com]=20
=B7=A2=CB=CD=CA=B1=BC=E4: 2005=C4=EA12=D4=C25=C8=D5 1:52
=CA=D5=BC=FE=C8=CB: Paul Wouters
=B3=AD=CB=CD: Chen Lintao; users at openswan.org
=D6=F7=CC=E2: Re: [Openswan Users] How to use Openswan on ARM platform



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=3Darm
# export USERCOMPILE=3D-Os

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

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

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

export PATH=3D$TOOLCHAINROOT/bin:$PATH
export CC=3D"$TOOLCHAINROOT/bin/$TOOLCHAINNAME-gcc =
-I$TOOLCHAINROOT/include"
export KERNELCC=3D$TOOLCHAINROOT/bin/$TOOLCHAINNAME-gcc
export LD=3D$TOOLCHAINROOT/bin/$TOOLCHAINNAME-ld
export RANLIB=3D$TOOLCHAINROOT/bin/$TOOLCHAINNAME-ranlib
export AR=3D$TOOLCHAINROOT/bin/$TOOLCHAINNAME-ar
export SR=3D$TOOLCHAINROOT/bin/$TOOLCHAINNAME-as
export AS=3D$TOOLCHAINROOT/bin/$TOOLCHAINNAME-as
export STRIP=3D$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=3D$KERNELCC AS=3D$AS LD=3D$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