MacOS – Compile CFLite requires some unknown dependencies

macosxcode

I've downloaded CoreFoundationLite – CFLite from apple open source of OSX version 10.10.5, and attempted to compile it on my own mac (I'm running 10.11.5 and Xcode 7.2.1). notice that this code compile under regular make, and doesn't use Xcode SDK …

According the the README file, it should just require using the default makefile. However, it failed on the following issue :

/usr/bin/clang -O2 -arch i386 -arch x86_64 -c -x c -pipe -std=gnu99 
Wmost -Wno-trigraphs -Wno-deprecated -mmacosx-version-min=10.10 
-fconstant-cfstrings -fexceptions -DCF_BUILDING_CF=1 
-DDEPLOYMENT_TARGET_MACOSX=1     
-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10 
-DU_SHOW_DRAFT_API=1 -DU_SHOW_CPLUSPLUS_API=0 -ICF-Objects/normal 
-DVERSION=1153.18 -include CoreFoundation_Prefix.h 
 CFApplicationPreferences.c 
-o CF-Objects/normal/CFApplicationPreferences.o


In file included from CFApplicationPreferences.c:30:
./CFInternal.h:759:10: fatal error: 'dispatch/private.h' file not found
#include <dispatch/private.h>

it seems like I'm missing dependency named libdispatch.
is it because this library was removed from 10.11.5 and exist in 10.10.5 ? where can i find it (couldn't trace it on apple source code)

Best Answer

You can find the files you need in the libdispatch-442.1.4 download at the open source site you linked above.

And libdispatch is included with 10.11.5 as well, as you can see on this page. https://opensource.apple.com/release/os-x-10115/

I don't have a Mac here to confirm, but I assume if you haven't installed Xcode (with its accompanying SDKs) then the headers won't be installed on your Mac.