Enabling/Disabling Vim features during compilation

48 views
Skip to first unread message

li...@ifohancroft.com

unread,
Aug 30, 2021, 9:37:38 AM8/30/21
to v...@vim.org, vim...@googlegroups.com

Hi,

I have a couple of questions that I couldn't find an answer for. If
anything is unclear, please let me know.

1. Excluding the features marked with '-', can each of the
features in https://vimhelp.org/various.txt.html#%2Bfeature-list be
explicitly enabled or disabled on their own during compilation?

2. Are there any features that can be disabled/enabled during
compilation
that can't be enabled/disabled by passing an option to ./configure?

If the answer to #1 is yes and the answer to #2 is no - I see that
./configure --help doesn't list a separate option for each of the
features, but there is --enable-FEATURE[=ARG] and --disable-FEATURE so I
am guessing I just replace FEATURE with the name of the feature I wish
to enable or disable and I don't actually include the + sign, just the
plain feature name, however:

3.1. If builtin_terms is enabled, whether only some terminals will be
builtin or all of them depends on whether builtin_terms is
+builtin_terms or ++builtin_terms. How do I specify ++builtin_terms as
--enable-FEATURE? Should it be --enable-+builtinterms?

3.2. I see that some features that have explicit enable/disable options
for them and require passing an argument (for example the Perl
interpreter option requires an argument whether it should be anbled or
not and whether it should be dynamically loaded) have a +feature
equivalent with separate options for the different arguments of the
builtin enable/disable option. Very clever btw! In such a case, if I
choose to enable the Perl interpret using --enable-perl and want it
loaded dynamic, instead of setting --enable-perlinterp=dynamic, do I use
just --enable-perl/dyn or should I use both --enable-perl and
--enable-perl/dyn?

Best Regards,
IFo Hancroft

Christian Brabandt

unread,
Aug 31, 2021, 2:11:27 AM8/31/21
to v...@vim.org, vim...@googlegroups.com

On Mo, 30 Aug 2021, li...@ifohancroft.com wrote:

>
> Hi,
>
> I have a couple of questions that I couldn't find an answer for. If anything
> is unclear, please let me know.
>
> 1. Excluding the features marked with '-', can each of the
> features in https://vimhelp.org/various.txt.html#%2Bfeature-list be
> explicitly enabled or disabled on their own during compilation?

Not sure what you mean by that. Many features (but not all) can be
enabled passing appropriate flags to the configure script. Check the
help from ./configure --help for the different flags.

> 2. Are there any features that can be disabled/enabled during compilation
> that can't be enabled/disabled by passing an option to ./configure?

Yes. You may edit the header file feature.h. Note, if you just start
enabling features blindly, compilation may fail (because of ifdefs), so
be careful.

> If the answer to #1 is yes and the answer to #2 is no - I see that
> ./configure --help doesn't list a separate option for each of the
> features, but there is --enable-FEATURE[=ARG] and --disable-FEATURE so I
> am guessing I just replace FEATURE with the name of the feature I wish
> to enable or disable and I don't actually include the + sign, just the
> plain feature name, however:
>
> 3.1. If builtin_terms is enabled, whether only some terminals will be
> builtin or all of them depends on whether builtin_terms is
> +builtin_terms or ++builtin_terms. How do I specify ++builtin_terms as
> --enable-FEATURE? Should it be --enable-+builtinterms?

I believe this is a feature, that is enabled using feature.h depending
on the feature set (huge, normal, small). What are you trying to do
here? Is there a particular interest in the builtinterms feature?

> 3.2. I see that some features that have explicit enable/disable options
> for them and require passing an argument (for example the Perl
> interpreter option requires an argument whether it should be anbled or
> not and whether it should be dynamically loaded) have a +feature
> equivalent with separate options for the different arguments of the
> builtin enable/disable option. Very clever btw! In such a case, if I
> choose to enable the Perl interpret using --enable-perl and want it
> loaded dynamic, instead of setting --enable-perlinterp=dynamic, do I use
> just --enable-perl/dyn or should I use both --enable-perl and
> --enable-perl/dyn?

Check the help of the configure script:

#v+
chrisbra@debian ~/code/vim-src/src% ./configure --help |grep -i perl
--enable-perlinterp=OPTS Include Perl interpreter. default=no OPTS=no/yes/dynamic
#v-

Does that help?

Best,
Christian
--
Jemand, der immer lustig ist, ist was Unerträgliches.
-- Loriot (eigentlich Vicco von Bülow)

li...@ifohancroft.com

unread,
Aug 31, 2021, 6:30:46 AM8/31/21
to v...@vim.org, vim...@googlegroups.com
On 2021-08-30 23:11, Christian Brabandt wrote:

> Not sure what you mean by that. Many features (but not all) can be
> enabled passing appropriate flags to the configure script. Check the
> help from ./configure --help for the different flags.

https://vimhelp.org/various.txt.html#%2Bfeature-list is the list of
features that can be enable during compilation. Those features that have
'-' before them are features that are no longer available. I am asking
if any of those features in the feature list can be enabled or disabled
on its own during compilation.

> Yes. You may edit the header file feature.h. Note, if you just start
> enabling features blindly, compilation may fail (because of ifdefs), so
> be careful.

I know there are some features that can't be enabled by editing
feature.h as the comments around them in feature.h explicitly tell you
to enable/disable them using ./configure

I am basically looking to compile Vim myself, enabling all the features
I want and disabling the ones I don't, explicitly, one by one, not
having to rely on the 'big/small' etc feature set options and I was
hoping to do it by editing the PKGBUILD in AUR for vim-git hence wanting
to enable/disable all features using ./configure.

Also, ./configure has the option --enable-FEATURE and --disable-FEATURE
where FEATURE is to be replaced by the feature's name, so I am guessing
in theory it is possible to enable or disable each of the features in
https://vimhelp.org/various.txt.html#%2Bfeature-list using ./configure
options

> I believe this is a feature, that is enabled using feature.h depending
> on the feature set (huge, normal, small). What are you trying to do
> here? Is there a particular interest in the builtinterms feature?

I want to compile Vim myself, enabling the features I want and
+builtinterms is one of them, but like I've mentioned above, I don't
want to have to rely on the 'huge/normal/small' feature set. I want to
specify each feature myself.

> chrisbra@debian ~/code/vim-src/src% ./configure --help |grep -i perl
> --enable-perlinterp=OPTS Include Perl interpreter. default=no
> OPTS=no/yes/dynamic
> #v-
>
> Does that help?

That helps a lot. Thank you!
Not sure how I missed it when looking at ./configure --help

> Best,
> Christian
> --
> Jemand, der immer lustig ist, ist was Unerträgliches.
> -- Loriot (eigentlich Vicco von Bülow)
>
> --

Best Regards,
IFo Hancroft

Tony Mechelynck

unread,
Aug 31, 2021, 10:47:34 AM8/31/21
to vim_use
When running incremental make (running make after a source update,
without rerunning configure, in order to compile only what is
necessary, i.e. changed modules plus anything that depends on them) it
may happen (rarely but not never) that make spontaneously decides to
rerun configure. Of course, if you pass configure arguments on the
configure command-line, make won't have them at hand. The "safe" way
is never to run configure yourself, but always let make do it, and
pass configure arguments to make by means of environment variables.
I'm attaching as examples the scripts which I use to compile one
version each of Huge, Big, Normal, Small and Tiny Vim, in each case
plus or minus some particular features which I want to have or not to
have in that particular build of Vim. These scripts (written for the
bash shell) must be "sourced", not "run", by the same shell which will
run "make" (and/or "make config" "make reconfig" "make install" etc.)
When there are new patches, I run five instances of make in parallel,
each in its own shell with its own configuration. If you want to use
these scripts, at least one line (the "compiled by" line) and possibly
others, must be changed: use your best taste and good judgment. These
scripts happen to have the same filename: don't download them under
that name into the same directory.

Best regards,
Tony.
myconfig
myconfig
myconfig
myconfig
myconfig

Tony Mechelynck

unread,
Aug 31, 2021, 10:54:37 AM8/31/21
to vim_use
P.S. In my previous post, the attachments are Big, Huge, Normal, Small
and Tiny in that order. I think the second one (Huge) is maybe the
most interesting one.

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages