Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clang Environment variable for linker path

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"
like image 229
Niklas R Avatar asked Feb 04 '26 23:02

Niklas R


1 Answers

LIBRARY_PATH is the right environment variable for this (at least on OSX).

like image 177
Frédéric Devernay Avatar answered Feb 06 '26 12:02

Frédéric Devernay