moretension / duti

A command-line tool to select default applications for document types and URL schemes on Mac OS X
Other
1.41k stars 66 forks source link

Won't build on 10.10.5 with Xcode 7 (unless Homebrew is used) #15

Closed chdiza closed 5 years ago

chdiza commented 8 years ago

duti won't build on 10.10.5 with Xcode 7. That seems to be because it hardcodes:

-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk

but the 10.10 SDK doesn't exist in Xcode 7. For reference, the call that fails is:

gcc -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.10 -Wall -Wmissing-prototypes -g -O2 -c ./util.c
clang: warning: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk'
./util.c:1:10: fatal error: 'CoreFoundation/CoreFoundation.h' file not found
#include <CoreFoundation/CoreFoundation.h>
         ^
1 error generated.
make: *** [util.o] Error 1

It can be built using Homebrew, under their superenv, which among other things removes the isysroot. (If you build in Homebrew without superenv, a similar choke occurs.)

Here is Homebrew's summary of how it altered things, on the clang call in question:

clang called with: -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -mmacosx-version-min=10.10 -Wall -Wmissing-prototypes -g -O2 -c ./util.c
superenv removed:  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -Wall -Wmissing-prototypes -g -O2
superenv added:    -pipe -w -Os -march=native -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
superenv executed: clang -pipe -w -Os -march=native -mmacosx-version-min=10.10 -c ./util.c -isystem/usr/local/include -isystem/usr/include/libxml2 -isystem/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers

Also, here is the Homebrew issue report that led me to post here.

spiffytech commented 8 years ago

:+1:

dickguertin commented 8 years ago

See "duti not compatible with Yosemite #6" for my fixes to "configure" concerning sdk-library.