]> granicus.if.org Git - vim/commitdiff
patch 8.1.0612: cannot use two global runtime dirs with configure v8.1.0612
authorBram Moolenaar <Bram@vim.org>
Fri, 21 Dec 2018 10:48:51 +0000 (11:48 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 21 Dec 2018 10:48:51 +0000 (11:48 +0100)
Problem:    Cannot use two global runtime dirs with configure.
Solution:   Support a comma in --with-global-runtime. (James McCoy,
            closes #3704)

src/Makefile
src/auto/configure
src/config.h.in
src/configure.ac
src/feature.h
src/os_unix.h
src/version.c

index 2d966d18b115ba9c93a7df36a7b967fff2e8672c..d8667373b8f3aee443f01561921916b84b1b467a 100644 (file)
@@ -317,12 +317,13 @@ CClink = $(CC)
 # You can give a lot of options to configure.
 # Change this to your desire and do 'make config' afterwards
 
-# examples (can only use one!):
-#CONF_ARGS = --exec-prefix=/usr
-#CONF_ARGS = --with-vim-name=vim7 --with-ex-name=ex7 --with-view-name=view7
-#CONF_ARGS = --with-global-runtime=/etc/vim
-#CONF_ARGS = --with-local-dir=/usr/share
-#CONF_ARGS = --without-local-dir
+# examples:
+#CONF_ARGS1 = --exec-prefix=/usr
+#CONF_ARGS2 = --with-vim-name=vim8 --with-ex-name=ex8 --with-view-name=view8
+#CONF_ARGS3 = --with-global-runtime=/etc/vim,/usr/share/vim
+#CONF_ARGS4 = --with-local-dir=/usr/share
+#CONF_ARGS5 = --without-local-dir
+CONF_ARGS = $(CONF_ARGS1) $(CONF_ARGS2) $(CONF_ARGS3) $(CONF_ARGS4) $(CONF_ARGS5)
 
 # Use this one if you distribute a modified version of Vim.
 #CONF_ARGS = --with-modified-by="John Doe"
index 825d5da4f57636a28c9dcb8778ea2a0a798af387..3a1495b9188e0c59c103754a0f667c81f18992fb 100755 (executable)
@@ -1533,7 +1533,7 @@ Optional Packages:
   --with-vim-name=NAME    what to call the Vim executable
   --with-ex-name=NAME     what to call the Ex executable
   --with-view-name=NAME   what to call the View executable
-  --with-global-runtime=DIR    global runtime directory in 'runtimepath'
+  --with-global-runtime=DIR    global runtime directory in 'runtimepath', comma-separated for multiple directories
   --with-modified-by=NAME       name of who modified a release version
   --with-features=TYPE    tiny, small, normal, big or huge (default: huge)
   --with-compiledby=NAME  name to show in :version message
@@ -4890,17 +4890,26 @@ $as_echo_n "checking --with-global-runtime argument... " >&6; }
 
 # Check whether --with-global-runtime was given.
 if test "${with_global_runtime+set}" = set; then :
-  withval=$with_global_runtime; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
-$as_echo "$withval" >&6; }; cat >>confdefs.h <<_ACEOF
-#define RUNTIME_GLOBAL "$withval"
-_ACEOF
-
+  withval=$with_global_runtime; RUNTIME_GLOBAL="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
+$as_echo "$withval" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
+if test "X$RUNTIME_GLOBAL" != "X"; then
+  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" }')
+  cat >>confdefs.h <<_ACEOF
+#define RUNTIME_GLOBAL "$RUNTIME_GLOBAL"
+_ACEOF
+
+  cat >>confdefs.h <<_ACEOF
+#define RUNTIME_GLOBAL_AFTER "$RUNTIME_GLOBAL_AFTER"
+_ACEOF
+
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking --with-modified-by argument" >&5
 $as_echo_n "checking --with-modified-by argument... " >&6; }
 
index 8352563a34be49d10f90a75b96d5ecca661a30d5..4a5cb099e4bf3b9eb5761754e4d4cbc7c44809fe 100644 (file)
 /* Define if you want to include terminal emulator support. */
 #undef FEAT_TERMINAL
 
-/* Define default global runtime path */
+// Define default global runtime path.
 #undef RUNTIME_GLOBAL
 
+// Define default global runtime after path.
+#undef RUNTIME_GLOBAL_AFTER
+
 /* Define name of who modified a released Vim */
 #undef MODIFIED_BY
 
index c97603a716f30f439b951e939bdcc95c5786d62c..b256a87aaec6a63963ffde0335444bd6e79af029 100644 (file)
@@ -345,10 +345,16 @@ AC_ARG_WITH(view-name, [  --with-view-name=NAME   what to call the View executab
 AC_SUBST(VIEWNAME)
 
 AC_MSG_CHECKING(--with-global-runtime argument)
-AC_ARG_WITH(global-runtime, [  --with-global-runtime=DIR    global runtime directory in 'runtimepath'],
-       AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$withval"),
+AC_ARG_WITH(global-runtime, [  --with-global-runtime=DIR    global runtime directory in 'runtimepath', comma-separated for multiple directories],
+       RUNTIME_GLOBAL="$withval"; AC_MSG_RESULT($withval),
        AC_MSG_RESULT(no))
 
+if test "X$RUNTIME_GLOBAL" != "X"; then
+  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" }')
+  AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL, "$RUNTIME_GLOBAL")
+  AC_DEFINE_UNQUOTED(RUNTIME_GLOBAL_AFTER, "$RUNTIME_GLOBAL_AFTER")
+fi
+
 AC_MSG_CHECKING(--with-modified-by argument)
 AC_ARG_WITH(modified-by, [  --with-modified-by=NAME       name of who modified a release version],
        AC_MSG_RESULT($withval); AC_DEFINE_UNQUOTED(MODIFIED_BY, "$withval"),
index 9615a9fa49e8767a7774bec00961616add2d93f0..5c03e2bf6a8a286ba970e6388c4f75b7ddd3a340 100644 (file)
 #endif
 
 /*
- * RUNTIME_GLOBAL      Directory name for global Vim runtime directory.
+ * RUNTIME_GLOBAL      Comma-separated list of directory names for global Vim
+ *                     runtime directories.
  *                     Don't define this if the preprocessor can't handle
  *                     string concatenation.
  *                     Also set by "--with-global-runtime" configure argument.
  */
 /* #define RUNTIME_GLOBAL "/etc/vim" */
 
+/*
+ * RUNTIME_GLOBAL_AFTER        Comma-separated list of directory names for global Vim
+ *                     runtime after directories.
+ *                     Don't define this if the preprocessor can't handle
+ *                     string concatenation.
+ *                     Also set by "--with-global-runtime" configure argument.
+ */
+/* #define RUNTIME_GLOBAL_AFTER "/etc/vim/after" */
+
 /*
  * MODIFIED_BY         Name of who modified Vim.  Required when distributing
  *                     a modified version of Vim.
index ca2ce705a441afa5de6cfad405b503751b3fc8b2..8919ff0fa12c1def12d5c32663f831e73a9ffeca 100644 (file)
@@ -369,8 +369,13 @@ typedef struct dsc$descriptor   DESC;
 # define CLEAN_RUNTIMEPATH      "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"
 #else
 # ifdef RUNTIME_GLOBAL
-#  define DFLT_RUNTIMEPATH     "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after"
-#  define CLEAN_RUNTIMEPATH    RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after"
+#  ifdef RUNTIME_GLOBAL_AFTER
+#   define DFLT_RUNTIMEPATH    "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER ",~/.vim/after"
+#   define CLEAN_RUNTIMEPATH   RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL_AFTER
+#  else
+#   define DFLT_RUNTIMEPATH    "~/.vim," RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after,~/.vim/after"
+#   define CLEAN_RUNTIMEPATH   RUNTIME_GLOBAL ",$VIMRUNTIME," RUNTIME_GLOBAL "/after"
+#  endif
 # else
 #  define DFLT_RUNTIMEPATH     "~/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,~/.vim/after"
 #  define CLEAN_RUNTIMEPATH    "$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after"
index 99513d1dcc80b188ee545ec481658c5a25b1b93e..a605def475fdaaf3e728d38544afa18b1a9a76af 100644 (file)
@@ -799,6 +799,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    612,
 /**/
     611,
 /**/