Skip to content

Commit 9d302ad

Browse files
committed
patch 8.1.0612: cannot use two global runtime dirs with configure
Problem: Cannot use two global runtime dirs with configure. Solution: Support a comma in --with-global-runtime. (James McCoy, closes #3704)
1 parent a79fd56 commit 9d302ad

7 files changed

Lines changed: 54 additions & 18 deletions

File tree

src/Makefile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,13 @@ CClink = $(CC)
317317
# You can give a lot of options to configure.
318318
# Change this to your desire and do 'make config' afterwards
319319

320-
# examples (can only use one!):
321-
#CONF_ARGS = --exec-prefix=/usr
322-
#CONF_ARGS = --with-vim-name=vim7 --with-ex-name=ex7 --with-view-name=view7
323-
#CONF_ARGS = --with-global-runtime=/etc/vim
324-
#CONF_ARGS = --with-local-dir=/usr/share
325-
#CONF_ARGS = --without-local-dir
320+
# examples:
321+
#CONF_ARGS1 = --exec-prefix=/usr
322+
#CONF_ARGS2 = --with-vim-name=vim8 --with-ex-name=ex8 --with-view-name=view8
323+
#CONF_ARGS3 = --with-global-runtime=/etc/vim,/usr/share/vim
324+
#CONF_ARGS4 = --with-local-dir=/usr/share
325+
#CONF_ARGS5 = --without-local-dir
326+
CONF_ARGS = $(CONF_ARGS1) $(CONF_ARGS2) $(CONF_ARGS3) $(CONF_ARGS4) $(CONF_ARGS5)
326327

327328
# Use this one if you distribute a modified version of Vim.
328329
#CONF_ARGS = --with-modified-by="John Doe"

src/auto/configure

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ Optional Packages:
15331533
--with-vim-name=NAME what to call the Vim executable
15341534
--with-ex-name=NAME what to call the Ex executable
15351535
--with-view-name=NAME what to call the View executable
1536-
--with-global-runtime=DIR global runtime directory in 'runtimepath'
1536+
--with-global-runtime=DIR global runtime directory in 'runtimepath', comma-separated for multiple directories
15371537
--with-modified-by=NAME name of who modified a release version
15381538
--with-features=TYPE tiny, small, normal, big or huge (default: huge)
15391539
--with-compiledby=NAME name to show in :version message
@@ -4890,17 +4890,26 @@ $as_echo_n "checking --with-global-runtime argument... " >&6; }
48904890

48914891
# Check whether --with-global-runtime was given.
48924892
if test "${with_global_runtime+set}" = set; then :
4893-
withval=$with_global_runtime; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
4894-
$as_echo "$withval" >&6; }; cat >>confdefs.h <<_ACEOF
4895-
#define RUNTIME_GLOBAL "$withval"
4896-
_ACEOF
4897-
4893+
withval=$with_global_runtime; RUNTIME_GLOBAL="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
4894+
$as_echo "$withval" >&6; }
48984895
else
48994896
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
49004897
$as_echo "no" >&6; }
49014898
fi
49024899

49034900

4901+
if test "X$RUNTIME_GLOBAL" != "X"; then
4902+
RUNTIME_GLOBAL_AFTER=$(printf -- "$RUNTIME_GLOBAL\\n" | $AWK -F, 'BEGIN { comma=0 } { for (i = NF; i > 0; i--) { if (comma) { printf ",%s/after", $i } else { printf "%s/after", $i; comma=1 } } } END { printf "\n" }')
4903+
cat >>confdefs.h <<_ACEOF
4904+
#define RUNTIME_GLOBAL "$RUNTIME_GLOBAL"
4905+
_ACEOF
4906+
4907+
cat >>confdefs.h <<_ACEOF
4908+
#define RUNTIME_GLOBAL_AFTER "$RUNTIME_GLOBAL_AFTER"
4909+
_ACEOF
4910+
4911+
fi
4912+
49044913
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-modified-by argument" >&5
49054914
$as_echo_n "checking --with-modified-by argument... " >&6; }
49064915

src/config.h.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,12 @@
453453
/* Define if you want to include terminal emulator support. */
454454
#undef FEAT_TERMINAL
455455

456-
/* Define default global runtime path */
456+
// Define default global runtime path.
457457
#undef RUNTIME_GLOBAL
458458

459+
// Define default global runtime after path.
460+
#undef RUNTIME_GLOBAL_AFTER
461+
459462
/* Define name of who modified a released Vim */
460463
#undef MODIFIED_BY
461464

src/configure.ac

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,16 @@ AC_ARG_WITH(view-name, [ --with-view-name=NAME what to call the View executab
345345
AC_SUBST(VIEWNAME)
346346

347347
AC_MSG_CHECKING(--with-global-runtime argument)
348-
AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath'],
349-
AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"),
348+
AC_ARG_WITH(global-runtime, [ --with-global-runtime=DIR global runtime directory in 'runtimepath', comma-separated for multiple directories],
349+
RUNTIME_GLOBAL="$withval"; AC_MSG_RESULT($withval),
350350
AC_MSG_RESULT(no))
351351

352+
if test "X$RUNTIME_GLOBAL" != "X"; then
353+
RUNTIME_GLOBAL_AFTER=$(printf -- "$RUNTIME_GLOBAL\\n" | $AWK -F, 'BEGIN { comma=0 } { for (i = NF; i > 0; i--) { if (comma) { printf ",%s/after", $i } else { printf "%s/after", $i; comma=1 } } } END { printf "\n" }')
354+
AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$RUNTIME_GLOBAL")
355+
AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL_AFTER, "$RUNTIME_GLOBAL_AFTER")
356+
fi
357+
352358
AC_MSG_CHECKING(--with-modified-by argument)
353359
AC_ARG_WITH(modified-by, [ --with-modified-by=NAME name of who modified a release version],
354360
AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),

src/feature.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,13 +973,23 @@
973973
#endif
974974

975975
/*
976-
* RUNTIME_GLOBAL Directory name for global Vim runtime directory.
976+
* RUNTIME_GLOBAL Comma-separated list of directory names for global Vim
977+
* runtime directories.
977978
* Don't define this if the preprocessor can't handle
978979
* string concatenation.
979980
* Also set by "--with-global-runtime" configure argument.
980981
*/
981982
/* #define RUNTIME_GLOBAL "/etc/vim" */
982983

984+
/*
985+
* RUNTIME_GLOBAL_AFTER Comma-separated list of directory names for global Vim
986+
* runtime after directories.
987+
* Don't define this if the preprocessor can't handle
988+
* string concatenation.
989+
* Also set by "--with-global-runtime" configure argument.
990+
*/
991+
/* #define RUNTIME_GLOBAL_AFTER "/etc/vim/after" */
992+
983993
/*
984994
* MODIFIED_BY Name of who modified Vim. Required when distributing
985995
* a modified version of Vim.

src/os_unix.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,13 @@ typedef struct dsc$descriptor DESC;
369369
# define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"
370370
#else
371371
# ifdef RUNTIME_GLOBAL
372-
# define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after"
373-
# define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after"
372+
# ifdef RUNTIME_GLOBAL_AFTER
373+
# define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER ",~/.vim/after"
374+
# define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER
375+
# else
376+
# define DFLT_RUNTIMEPATH "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after"
377+
# define CLEAN_RUNTIMEPATH RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after"
378+
# endif
374379
# else
375380
# define DFLT_RUNTIMEPATH "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
376381
# define CLEAN_RUNTIMEPATH "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,8 @@ static char *(features[]) =
799799

800800
static int included_patches[] =
801801
{ /* Add new patch number below this line */
802+
/**/
803+
612,
802804
/**/
803805
611,
804806
/**/

0 commit comments

Comments
 (0)