I tidied up my steps as following:
Install Debian 7.8 32bit.
Install following packages:
echo "deb http://ftp.debian.org/debian wheezy-backports main contrib non-free" >>/etc/apt/sources.list
apt-get -t wheezy-backports install qemu-user-static
apt-get install binfmt-support
apt-get install make libtool
apt-get -y install build-essential automake libncurses5-dev build-essential intltool checkinstall
apt-get build-dep nmon
apt-get build-dep vim-gnome
apt-get -d source zlib openssl curl libevent
apt-get install libssl-dev libreadline-gplv2-dev
apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
Then:
cd /root
mkdir wdmc-build && cd wdmc-build
Download Ex2 GPL: http://support.wdc.com/product/download.asp?groupid=906&sid=220&lang=en to this folder.
Once you extracted, you will get a file named: My_Cloud_EX2_Release_Notes_GPL_v1.05.36_20150624.txt
Follow that file till 3.3 as following:
1. Introduction
This file will show you how to build the WDMyClound EX2 firmware.
1.1 # tar zxvf WDMyCloud_EX2_GPL_v1.05.36_20150624.tar.gz
1.2 # cd WDMyCloud_EX2_GPL_v1.05.36_20150624
1.3 # export HOME_DIR=`pwd`
2. Install tool-chain
2.1 # cd $HOME_DIR/toolchain
2.2 # tar zxvf armv7-marvell-linux-gnueabi-softfp_i686_64K_Dev_20131002.tar.gz
3. How to build Open source modules? For example: build attr-2.4.46
3.1 Install compiler toolchain
3.2 # cd $HOME_DIR/Open_Source_packages
3.3 # source source.me
Please note: source source.me under Open_Source_package is very important!
Compile existing ncurses lib in Open_Source_packages:
tar xf ncurses-5.7.tar.gz
cd ncurses-5.7/
./xbuild build
./xbuild install
cd /root/wdmc-build/WDMyCloud_EX2_GPL_v1.05.36_20150624/firmware/module/crfs/lib/
ln -s libncurses.so.5.7 libncurses.so.5
ln -s libncurses.so.5.7 libncurses.so
Download vim74 source tar ball to Open_Source_packages folder, extract it.
Put following content as xbuild.sh into vim74 folder:
#!/bin/sh
unset CFLAGS
unset LDFLAGS
unset LIBS
CFLAGS="-I${PWD}/../_xinstall/${PROJECT_NAME}/include"
CXXFLAGS="-I${PWD}/../_xinstall/${PROJECT_NAME}/include"
export CFLAGS
export LDFLAGS
export CXXFLAGS
MY_PREFIX=$PWD/../_xinstall/${PROJECT_NAME}
export vim_cv_terminfo="yes"
export vim_cv_tty_group="world"
export vim_cv_tty_mode="0620"
export vim_cv_getcwd_broken="no"
export vim_cv_memmove_handles_overlap=yes
export vim_cv_stat_ignores_slash=yes
export vim_cv_tgetent=zero
export vim_cv_toupper_broken=no
export LDFLAGS="-L/root/wdmc-build/WDMyCloud_EX2_GPL_v1.05.36_20150624/firmware/module/crfs/lib/"
xcp()
{
echo "sour: $1"
echo "dest: $2"
cp -f $1 $2
}
xbuild()
{
make distclean
./configure --build=i386-linux --host=arm-linux --prefix=${MY_PREFIX} --disable-selinux --disable-gpm --disable-nls --disable-gtktest --disable-netbeans --disable-darwin --enable-fontset --with-tlib=ncurses
make
}
if ["$1" = "build"]; then
xbuild
else
echo "Usage : [xbuild.sh build]"
fi
then run:
./xbuild.sh build
Then you will get src/vim in ARM format!
Good Luck!