Compile vim with clipboard support.

970 views
Skip to first unread message

Hongyi Zhao

unread,
Aug 23, 2019, 2:10:03 AM8/23/19
to vim...@googlegroups.com
Hi,

I use Debian 9 and want to compile vim with clipboard support. I've
installed xorg-dev package corresponding dependent packages. But, I
still cannot do the trick:

$ ./configure --enable-cscope \
--enable-luainterp \
--enable-multibyte \
--enable-python3interp \
--enable-perlinterp \
--enable-rubyinterp \
--enable-tclinterp \
--enable-gui=auto \
--enable-gtk2-check \
--enable-gnome-check \
--with-x --with-features=huge

I will meet the following error:

------
checking for X... (cached) no
checking if X11 header files can be found... yes
configure: error: could not configure X
-------

How to solve this problem?

ps. I use the latest git source to do the job.

Regards

--
Hongsheng Zhao <hongy...@gmail.com>
Institute of Semiconductors, Chinese Academy of Sciences
GnuPG DSA: 0xD108493

Tony Mechelynck

unread,
Aug 23, 2019, 2:16:44 AM8/23/19
to vim_use
Try "make reconfig" (with config arguments as environment variables)
to clear the cache.

See http://users.skynet.be/antoine.mechelynck/vim/compunix.htm about
how to set environment variables for config arguments. That HowTo
assumes bash shell but you should be able to adapt it for csh shell if
necessary.

Best regards,
Tony.

Christian Brabandt

unread,
Aug 23, 2019, 2:32:09 AM8/23/19
to vim...@googlegroups.com

On Fr, 23 Aug 2019, Hongyi Zhao wrote:

> Hi,
>
> I use Debian 9 and want to compile vim with clipboard support. I've
> installed xorg-dev package corresponding dependent packages. But, I
> still cannot do the trick:
>
> $ ./configure --enable-cscope \
> --enable-luainterp \
> --enable-multibyte \
> --enable-python3interp \
> --enable-perlinterp \
> --enable-rubyinterp \
> --enable-tclinterp \
> --enable-gui=auto \
> --enable-gtk2-check \
> --enable-gnome-check \
> --with-x --with-features=huge
>
> I will meet the following error:
>
> ------
> checking for X... (cached) no
> checking if X11 header files can be found... yes
> configure: error: could not configure X
> -------
>
> How to solve this problem?

Try explicitly installing Debians build-dependencies:

sudo apt build-dep vim-gtk

(for the gtk2 gui, use vim-gtk3 if you want to compile a vim withtfk3
gui)

Best,
Christian
--
Wenn es keinen Gott gäbe, müßten wir ihn erfinden.
-- François Marie Voltaire

Hongyi Zhao

unread,
Aug 23, 2019, 9:13:31 AM8/23/19
to vim...@googlegroups.com
Tony Mechelynck <antoine.m...@gmail.com> 于2019年8月23日周五 下午2:16写道:
werner@localhost:~/software/editor/vim/SpaceVim.git$ make reconfig
make: *** No rule to make target 'reconfig'. Stop.


>
> See http://users.skynet.be/antoine.mechelynck/vim/compunix.htm about
> how to set environment variables for config arguments. That HowTo
> assumes bash shell but you should be able to adapt it for csh shell if
> necessary.
>
> Best regards,
> Tony.
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXtNuuMq2esgPkunDjK-CeyoEtO-Uwovupgt81PrMYP_ZQ%40mail.gmail.com.

Christian Brabandt

unread,
Aug 23, 2019, 9:22:21 AM8/23/19
to vim...@googlegroups.com

On Fr, 23 Aug 2019, Hongyi Zhao wrote:
> werner@localhost:~/software/editor/vim/SpaceVim.git$ make reconfig
> make: *** No rule to make target 'reconfig'. Stop.

You obviously don't want to run this in the SpaceVim repository but in
the checkout out vim source.

Best,
Christian
--
Schreckliches Klima, das durch Eintracht des demographischen Hochs mit
dem geistigen Tief entsteht.
-- Stanislaw Jerzy Lec (eig. S. J. de Tusch-Letz)

Tony Mechelynck

unread,
Aug 23, 2019, 9:44:11 AM8/23/19
to vim_use
On Fri, Aug 23, 2019 at 3:13 PM Hongyi Zhao <hongy...@gmail.com> wrote:
> werner@localhost:~/software/editor/vim/SpaceVim.git$ make reconfig
> make: *** No rule to make target 'reconfig'. Stop.

You should run this make command, like all commands used to compile
Vim, either from the top of your source (whose path normally ends in
.../vim) or in its src subdirectory — or in a shadow directory if you
have made one. The top Makefile has a "reconfig" target at line 35
which invokes the src/Makefile; and the latter has a "reconfig" target
at line 1995. If make doesn't find that target, then either you're in
a wrong directory or your Makefile is corrupt.

Best regards,
Tony.

Hongyi Zhao

unread,
Aug 23, 2019, 9:48:04 AM8/23/19
to vim...@googlegroups.com
Tony Mechelynck <antoine.m...@gmail.com> 于2019年8月23日周五 下午2:16写道:
>
Sorry for my last reply to this thread. I try in a incorrect dir.

Thanks a lot, I tried both of the following methods, it seems they all
will do the trick:

./configure ...
make -24 reconfig

or

git clean -xdf
./configure ...
make -24


>
> See http://users.skynet.be/antoine.mechelynck/vim/compunix.htm about
> how to set environment variables for config arguments. That HowTo
> assumes bash shell but you should be able to adapt it for csh shell if
> necessary.
>
> Best regards,
> Tony.
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXtNuuMq2esgPkunDjK-CeyoEtO-Uwovupgt81PrMYP_ZQ%40mail.gmail.com.



Tony Mechelynck

unread,
Aug 23, 2019, 10:04:20 AM8/23/19
to vim_use
On Fri, Aug 23, 2019 at 3:48 PM Hongyi Zhao <hongy...@gmail.com> wrote:
> Sorry for my last reply to this thread. I try in a incorrect dir.
>
> Thanks a lot, I tried both of the following methods, it seems they all
> will do the trick:
>
> ./configure ...
> make -24 reconfig

"make reconfig" is the equivalent of "make distclean && make config &&
make", you don't need to run config just before but you do need to set
your config arguments in environment variables, otherwise it will
invoke configure with no arguments and you'll get a default Vim with
none of your customizations
>
> or
>
> git clean -xdf
> ./configure ...
> make -24

What is this -24 argument? I find it in neither "man make" nor "info
make". If you want to run 4 instances of gcc in parallel it's -j4 --
or you can let make compile one module at a time and omit it
altogether.

Best regards,
Tony.

Hongyi Zhao

unread,
Aug 23, 2019, 10:11:17 AM8/23/19
to vim...@googlegroups.com
Hongyi Zhao <hongy...@gmail.com> 于2019年8月23日周五 下午9:47写道:
I don't know whether the above usage of mine is correct or not. Since
I've never used make like this. If I'm wrong, please correct me.

Hongyi Zhao

unread,
Aug 23, 2019, 10:24:38 AM8/23/19
to vim...@googlegroups.com
Tony Mechelynck <antoine.m...@gmail.com> 于2019年8月23日周五 下午10:04写道:
>
> On Fri, Aug 23, 2019 at 3:48 PM Hongyi Zhao <hongy...@gmail.com> wrote:
> > Sorry for my last reply to this thread. I try in a incorrect dir.
> >
> > Thanks a lot, I tried both of the following methods, it seems they all
> > will do the trick:
> >
> > ./configure ...
> > make -24 reconfig

My typo, I mean `-j24'

>
> "make reconfig" is the equivalent of "make distclean && make config &&
> make", you don't need to run config just before but you do need to set
> your config arguments in environment variables, otherwise it will
> invoke configure with no arguments and you'll get a default Vim with
> none of your customizations

This method is not so convenient, considering that I must prepare a
separate file for environment variables
and then source it before `make reconfig'. And, the most
inconvenient thing is that the name for the environment variables are
not so easy to find, remember and write.

What's point of view?

On the other hand, due to this is a git local repo, I tried with the
following steps and it does work as I have posted here:

Under the src dir of vim:

git clean -xdf
./configure ...
make

See the following info with the above method:

---------------
werner@localhost:~/software/editor/vim/vim.git$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug 23 2019 22:22:27)
Included patches: 1-1912
Compiled by werner@localhost
Huge version with GTK2 GUI. Features included (+) or not (-):
+acl -farsi -mouse_sysmouse -tag_any_white
+arabic +file_in_path +mouse_urxvt +tcl
+autocmd +find_in_path +mouse_xterm +termguicolors
+autochdir +float +multi_byte +terminal
+autoservername +folding +multi_lang +terminfo
+balloon_eval -footer -mzscheme +termresponse
+balloon_eval_term +fork() +netbeans_intg +textobjects
+browse +gettext +num64 +textprop
++builtin_terms +hangul_input +packages +timers
+byte_offset +iconv +path_extra +title
+channel +insert_expand +perl +toolbar
+cindent +job +persistent_undo +user_commands
+clientserver +jumplist +postscript +vartabs
+clipboard +keymap +printer +vertsplit
+cmdline_compl +lambda +profile +virtualedit
+cmdline_hist +langmap -python +visual
+cmdline_info +libcall +python3 +visualextra
+comments +linebreak +quickfix +viminfo
+conceal +lispindent +reltime +vreplace
+cryptv +listcmds +rightleft +wildignore
+cscope +localmap +ruby +wildmenu
+cursorbind +lua +scrollbind +windows
+cursorshape +menu +signs +writebackup
+dialog_con_gui +mksession +smartindent +X11
+diff +modify_fname +sound -xfontset
+digraphs +mouse +spell -xim
+dnd +mouseshape +startuptime +xpm
-ebcdic +mouse_dec +statusline +xsmp_interact
+emacs_tags +mouse_gpm -sun_workshop +xterm_clipboard
+eval -mouse_jsbterm +syntax -xterm_save
+ex_extra +mouse_netterm +tag_binary
+extra_search +mouse_sgr -tag_old_static
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
system gvimrc file: "$VIM/gvimrc"
user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
defaults file: "$VIMRUNTIME/defaults.vim"
system menu file: "$VIMRUNTIME/menu.vim"
fall-back for $VIM: "/usr/local/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK
-pthread -I/usr/include/gtk-2.0
-I/usr/lib/x86_64-linux-gnu/gtk-2.0/include
-I/usr/include/gio-unix-2.0/ -I/usr/include/cairo
-I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo
-I/usr/include/pixman-1 -I/usr/include/libpng16
-I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16
-I/usr/include/pango-1.0 -I/usr/include/harfbuzz
-I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2
-g -O2 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L. -Wl,-z,relro -Wl,-z,now -fstack-protector -rdynamic
-Wl,-export-dynamic -Wl,-E -L/usr/local/lib -Wl,--as-needed -o vim
-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo
-lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0
-lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp
-lSM -lICE -lm -ltinfo -lnsl -lselinux -lcanberra -lacl -lattr
-lgpm -ldl -L/usr/lib -llua5.2 -Wl,-E -fstack-protector-strong
-L/usr/local/lib -L/usr/lib/x86_64-linux-gnu/perl/5.24/CORE -lperl
-ldl -lm -lpthread -lcrypt
-L/home/werner/.pyenv/versions/3.7.4/lib/python3.7/config-3.7m-x86_64-linux-gnu
-lpython3.7m -lcrypt -lpthread -ldl -lutil -lm
-L/usr/lib/x86_64-linux-gnu -ltcl8.6 -ldl -lz -lpthread -lieee -lm
-lruby-2.3 -lpthread -lgmp -ldl -lcrypt -lm
werner@localhost:~/software/editor/vim/vim.git$
---------------

Regards

> >
> > or
> >
> > git clean -xdf
> > ./configure ...
> > make -24
>
> What is this -24 argument? I find it in neither "man make" nor "info
> make". If you want to run 4 instances of gcc in parallel it's -j4 --
> or you can let make compile one module at a time and omit it
> altogether.
>
> Best regards,
> Tony.
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXsRN%2BrDjcbBpbjqLJ%3Dq2TMugGvgDNKDn89KxMd-CyoEWg%40mail.gmail.com.

Tony Mechelynck

unread,
Aug 23, 2019, 10:49:03 AM8/23/19
to vim_use
On Fri, Aug 23, 2019 at 4:24 PM Hongyi Zhao <hongy...@gmail.com> wrote:
>
> Tony Mechelynck <antoine.m...@gmail.com> 于2019年8月23日周五 下午10:04写道:
> >
> > On Fri, Aug 23, 2019 at 3:48 PM Hongyi Zhao <hongy...@gmail.com> wrote:
> > > Sorry for my last reply to this thread. I try in a incorrect dir.
> > >
> > > Thanks a lot, I tried both of the following methods, it seems they all
> > > will do the trick:
> > >
> > > ./configure ...
> > > make -24 reconfig
>
> My typo, I mean `-j24'
>
> >
> > "make reconfig" is the equivalent of "make distclean && make config &&
> > make", you don't need to run config just before but you do need to set
> > your config arguments in environment variables, otherwise it will
> > invoke configure with no arguments and you'll get a default Vim with
> > none of your customizations
>
> This method is not so convenient, considering that I must prepare a
> separate file for environment variables
> and then source it before `make reconfig'. And, the most
> inconvenient thing is that the name for the environment variables are
> not so easy to find, remember and write.
>
> What's point of view?

Well,
1) this way you get the same configure settings from one run of make
to the next, you don't need to type them yourself;
2) this way you don't need to run configure separately; make does it for you
3) sometimes an incremental "make" will run "configure" before it
starts compiling even if you started a plain "make" with no arguments;
in that case, if you haven't set your configure settings in the
environment you'll get a "default Vim" without your customizations
4) which environment variables to set can be found by inspecting the
src/Makefile which has comments at the beginning describing them; and
the most usual of them can be seen in my HowTo page
http://users.skynet.be/antoine.mechelynck/vim/compunix.htm
If it works for you, so much the better. One characteristic of Vim is
that there are often several ways to achieve the same result.

Best regards,
Tony.

Hongyi Zhao

unread,
Aug 24, 2019, 3:26:19 AM8/24/19
to vim...@googlegroups.com
Tony Mechelynck <antoine.m...@gmail.com> 于2019年8月23日周五 下午10:49写道:
Based on the instructions given here:

https://github.com/vim/vim/blob/master/src/INSTALL

It said that:

-----------
The advantage of running configure separately, is that you can write a script
to build Vim, without changing the Makefile or feature.h. Example (using sh):

CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif

One thing to watch out for: If the configure script itself changes, running
"make" will execute it again, but without your arguments. Do "make clean" and
run configure again.
-----------

So, it should be enough to do the following for using specific
configure arguments:

make clean
./configure ...
make

Am I right?
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAJkCKXs%3DCFu6Pbhsjtjn4eMBgzsKbnNU9tmhbP4hiKBjHTCD5w%40mail.gmail.com.

Tony Mechelynck

unread,
Aug 24, 2019, 6:50:09 PM8/24/19
to vim_use
On Sat, Aug 24, 2019 at 9:26 AM Hongyi Zhao <hongy...@gmail.com> wrote:
> Based on the instructions given here:
>
> https://github.com/vim/vim/blob/master/src/INSTALL
>
> It said that:
>
> -----------
> The advantage of running configure separately, is that you can write a script
> to build Vim, without changing the Makefile or feature.h. Example (using sh):
>
> CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif
>
> One thing to watch out for: If the configure script itself changes, running
> "make" will execute it again, but without your arguments. Do "make clean" and
> run configure again.
> -----------
>
> So, it should be enough to do the following for using specific
> configure arguments:
>
> make clean
> ./configure ...
> make
>
> Am I right?

Well, setting configure options by means of environment variables
means that I don't need to modify the Makefile either. It also means
that I don't need another script to compile: I set the options once
and for all in the shell used to compile Vim (or in, say, one shell
for Big "vim" and one shell for Tiny "vi" in a shadow directory), then
I use just "make" to compile and "make install" thereafter if it ends
OK. And if the make program finds that it wants to reconfigure, it
will do it with the appropriate configure settings.

This means that I can afford not to run "make clean" (so that I can do
incremental compiles, compiling only the changed modules and what
depends on them) and that configure will only be run when necessary
(make does it when there is a change to the configure script, and it
does it with my configure settings). If I need to force a reconfigure
(for instance to pick up new system libraries after an OS upgrade)
then I run "make reconfig" instead of "make" and that will configure
(using my customizations and checking my system libraries) then
recompile everything.

Best regards,
Tony.

Ottavio Caruso

unread,
Aug 25, 2019, 4:41:10 AM8/25/19
to vim...@googlegroups.com
On Sat, 24 Aug 2019 at 08:25, Hongyi Zhao <hongy...@gmail.com> wrote:

>
> Based on the instructions given here:
>
> https://github.com/vim/vim/blob/master/src/INSTALL
>
> It said that:
>
> -----------
> The advantage of running configure separately, is that you can write a script
> to build Vim, without changing the Makefile or feature.h. Example (using sh):
>
> CFLAGS=-DCOMPILER_FLAG ./configure --enable-gui=motif
>
> One thing to watch out for: If the configure script itself changes, running
> "make" will execute it again, but without your arguments. Do "make clean" and
> run configure again.
> -----------
>
> So, it should be enough to do the following for using specific
> configure arguments:
>
> make clean
> /configure ...
> make
>
> Am I right?
>

[DISCLAIMER: I'm writing this out of selfishness, as I'd really like
to see more people testing vim-* on pkgsrc. Apologies for the detour]

This won't answer your question directly, but you can always try and
build vim on your system using pkgsrc [1] [2] .

Vim on pkgsrc is built around separate packages, the master being
vim-share [3] and in your case you want vim-gtk2 [4].

Then you can modify the Makefile [5] adding your flags or just insert
them from the command line:

$ cd [path-to-pkgsrc]/editors/vim-gtk2 && bmake <insert your flags here> install

I can't guarantee this will be an easy ride, though. I had to disable
fortify to make my package work on Linux.

[1] https://www.pkgsrc.org/
[2] https://cdn.netbsd.org/pub/pkgsrc/current/pkgsrc/doc/pkgsrc.html
[3] http://pkgsrc.se/editors/vim-share
[4] http://pkgsrc.se/editors/vim-gtk2
[5} http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/editors/vim-gtk2/Makefile?rev=1.84&content-type=text/x-cvsweb-markup

--
Ottavio Caruso
Reply all
Reply to author
Forward
0 new messages