views:

54

answers:

1

I have a newbie Linux programming question. Suppose I have a project that uses Autotools for compiling and deployment, and I have data files that are to be installed in a location like /var/something or /usr/share/something etc., but in Autoconf, I can change these installation paths. How should the program find these files? How does it know where they are actually installed (if anywhere, since the program should work even if not installed, but run from where it was built)?

+5  A: 

Typically if your program depends on files being stored in a certain location that is tunable by the build system, you should pass this path as a compiler definition and in your program use that definition where you need it.

jer