In GNU Autotools, the directory variables $sharedstatedir and $localstatedir expand to $(prefix)/com and $(prefix)/var respectively.

However the com and var directories don't exist anymore in FHS 3, and /var/lib should be used instead.

Therefore we want to overwrite localstatedir to /var/lib in our Autotools build system, since we're using it to define a macro in our code:


But if the user provides a custom localstatedir with --localstatedir=…, we want to use that instead.

How can this be accomplished?


So far I've managed to put a localstatedir=/var/lib to our configure.ac, which does the first part correctly. But I haven't found a way to redefine that later, e.g.
./configure --localstatedir=/custom/dir. Is this possible?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.