I wrote a little Python script to extract the XCode CLTools to a specific directory. (You can find it here if you want it). Now I just need to get an activate script working in order to use the tools from the command-line.
The script updates the PATH and C_INCLUDEPATH, CPLUS_INCLUDE_PATH, etc. but now I get linker errors. What environment variables can I use? C_LINKER_PATH, CPLUS_LINKER_PATH? Or is there another way to make it work?
Since the directory structure is the same as if it was merged into /, maybe I can just tell it ~/Clang-5.1 is your new / and look from there?
ABSDIR=$(pwd)/$(dirname ${BASH_SOURCE[0]})
INCLUDE="$ABSDIR/usr/include"
export PATH="$ABSDIR/Library/Developer/CommandLineTools/usr/bin:$PATH"
export C_INCLUDE_PATH="$INCLUDE:$C_INCLUDE_PATH"
export CPLUS_INCLUDE_PATH="$INCLUDE:$INCLUDE/c++/4.2.2:$CPLUS_INCLUDE_PATH"
export OBJC_INCLUDE_PATH="$INCLUDE:$OBJC_INCLUDE_PATH"
export OBJCPLUS_INCLUDE_PATH="$INCLUDE:$INCLUDE/objc:$OBJCPLUS_INCLUDE_PATH"
LIBRARY_PATH is the right environment variable for this (at least on OSX).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With