2

I want to build vim with all libraries, which vim depends on, statically linked. Vim version is sufficient to run YouCompleteMe. I use the following flags with configure script:

$./configure --with-features=huge \
             --enable-multibyte \
             --enable-rubyinterp \
             --enable-pythoninterp \
             --enable-perlinterp \
             --enable-luainterp \
             --enable-gui=gtk2 \
             --enable-cscope

I set LDFLAGS to '-static'

$export LDFLAGS='-static'

I also installed all vim build dependencies:

$sudo apt-get build-dep vim

It turns out that there is still something missing because I get the following error message from configure script:

checking --with-tlib argument... empty: automatic terminal library selection
checking for tgetent in -ltinfo... no
checking for tgetent in -lncurses... no
checking for tgetent in -ltermlib... no
checking for tgetent in -ltermcap... no
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.

I checked if I have static version of ncurses library - yes, I have under the following location:

/usr/lib/i386-linux-gnu/libncurses.a

Without static LDFLAG vim builds without any problem.

Do you have any ideas why this happens?

  • Did you see this Stack Overflow answer (maybe related): tgetent() not found while compiling vim – steeldriver Jul 5 '15 at 12:29
  • @steeldriver yes, I did - I followed all the advices mentioned there and still have the error in configure script. – user2551229 Jul 5 '15 at 12:32
  • Hmm... so this doesn't seem to be an issue with tgetent specifically: if you look in src/auto/config.log you will probably see an entry like /usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/gcc...libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie. Likely the error just appears to relate to the terminal library because that's the first occasion that ./configure attempts to link anything with your LDFLAGS='-static' – steeldriver Jul 5 '15 at 14:07
  • ... the conflicting LDFLAGS seem to result from enabling Ruby interpreter support: see if it works when you set --enable-rubyinterp=NO - if so that will at least give you somewhere to focus – steeldriver Jul 5 '15 at 15:59
  • @steeldriver it helps - thanks! But I still need rubyinterp in vim to enable YouCompleteMe - do you you have any idea why it is the problem with libc.a? – user2551229 Jul 5 '15 at 16:25
1

I had the similar problem when trying some things with pkgsrc on vim port. Try to open the config.log file. In my case, the configure script told me this :

| int
| main ()
| {
| char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist");
|   ;
|   return 0;
| }
configure:11408: error: NOT FOUND!
      You need to install a terminal library; for example ncurses.
      Or specify the name of the library with --with-tlib.

The problem here is that the termcap.h header is missing on the C code snippet. So I patched the configure script by adding #include <termcap.h> and then it was ok.

I don't know if it the same problem on your platform but you should try :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.