macvim OS X 10.9 Mavericks build

4,379 views
Skip to first unread message

dsim

unread,
Jun 20, 2013, 3:59:12 AM6/20/13
to vim...@googlegroups.com
Did anyone have working build for os x 10.9?
I used `brew install macvim --with-cscope --with-lua` in Mountain Lion but this build crashing on Mavericks.

Hisashi T Fujinaka

unread,
Jun 20, 2013, 9:49:09 AM6/20/13
to vim...@googlegroups.com
On Thu, 20 Jun 2013, dsim wrote:

> Did anyone have working build for os x 10.9?
> I used `brew install macvim --with-cscope --with-lua` in Mountain Lion but this build crashing on Mavericks.

Yes and no. I have it building in fink. I only had to modify os_unix.c
because some of the defines are missing in 10.9.

--
Hisashi T Fujinaka - ht...@twofifty.com
BSEE(6/86) + BSChem(3/95) + BAEnglish(8/95) + MSCS(8/03) + $2.50 = latte

Jimmy Zelinskie

unread,
Jun 27, 2013, 4:01:07 PM6/27/13
to vim...@googlegroups.com
As per the discussion at https://github.com/mxcl/homebrew/pull/20831#discussion_r4917643

The required macro MAC_OS_X_VERSION_MAX_ALLOWED requires
AvailabilityMacros.h to be defined. This diff is all that's required upstream, the rest is brew specific:

diff --git a/src/os_unix.c b/src/os_unix.c
index bb4c10e..00d9728 100644
--- a/src/os_unix.c
+++ b/src/os_unix.c
@@ -18,6 +18,10 @@
* changed beyond recognition.
*/

+#if defined(__APPLE__)
+#include <AvailabilityMacros.h>
+#endif
+
/*
* Some systems have a prototype for select() that has (int *) instead of
* (fd_set *), which is wrong. This define removes that prototype. We define

björn

unread,
Jun 28, 2013, 2:33:19 AM6/28/13
to vim...@googlegroups.com
> --
> --

Thanks for the patch.

What is the reason that we have to pollute os_unix.c (which has
nothing to do with OS X) with an OS X-only header?

What exact problem does this patch address and is there perhaps a
better way to solve it?

Björn

Bram Moolenaar

unread,
Jun 28, 2013, 5:05:03 PM6/28/13
to Jimmy Zelinskie, vim...@googlegroups.com
So, on what systems is AvailabilityMacros.h available?

Isn't this a chicken-egg problem?

--
Veni, Vidi, Video -- I came, I saw, I taped what I saw.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Jimmy Zelinskie

unread,
Jun 28, 2013, 6:28:47 PM6/28/13
to vim...@googlegroups.com, Jimmy Zelinskie
On Friday, June 28, 2013 2:33:19 AM UTC-4, björn wrote:
> On Thu, Jun 27, 2013 at 10:01 PM, Jimmy Zelinskie wrote:
>
> > As per the discussion at https://github.com/mxcl/homebrew/pull/20831#discussion_r4917643
>
> >
>
> > The required macro MAC_OS_X_VERSION_MAX_ALLOWED requires
>
> > AvailabilityMacros.h to be defined. This diff is all that's required upstream, the rest is brew specific:
>
> >
>
> > diff --git a/src/os_unix.c b/src/os_unix.c
>
> > index bb4c10e..00d9728 100644
>
> > --- a/src/os_unix.c
>
> > +++ b/src/os_unix.c
>
> > @@ -18,6 +18,10 @@
>
> > * changed beyond recognition.
>
> > */
>
> >
>
> > +#if defined(__APPLE__)
>
> > +#include <AvailabilityMacros.h>
>
> > +#endif
>
> > +
>
> > /*
>
> > * Some systems have a prototype for select() that has (int *) instead of
>
> > * (fd_set *), which is wrong. This define removes that prototype. We define
>
> >
>
> > --
>
> > --
>
>
>
> Thanks for the patch.
>
>
>
> What is the reason that we have to pollute os_unix.c (which has
>
> nothing to do with OS X) with an OS X-only header?
>
>
>
> What exact problem does this patch address and is there perhaps a
>
> better way to solve it?
>
>
>
> Björn

I agree -- this was just the patch located at the bottom of the pull request on the homebrew issue tracker. Vim builds if you place the #include in os_mac.h
This documentation[1] leads me to believe that OSX 10.2+ supports it. This homebrew pull request[2] cites that it has been built successfully on 10.8.4-x86_64 and 10.7.5-i386.

[1] http://wiki.herzbube.ch/index.php/Mac_OS_X_Programming#Availability_Macros
[2] https://github.com/mxcl/homebrew/pull/20473#issuecomment-19434950

björn

unread,
Jul 8, 2013, 3:53:00 PM7/8/13
to vim...@googlegroups.com
Usually the AvailabilityMacros.h header gets included when you pull in a Carbon/Cocoa header - it would be good to know why this is problem is showing up on 10.9 but nowhere else (or does it?).

On the other hand, placing the include at the top of os_mac.h should be harmless as this header should be present when building on a Mac.

At the moment I don't think it is urgent to patch this, since 10.9 has not yet been publicly released, but if somebody with access to 10.9 took a closer look it would certainly be helpful (as I probably won't get 10.9 myself for a long time).

Björn

Felix Bünemann

unread,
Jul 9, 2013, 5:23:43 AM7/9/13
to vim...@googlegroups.com
I'll look into why it's no longer included on 10.9, once I'm back from vacation. I agree that including from os_mac.h is the cleaner solution.

Felix Bünemann

unread,
Aug 4, 2013, 9:34:53 AM8/4/13
to vim...@googlegroups.com
Am Dienstag, 9. Juli 2013 11:23:43 UTC+2 schrieb Felix Bünemann:
> I'll look into why it's no longer included on 10.9, once I'm back from vacation. I agree that including from os_mac.h is the cleaner solution.

Does this patch https://gist.github.com/felixbuenemann/6150257 look cleaner?

Note that I can also include Cocoa/Cocoa.h instead. I'm not sure where vim is supposed to pull in Cocoa.h, but it is detected by configure, however the version macros are used in os_unix.c and not in any gui code, so maybe that's the problem?

Felix Bünemann

unread,
Oct 6, 2013, 10:34:24 PM10/6/13
to vim...@googlegroups.com
Can we get this patch included, now that 10.9 is GM?

björn

unread,
Oct 7, 2013, 12:29:39 PM10/7/13
to vim...@googlegroups.com
On Mon, Oct 7, 2013 at 4:34 AM, Felix Bünemann
<felix.b...@gmail.com> wrote:
> Can we get this patch included, now that 10.9 is GM?

Since it is a bit unclear as to when AvailabilityMacros.h became
available and since we don't know what the correct #ifdef should be in
order to only include when it is needed it is a bit difficult making a
general patch to be included in mainline Vim (it needs to build on
older version of Mac OS).

For now I have just merged the patch in the MacVim repository since
MacVim requires OS X 10.4 or later (and hence we can be sure it is OK
to include AvailabilityMacros.h ... uh, unless Apple forces the use of
Availability.h in the future ... I guess we'll have to deal with it
then). This way everybody on OS X 10.9 can at least pull from the
MacVim repo and build Vim / MacVim from there.

Thanks for the patch,
Björn

Douglas Drumond

unread,
Oct 7, 2013, 5:00:43 PM10/7/13
to vim...@googlegroups.com
Thanks, I don't have access to GM, but when Mavericks is publicly released, I'll upgrade my laptop and I'll have access to the 10.7, 8 and 9.



2013/10/7 björn <bjorn.w...@gmail.com>

--
--
You received this message from the "vim_mac" 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_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Felix Bünemann

unread,
Oct 8, 2013, 6:18:43 PM10/8/13
to vim...@googlegroups.com
I have VMs with 10.5, 10.6, 10.7, 10.8 with the latest updates and Xcode versions and have verified the patch on those. Testing older versions is hard, because they can't run in a VM or require PPC which is a dying breed.

I'm pretty sure that AvailabilityMacros.h is available on all versions of OS X, because it's copyright header states 2001-20xx which matches the OS X 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that case we should add a configure check.

Felix Bünemann
Message has been deleted

Akio Ito

unread,
Oct 9, 2013, 6:53:52 AM10/9/13
to vim...@googlegroups.com
On Thursday, June 20, 2013 4:59:12 PM UTC+9, dsim wrote:
> Did anyone have working build for os x 10.9?
> I used `brew install macvim --with-cscope --with-lua` in Mountain Lion but this build crashing on Mavericks.

My Mavericks build,
https://github.com/akioito/macvim/releases

it was compiled with:
CC=clang CFLAGS=-O3 ./configure --with-features=huge \
--enable-rubyinterp \
--enable-pythoninterp \
--enable-perlinterp \
--enable-cscope \
--enable-luainterp \
--with-luajit \
--with-lua-prefix=/usr/local

björn

unread,
Oct 9, 2013, 2:25:49 PM10/9/13
to vim...@googlegroups.com
On Wed, Oct 9, 2013 at 12:18 AM, Felix Bünemann wrote:
> I have VMs with 10.5, 10.6, 10.7, 10.8 with the latest updates and Xcode
> versions and have verified the patch on those. Testing older versions is
> hard, because they can't run in a VM or require PPC which is a dying breed.

Thanks. Good to know.


> I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
> X, because it's copyright header states 2001-20xx which matches the OS X
> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
> case we should add a configure check.

Yes, pre-OS X should be supported. If there is a suitable #ifdef
check for that, then it should be possible to submit as a patch to
mainline Vim.

Björn

Felix Bünemann

unread,
Oct 13, 2013, 5:16:37 PM10/13/13
to vim...@googlegroups.com
OK, I've updated the patch with a configure check:
https://gist.github.com/felixbuenemann/6150257

> Björn

Felix

björn

unread,
Oct 19, 2013, 12:54:42 PM10/19/13
to vim...@googlegroups.com
This looks good to me ... but should we perhaps be checking for
"Availability.h" instead as that is what is used on Mavericks (and
earlier OS X versions did not need explicit inclusion of
AvailabilityMacros.h)?

Björn

Felix Buenemann

unread,
Oct 20, 2013, 6:14:57 PM10/20/13
to vim...@googlegroups.com
The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.

> Björn

Felix

Zhao Cai

unread,
Oct 23, 2013, 4:35:10 AM10/23/13
to vim...@googlegroups.com
Does anyone fail to enable python in osx 10.9? upgrade today and cannot pass the configure phrase for python. related message:

checking --enable-pythoninterp argument... yes
checking for python2... no
checking for python... /usr/bin/python
checking Python version... 2.7
checking Python is 2.3 or better... yep
checking Python's install prefix... /System/Library/Frameworks/Python.framework/Versions/2.7
checking Python's execution prefix... /System/Library/Frameworks/Python.framework/Versions/2.7
checking Python's configuration directory... (cached) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config
checking if -pthread should be used... no
checking if compile and link flags for Python are sane... no: PYTHON DISABLED

Felix Buenemann

unread,
Oct 23, 2013, 5:00:53 AM10/23/13
to vim...@googlegroups.com
My guess would be that you don't have Xcode command line tools installed.

Zhao Cai

unread,
Oct 23, 2013, 5:40:23 AM10/23/13
to vim...@googlegroups.com
I did update to XCode 5.0.1 and installed the command line tools.

I am not quite sure how to verify that. But I do get something like this.

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix


Douglas Drumond

unread,
Oct 23, 2013, 7:39:41 AM10/23/13
to vim...@googlegroups.com

Hi,

I upgraded to Mavericks and probably I'll upload a build tonight. Thanks for making MacVim Mavericks compatible.

Androidから送信

Zhao Cai

unread,
Oct 24, 2013, 5:33:56 AM10/24/13
to vim...@googlegroups.com

It is the issue of command line tool. need to run `xcode-select --install` manually

Douglas Drumond

unread,
Oct 24, 2013, 7:50:45 AM10/24/13
to vim...@googlegroups.com


> It is the issue of command line tool. need to run `xcode-select --install` manually
>

Yesterday I got stuck with several warnings related to duplicate #define and variable type leading to a non-working MacVim. Those were related to Ruby. I'll try xcode-select again. Thanks.

Douglas

Androidから送信

Mario Günterberg

unread,
Oct 24, 2013, 8:21:07 AM10/24/13
to vim...@googlegroups.com
My build of MacVim yesterday with CC=clang ./configure --enable-perlinterp=yes --enable-pythoninterp=yes --enable-rubyinterp=yes --with-features=huge was successful. No additional stuff like homebrew or whatever installed before. Only system python, ruby, perl and Xcode 5.0.1 with CLT for Mavericks was used.

have fun

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/IT d(-) s+(++):+(++) a+ C+++(++++) UBLC+++(++++) P++ L+++(++++)
E--- W+++ N++ o+ K- !w !O !M !V PS++ PE++ Y+ PGP+++ t 5 X++++ R+++
tv b++++ DI++ D+++ G++ e h---- r+++ y+++
------END GEEK CODE BLOCK------

signature.asc

Ulrich Winkler

unread,
Oct 24, 2013, 12:56:48 PM10/24/13
to vim...@googlegroups.com
On Thursday, 20 June 2013 09:59:12 UTC+2, dsim wrote:
> Did anyone have working build for os x 10.9?
> I used `brew install macvim --with-cscope --with-lua` in Mountain Lion but this build crashing on Mavericks.

http://kodira.de/2013/10/macvim-osx-10-9-mavericks/ provides a binary for Mavericks - if that helps.

Michael Grubb

unread,
Oct 24, 2013, 2:55:15 PM10/24/13
to vim...@googlegroups.com
I was also able to compile HEAD from github repo with options similar to Mario (though it wasn't picking up python (failed to find "sane" compile options from python). However, I'm experiencing a console message about CGContextErase being deprecated (from https://code.google.com/p/macvim/issues/detail?id=452). My guess is that it is actually being generated from a few other deprecated functions CGContextShowGlyphsWithAdvances in MMCoreTextView.m. I tried to do some more digging but I'm afraid it was mostly greek to me. Willing to provide any help and feedback that I can.

björn

unread,
Oct 24, 2013, 4:01:42 PM10/24/13
to vim...@googlegroups.com
I've upgraded my machine to Mavericks and will be releasing a new
snapshot this weekend. Was hoping to do so today, but I see some new
warnings that are probably spurious, but I'd like to take a careful
look first.

My test builds seem to work fine -- I've not encountered any problems
with Ruby with the little testing I've done so far.

Björn

Francisco Beron-Vera

unread,
Oct 24, 2013, 9:45:16 PM10/24/13
to vim...@googlegroups.com
Björn,

Please not that in the above build (and the one I compiled myself from source) Monaco fonts look too spaced. I've been struggling with this (annoying) issue for a couple of days without success. Perhaps you can take care of this? Or is it perhaps something Mavericks specific? (It didn't happen in Mountain Lion.)

Thank you for great work.

Francisco

björn

unread,
Oct 25, 2013, 1:25:23 PM10/25/13
to vim...@googlegroups.com
On Fri, Oct 25, 2013 at 3:45 AM, Francisco Beron-Vera wrote:
>
> Please not that in the above build (and the one I compiled myself from source) Monaco fonts look too spaced. I've been struggling with this (annoying) issue for a couple of days without success. Perhaps you can take care of this? Or is it perhaps something Mavericks specific? (It didn't happen in Mountain Lion.)

I'm guessing that you've disabled the Core Text renderer in the
advanced preferences? Apple changed the font rendering in NSTextView
when Lion (or Mountain Lion) was released and it causes these too wide
glyphs. This was one of the big reasons why I switched to make the
Core Text renderer the default.

Björn

Francisco Beron-Vera

unread,
Oct 26, 2013, 10:24:31 AM10/26/13
to vim...@googlegroups.com
Thanks, Björn. Enabling the Core Text renderer seems to be the solution! -Francisco

björn

unread,
Oct 26, 2013, 2:02:46 PM10/26/13
to vim...@googlegroups.com, Bram Moolenaar
On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
OK. Well, then I think this solves the problem of compiling on OS X
10.9 neatly and that it could be included in mainline Vim.

Bram, can you please consider this patch for inclusion. It should
apply cleanly (I just tried myself) and it automatically solves the
problem of us having to know exactly when this header was made
available. I've pasted it below for your convenience. Note that
Felix Bünemann wrote the patch, not me.

Thanks,
Björn


diff -r 92c9748e0ccb src/config.h.in
--- a/src/config.h.in Sun Oct 06 17:46:56 2013 +0200
+++ b/src/config.h.in Sun Oct 13 23:11:37 2013 +0200
@@ -442,3 +442,6 @@

/* Define if you want Cygwin to use the WIN32 clipboard, not
compatible with X11*/
#undef FEAT_CYGWIN_WIN32_CLIPBOARD
+
+/* Define if we have AvailabilityMacros.h on Mac OS X */
+#undef HAVE_AVAILABILITYMACROS_H
diff -r 92c9748e0ccb src/configure.in
--- a/src/configure.in Sun Oct 06 17:46:56 2013 +0200
+++ b/src/configure.in Sun Oct 13 23:11:37 2013 +0200
@@ -206,6 +206,10 @@
dnl TODO: use -arch i386 on Intel machines
CPPFLAGS="$CPPFLAGS -DMACOS_X_UNIX -no-cpp-precomp"

+ dnl Mac OS X 10.9+ no longer include AvailabilityMacros.h in Carbon
+ dnl so we need to include it to have access to version macros.
+ AC_CHECK_HEADER(AvailabilityMacros.h,[AC_DEFINE(HAVE_AVAILABILITYMACROS_H,
1, [ Define if we have AvailabilityMacros.h on Mac OS X ])])
+
dnl If Carbon is found, assume we don't want X11
dnl unless it was specifically asked for (--with-x)
dnl or Motif, Athena or GTK GUI is used.
diff -r 92c9748e0ccb src/os_mac.h
--- a/src/os_mac.h Sun Oct 06 17:46:56 2013 +0200
+++ b/src/os_mac.h Sun Oct 13 23:11:37 2013 +0200
@@ -16,6 +16,11 @@
# define OPAQUE_TOOLBOX_STRUCTS 0
#endif

+/* Include MAC_OS_X_VERSION_* macros */
+#ifdef HAVE_AVAILABILITYMACROS_H
+# include <AvailabilityMacros.h>
+#endif
+
/*
* Macintosh machine-dependent things.
*

Bram Moolenaar

unread,
Oct 27, 2013, 11:02:57 AM10/27/13
to björn, vim...@googlegroups.com

Bj�rn wrote:

> On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
> > Am 19.10.2013 um 18:54 schrieb bj�rn:
> >> On Sun, Oct 13, 2013 at 11:16 PM, Felix B�nemann wrote:
> >>> Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb bj�rn:
> >>>> On Wed, Oct 9, 2013 at 12:18 AM, Felix B�nemann wrote:
> >>>>> I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
> >>>>> X, because it's copyright header states 2001-20xx which matches the OS X
> >>>>> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
> >>>>> case we should add a configure check.
> >>>>
> >>>> Yes, pre-OS X should be supported. If there is a suitable #ifdef
> >>>> check for that, then it should be possible to submit as a patch to
> >>>> mainline Vim.
> >>>
> >>> OK, I've updated the patch with a configure check:
> >>> https://gist.github.com/felixbuenemann/6150257
> >>
> >> This looks good to me ... but should we perhaps be checking for
> >> "Availability.h" instead as that is what is used on Mavericks (and
> >> earlier OS X versions did not need explicit inclusion of
> >> AvailabilityMacros.h)?
> >
> > The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
> > Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.
>
> OK. Well, then I think this solves the problem of compiling on OS X
> 10.9 neatly and that it could be included in mainline Vim.
>
> Bram, can you please consider this patch for inclusion. It should
> apply cleanly (I just tried myself) and it automatically solves the
> problem of us having to know exactly when this header was made
> available. I've pasted it below for your convenience. Note that
> Felix B�nemann wrote the patch, not me.

Thanks, I'll put it in the todo list.

How about the patch that Kazunobu Kuriyama sent on Friday?

--
I wonder, do vegetarians eat fruit bats?

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Felix Buenemann

unread,
Oct 28, 2013, 6:24:18 AM10/28/13
to vim...@googlegroups.com

Am 27.10.2013 um 16:02 schrieb Bram Moolenaar <Br...@moolenaar.net>:
> Björn wrote:
>
>> On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
>>> Am 19.10.2013 um 18:54 schrieb björn:
>>>> On Sun, Oct 13, 2013 at 11:16 PM, Felix Bünemann wrote:
>>>>> Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb björn:
>>>>>> On Wed, Oct 9, 2013 at 12:18 AM, Felix Bünemann wrote:
>>>>>>> I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
>>>>>>> X, because it's copyright header states 2001-20xx which matches the OS X
>>>>>>> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
>>>>>>> case we should add a configure check.
>>>>>>
>>>>>> Yes, pre-OS X should be supported. If there is a suitable #ifdef
>>>>>> check for that, then it should be possible to submit as a patch to
>>>>>> mainline Vim.
>>>>>
>>>>> OK, I've updated the patch with a configure check:
>>>>> https://gist.github.com/felixbuenemann/6150257
>>>>
>>>> This looks good to me ... but should we perhaps be checking for
>>>> "Availability.h" instead as that is what is used on Mavericks (and
>>>> earlier OS X versions did not need explicit inclusion of
>>>> AvailabilityMacros.h)?
>>>
>>> The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
>>> Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.
>>
>> OK. Well, then I think this solves the problem of compiling on OS X
>> 10.9 neatly and that it could be included in mainline Vim.
>>
>> Bram, can you please consider this patch for inclusion. It should
>> apply cleanly (I just tried myself) and it automatically solves the
>> problem of us having to know exactly when this header was made
>> available. I've pasted it below for your convenience. Note that
>> Felix Bünemann wrote the patch, not me.
>
> Thanks, I'll put it in the todo list.
>
> How about the patch that Kazunobu Kuriyama sent on Friday?

Both patches should be fine. Mine uses a configure check to see if AvailabilityMacros.h is available while Kazonubu Kuriyama used some compiler defines to check if the header is needed, so his solution is a bit more lightweight.

Felix

Bram Moolenaar

unread,
Oct 31, 2013, 11:47:04 PM10/31/13
to Felix Buenemann, vim...@googlegroups.com

Felix Buenemann wrote:

> Am 27.10.2013 um 16:02 schrieb Bram Moolenaar <Br...@moolenaar.net>:
> > Bj�rn wrote:
> >
> >> On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
> >>> Am 19.10.2013 um 18:54 schrieb bj�rn:
> >>>> On Sun, Oct 13, 2013 at 11:16 PM, Felix B�nemann wrote:
> >>>>> Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb bj�rn:
> >>>>>> On Wed, Oct 9, 2013 at 12:18 AM, Felix B�nemann wrote:
> >>>>>>> I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
> >>>>>>> X, because it's copyright header states 2001-20xx which matches the OS X
> >>>>>>> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
> >>>>>>> case we should add a configure check.
> >>>>>>
> >>>>>> Yes, pre-OS X should be supported. If there is a suitable #ifdef
> >>>>>> check for that, then it should be possible to submit as a patch to
> >>>>>> mainline Vim.
> >>>>>
> >>>>> OK, I've updated the patch with a configure check:
> >>>>> https://gist.github.com/felixbuenemann/6150257
> >>>>
> >>>> This looks good to me ... but should we perhaps be checking for
> >>>> "Availability.h" instead as that is what is used on Mavericks (and
> >>>> earlier OS X versions did not need explicit inclusion of
> >>>> AvailabilityMacros.h)?
> >>>
> >>> The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
> >>> Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.
> >>
> >> OK. Well, then I think this solves the problem of compiling on OS X
> >> 10.9 neatly and that it could be included in mainline Vim.
> >>
> >> Bram, can you please consider this patch for inclusion. It should
> >> apply cleanly (I just tried myself) and it automatically solves the
> >> problem of us having to know exactly when this header was made
> >> available. I've pasted it below for your convenience. Note that
> >> Felix B�nemann wrote the patch, not me.
> >
> > Thanks, I'll put it in the todo list.
> >
> > How about the patch that Kazunobu Kuriyama sent on Friday?
>
> Both patches should be fine. Mine uses a configure check to see if
> AvailabilityMacros.h is available while Kazonubu Kuriyama used some
> compiler defines to check if the header is needed, so his solution is
> a bit more lightweight.

Just to be clear: So including one or the other works, but I should not
include both?

--
Dreams are free, but there's a small charge for alterations.

Kazunobu Kuriyama

unread,
Nov 1, 2013, 3:27:12 AM11/1/13
to vim...@googlegroups.com
On Nov 1, 2013, at 12:47 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:

>
> Felix Buenemann wrote:
>
>> Am 27.10.2013 um 16:02 schrieb Bram Moolenaar <Br...@moolenaar.net>:
>>> Björn wrote:
>>>
>>>> On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
>>>>> Am 19.10.2013 um 18:54 schrieb björn:
>>>>>> On Sun, Oct 13, 2013 at 11:16 PM, Felix Bünemann wrote:
>>>>>>> Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb björn:
>>>>>>>> On Wed, Oct 9, 2013 at 12:18 AM, Felix Bünemann wrote:
>>>>>>>>> I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
>>>>>>>>> X, because it's copyright header states 2001-20xx which matches the OS X
>>>>>>>>> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
>>>>>>>>> case we should add a configure check.
>>>>>>>>
>>>>>>>> Yes, pre-OS X should be supported. If there is a suitable #ifdef
>>>>>>>> check for that, then it should be possible to submit as a patch to
>>>>>>>> mainline Vim.
>>>>>>>
>>>>>>> OK, I've updated the patch with a configure check:
>>>>>>> https://gist.github.com/felixbuenemann/6150257
>>>>>>
>>>>>> This looks good to me ... but should we perhaps be checking for
>>>>>> "Availability.h" instead as that is what is used on Mavericks (and
>>>>>> earlier OS X versions did not need explicit inclusion of
>>>>>> AvailabilityMacros.h)?
>>>>>
>>>>> The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
>>>>> Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.
>>>>
>>>> OK. Well, then I think this solves the problem of compiling on OS X
>>>> 10.9 neatly and that it could be included in mainline Vim.
>>>>
>>>> Bram, can you please consider this patch for inclusion. It should
>>>> apply cleanly (I just tried myself) and it automatically solves the
>>>> problem of us having to know exactly when this header was made
>>>> available. I've pasted it below for your convenience. Note that
>>>> Felix Bünemann wrote the patch, not me.
>>>
>>> Thanks, I'll put it in the todo list.
>>>
>>> How about the patch that Kazunobu Kuriyama sent on Friday?
>>
>> Both patches should be fine. Mine uses a configure check to see if
>> AvailabilityMacros.h is available while Kazonubu Kuriyama used some
>> compiler defines to check if the header is needed, so his solution is
>> a bit more lightweight.
>
> Just to be clear: So including one or the other works, but I should not
> include both?
>

Though Björn Winckler has not replied to Bram’s email above yet, let me try to clarify.

Felix Bünemann’s patch is for building VIM as a Carbon application, while mine is for that as a plain UNIX application, I mean, the latter lets VIM depend only on universal libc and ncurses (and additionally X11) stuff, not on any API such as Carbon or Quartz peculiar to Mac.

That makes a big difference in keyboard response, but this is another story...

From practical and technical points of view, I think both of the patches won’t conflict each other because his patch is mainly for os_mac.h while mine is only for os_unix.c. No intersection, no conflict, though his solution uses the configure script which affects the whole build procedure, thus making it harder to evaluate possible unfavorable impact on the build.

Each of the patches will do for its own purpose.

Hopefully, this clarifies the issue.

Regards,
KK

Felix Buenemann

unread,
Nov 2, 2013, 4:57:52 PM11/2/13
to vim...@googlegroups.com
Are we talking about the same patches? I was referring to the patch you send to the vim_dev list with the subject "[patch] src/os_unix.c (for build on Mac OS X 10.9 Mavericks)“.

To compare https://gist.github.com/6150257 (my patch) and https://gist.github.com/felixbuenemann/7283250 (KK’s patch).

I think they achieve exactly the same think and the only difference is that my patch uses configure to check if AvailabilityMacros.h is available, while KK’s patch uses some existing preprocessor macros. This means that only one of the patches should be used.

Felix

Bram Moolenaar

unread,
Nov 2, 2013, 5:09:57 PM11/2/13
to Felix Buenemann, vim...@googlegroups.com

Felix Buenemann wrote:

> Am 01.11.2013 um 08:27 schrieb Kazunobu Kuriyama <kazunobu...@nifty.com>:
> > On Nov 1, 2013, at 12:47 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:
> >>
> >> Felix Buenemann wrote:
> >>> Am 27.10.2013 um 16:02 schrieb Bram Moolenaar <Br...@moolenaar.net>:
> >>>> Bj�rn wrote:
> >>>>> On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
> >>>>>> Am 19.10.2013 um 18:54 schrieb bj�rn:
> >>>>>>> On Sun, Oct 13, 2013 at 11:16 PM, Felix B�nemann wrote:
> >>>>>>>> Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb bj�rn:
> >>>>>>>>> On Wed, Oct 9, 2013 at 12:18 AM, Felix B�nemann wrote:
> >>>>>>>>>> I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
> >>>>>>>>>> X, because it's copyright header states 2001-20xx which matches the OS X
> >>>>>>>>>> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
> >>>>>>>>>> case we should add a configure check.
> >>>>>>>>>
> >>>>>>>>> Yes, pre-OS X should be supported. If there is a suitable #ifdef
> >>>>>>>>> check for that, then it should be possible to submit as a patch to
> >>>>>>>>> mainline Vim.
> >>>>>>>>
> >>>>>>>> OK, I've updated the patch with a configure check:
> >>>>>>>> https://gist.github.com/felixbuenemann/6150257
> >>>>>>>
> >>>>>>> This looks good to me ... but should we perhaps be checking for
> >>>>>>> "Availability.h" instead as that is what is used on Mavericks (and
> >>>>>>> earlier OS X versions did not need explicit inclusion of
> >>>>>>> AvailabilityMacros.h)?
> >>>>>>
> >>>>>> The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
> >>>>>> Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.
> >>>>>
> >>>>> OK. Well, then I think this solves the problem of compiling on OS X
> >>>>> 10.9 neatly and that it could be included in mainline Vim.
> >>>>>
> >>>>> Bram, can you please consider this patch for inclusion. It should
> >>>>> apply cleanly (I just tried myself) and it automatically solves the
> >>>>> problem of us having to know exactly when this header was made
> >>>>> available. I've pasted it below for your convenience. Note that
> >>>>> Felix B�nemann wrote the patch, not me.
> >>>>
> >>>> Thanks, I'll put it in the todo list.
> >>>>
> >>>> How about the patch that Kazunobu Kuriyama sent on Friday?
> >>>
> >>> Both patches should be fine. Mine uses a configure check to see if
> >>> AvailabilityMacros.h is available while Kazonubu Kuriyama used some
> >>> compiler defines to check if the header is needed, so his solution is
> >>> a bit more lightweight.
> >>
> >> Just to be clear: So including one or the other works, but I should not
> >> include both?
> >>
> >
> > Though Bj�rn Winckler has not replied to Bram�s email above yet, let me try to clarify.
> >
> > Felix B�nemann�s patch is for building VIM as a Carbon application, while mine is for that as a plain UNIX application, I mean, the latter lets VIM depend only on universal libc and ncurses (and additionally X11) stuff, not on any API such as Carbon or Quartz peculiar to Mac.
> >
> > That makes a big difference in keyboard response, but this is another story...
> >
> > From practical and technical points of view, I think both of the patches won�t conflict each other because his patch is mainly for os_mac.h while mine is only for os_unix.c. No intersection, no conflict, though his solution uses the configure script which affects the whole build procedure, thus making it harder to evaluate possible unfavorable impact on the build.
> >
> > Each of the patches will do for its own purpose.
> >
> > Hopefully, this clarifies the issue.
> >
> > Regards,
> > KK
>
> Are we talking about the same patches? I was referring to the patch you send to the vim_dev list with the subject "[patch] src/os_unix.c (for build on Mac OS X 10.9 Mavericks)�.
>
> To compare https://gist.github.com/6150257 (my patch) and https://gist.github.com/felixbuenemann/7283250 (KK�s patch).
>
> I think they achieve exactly the same think and the only difference is
> that my patch uses configure to check if AvailabilityMacros.h is
> available, while KK�s patch uses some existing preprocessor macros.
> This means that only one of the patches should be used.

I sent out two patches that combine them, using the configure check for
Kazonubu's patch as well. Please check it works this way.

--
Men may not be seen publicly in any kind of strapless gown.
[real standing law in Florida, United States of America]

Kazunobu Kuriyama

unread,
Nov 2, 2013, 6:20:17 PM11/2/13
to vim...@googlegroups.com, vim...@googlegroups.com

On Nov 3, 2013, at 6:09 AM, Bram Moolenaar <Br...@Moolenaar.net> wrote:

>
> Felix Buenemann wrote:
>
>> Am 01.11.2013 um 08:27 schrieb Kazunobu Kuriyama <kazunobu...@nifty.com>:
>>> On Nov 1, 2013, at 12:47 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:
>>>>
>>>> Felix Buenemann wrote:
>>>>> Am 27.10.2013 um 16:02 schrieb Bram Moolenaar <Br...@moolenaar.net>:
>>>>>> Björn wrote:
>>>>>>> On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
>>>>>>>> Am 19.10.2013 um 18:54 schrieb björn:
>>>>>>>>> On Sun, Oct 13, 2013 at 11:16 PM, Felix Bünemann wrote:
>>>>>>>>>> Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb björn:
>>>>>>>>>>> On Wed, Oct 9, 2013 at 12:18 AM, Felix Bünemann wrote:
>>>>>>>>>>>> I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
>>>>>>>>>>>> X, because it's copyright header states 2001-20xx which matches the OS X
>>>>>>>>>>>> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
>>>>>>>>>>>> case we should add a configure check.
>>>>>>>>>>>
>>>>>>>>>>> Yes, pre-OS X should be supported. If there is a suitable #ifdef
>>>>>>>>>>> check for that, then it should be possible to submit as a patch to
>>>>>>>>>>> mainline Vim.
>>>>>>>>>>
>>>>>>>>>> OK, I've updated the patch with a configure check:
>>>>>>>>>> https://gist.github.com/felixbuenemann/6150257
>>>>>>>>>
>>>>>>>>> This looks good to me ... but should we perhaps be checking for
>>>>>>>>> "Availability.h" instead as that is what is used on Mavericks (and
>>>>>>>>> earlier OS X versions did not need explicit inclusion of
>>>>>>>>> AvailabilityMacros.h)?
>>>>>>>>
>>>>>>>> The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
>>>>>>>> Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.
>>>>>>>
>>>>>>> OK. Well, then I think this solves the problem of compiling on OS X
>>>>>>> 10.9 neatly and that it could be included in mainline Vim.
>>>>>>>
>>>>>>> Bram, can you please consider this patch for inclusion. It should
>>>>>>> apply cleanly (I just tried myself) and it automatically solves the
>>>>>>> problem of us having to know exactly when this header was made
>>>>>>> available. I've pasted it below for your convenience. Note that
>>>>>>> Felix Bünemann wrote the patch, not me.
>>>>>>
>>>>>> Thanks, I'll put it in the todo list.
>>>>>>
>>>>>> How about the patch that Kazunobu Kuriyama sent on Friday?
>>>>>
>>>>> Both patches should be fine. Mine uses a configure check to see if
>>>>> AvailabilityMacros.h is available while Kazonubu Kuriyama used some
>>>>> compiler defines to check if the header is needed, so his solution is
>>>>> a bit more lightweight.
>>>>
>>>> Just to be clear: So including one or the other works, but I should not
>>>> include both?
>>>>
>>>
>>> Though Björn Winckler has not replied to Bram’s email above yet, let me try to clarify.
>>>
>>> Felix Bünemann’s patch is for building VIM as a Carbon application, while mine is for that as a plain UNIX application, I mean, the latter lets VIM depend only on universal libc and ncurses (and additionally X11) stuff, not on any API such as Carbon or Quartz peculiar to Mac.
>>>
>>> That makes a big difference in keyboard response, but this is another story...
>>>
>>> From practical and technical points of view, I think both of the patches won’t conflict each other because his patch is mainly for os_mac.h while mine is only for os_unix.c. No intersection, no conflict, though his solution uses the configure script which affects the whole build procedure, thus making it harder to evaluate possible unfavorable impact on the build.
>>>
>>> Each of the patches will do for its own purpose.
>>>
>>> Hopefully, this clarifies the issue.
>>>
>>> Regards,
>>> KK
>>
>> Are we talking about the same patches? I was referring to the patch you send to the vim_dev list with the subject "[patch] src/os_unix.c (for build on Mac OS X 10.9 Mavericks)“.
>>
>> To compare https://gist.github.com/6150257 (my patch) and https://gist.github.com/felixbuenemann/7283250 (KK’s patch).
>>
>> I think they achieve exactly the same think and the only difference is
>> that my patch uses configure to check if AvailabilityMacros.h is
>> available, while KK’s patch uses some existing preprocessor macros.
>> This means that only one of the patches should be used.
>
> I sent out two patches that combine them, using the configure check for
> Kazonubu's patch as well. Please check it works this way.

Bram,

Please include my patch as it was; otherwise, it won’t work as expected. In fact, Patch 7.4.056 fails to compile os_unix.c.

Let me clarify my point in another way: Felix Bünemann’s patch doesn’t cover the case where the configuration option -—disable-darwin is chosen in the build on the Mac.

I’d like to remind you of Section 1.2 of src/INSTALLmac.txt, that is, there is another way to build vim differently from that of MacVim or alike.

That’s why I sent my patch to vim_dev, not to mac_vim; the patch fixes a problem which is almost irrelevant to MacVim.

Bram Moolenaar

unread,
Nov 2, 2013, 6:40:00 PM11/2/13
to Kazunobu Kuriyama, vim...@googlegroups.com, vim...@googlegroups.com

Kazunobu Kuriyama wrote:

> On Nov 3, 2013, at 6:09 AM, Bram Moolenaar <Br...@Moolenaar.net> wrote:
>
> >
> > Felix Buenemann wrote:
> >
> >> Am 01.11.2013 um 08:27 schrieb Kazunobu Kuriyama <kazunobu...@nifty.com>:
> >>> On Nov 1, 2013, at 12:47 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:
> >>>>
> >>>> Felix Buenemann wrote:
> >>>>> Am 27.10.2013 um 16:02 schrieb Bram Moolenaar <Br...@moolenaar.net>:
> >>>>>> Bj�rn wrote:
> >>>>>>> On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
> >>>>>>>> Am 19.10.2013 um 18:54 schrieb bj�rn:
> >>>>>>>>> On Sun, Oct 13, 2013 at 11:16 PM, Felix B�nemann wrote:
> >>>>>>>>>> Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb bj�rn:
> >>>>>>>>>>> On Wed, Oct 9, 2013 at 12:18 AM, Felix B�nemann wrote:
> >>>>>>>>>>>> I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
> >>>>>>>>>>>> X, because it's copyright header states 2001-20xx which matches the OS X
> >>>>>>>>>>>> 10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
> >>>>>>>>>>>> case we should add a configure check.
> >>>>>>>>>>>
> >>>>>>>>>>> Yes, pre-OS X should be supported. If there is a suitable #ifdef
> >>>>>>>>>>> check for that, then it should be possible to submit as a patch to
> >>>>>>>>>>> mainline Vim.
> >>>>>>>>>>
> >>>>>>>>>> OK, I've updated the patch with a configure check:
> >>>>>>>>>> https://gist.github.com/felixbuenemann/6150257
> >>>>>>>>>
> >>>>>>>>> This looks good to me ... but should we perhaps be checking for
> >>>>>>>>> "Availability.h" instead as that is what is used on Mavericks (and
> >>>>>>>>> earlier OS X versions did not need explicit inclusion of
> >>>>>>>>> AvailabilityMacros.h)?
> >>>>>>>>
> >>>>>>>> The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
> >>>>>>>> Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.
> >>>>>>>
> >>>>>>> OK. Well, then I think this solves the problem of compiling on OS X
> >>>>>>> 10.9 neatly and that it could be included in mainline Vim.
> >>>>>>>
> >>>>>>> Bram, can you please consider this patch for inclusion. It should
> >>>>>>> apply cleanly (I just tried myself) and it automatically solves the
> >>>>>>> problem of us having to know exactly when this header was made
> >>>>>>> available. I've pasted it below for your convenience. Note that
> >>>>>>> Felix B�nemann wrote the patch, not me.
> >>>>>>
> >>>>>> Thanks, I'll put it in the todo list.
> >>>>>>
> >>>>>> How about the patch that Kazunobu Kuriyama sent on Friday?
> >>>>>
> >>>>> Both patches should be fine. Mine uses a configure check to see if
> >>>>> AvailabilityMacros.h is available while Kazonubu Kuriyama used some
> >>>>> compiler defines to check if the header is needed, so his solution is
> >>>>> a bit more lightweight.
> >>>>
> >>>> Just to be clear: So including one or the other works, but I should not
> >>>> include both?
> >>>>
> >>>
> >>> Though Bj�rn Winckler has not replied to Bram�s email above yet, let me try to clarify.
> >>>
> >>> Felix B�nemann�s patch is for building VIM as a Carbon application, while mine is for that as a plain UNIX application, I mean, the latter lets VIM depend only on universal libc and ncurses (and additionally X11) stuff, not on any API such as Carbon or Quartz peculiar to Mac.
> >>>
> >>> That makes a big difference in keyboard response, but this is another story...
> >>>
> >>> From practical and technical points of view, I think both of the patches won�t conflict each other because his patch is mainly for os_mac.h while mine is only for os_unix.c. No intersection, no conflict, though his solution uses the configure script which affects the whole build procedure, thus making it harder to evaluate possible unfavorable impact on the build.
> >>>
> >>> Each of the patches will do for its own purpose.
> >>>
> >>> Hopefully, this clarifies the issue.
> >>>
> >>> Regards,
> >>> KK
> >>
> >> Are we talking about the same patches? I was referring to the patch you send to the vim_dev list with the subject "[patch] src/os_unix.c (for build on Mac OS X 10.9 Mavericks)�.
> >>
> >> To compare https://gist.github.com/6150257 (my patch) and https://gist.github.com/felixbuenemann/7283250 (KK�s patch).
> >>
> >> I think they achieve exactly the same think and the only difference is
> >> that my patch uses configure to check if AvailabilityMacros.h is
> >> available, while KK�s patch uses some existing preprocessor macros.
> >> This means that only one of the patches should be used.
> >
> > I sent out two patches that combine them, using the configure check for
> > Kazonubu's patch as well. Please check it works this way.
>
> Bram,
>
> Please include my patch as it was; otherwise, it won�t work as expected. In fact, Patch 7.4.056 fails to compile os_unix.c.
>
> Let me clarify my point in another way: Felix B�nemann�s patch doesn�t cover the case where the configuration option -�disable-darwin is chosen in the build on the Mac.
>
> I�d like to remind you of Section 1.2 of src/INSTALLmac.txt, that is, there is another way to build vim differently from that of MacVim or alike.
>
> That�s why I sent my patch to vim_dev, not to mac_vim; the patch fixes a problem which is almost irrelevant to MacVim.

Hmm, why is that configure check inside
"if test "$enable_darwin" = "yes"; then"?

Checking for header files should be done by configure. using #ifdefs is
bound to break somewhere somewhen.

What if we move the configure check outside of that "if"? Or pehaps it
should go at the toplevel?

Looking at it again, I wonder why this doesn't use the normal way of
AC_CHECK_HEADER:

AC_CHECK_HEADER(AvailabilityMacros.h, HAVE_AVAILABILITYMACROS_H = 1)

Also, why protect the #include with the version check,
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__. What happens if we leave
that out?

--
It is illegal for anyone to give lighted cigars to dogs, cats, and other
domesticated animal kept as pets.
[real standing law in Illinois, United States of America]

Felix Buenemann

unread,
Nov 2, 2013, 6:47:40 PM11/2/13
to vim...@googlegroups.com
Am 02.11.2013 um 23:40 schrieb Bram Moolenaar <Br...@moolenaar.net>:
Kazunobu Kuriyama wrote:
On Nov 3, 2013, at 6:09 AM, Bram Moolenaar <Br...@Moolenaar.net> wrote:
Felix Buenemann wrote:
Am 01.11.2013 um 08:27 schrieb Kazunobu Kuriyama <kazunobu...@nifty.com>:
On Nov 1, 2013, at 12:47 PM, Bram Moolenaar <Br...@moolenaar.net> wrote:
Felix Buenemann wrote:
Am 27.10.2013 um 16:02 schrieb Bram Moolenaar <Br...@moolenaar.net>:
Björn wrote:
On Mon, Oct 21, 2013 at 12:14 AM, Felix Buenemann wrote:
Am 19.10.2013 um 18:54 schrieb björn:
On Sun, Oct 13, 2013 at 11:16 PM, Felix Bünemann wrote:
Am Mittwoch, 9. Oktober 2013 20:25:49 UTC+2 schrieb björn:

On Wed, Oct 9, 2013 at 12:18 AM, Felix Bünemann wrote:
I'm pretty sure that AvailabilityMacros.h is available on all versions of OS
X, because it's copyright header states 2001-20xx which matches the OS X
10.0 release timeline. Is the os_mac.h code also targeting OS 9? In that
case we should add a configure check.

Yes, pre-OS X should be supported.  If there is a suitable #ifdef
check for that, then it should be possible to submit as a patch to
mainline Vim.

OK, I've updated the patch with a configure check:
https://gist.github.com/felixbuenemann/6150257

This looks good to me ... but should we perhaps be checking for
"Availability.h" instead as that is what is used on Mavericks (and
earlier OS X versions did not need explicit inclusion of
AvailabilityMacros.h)?

The macros used in the vim codebase are defined in AvailabilityMacros.h not Availability.h.
Availability.h has similar but not the same macros, so using it would require cluttering the code with even more ifdefs.

OK.  Well, then I think this solves the problem of compiling on OS X
10.9 neatly and that it could be included in mainline Vim.

Bram, can you please consider this patch for inclusion.  It should
apply cleanly (I just tried myself) and it automatically solves the
problem of us having to know exactly when this header was made
available.  I've pasted it below for your convenience.  Note that
Felix Bünemann wrote the patch, not me.

Thanks, I'll put it in the todo list.

How about the patch that Kazunobu Kuriyama sent on Friday?

Both patches should be fine. Mine uses a configure check to see if
AvailabilityMacros.h is available while Kazonubu Kuriyama used some
compiler defines to check if the header is needed, so his solution is
a bit more lightweight.

Just to be clear: So including one or the other works, but I should not
include both?


Though Björn Winckler has not replied to Bram’s email above yet, let me try to clarify.

Felix Bünemann’s patch is for building VIM as a Carbon application, while mine is for that as a plain UNIX application, I mean, the latter lets VIM depend only on universal libc and ncurses (and additionally X11) stuff, not on any API such as Carbon or Quartz peculiar to Mac.


That makes a big difference in keyboard response, but this is another story...

From practical and technical points of view, I think both of the patches won’t conflict each other because his patch is mainly for os_mac.h while mine is only for os_unix.c.  No intersection, no conflict, though his solution uses the configure script which affects the whole build procedure, thus making it harder to evaluate possible unfavorable impact on the build.

Each of the patches will do for its own purpose.

Hopefully, this clarifies the issue.  

Regards,
KK

Are we talking about the same patches? I was referring to the patch you send to the vim_dev list with the subject "[patch] src/os_unix.c (for build on Mac OS X 10.9 Mavericks)“.

To compare https://gist.github.com/6150257 (my patch) and https://gist.github.com/felixbuenemann/7283250 (KK’s patch).

I think they achieve exactly the same think and the only difference is
that my patch uses configure to check if AvailabilityMacros.h is
available, while KK’s patch uses some existing preprocessor macros.
This means that only one of the patches should be used.

I sent out two patches that combine them, using the configure check for
Kazonubu's patch as well.  Please check it works this way.

Bram,

Please include my patch as it was; otherwise, it won’t work as expected.  In fact, Patch 7.4.056 fails to compile os_unix.c.

Let me clarify my point in another way: Felix Bünemann’s patch doesn’t cover the case where the configuration option -—disable-darwin is chosen in the build on the Mac.


I’d like to remind you of Section 1.2 of src/INSTALLmac.txt, that is, there is another way to build vim differently from that of MacVim or alike.

That’s why I sent my patch to vim_dev, not to mac_vim; the patch fixes a problem which is almost irrelevant to MacVim.

Hmm, why is that configure check inside
"if test "$enable_darwin" = "yes"; then“?

It’s inside that block because it seemed the most appropriate place to put it when I wrote that code and I wasn’t aware of the fact that you can compile vim with disable-darwin on OS X.

Checking for header files should be done by configure. using #ifdefs is
bound to break somewhere somewhen.

What if we move the configure check outside of that "if"?  Or pehaps it
should go at the toplevel?

That should work.

Looking at it again, I wonder why this doesn't use the normal way of
AC_CHECK_HEADER:

AC_CHECK_HEADER(AvailabilityMacros.h, HAVE_AVAILABILITYMACROS_H = 1)

Also, why protect the #include with the version check,
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__.  What happens if we leave
that out?

Well there is the remote case of Mac OS X 10.0 and 10.1 where AvailabilityMacros.h is missing

-- 
It is illegal for anyone to give lighted cigars to dogs, cats, and other
domesticated animal kept as pets.
[real standing law in Illinois, United States of America]

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
\\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_mac" 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 a topic in the Google Groups "vim_mac" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_mac/5kVAMSPb6uU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_mac+u...@googlegroups.com.

Bram Moolenaar

unread,
Nov 2, 2013, 7:05:34 PM11/2/13
to Felix Buenemann, vim...@googlegroups.com
Then configure wouldn't find it. So one #ifdef would be sufficient.
So, these version checks only make sense when not using the configure
defined symbol but checking for the APPLE macro.

--
Sometimes I think the surest sign that intelligent life exists elsewhere
in the universe is that none of it has tried to contact us. (Calvin)
Reply all
Reply to author
Forward
0 new messages