Say I have my_application.py.in for automake to generate my_application.py. How do I get the datadir into my application with ${prefix} expanded? Right now the best I can figure is to use replace() in my python application, but, I’m assuming there is a more appropriate way.
if __name__ == "__main__":
app = Application()
app.VERSION = '@VERSION@'
app.PACKAGE = '@PACKAGE@'
# How should I get the DATA_DIR in this next line?
app.DATA_DIR = "@datarootdir@".replace("${prefix}", "@prefix@")
app.run()
You need to do the substitution at
maketime. This is easier in C, where you can set a#define, but for Python, I’d try something like this:(add
AC_PROG_SEDtoconfigure.ac)