Permalink
Browse files

patch 8.0.1236: Mac features are confusing

Problem:    Mac features are confusing.
Solution:   Make feature names more consistent, add "osxdarwin". Rename
            feature flags, cleanup Mac code. (Kazunobu Kuriyama, closes #2178)
  • Loading branch information...
brammool committed Oct 28, 2017
1 parent ef83956 commit d057301b1f28736f094affa17b190244ad56e8d9
Showing with 268 additions and 383 deletions.
  1. +4 −3 runtime/doc/eval.txt
  2. +3 −2 runtime/doc/os_mac.txt
  3. +52 −27 src/auto/configure
  4. +1 −0 src/config.h.in
  5. +53 −33 src/configure.ac
  6. +2 −2 src/digraph.c
  7. +2 −2 src/edit.c
  8. +8 −9 src/evalfunc.c
  9. +4 −4 src/feature.h
  10. +7 −31 src/fileio.c
  11. +6 −5 src/getchar.c
  12. +3 −3 src/globals.h
  13. +2 −2 src/gui.c
  14. +1 −3 src/gui_mac.c
  15. +0 −20 src/if_python.c
  16. +1 −20 src/if_python3.c
  17. +9 −5 src/if_ruby.c
  18. +1 −1 src/keymap.h
  19. +3 −8 src/macros.h
  20. +4 −11 src/main.c
  21. +13 −13 src/mbyte.c
  22. +3 −4 src/message.c
  23. +2 −9 src/misc1.c
  24. +5 −16 src/misc2.c
  25. +5 −6 src/option.c
  26. +37 −53 src/os_mac.h
  27. +2 −6 src/os_macosx.m
  28. +0 −11 src/os_unix.c
  29. +2 −2 src/proto.h
  30. +1 −7 src/pty.c
  31. +4 −11 src/structs.h
  32. +2 −2 src/term.c
  33. +1 −1 src/termlib.c
  34. +2 −2 src/ui.c
  35. +1 −1 src/undo.c
  36. +7 −12 src/version.c
  37. +14 −35 src/vim.h
  38. +1 −1 src/window.c
View
@@ -8877,9 +8877,8 @@ listcmds Compiled with commands for the buffer list |:files|
and the argument list |arglist|.
localmap Compiled with local mappings and abbr. |:map-local|
lua Compiled with Lua interface |Lua|.
mac Any Macintosh version of Vim, but not all OS X.
macunix Compiled for OS X, with |mac-darwin-feature|
osx Compiled for OS X, with or w/o |mac-darwin-feature|
mac Any Macintosh version of Vim cf. osx
macunix Synonym for osxdarwin
menu Compiled with support for |:menu|.
mksession Compiled with support for |:mksession|.
modify_fname Compiled with file name modifiers. |filename-modifiers|
@@ -8902,6 +8901,8 @@ netbeans_enabled Compiled with support for |netbeans| and connected.
netbeans_intg Compiled with support for |netbeans|.
num64 Compiled with 64-bit |Number| support.
ole Compiled with OLE automation support for Win32.
osx Compiled for macOS cf. mac
osxdarwin Compiled for macOS, with |mac-darwin-feature|
packages Compiled with |packages| support.
path_extra Compiled with up/downwards search in 'path' and 'tags'
perl Compiled with Perl interface.
View
@@ -164,8 +164,9 @@ If you want to disable it, pass `--disable-darwin` to the configure script: >
and then run `make` to build Vim. The order of the options doesn't matter.
To make sure at runtime whether or not the darwin feature is compiled in, you
can use `has('macunix')` which returns 1 if the feature is compiled in; 0
otherwise.
can use `has('osxdarwin')` which returns 1 if the feature is compiled in; 0
otherwise. For backwards comptibility, you can still use `macunix` instead of
`osxdarwin`.
Notable use cases where `--disable-darwin` is turned out to be useful are:
View
@@ -4187,6 +4187,8 @@ $as_echo_n "checking for Darwin (Mac OS X)... " >&6; }
if test "`(uname) 2>/dev/null`" = Darwin; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
MACOS_X=yes
CPPFLAGS="$CPPFLAGS -DMACOS_X"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --disable-darwin argument" >&5
$as_echo_n "checking --disable-darwin argument... " >&6; }
@@ -4357,10 +4359,10 @@ rm -f core conftest.err conftest.$ac_objext \
fi
if test "$enable_darwin" = "yes"; then
MACOSX=yes
MACOS_X_DARWIN=yes
OS_EXTRA_SRC="os_macosx.m os_mac_conv.c";
OS_EXTRA_OBJ="objects/os_macosx.o objects/os_mac_conv.o"
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX"
CPPFLAGS="$CPPFLAGS -DMACOS_X_DARWIN"
# On IRIX 5.3, sys/types and inttypes.h are conflicting.
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
@@ -5153,7 +5155,7 @@ rm -f core conftest.err conftest.$ac_objext \
if test -f "${vi_cv_path_lua_pfx}/bin/cyglua-${vi_cv_version_lua}.dll"; then
vi_cv_dll_name_lua="cyglua-${vi_cv_version_lua}.dll"
else
if test "x$MACOSX" = "xyes"; then
if test "x$MACOS_X" = "xyes"; then
ext="dylib"
indexes=""
else
@@ -5199,7 +5201,7 @@ $as_echo "yes" >&6; }
LUA_CFLAGS="-DDYNAMIC_LUA_DLL=\\\"${vi_cv_dll_name_lua}\\\" $LUA_CFLAGS"
fi
if test "X$LUA_CFLAGS$LUA_LIBS" != "X" && \
test "x$MACOSX" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \
test "x$MACOS_X" = "xyes" && test "x$vi_cv_with_luajit" != "xno" && \
test "`(uname -m) 2>/dev/null`" = "x86_64"; then
LUA_LIBS="-pagezero_size 10000 -image_base 100000000 $LUA_LIBS"
fi
@@ -5404,7 +5406,7 @@ $as_echo "not found" >&6; }
for path in "${vi_cv_path_mzscheme_pfx}/lib" "${SCHEME_LIB}"; do
if test "X$path" != "X"; then
if test "x$MACOSX" = "xyes"; then
if test "x$MACOS_X" = "xyes"; then
MZSCHEME_LIBS="-framework Racket"
MZSCHEME_CFLAGS="-DMZ_PRECISE_GC"
elif test -f "${path}/libmzscheme3m.a"; then
@@ -5784,7 +5786,7 @@ $as_echo ">>> too old; need Perl version 5.003_01 or later <<<" >&6; }
fi
fi
if test "x$MACOSX" = "xyes"; then
if test "x$MACOS_X" = "xyes"; then
dir=/System/Library/Perl
darwindir=$dir/darwin
if test -d $darwindir; then
@@ -6002,7 +6004,7 @@ __:
eof
eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
rm -f -- "${tmp_mkf}"
if test "x$MACOSX" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \
if test "x$MACOS_X" = "xyes" && test -n "${python_PYTHONFRAMEWORK}" && ${vi_cv_path_python} -c \
"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
vi_cv_path_python_plibs="-framework Python"
if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
@@ -6965,7 +6967,7 @@ $as_echo "$tclver - OK" >&6; };
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Tcl include" >&5
$as_echo_n "checking for location of Tcl include... " >&6; }
if test "x$MACOSX" != "xyes"; then
if test "x$MACOS_X" != "xyes"; then
tclinc="$tclloc/include $tclloc/include/tcl $tclloc/include/tcl$tclver /usr/local/include /usr/local/include/tcl$tclver /usr/include /usr/include/tcl$tclver"
else
tclinc="/System/Library/Frameworks/Tcl.framework/Headers"
@@ -6987,7 +6989,7 @@ $as_echo "<not found>" >&6; }
if test -z "$SKIP_TCL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of tclConfig.sh script" >&5
$as_echo_n "checking for location of tclConfig.sh script... " >&6; }
if test "x$MACOSX" != "xyes"; then
if test "x$MACOS_X" != "xyes"; then
tclcnf=`echo $tclinc | sed s/include/lib/g`
tclcnf="$tclcnf `echo $tclinc | sed s/include/lib64/g`"
else
@@ -7567,7 +7569,7 @@ fi
$as_echo "$enable_fontset" >&6; }
test -z "$with_x" && with_x=yes
test "${enable_gui-yes}" != no -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && with_x=yes
test "${enable_gui-yes}" != no -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && with_x=yes
if test "$with_x" = no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to: don't HAVE_X11" >&5
$as_echo "defaulting to: don't HAVE_X11" >&6; }
@@ -8584,7 +8586,7 @@ $as_echo "$ac_cv_small_wchar_t" >&6; }
fi
fi
test "x$with_x" = xno -a "x$MACOSX" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no
test "x$with_x" = xno -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && enable_gui=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking --enable-gui argument" >&5
$as_echo_n "checking --enable-gui argument... " >&6; }
@@ -8626,7 +8628,7 @@ $as_echo "Sorry, $enable_gui GUI is not supported" >&6; }
SKIP_PHOTON=YES ;;
esac
elif test "x$MACOSX" = "xyes" -a "x$with_x" = "xno" ; then
elif test "x$MACOS_X" = "xyes" -a "x$with_x" = "xno" ; then
SKIP_CARBON=
case "$enable_gui_canon" in
no) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no GUI support" >&5
@@ -8804,7 +8806,7 @@ $as_echo "$enable_carbon_check" >&6; };
fi
if test "x$MACOSX" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
if test "x$MACOS_X" = "xyes" -a -z "$SKIP_CARBON" -a "x$CARBON" = "xyes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Carbon GUI" >&5
$as_echo_n "checking for Carbon GUI... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -10624,7 +10626,7 @@ fi
done
if test "x$MACOSX" = "xyes"; then
if test "x$MACOS_X" = "xyes"; then
$as_echo "#define NO_STRINGS_WITH_STRING_H 1" >>confdefs.h
else
@@ -12076,7 +12078,7 @@ for ac_func in fchdir fchown fsync getcwd getpseudotty \
getpgid setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
usleep utime utimes
usleep utime utimes mblen
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -14099,27 +14101,50 @@ fi
done
if test "x$MACOSX" = "xyes" -a -n "$PERL"; then
if test "x$MACOS_X" = "xyes" -a -n "$PERL"; then
if echo $LIBS | grep -e '-ldl' >/dev/null; then
LIBS=`echo $LIBS | sed s/-ldl//`
PERL_LIBS="$PERL_LIBS -ldl"
fi
fi
if test "x$MACOSX" = "xyes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -framework Cocoa" >&5
$as_echo_n "checking whether we need -framework Cocoa... " >&6; }
if test "x$features" != "xtiny" || test "x$enable_multibyte" = "xyes"; then
LIBS=$"$LIBS -framework Cocoa"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
if test "$MACOS_X" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need macOS frameworks" >&5
$as_echo_n "checking whether we need macOS frameworks... " >&6; }
if test "$GUITYPE" = "CARBONGUI"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need Carbon" >&5
$as_echo "yes, we need Carbon" >&6; }
LIBS="$LIBS -framework Carbon"
elif test "$MACOS_X_DARWIN" = "yes"; then
if test "$features" = "tiny"; then
OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'`
OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'`
if test "$enable_multibyte" = "yes"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need CoreServices" >&5
$as_echo "yes, we need CoreServices" >&6; }
LIBS="$LIBS -framework CoreServices"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_mac_conv.c++'`
OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_mac_conv.o++'`
CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's+-DMACOS_X_DARWIN++'`
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, we need AppKit" >&5
$as_echo "yes, we need AppKit" >&6; }
LIBS="$LIBS -framework AppKit"
if test "$features" = "small" -a "$enable_multibyte" = "no"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: +multi_byte will be set in favor of +clipboard" >&5
$as_echo "$as_me: +multi_byte will be set in favor of +clipboard" >&6;}
enable_multibyte=yes
$as_echo "#define FEAT_MBYTE 1" >>confdefs.h
fi
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$features" = "xtiny"; then
OS_EXTRA_SRC=`echo "$OS_EXTRA_SRC" | sed -e 's+os_macosx.m++'`
OS_EXTRA_OBJ=`echo "$OS_EXTRA_OBJ" | sed -e 's+objects/os_macosx.o++'`
fi
fi
if test "x$MACARCH" = "xboth" && test "x$GUITYPE" = "xCARBONGUI"; then
View
@@ -212,6 +212,7 @@
#undef HAVE_USLEEP
#undef HAVE_UTIME
#undef HAVE_BIND_TEXTDOMAIN_CODESET
#undef HAVE_MBLEN
/* Define, if needed, for accessing large files. */
#undef _LARGE_FILES
Oops, something went wrong.

0 comments on commit d057301

Please sign in to comment.