title: cross compile vim for armv7
body: <p>I want to cross compile vim on Ubuntu 16.04 LTS for armv7. When I try to configure, I got the error:</p>
  
  <pre><code>…
  checking for tgetent in -lcurses... no
  no terminal library found
  checking for tgetent()... configure: error: NOT FOUND!
        You need to install a terminal library; for example ncurses.
        Or specify the name of the library with --with-tlib.
  </code></pre>
  
  <p>Therefore, I cross compiled ncurses and I install ncurses for arm in <em>~/work/ncurses/install</em>:</p>
  
  <pre><code>#~/work/ncurses/install# l
  insgesamt 12K
  drwxrwxr-x 2 root root 4,0K Sep  3 16:56 bin
  drwxrwxr-x 2 root root 4,0K Sep  3 16:56 lib
  drwxrwxr-x 5 root root 4,0K Sep  3 16:56 usr
  #~/work/ncurses/install# cd bin
  #~/work/ncurses/install/bin# l
  insgesamt 192K
  lrwxrwxrwx 1 root root   23 Sep  3 16:56 arm-linux-gnueabihf-captoinfo -&gt; arm-linux-gnueabihf-tic
  -rwxr-xr-x 1 root root 8,3K Sep  3 16:56 arm-linux-gnueabihf-clear
  -rwxr-xr-x 1 root root  47K Sep  3 16:56 arm-linux-gnueabihf-infocmp
  lrwxrwxrwx 1 root root   23 Sep  3 16:56 arm-linux-gnueabihf-infotocap -&gt; arm-linux-gnueabihf-tic
  lrwxrwxrwx 1 root root   24 Sep  3 16:56 arm-linux-gnueabihf-reset -&gt; arm-linux-gnueabihf-tset
  -rwxr-xr-x 1 root root  14K Sep  3 16:56 arm-linux-gnueabihf-tabs
  -rwxr-xr-x 1 root root  51K Sep  3 16:56 arm-linux-gnueabihf-tic
  -rwxr-xr-x 1 root root  14K Sep  3 16:56 arm-linux-gnueabihf-toe
  -rwxr-xr-x 1 root root  14K Sep  3 16:56 arm-linux-gnueabihf-tput
  -rwxr-xr-x 1 root root  20K Sep  3 16:56 arm-linux-gnueabihf-tset
  -rwxr-xr-x 1 root root 5,2K Sep  3 16:56 ncurses5-config
  #~/work/ncurses/install/bin# l ../lib
  insgesamt 1004K
  lrwxrwxrwx 1 root root   12 Sep  3 16:56 libcurses.a -&gt; libncurses.a
  lrwxrwxrwx 1 root root   17 Sep  3 16:56 libcurses.so -&gt; libncurses.so.5.9
  -rw-r--r-- 1 root root  79K Sep  3 16:56 libform.a
  lrwxrwxrwx 1 root root   12 Sep  3 16:56 libform.so -&gt; libform.so.5
  lrwxrwxrwx 1 root root   14 Sep  3 16:56 libform.so.5 -&gt; libform.so.5.9
  -rwxrwxr-x 1 root root  49K Sep  3 16:56 libform.so.5.9
  -rw-r--r-- 1 root root  44K Sep  3 16:56 libmenu.a
  lrwxrwxrwx 1 root root   12 Sep  3 16:56 libmenu.so -&gt; libmenu.so.5
  lrwxrwxrwx 1 root root   14 Sep  3 16:56 libmenu.so.5 -&gt; libmenu.so.5.9
  -rwxrwxr-x 1 root root  30K Sep  3 16:56 libmenu.so.5.9
  -rw-r--r-- 1 root root 377K Sep  3 16:56 libncurses.a
  -rw-r--r-- 1 root root 128K Sep  3 16:56 libncurses++.a
  lrwxrwxrwx 1 root root   15 Sep  3 16:56 libncurses.so -&gt; libncurses.so.5
  lrwxrwxrwx 1 root root   17 Sep  3 16:56 libncurses.so.5 -&gt; libncurses.so.5.9
  -rwxrwxr-x 1 root root 230K Sep  3 16:56 libncurses.so.5.9
  -rw-r--r-- 1 root root  19K Sep  3 16:56 libpanel.a
  lrwxrwxrwx 1 root root   13 Sep  3 16:56 libpanel.so -&gt; libpanel.so.5
  lrwxrwxrwx 1 root root   15 Sep  3 16:56 libpanel.so.5 -&gt; libpanel.so.5.9
  -rwxrwxr-x 1 root root  13K Sep  3 16:56 libpanel.so.5.9
  #~/work/ncurses/install/bin# l ../usr
  insgesamt 12K
  drwxrwxr-x 2 root root 4,0K Sep  3 16:56 include
  drwxrwxr-x 6 root root 4,0K Sep  3 16:56 man
  drwxrwxr-x 4 root root 4,0K Sep  3 16:56 share
  </code></pre>
  
  <p>I try now to configure with <em>--with-tlib=~/work/ncurses/install/lib</em> but I get the error:</p>
  
  <pre><code>…
  checking for stack_t... yes
  checking whether stack_t has an ss_base field... no
  checking --with-tlib argument... ~/work/ncurses/install/lib
  checking for linking with ~/work/ncurses/install/lib library... configure: error: FAILED
  </code></pre>
  
  <p>How can I make it work?
  Thanks in advance.</p>
  
  <hr>
  
  <p>full configure:</p>
  
  <pre><code>export TARGET=arm-linux-gnueabihf
  LDFLAGS=-L~/work/ncurses/install/lib ./configure --target=$TARGET --prefix=$PREFIX --with-sysroot=$TARGET --with-arch=$TARGET CC=arm-linux-gnueabihf-gcc --host=$TARGET --with-tlib=ncurses
  </code></pre>
  
  <hr>
  
  <p>Finally I succeeded:</p>
  
  <pre><code>export TARGET=arm
  export LDFLAGS=-L$HOME/work/ncurses/install/lib
  export PREFIX=$HOME/work/vim2/build
  ./configure --build=$TARGET --host=$TARGET    --prefix=/usr --enable-multibyte --enable-gui=no -disable-gtktest --disable-xim --with-features=normal     --disable-gpm --without-x --disable-netbeans --with-tlib=ncurses
  make -j4 CC=arm-linux-gnueabihf-gcc
  make DESTDIR=/root/work/vim2/install CC=arm-linux-gnueabihf-gcc install
  </code></pre>