oarfish
oarfish

Reputation: 4622

Compiling Vim on OS X 10.10.3 does not work

[I am not sure whether this fits here or should be moved to apple.SE]

Today I got the idea to recompile my vim in order to get the latest updates. I have once or twice before followed the suggestion in this answer so I did it again. I cloned the repo and ran

./configure --prefix=/opt/local/ --with-features=huge

(I tried with no options, problem persists) Invariably, compilation aborts when the compiler attempts to parse ObjC-Files (for whatever reason it has to)

/usr/include/objc/NSObject.h:22:4: error: unknown type name 'instancetype'
 - (instancetype)self;

It seems the compiler does not know the current Objective-C standard. There seems to be a problem with gcc because I found this bug ticket. However, the most recent update on this is from last year.

Can someone suggest a way to make this work?

EDIT: I know I could install it via homebrew or macports; yet I am still very curious how to fix this particular problem.

Also I tried manually changing the compiler to clang like so

CC=clang ./configure --prefix=/opt/local/ --with-features=huge

After simply setting CC=clang before running (which is what the configure help seems to advertise) and seeing it did nothing. However when specifying a compiler this way (I tried the same with gcc as well), many configure checks turn out no and it eventually aborts.

Upvotes: 1

Views: 351

Answers (1)

trojanfoe
trojanfoe

Reputation: 122391

I am assuming that gcc has not been configured with Objective-C support (it supports at least C, C++ and Objective-C and the installer can opt for whatever support they want).

It's possible that the 3rd-party clang is in the same boat. However I know that the Xcode version supports all 3 languages and will pick-up the correct OSX Cocoa runtime libraries, so using that appears to have solved the issue:

$ CC="xcrun clang" ./configure --prefix=/opt/local/ --with-features=huge

However just using clang should have worked as well, if which clang returns /usr/bin/clang as you say it does, so I'm at a loss to explain exactly why that didn't work.

Upvotes: 4

Related Questions