Programs on Linux install data for programs into $PREFIX/share/programname, how does the program know where that is, does it need to be compiled in?
Would it be suitable to assume that the binary is in $PREFIX/bin, and use that to determine $PREFIX?
This only needs to work on Linux, and specifically, I am using C.
It depends entirely on the program. A common pattern is to define PREFIX as a preprocessor directive. GNU autoconf has standard names and allows them to be overridden at configure time.