It seems like on recent builds of macOS (I think since 10.12) some of the system headers have defined the macos macro which conflicts with the -Dmacos macro we define when calling clang. This PR changes the macos macro used by omi to is_macos to avoid this conflict.
Before the PR running ./configure would fail with
*** UNABLE TO LOCATE FILE omi.version; USING VERSION 1.0.8.6 ***
*** Update build process to include omi.version from superproject! ***
checking whether pkg-config command is on the path... yes
created /Users/jborean/dev/omi/Unix/output
checking whether C compiler is on the path... yes
checking whether C compiler compiles... yes
checking whether C program executes... yes
checking for __FUNCTION__ macro or reserved word... yes
checking for __builtin_ctz... no
checking for __builtin_prefetch... yes
checking for sched_getcpu... no
checking for wcstoll... no
checking for wcsdup... no
checking for wcscasecmp, wcsncasecmp... no
checking for vswscanf... no
checking for va_copy... no
checking for backtrace... no
checking for __sync_synchronize... yes
checking for Atomic Intrinsic Functions... no
checking for sem_timedwait... no
checking for strerror_r... yes
checking for pthread_rwlock_t... no
That's because it's trying to compile and run the following code
In file included from /tmp/pthread_rwlock_t_func.c:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:73:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h:34:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h:132:31: error: expected ','
__QOS_CLASS_AVAILABLE(macos(10.10), ios(8.0)) = 0x21,
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h:126:31: note: expanded from macro
'__QOS_CLASS_AVAILABLE'
#define __QOS_CLASS_AVAILABLE __API_AVAILABLE
After this change I am able to compile and build OMI on my macOS host. I'm mostly doing this so I have a libmi.dylib that is linked to OpenSSL 1.1 and not 1.0 that comes with PowerShell. If you wish to change the macro to another name, happy to change it to whatever you suggest.
It seems like on recent builds of macOS (I think since 10.12) some of the system headers have defined the
macos
macro which conflicts with the-Dmacos
macro we define when calling clang. This PR changes themacos
macro used by omi tois_macos
to avoid this conflict.Before the PR running
./configure
would fail withThat's because it's trying to compile and run the following code
This fails with multiple errors of the following
After this change I am able to compile and build OMI on my macOS host. I'm mostly doing this so I have a
libmi.dylib
that is linked to OpenSSL 1.1 and not 1.0 that comes with PowerShell. If you wish to change the macro to another name, happy to change it to whatever you suggest.