Currently the libcurl code checks for MAC_10_? and IPHONE_?_? to determine what it is compiling against.. However that is incorrect usage, as those macros document what is installed on the development system, not what SDK is being compiled against. (yeah.. rather silly IMHO).
The cause is that some of the recent changes in darwin_ssl fail to compile when compiling on a 10.6 SDK. The CopyIdentityWithLabel includes some new code that has this define check
#if defined(__MAC_10_6) || defined(__IPHONE_2_0) // check and use SecItemCopyMatching() #endif
However, the SecItemCopyMatching code does not in fact compile on 10.6 SDK as an extra header needs to be included explicitly (<Security SecItem.h="">) AND it doesn't define kSecClassIdentity.
Now changing the definition to
#if defined(__MAC_10_7) || defined(__IPHONE_2_0)
however does not work as my /usr/include/Availability.h defines __IPHONE_2_0 (even in an Mac compilation) as I have that SDK installed on my system!.
The proper checks should be
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 20000
Read more on this usage in the Availability.h header itself.. These defines are automatically set by the compiler according to which SDK is being used to compile with. (and in the case of OS X compiling the iphone define is undefined and evaluates as 0 in the comparison so it works correctly.
This has since then been updated in the git repo. Can you please check the latest code there and see if you still spot any problem(s) ?
It's almost there.. your lib/md5.c and src/tool_metalink.c still have checks against the MAC and IPHONE macros.. and I'll need to do some more testing on the "CopyIdentityWithLabel" method.. as it doesn't compile on a 10.6 SDK, so I'm going to compile on a 10.7/8 SDK and test that functionality on a 10.6 box to ensure the run-time checks work correctly. (yes SecItemCopyMatching was added in 10.6 BUT kSecClassIdentity was added on 10.7)
Can I ask you to please take this subject to the curl-library mailing list and if possible provide a patch showing your suggested further edits?
I'm not the Mac guy around here and discussing it on the list will make more people see it and possibly participate.
Nick Zitzmann wrote:
For some reason I can't seem to access my Sourceforge account at the moment. But I did push two changes that ought to fix the remaining problems (incorrect use of macros, build breakage on Snow Leopard).
http://curl.haxx.se/mail/lib-2013-07/0315.html
Ill revalidate against the latest git on all of my test systems.. Thanks!!
On Jul 31, 2013, at 10:12 , Daniel Stenberg wrote:
Edward Rudd
OutOfOrder.cc
Skype: outoforder_cc
317-674-3296
Related
Bugs:
#1255